From 8bc21a7c1c33284827b8f58d35731b2746ca7d71 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 3 May 2013 08:38:11 +0200 Subject: [PATCH] Some minor changes to SplitCard. --- Mage/src/mage/cards/SplitCard.java | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Mage/src/mage/cards/SplitCard.java b/Mage/src/mage/cards/SplitCard.java index 3d02c36220..48cc68801e 100644 --- a/Mage/src/mage/cards/SplitCard.java +++ b/Mage/src/mage/cards/SplitCard.java @@ -51,7 +51,7 @@ import mage.watchers.Watcher; public abstract class SplitCard> extends CardImpl { public enum ActiveCardHalf { - NONE, LEFT, RIGHT + NONE, LEFT, RIGHT, BOTH } private Card leftHalfCard; private Card rightHalfCard; @@ -67,8 +67,8 @@ public abstract class SplitCard> extends CardImpl { public SplitCard(SplitCard card) { super(card); - this.leftHalfCard = card.leftHalfCard; - this.rightHalfCard = card.rightHalfCard; + this.leftHalfCard = card.leftHalfCard.copy(); + this.rightHalfCard = card.rightHalfCard.copy(); this.activeCardHalf = card.activeCardHalf; } @@ -104,16 +104,19 @@ public abstract class SplitCard> extends CardImpl { @Override public boolean cast(Game game, Constants.Zone fromZone, SpellAbility ability, UUID controllerId) { + if (this.getAbilities().contains(ability)) { + activeCardHalf = ActiveCardHalf.BOTH; + } else if (leftHalfCard.getAbilities().contains(ability)) { + activeCardHalf = ActiveCardHalf.LEFT; + } else if (rightHalfCard.getAbilities().contains(ability)) { + activeCardHalf = ActiveCardHalf.RIGHT; + } else { + activeCardHalf = ActiveCardHalf.NONE; + } if (super.cast(game, fromZone, ability, controllerId)) { - if (leftHalfCard.getAbilities().contains(ability)) { - activeCardHalf = ActiveCardHalf.LEFT; - } else if (rightHalfCard.getAbilities().contains(ability)) { - activeCardHalf = ActiveCardHalf.RIGHT; - } else { - activeCardHalf = ActiveCardHalf.NONE; - } return true; } + activeCardHalf = ActiveCardHalf.NONE; return false; }