mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08: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
|
|
@ -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…
Add table
Add a link
Reference in a new issue