From 79be305eb972694840d2ebb52ce28c807384a59a Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Sun, 5 Feb 2012 22:50:42 -0500 Subject: [PATCH] fixed continuous effects generated by spells --- Mage/src/mage/Constants.java | 1 + .../mage/abilities/effects/ContinuousEffects.java | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Mage/src/mage/Constants.java b/Mage/src/mage/Constants.java index 4926f8765dd..0c7a4fdf85d 100644 --- a/Mage/src/mage/Constants.java +++ b/Mage/src/mage/Constants.java @@ -193,6 +193,7 @@ public final class Constants { EndOfGame("for the rest of the game"), WhileOnBattlefield(""), WhileOnStack(""), + WhileInGraveyard(""), EndOfTurn("until end of turn"), EndOfCombat("until end of combat"), Custom(""); diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java index 58f3b928dbe..e53841168a3 100644 --- a/Mage/src/mage/abilities/effects/ContinuousEffects.java +++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java @@ -219,9 +219,16 @@ public class ContinuousEffects implements Serializable { private List getLayeredEffects(Game game) { List layerEffects = new ArrayList(); for (ContinuousEffect effect: layeredEffects) { - Ability ability = abilityMap.get(effect.getId()); - if (ability.isInUseableZone(game)) { - layerEffects.add(effect); + switch (effect.getDuration()) { + case WhileOnBattlefield: + case WhileOnStack: + case WhileInGraveyard: + Ability ability = abilityMap.get(effect.getId()); + if (ability.isInUseableZone(game)) + layerEffects.add(effect); + break; + default: + layerEffects.add(effect); } } Collections.sort(layerEffects, new TimestampSorter());