Minor fix that triggering creature must be on the battlefield when effect resolves.

This commit is contained in:
LevelX2 2013-01-04 18:04:58 +01:00
parent 9762cf0b0d
commit 019b5a3f0e

View file

@ -76,6 +76,11 @@ public class EvolveAbility extends TriggeredAbilityImpl<EvolveAbility> {
return false; return false;
} }
@Override
public boolean checkInterveningIfClause(Game game) {
return true;
}
public static boolean isPowerOrThoughnessGreater(Permanent sourceCreature, Permanent newCreature) { public static boolean isPowerOrThoughnessGreater(Permanent sourceCreature, Permanent newCreature) {
if (newCreature.getPower().getValue() > sourceCreature.getPower().getValue()) { if (newCreature.getPower().getValue() > sourceCreature.getPower().getValue()) {
return true; return true;
@ -116,9 +121,6 @@ class EvolveEffect extends OneShotEffect<EvolveEffect> {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
UUID triggeringCreatureId = (UUID) getValue("triggeringCreature"); UUID triggeringCreatureId = (UUID) getValue("triggeringCreature");
Permanent triggeringCreature = game.getPermanent(triggeringCreatureId); Permanent triggeringCreature = game.getPermanent(triggeringCreatureId);
if (triggeringCreature == null) {
triggeringCreature = (Permanent) game.getLastKnownInformation(triggeringCreatureId, Zone.BATTLEFIELD);
}
if (triggeringCreature != null) { if (triggeringCreature != null) {
Permanent sourceCreature = game.getPermanent(source.getSourceId()); Permanent sourceCreature = game.getPermanent(source.getSourceId());
if (sourceCreature != null && EvolveAbility.isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) { if (sourceCreature != null && EvolveAbility.isPowerOrThoughnessGreater(sourceCreature, triggeringCreature)) {