* Cavern of Souls - Fixed a bug of the can't be countered handling.

This commit is contained in:
LevelX2 2015-03-23 13:25:37 +01:00
parent 6079ecbbbc
commit 98ab135488
2 changed files with 19 additions and 9 deletions

View file

@ -204,6 +204,7 @@ class CavernOfSoulsWatcher extends Watcher {
public CavernOfSoulsWatcher(final CavernOfSoulsWatcher watcher) {
super(watcher);
this.spells.addAll(watcher.spells);
}
@Override
@ -259,15 +260,15 @@ class CavernOfSoulsCantCounterEffect extends ContinuousRuleModifyingEffectImpl {
return null;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.COUNTER;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.COUNTER) {
CavernOfSoulsWatcher watcher = (CavernOfSoulsWatcher) game.getState().getWatchers().get("ManaPaidFromCavernOfSoulsWatcher");
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && watcher.spells.contains(spell.getId())) {
return true;
}
}
return false;
CavernOfSoulsWatcher watcher = (CavernOfSoulsWatcher) game.getState().getWatchers().get("ManaPaidFromCavernOfSoulsWatcher");
Spell spell = game.getStack().getSpell(event.getTargetId());
return spell != null && watcher.spells.contains(spell.getId());
}
}

View file

@ -94,7 +94,16 @@ public class GameEvent {
PLAY_LAND, LAND_PLAYED,
CAST_SPELL, SPELL_CAST,
ACTIVATE_ABILITY, ACTIVATED_ABILITY,
ADD_MANA, MANA_ADDED, MANA_PAYED,
ADD_MANA, MANA_ADDED,
/* MANA_PAYED
targetId id if the ability the mana was paid for (not the sourceId)
sourceId sourceId of the mana source
playerId controller of the ability the mana was paid for
amount not used for this event
flag indicates a special condition (e.g. TRUE if it's a colored mana from Cavern of Souls)
*/
MANA_PAYED,
LOSES, LOST, WINS,
TARGET, TARGETED,
COUNTER, COUNTERED,