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 76ea5a80f5d..6b9f58b717b 100644 --- a/forge-game/src/main/java/forge/game/cost/Cost.java +++ b/forge-game/src/main/java/forge/game/cost/Cost.java @@ -764,7 +764,7 @@ public class Cost { String r1 = ((CostPartMana) part).getRestiction(); String r = r1 == null ? r2 : ( r2 == null ? r1 : r1 + "." + r2); costParts.remove(costPart2); - costParts.add(0, new CostPartMana(oldManaCost.toManaCost(), r)); + costParts.add(0, new CostPartMana(oldManaCost.toManaCost(), r, ((CostPartMana)part).isExiledCreatureCost(), ((CostPartMana)part).isEnchantedCreatureCost())); } else if (part instanceof CostDiscard || part instanceof CostTapType) { boolean alreadyAdded = false; for (final CostPart other : costParts) { diff --git a/forge-game/src/main/java/forge/game/cost/CostPartMana.java b/forge-game/src/main/java/forge/game/cost/CostPartMana.java index d0e6281b0c0..63803399826 100644 --- a/forge-game/src/main/java/forge/game/cost/CostPartMana.java +++ b/forge-game/src/main/java/forge/game/cost/CostPartMana.java @@ -49,6 +49,15 @@ public class CostPartMana extends CostPart { this.restriction = xCantBe0 || isExiledCreatureCost || isEnchantedCreatureCost? null : restriction; } + // This version of the constructor allows to explicitly set exiledCreatureCost/enchantedCreatureCost, used only when copying costs + public CostPartMana(final ManaCost cost, String restriction, boolean exiledCreatureCost, boolean enchantedCreatureCost) { + this.cost = cost; + this.xCantBe0 = "XCantBe0".equals(restriction); + this.isExiledCreatureCost = exiledCreatureCost; + this.isEnchantedCreatureCost = enchantedCreatureCost; + this.restriction = xCantBe0 || isExiledCreatureCost || isEnchantedCreatureCost? null : restriction; + } + /** * Gets the mana. *