[FIX] Fixes issue 296. This fix seems more sane than removing line 363 of GameState.java.

This commit is contained in:
maurer.it 2011-10-20 18:02:44 -04:00
parent 621e0fb4b1
commit 0ccbc694cf

View file

@ -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;
}
}
}