diff --git a/forge-game/src/main/java/forge/game/cost/Cost.java b/forge-game/src/main/java/forge/game/cost/Cost.java index 294c0cb415b..a6b3fc3a2a0 100644 --- a/forge-game/src/main/java/forge/game/cost/Cost.java +++ b/forge-game/src/main/java/forge/game/cost/Cost.java @@ -51,12 +51,23 @@ public class Cost implements Serializable { private final List costParts = Lists.newArrayList(); private boolean isMandatory = false; + // Primarily used for Summoning Sickness awareness private boolean tapCost = false; public final boolean hasTapCost() { return this.tapCost; } + private void cacheTapCost() { + tapCost = false; + for (CostPart p : getCostParts()) { + if (p instanceof CostTap || p instanceof CostUntap) { + tapCost = true; + return; + } + } + } + public final boolean hasNoManaCost() { return this.getCostMana() == null; } @@ -508,6 +519,7 @@ public class Cost implements Serializable { for (CostPart cp : this.costParts) { toRet.costParts.add(cp.copy()); } + toRet.cacheTapCost(); return toRet; } @@ -518,12 +530,14 @@ public class Cost implements Serializable { if (!(cp instanceof CostPartMana)) toRet.costParts.add(cp.copy()); } + toRet.cacheTapCost(); return toRet; } public final Cost copyWithDefinedMana(String manaCost) { Cost toRet = copyWithNoMana(); toRet.costParts.add(new CostPartMana(new ManaCost(new ManaCostParser(manaCost)), null)); + toRet.cacheTapCost(); return toRet; }