* Deathless Knight - Fixed triggered ability.

This commit is contained in:
LevelX2 2019-12-17 22:15:05 +01:00
parent 6470fc85ef
commit 1c2ac9a90d

View file

@ -1,5 +1,6 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID;
import mage.MageInt; import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
@ -12,8 +13,6 @@ import mage.constants.Zone;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import java.util.UUID;
/** /**
* @author TheElk801 * @author TheElk801
*/ */
@ -49,7 +48,7 @@ class DeathlessKnightTriggeredAbility extends TriggeredAbilityImpl {
private boolean triggeredOnce = false; private boolean triggeredOnce = false;
DeathlessKnightTriggeredAbility() { DeathlessKnightTriggeredAbility() {
super(Zone.ALL, new ReturnSourceFromGraveyardToHandEffect(), false); super(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), false);
} }
private DeathlessKnightTriggeredAbility(final DeathlessKnightTriggeredAbility ability) { private DeathlessKnightTriggeredAbility(final DeathlessKnightTriggeredAbility ability) {
@ -70,8 +69,7 @@ class DeathlessKnightTriggeredAbility extends TriggeredAbilityImpl {
return false; return false;
} }
if (event.getType() != GameEvent.EventType.GAINED_LIFE if (event.getType() != GameEvent.EventType.GAINED_LIFE
|| !event.getPlayerId().equals(controllerId) || !event.getPlayerId().equals(getControllerId())) {
|| game.getState().getZone(this.getSourceId()) == Zone.GRAVEYARD) {
return false; return false;
} }
if (triggeredOnce) { if (triggeredOnce) {