mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Cavern of Souls - Fixed a bug of the can't be countered handling.
This commit is contained in:
parent
6079ecbbbc
commit
98ab135488
2 changed files with 19 additions and 9 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue