From d6f16061edc99a6661d649de08e3cedddc5710dd Mon Sep 17 00:00:00 2001 From: Agetian Date: Tue, 5 Mar 2013 13:30:21 +0000 Subject: [PATCH] - Fixed a bug that caused copies of split card spells (e.g. from Isochron Scepter) not to go on stack correctly. Please revise, I'm not sure if there may be other cases like that which are not yet accounted for. --- src/main/java/forge/game/GameActionPlay.java | 43 +++++++++++--------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/main/java/forge/game/GameActionPlay.java b/src/main/java/forge/game/GameActionPlay.java index ca05fff834d..49e78212e9d 100644 --- a/src/main/java/forge/game/GameActionPlay.java +++ b/src/main/java/forge/game/GameActionPlay.java @@ -366,26 +366,9 @@ public class GameActionPlay { sa.setActivatingPlayer(activator); final Card source = sa.getSourceCard(); - + // Split card support - if (source.getRules() != null) { - if (source.getRules().getSplitType() == CardSplitType.Split) { - List leftSplitAbilities = source.getState(CardCharacteristicName.LeftSplit).getSpellAbility(); - List rightSplitAbilities = source.getState(CardCharacteristicName.RightSplit).getSpellAbility(); - for (SpellAbility a : leftSplitAbilities) { - if (sa == a) { - source.setState(CardCharacteristicName.LeftSplit); - break; - } - } - for (SpellAbility a : rightSplitAbilities) { - if (sa == a) { - source.setState(CardCharacteristicName.RightSplit); - break; - } - } - } - } + setSplitCardState(source, sa); if (sa.getApi() == ApiType.Charm && !sa.isWrapper()) { CharmEffect.makeChoices(sa); @@ -555,4 +538,26 @@ public class GameActionPlay { return usableColors; } + + private void setSplitCardState(final Card source, SpellAbility sa) { + // Split card support + if (source.getRules() != null) { + if (source.getRules().getSplitType() == CardSplitType.Split) { + List leftSplitAbilities = source.getState(CardCharacteristicName.LeftSplit).getSpellAbility(); + List rightSplitAbilities = source.getState(CardCharacteristicName.RightSplit).getSpellAbility(); + for (SpellAbility a : leftSplitAbilities) { + if (sa == a || sa.getDescription().equals(String.format("%s (without paying its mana cost)", a.getDescription()))) { + source.setState(CardCharacteristicName.LeftSplit); + break; + } + } + for (SpellAbility a : rightSplitAbilities) { + if (sa == a || sa.getDescription().equals(String.format("%s (without paying its mana cost)", a.getDescription()))) { + source.setState(CardCharacteristicName.RightSplit); + break; + } + } + } + } + } }