mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
[FIX] Fixes issue 296. This fix seems more sane than removing line 363 of GameState.java.
This commit is contained in:
parent
621e0fb4b1
commit
0ccbc694cf
1 changed files with 19 additions and 0 deletions
|
@ -28,8 +28,11 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -37,6 +40,8 @@ import mage.abilities.effects.Effect;
|
|||
*/
|
||||
public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility<DiesTriggeredAbility> {
|
||||
|
||||
boolean used = false;
|
||||
|
||||
public DiesTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Zone.BATTLEFIELD, Zone.GRAVEYARD, effect, "When {this} dies, ", optional);
|
||||
}
|
||||
|
@ -54,4 +59,18 @@ public class DiesTriggeredAbility extends ZoneChangeTriggeredAbility<DiesTrigger
|
|||
return new DiesTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return super.checkTrigger(event, game) && !used;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void trigger(Game game, UUID controllerId) {
|
||||
if ( !used ) {
|
||||
super.trigger(game, controllerId);
|
||||
used = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue