forked from External/mage
* Some standardisation of dies trigger handling (fixes #7063 Midnight Reaper triggers when dies face down).
This commit is contained in:
parent
e1ab14e0f5
commit
2fec825523
17 changed files with 720 additions and 710 deletions
|
|
@ -48,30 +48,14 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI
|
|||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
|
||||
Permanent sourcePermanent = null;
|
||||
if (game.getState().getZone(getSourceId()) == Zone.BATTLEFIELD) {
|
||||
sourcePermanent = game.getPermanent(getSourceId());
|
||||
} else {
|
||||
if (game.getShortLivingLKI(getSourceId(), Zone.BATTLEFIELD)) {
|
||||
sourcePermanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD);
|
||||
}
|
||||
}
|
||||
if (sourcePermanent == null) {
|
||||
return false;
|
||||
}
|
||||
return hasSourceObjectAbility(game, sourcePermanent, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
|
||||
if (game.getPermanentOrLKIBattlefield(getSourceId()) == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// if (game.getPermanentOrLKIBattlefield(getSourceId()) == null) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
if (zEvent.isDiesEvent()) {
|
||||
if (zEvent.getTarget() != null) {
|
||||
if (!applyFilterOnSource && zEvent.getTarget().getId().equals(this.getSourceId())) {
|
||||
|
|
@ -85,6 +69,24 @@ public class DiesThisOrAnotherCreatureTriggeredAbility extends TriggeredAbilityI
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInUseableZone(Game game, MageObject source, GameEvent event) {
|
||||
return TriggeredAbilityImpl.isInUseableZoneDiesTrigger(this, event, game);
|
||||
//
|
||||
// Permanent sourcePermanent = null;
|
||||
// if (game.getState().getZone(getSourceId()) == Zone.BATTLEFIELD) {
|
||||
// sourcePermanent = game.getPermanent(getSourceId());
|
||||
// } else {
|
||||
// if (game.getShortLivingLKI(getSourceId(), Zone.BATTLEFIELD)) {
|
||||
// sourcePermanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD);
|
||||
// }
|
||||
// }
|
||||
// if (sourcePermanent == null) {
|
||||
// return false;
|
||||
// }
|
||||
// return hasSourceObjectAbility(game, sourcePermanent, event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue