diff --git a/forge-game/src/main/java/forge/game/ability/effects/ChangeTargetsEffect.java b/forge-game/src/main/java/forge/game/ability/effects/ChangeTargetsEffect.java index e625c7ab55b..c3a24f2b8ce 100644 --- a/forge-game/src/main/java/forge/game/ability/effects/ChangeTargetsEffect.java +++ b/forge-game/src/main/java/forge/game/ability/effects/ChangeTargetsEffect.java @@ -56,10 +56,10 @@ public class ChangeTargetsEffect extends SpellAbilityEffect { if (sa.hasParam("ChangeSingleTarget")) { // 1. choose a target of target spell List> allTargets = new ArrayList<>(); - while(changingTgtSI != null) { + while (changingTgtSI != null) { SpellAbility changedSa = changingTgtSI.getSpellAbility(true); if (changedSa.usesTargeting()) { - for(GameObject it : changedSa.getTargets()) + for (GameObject it : changedSa.getTargets()) allTargets.add(ImmutablePair.of(changingTgtSI, it)); } changingTgtSI = changingTgtSI.getSubInstance(); @@ -76,12 +76,14 @@ public class ChangeTargetsEffect extends SpellAbilityEffect { GameObject oldTarget = chosenTarget.getValue(); TargetChoices oldTargetBlock = replaceIn.getTargetChoices(); TargetChoices newTargetBlock = oldTargetBlock.clone(); - // gets the divied value from old target + // gets the divided value from old target Integer div = oldTargetBlock.getDividedValue(oldTarget); // 3. test if updated choices would be correct. GameObject newTarget = Iterables.getFirst(getDefinedCardsOrTargeted(sa, "DefinedMagnet"), null); - if (replaceIn.getSpellAbility(true).canTarget(newTarget)) { + // CR 115.3. The same target can’t be chosen multiple times for + // any one instance of the word “target” on a spell or ability. + if (!oldTargetBlock.contains(newTarget) && replaceIn.getSpellAbility(true).canTarget(newTarget)) { newTargetBlock.remove(oldTarget); newTargetBlock.add(newTarget); if (div != null) { @@ -89,9 +91,8 @@ public class ChangeTargetsEffect extends SpellAbilityEffect { } replaceIn.updateTarget(newTargetBlock, sa.getHostCard()); } - } - else { - while(changingTgtSI != null) { + } else { + while (changingTgtSI != null) { SpellAbility changingTgtSA = changingTgtSI.getSpellAbility(true); if (changingTgtSA.usesTargeting()) { // random target and DefinedMagnet works on single targets @@ -126,8 +127,7 @@ public class ChangeTargetsEffect extends SpellAbilityEffect { changingTgtSA.addDividedAllocation(newTarget, div); } } - } - else { + } else { // Update targets, with a potential new target Predicate filter = sa.hasParam("TargetRestriction") ? GameObjectPredicates.restriction(sa.getParam("TargetRestriction").split(","), activator, sa.getHostCard(), sa) : null; // TODO Creature.Other might not work yet as it should diff --git a/forge-gui/res/cardsfolder/b/bond_of_flourishing.txt b/forge-gui/res/cardsfolder/b/bond_of_flourishing.txt index 5a9655472b9..4866f0396db 100644 --- a/forge-gui/res/cardsfolder/b/bond_of_flourishing.txt +++ b/forge-gui/res/cardsfolder/b/bond_of_flourishing.txt @@ -2,5 +2,5 @@ Name:Bond of Flourishing ManaCost:1 G Types:Sorcery A:SP$ Dig | Cost$ 1 G | DigNum$ 3 | ChangeNum$ 1 | Optional$ True | ChangeValid$ Permanent | DestinationZone$ Hand | DestinationZone2$ Library | LibraryPosition$ -1 | RestRandomOrder$ True | SubAbility$ GainLife | SpellDescription$ Look at the top three cards of your library. You may reveal a permanent card from among them and put it into your hand. Put the rest on the bottom of your library in any order. You gain 3 life. -SVar:GainLife:DB$GainLife | LifeAmount$ 3 +SVar:GainLife:DB$ GainLife | LifeAmount$ 3 Oracle:Look at the top three cards of your library. You may reveal a permanent card from among them and put it into your hand. Put the rest on the bottom of your library in any order. You gain 3 life. diff --git a/forge-gui/res/cardsfolder/b/bond_of_passion.txt b/forge-gui/res/cardsfolder/b/bond_of_passion.txt index de92d3affc3..d4e57f1adb7 100644 --- a/forge-gui/res/cardsfolder/b/bond_of_passion.txt +++ b/forge-gui/res/cardsfolder/b/bond_of_passion.txt @@ -2,5 +2,5 @@ Name:Bond of Passion ManaCost:4 R R Types:Sorcery A:SP$ GainControl | Cost$ 4 R R | ValidTgts$ Creature | TgtPrompt$ Select target creature. | LoseControl$ EOT | Untap$ True | AddKWs$ Haste | SubAbility$ DBDamage | SpellDescription$ Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. CARDNAME deals 2 damage to any target. -SVar:DBDamage:DB$DealDamage | ValidTgts$ Creature,Player,Planeswalker | NumDmg$ 2 | TargetUnique$ True | TgtPrompt$ Select any target. +SVar:DBDamage:DB$ DealDamage | ValidTgts$ Creature,Player,Planeswalker | NumDmg$ 2 | TargetUnique$ True | TgtPrompt$ Select any target. Oracle:Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. Bond of Passion deals 2 damage to any other target.