diff --git a/.gitattributes b/.gitattributes index 10ced0e1922..32d4dec9fe8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2243,6 +2243,7 @@ res/cardsfolder/c/cursed_totem.txt svneol=native#text/plain res/cardsfolder/c/custody_battle.txt -text svneol=unset#text/plain res/cardsfolder/c/customs_depot.txt svneol=native#text/plain res/cardsfolder/c/cut_the_earthly_bond.txt svneol=native#text/plain +res/cardsfolder/c/cut_the_tethers.txt -text res/cardsfolder/c/cutthroat_il_dal.txt svneol=native#text/plain res/cardsfolder/c/cyclical_evolution.txt svneol=native#text/plain res/cardsfolder/c/cyclonic_rift.txt -text diff --git a/res/cardsfolder/c/cut_the_tethers.txt b/res/cardsfolder/c/cut_the_tethers.txt new file mode 100644 index 00000000000..2b9898afcae --- /dev/null +++ b/res/cardsfolder/c/cut_the_tethers.txt @@ -0,0 +1,8 @@ +Name:Cut the Tethers +ManaCost:2 U U +Types:Sorcery +A:SP$ RepeatEach | Cost$ 2 U U | RepeatSubAbility$ DBReturn | RepeatCards$ Creature.Spirit | SpellDescription$ For each Spirit, return it to its owner's hand unless that player pays 3. +SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Battlefield | Destination$ Hand | UnlessCost$ 3 | UnlessPayer$ RememberedController +SVar:Picture:http://www.wizards.com.sixxs.org/global/images/magic/general/cut_the_tethers.jpg +Oracle:For each Spirit, return it to its owner's hand unless that player pays {3}. +SetInfo:CHK Uncommon \ No newline at end of file diff --git a/src/main/java/forge/game/GameActionUtil.java b/src/main/java/forge/game/GameActionUtil.java index 00916038587..6e01632b5f3 100644 --- a/src/main/java/forge/game/GameActionUtil.java +++ b/src/main/java/forge/game/GameActionUtil.java @@ -405,6 +405,16 @@ public final class GameActionUtil { // Only human player pays this way final Player p = ability.getActivatingPlayer(); final Card source = ability.getSourceCard(); + Card current = null; // Used in spells with RepeatEach effect to distinguish cards, Cut the Tethers + if (!source.getRemembered().isEmpty() && source.isSpell()) { + if (source.getRemembered().get(0) instanceof Card) { + current = (Card) source.getRemembered().get(0); + } + } + if (!source.getImprinted().isEmpty() && source.isSpell()) { + current = source.getImprinted().get(0); + } + final List parts = cost.getCostParts(); ArrayList remainingParts = new ArrayList(cost.getCostParts()); CostPart costPart = null; @@ -554,7 +564,9 @@ public final class GameActionUtil { if (!(costPart instanceof CostPartMana )) throw new RuntimeException("GameActionUtil.payCostDuringAbilityResolve - The remaining payment type is not Mana."); - InputPayment toSet = new InputPayManaExecuteCommands(p, source + "\r\n", ability.getManaCost()); + InputPayment toSet = current == null + ? new InputPayManaExecuteCommands(p, source + "\r\n", ability.getManaCost()) + : new InputPayManaExecuteCommands(p, source + "\r\n" + "Current Card: " + current + "\r\n" , ability.getManaCost()); FThreads.setInputAndWait(toSet); return toSet.isPaid(); }