mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
fixed continuous effects generated by spells
This commit is contained in:
parent
5d4daab64e
commit
79be305eb9
2 changed files with 11 additions and 3 deletions
|
@ -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("");
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue