mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* 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:
parent
0ae89c453c
commit
203b65c584
3 changed files with 10 additions and 3 deletions
|
@ -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(),
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue