fixed continuous effects generated by spells

This commit is contained in:
BetaSteward 2012-02-05 22:50:42 -05:00
parent 5d4daab64e
commit 79be305eb9
2 changed files with 11 additions and 3 deletions

View file

@ -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("");

View file

@ -219,9 +219,16 @@ public class ContinuousEffects implements Serializable {
private List<ContinuousEffect> getLayeredEffects(Game game) {
List<ContinuousEffect> layerEffects = new ArrayList<ContinuousEffect>();
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());