mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
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:
parent
98a77e93f2
commit
d7cab00905
3 changed files with 6 additions and 3 deletions
|
@ -87,8 +87,9 @@ public class ContinuousEffectsList<T extends ContinuousEffect> extends ArrayList
|
||||||
|
|
||||||
switch(effect.getDuration()) {
|
switch(effect.getDuration()) {
|
||||||
case WhileOnBattlefield:
|
case WhileOnBattlefield:
|
||||||
if (game.getObject(ability.getSourceId()) == null) //TODO: does this really works?? object is returned across the game
|
if (game.getObject(ability.getSourceId()) == null) {//TODO: does this really works?? object is returned across the game
|
||||||
return (true);
|
return (true); // LevelX2: I guess it's not used, because effects stay the whole game
|
||||||
|
}
|
||||||
case OneUse:
|
case OneUse:
|
||||||
return effect.isUsed();
|
return effect.isUsed();
|
||||||
case Custom:
|
case Custom:
|
||||||
|
|
|
@ -446,7 +446,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
||||||
game.resetForSourceId(permanent.getId());
|
game.resetForSourceId(permanent.getId());
|
||||||
game.addPermanent(permanent);
|
game.addPermanent(permanent);
|
||||||
game.setZone(objectId, Zone.BATTLEFIELD);
|
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);
|
permanent.entersBattlefield(sourceId, game, event.getFromZone(), true);
|
||||||
game.applyEffects();
|
game.applyEffects();
|
||||||
game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));
|
game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));
|
||||||
|
|
|
@ -205,6 +205,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
||||||
game.fireEvent(event);
|
game.fireEvent(event);
|
||||||
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
|
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
|
||||||
game.resetForSourceId(getId());
|
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;
|
return game.getState().getZone(objectId) == toZone;
|
||||||
}
|
}
|
||||||
|
@ -235,6 +236,7 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
||||||
game.fireEvent(event);
|
game.fireEvent(event);
|
||||||
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
|
if (event.getFromZone().equals(Zone.BATTLEFIELD)) {
|
||||||
game.resetForSourceId(getId());
|
game.resetForSourceId(getId());
|
||||||
|
game.applyEffects();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue