* Fixed a bug that if power/toughness was set from a creature itself (e.g. Marsh Fitter) the effect was still applied if the creature left the battlefield and returned within the duration of the effect.

This commit is contained in:
LevelX2 2015-04-12 23:31:05 +02:00
parent 0ae89c453c
commit 203b65c584
3 changed files with 10 additions and 3 deletions

View file

@ -51,14 +51,15 @@ public class LatchkeyFaerie extends CardImpl {
this.subtype.add("Faerie");
this.subtype.add("Rogue");
this.color.setBlue(true);
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Prowl {2}{U}
this.addAbility(new ProwlAbility(this, "{2}{U}"));
// When Latchkey Faerie enters the battlefield, if its prowl cost was paid, draw a card.
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1), false);
this.addAbility(new ConditionalTriggeredAbility(ability, ProwlCondition.getInstance(),

View file

@ -64,7 +64,6 @@ public class MarshFlitter extends CardImpl {
this.subtype.add("Faerie");
this.subtype.add("Rogue");
this.color.setBlack(true);
this.power = new MageInt(1);
this.toughness = new MageInt(1);

View file

@ -36,6 +36,7 @@ import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game;
/**
@ -75,7 +76,13 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
MageObject mageObject = game.getObject(source.getSourceId()); // there are character definig abilities (e.g. P/T Nightmare) that have to work also for P/T of cards
MageObject mageObject;
if (source.getZone() == Zone.BATTLEFIELD) {
mageObject = source.getSourceObjectIfItStillExists(game);
} else {
mageObject = game.getObject(source.getSourceId()); // there are character definig abilities (e.g. P/T Nightmare) that have to work also for P/T of cards
}
if (mageObject == null) {
if (duration.equals(Duration.Custom)) {
discard();