mirror of
https://github.com/correl/mage.git
synced 2025-01-14 03:00:10 +00:00
fixed Wavebreak Hippocamp (missing watcher, wrong turn check)
This commit is contained in:
parent
f065c5ca9c
commit
6e5494c022
1 changed files with 8 additions and 2 deletions
|
@ -29,7 +29,7 @@ public final class WavebreakHippocamp extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever you cast your first spell during each opponent's turn, draw a card.
|
||||
this.addAbility(new WavebreakHippocampTriggeredAbility());
|
||||
this.addAbility(new WavebreakHippocampTriggeredAbility(), new SpellsCastWatcher());
|
||||
}
|
||||
|
||||
private WavebreakHippocamp(final WavebreakHippocamp card) {
|
||||
|
@ -59,14 +59,20 @@ class WavebreakHippocampTriggeredAbility extends SpellCastControllerTriggeredAbi
|
|||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!game.getActivePlayerId().equals(this.getControllerId())
|
||||
if (game.getActivePlayerId().equals(this.getControllerId()) // ignore controller turn
|
||||
|| !super.checkTrigger(event, game)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!game.getOpponents(this.getControllerId()).contains(game.getActivePlayerId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SpellsCastWatcher watcher = game.getState().getWatcher(SpellsCastWatcher.class);
|
||||
if (watcher == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<Spell> spells = watcher.getSpellsCastThisTurn(event.getPlayerId());
|
||||
return spells != null && spells.size() == 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue