mirror of
https://github.com/correl/mage.git
synced 2024-12-27 20:06:31 +00:00
* Nether Traitor - Fixed that the last ability did not trigger if a Token creature died.
This commit is contained in:
parent
03b8a22c43
commit
f61aa848cc
1 changed files with 12 additions and 11 deletions
|
@ -35,7 +35,6 @@ import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
|
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
|
||||||
import mage.abilities.keyword.HasteAbility;
|
import mage.abilities.keyword.HasteAbility;
|
||||||
import mage.abilities.keyword.ShadowAbility;
|
import mage.abilities.keyword.ShadowAbility;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.ColoredManaSymbol;
|
import mage.constants.ColoredManaSymbol;
|
||||||
|
@ -93,20 +92,22 @@ class NetherTraitorTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
return new NetherTraitorTriggeredAbility(this);
|
return new NetherTraitorTriggeredAbility(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
|
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
|
|
||||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
|
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||||
Card card = game.getCard(event.getTargetId());
|
if (zEvent.getTarget() != null &&
|
||||||
if (card != null &&
|
zEvent.getTarget().getOwnerId().equals(this.getControllerId()) &&
|
||||||
card.getOwnerId().equals(this.getControllerId()) &&
|
zEvent.getTarget().getCardType().contains(CardType.CREATURE)&&
|
||||||
card.getCardType().contains(CardType.CREATURE)&&
|
!zEvent.getTarget().getId().equals(this.getSourceId())) {
|
||||||
!card.getId().equals(this.getSourceId())) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue