P/T changing effects from static abilities are applied now before enters the battlefield event triggers. This fixes that Kird Ape or Tarmogoyf P/T wasn't calculated before evoke checked P/T.

This commit is contained in:
LevelX2 2013-03-19 01:38:19 +01:00
parent 98a77e93f2
commit d7cab00905
3 changed files with 6 additions and 3 deletions

View file

@ -87,8 +87,9 @@ public class ContinuousEffectsList<T extends ContinuousEffect> extends ArrayList
switch(effect.getDuration()) {
case WhileOnBattlefield:
if (game.getObject(ability.getSourceId()) == null) //TODO: does this really works?? object is returned across the game
return (true);
if (game.getObject(ability.getSourceId()) == null) {//TODO: does this really works?? object is returned across the game
return (true); // LevelX2: I guess it's not used, because effects stay the whole game
}
case OneUse:
return effect.isUsed();
case Custom:

View file

@ -446,7 +446,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
game.resetForSourceId(permanent.getId());
game.addPermanent(permanent);
game.setZone(objectId, Zone.BATTLEFIELD);
//game.applyEffects(); // magenoxx: this causes bugs
game.applyEffects(); // magenoxx: this causes bugs - LevelX2: but it's neccessary for casting e.g. Kird Ape which must trigger evolve
permanent.entersBattlefield(sourceId, game, event.getFromZone(), true);
game.applyEffects();
game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));

View file

@ -205,6 +205,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
game.fireEvent(event);
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
game.resetForSourceId(getId());
game.applyEffects(); // LevelX2: needed to execute isInactive for of custom duration copy effect if source returns directly (e.g. cloudshifted clone)
}
return game.getState().getZone(objectId) == toZone;
}
@ -235,6 +236,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
game.fireEvent(event);
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
game.resetForSourceId(getId());
game.applyEffects();
}
return true;
}