diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/GiveTake.java b/Mage.Sets/src/mage/sets/dragonsmaze/GiveTake.java index a1870eddb1..a92e5b014e 100644 --- a/Mage.Sets/src/mage/sets/dragonsmaze/GiveTake.java +++ b/Mage.Sets/src/mage/sets/dragonsmaze/GiveTake.java @@ -58,16 +58,16 @@ public class GiveTake extends SplitCard { this.color.setBlue(true); // Give - Card leftHalvCard = this.createLeftHalveCard("Give", "{2}{G}"); + Card leftHalfCard = this.createLeftHalfCard("Give", "{2}{G}"); // Put three +1/+1 counters on target creature. - leftHalvCard.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(3))); - leftHalvCard.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); + leftHalfCard.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(3))); + leftHalfCard.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); // Take - Card rightHalvCard = this.createRightHalveCard("Take", "{2}{U}"); + Card rightHalfCard = this.createRightHalfCard("Take", "{2}{U}"); // Remove all +1/+1 counters from target creature you control. Draw that many cards. - rightHalvCard.getSpellAbility().addEffect(new TakeEffect()); - rightHalvCard.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(true)); + rightHalfCard.getSpellAbility().addEffect(new TakeEffect()); + rightHalfCard.getSpellAbility().addTarget(new TargetControlledCreaturePermanent(true)); // Fuse (You may cast one or both halves of this card from your hand.) diff --git a/Mage.Sets/src/mage/sets/invasion/AssaultBattery.java b/Mage.Sets/src/mage/sets/invasion/AssaultBattery.java index ae23e0ed37..e191cd9d9e 100644 --- a/Mage.Sets/src/mage/sets/invasion/AssaultBattery.java +++ b/Mage.Sets/src/mage/sets/invasion/AssaultBattery.java @@ -55,17 +55,17 @@ public class AssaultBattery extends SplitCard { this.color.setGreen(true); // Assault - Card leftHalvCard = this.createLeftHalveCard("Assault", "{R}"); + Card leftHalfCard = this.createLeftHalfCard("Assault", "{R}"); // Assault deals 2 damage to target creature or player. Effect effect = new DamageTargetEffect(2); effect.setText("Assault deals 2 damage to target creature or player"); - leftHalvCard.getSpellAbility().addEffect(effect); - leftHalvCard.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true)); + leftHalfCard.getSpellAbility().addEffect(effect); + leftHalfCard.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true)); // Battery - Card rightHalvCard = this.createRightHalveCard("Battery", "{3}{G}"); + Card rightHalfCard = this.createRightHalfCard("Battery", "{3}{G}"); // Put a 3/3 green Elephant creature token onto the battlefield. - rightHalvCard.getSpellAbility().addEffect(new CreateTokenEffect(new ElephantToken())); + rightHalfCard.getSpellAbility().addEffect(new CreateTokenEffect(new ElephantToken())); } diff --git a/Mage/src/mage/cards/SplitCard.java b/Mage/src/mage/cards/SplitCard.java index 3a3e85c570..772acbe303 100644 --- a/Mage/src/mage/cards/SplitCard.java +++ b/Mage/src/mage/cards/SplitCard.java @@ -50,13 +50,13 @@ import mage.watchers.Watcher; public abstract class SplitCard> extends CardImpl { - public enum ActiveCardHalve { + public enum ActiveCardHalf { NONE, LEFT, RIGHT } - private Card leftHalveCard; - private Card rightHalveCard; + private Card leftHalfCard; + private Card rightHalfCard; - private ActiveCardHalve activeCardHalve = ActiveCardHalve.NONE; + private ActiveCardHalf activeCardHalf = ActiveCardHalf.NONE; public SplitCard(UUID ownerId, int cardNumber, String name, Rarity rarity, CardType[] cardTypes, String costs) { super(ownerId, cardNumber, name, rarity, cardTypes, costs); @@ -65,48 +65,48 @@ public abstract class SplitCard> extends CardImpl { public SplitCard(SplitCard card) { super(card); - this.leftHalveCard = card.leftHalveCard; - this.rightHalveCard = card.rightHalveCard; - this.activeCardHalve = card.activeCardHalve; + this.leftHalfCard = card.leftHalfCard; + this.rightHalfCard = card.rightHalfCard; + this.activeCardHalf = card.activeCardHalf; } - public Card createLeftHalveCard (String name, String costs) { + public Card createLeftHalfCard (String name, String costs) { CardType[] cardTypes = new CardType[getCardType().size()]; this.getCardType().toArray(cardTypes); - leftHalveCard = new leftHalveCard(this.getOwnerId(), this.getCardNumber(), name, this.rarity, cardTypes, costs); - leftHalveCard.getAbilities().setSourceId(objectId); - return leftHalveCard; + leftHalfCard = new leftHalfCard(this.getOwnerId(), this.getCardNumber(), name, this.rarity, cardTypes, costs); + leftHalfCard.getAbilities().setSourceId(objectId); + return leftHalfCard; } - public Card createRightHalveCard (String name, String costs) { + public Card createRightHalfCard (String name, String costs) { CardType[] cardTypes = new CardType[getCardType().size()]; this.getCardType().toArray(cardTypes); - rightHalveCard = new leftHalveCard(this.getOwnerId(), this.getCardNumber(), name, this.rarity, cardTypes, costs); - rightHalveCard.getAbilities().setSourceId(objectId); - return rightHalveCard; + rightHalfCard = new leftHalfCard(this.getOwnerId(), this.getCardNumber(), name, this.rarity, cardTypes, costs); + rightHalfCard.getAbilities().setSourceId(objectId); + return rightHalfCard; } - public Card getLeftHalveCard () { - return leftHalveCard; + public Card getLeftHalfCard () { + return leftHalfCard; } - public Card getRightHalveCard () { - return rightHalveCard; + public Card getRightHalfCard () { + return rightHalfCard; } - public ActiveCardHalve getActiveCardHalve() { - return activeCardHalve; + public ActiveCardHalf getActiveCardHalf() { + return activeCardHalf; } @Override public boolean cast(Game game, Constants.Zone fromZone, SpellAbility ability, UUID controllerId) { if (super.cast(game, fromZone, ability, controllerId)) { - if (leftHalveCard.getAbilities().contains(ability)) { - activeCardHalve = ActiveCardHalve.LEFT; - } else if (rightHalveCard.getAbilities().contains(ability)) { - activeCardHalve = ActiveCardHalve.RIGHT; + if (leftHalfCard.getAbilities().contains(ability)) { + activeCardHalf = ActiveCardHalf.LEFT; + } else if (rightHalfCard.getAbilities().contains(ability)) { + activeCardHalf = ActiveCardHalf.RIGHT; } else { - activeCardHalve = ActiveCardHalve.NONE; + activeCardHalf = ActiveCardHalf.NONE; } return true; } @@ -117,7 +117,7 @@ public abstract class SplitCard> extends CardImpl { public boolean moveToZone(Constants.Zone toZone, UUID sourceId, Game game, boolean flag, ArrayList appliedEffects) { if (super.moveToZone(toZone, sourceId, game, flag, appliedEffects)) { if (!toZone.equals(Zone.STACK)) { - activeCardHalve = ActiveCardHalve.NONE; + activeCardHalf = ActiveCardHalf.NONE; } return true; } @@ -127,7 +127,7 @@ public abstract class SplitCard> extends CardImpl { @Override public boolean moveToExile(UUID exileId, String name, UUID sourceId, Game game, ArrayList appliedEffects) { if(super.moveToExile(exileId, name, sourceId, game, appliedEffects)) { - activeCardHalve = ActiveCardHalve.NONE; + activeCardHalf = ActiveCardHalf.NONE; return true; } return false; @@ -136,11 +136,11 @@ public abstract class SplitCard> extends CardImpl { @Override public Abilities getAbilities(){ Abilities allAbilites = new AbilitiesImpl(); - if (activeCardHalve.equals(ActiveCardHalve.NONE) || activeCardHalve.equals(ActiveCardHalve.LEFT)) { - allAbilites.addAll(leftHalveCard.getAbilities()); + if (activeCardHalf.equals(ActiveCardHalf.NONE) || activeCardHalf.equals(ActiveCardHalf.LEFT)) { + allAbilites.addAll(leftHalfCard.getAbilities()); } - if (activeCardHalve.equals(ActiveCardHalve.NONE) || activeCardHalve.equals(ActiveCardHalve.RIGHT)) { - allAbilites.addAll(rightHalveCard.getAbilities()); + if (activeCardHalf.equals(ActiveCardHalf.NONE) || activeCardHalf.equals(ActiveCardHalf.RIGHT)) { + allAbilites.addAll(rightHalfCard.getAbilities()); } for (Ability ability: super.getAbilities()) { if (ability instanceof FuseAbility) { @@ -152,11 +152,11 @@ public abstract class SplitCard> extends CardImpl { @Override public SpellAbility getSpellAbility() { - switch (activeCardHalve) { + switch (activeCardHalf) { case LEFT: - return leftHalveCard.getSpellAbility(); + return leftHalfCard.getSpellAbility(); case RIGHT: - return rightHalveCard.getSpellAbility(); + return rightHalfCard.getSpellAbility(); } return null; } @@ -164,16 +164,16 @@ public abstract class SplitCard> extends CardImpl { @Override public List getRules() { List rules = new ArrayList(); - if (activeCardHalve.equals(ActiveCardHalve.NONE) || activeCardHalve.equals(ActiveCardHalve.LEFT)) { - rules.add(new StringBuilder("").append(leftHalveCard.getName()).append("").toString()); - rules.addAll(leftHalveCard.getRules()); + if (activeCardHalf.equals(ActiveCardHalf.NONE) || activeCardHalf.equals(ActiveCardHalf.LEFT)) { + rules.add(new StringBuilder("").append(leftHalfCard.getName()).append("").toString()); + rules.addAll(leftHalfCard.getRules()); } - if (activeCardHalve.equals(ActiveCardHalve.NONE)) { + if (activeCardHalf.equals(ActiveCardHalf.NONE)) { rules.add("
"); } - if (activeCardHalve.equals(ActiveCardHalve.NONE) || activeCardHalve.equals(ActiveCardHalve.RIGHT)) { - rules.add(new StringBuilder("").append(rightHalveCard.getName()).append("").toString()); - rules.addAll(rightHalveCard.getRules()); + if (activeCardHalf.equals(ActiveCardHalf.NONE) || activeCardHalf.equals(ActiveCardHalf.RIGHT)) { + rules.add(new StringBuilder("").append(rightHalfCard.getName()).append("").toString()); + rules.addAll(rightHalfCard.getRules()); } for (Ability ability: super.getAbilities()) { @@ -188,30 +188,30 @@ public abstract class SplitCard> extends CardImpl { @Override public void setControllerId(UUID controllerId) { abilities.setControllerId(controllerId); - leftHalveCard.getAbilities().setControllerId(controllerId); - rightHalveCard.getAbilities().setControllerId(controllerId); + leftHalfCard.getAbilities().setControllerId(controllerId); + rightHalfCard.getAbilities().setControllerId(controllerId); } @Override public void setOwnerId(UUID ownerId) { this.ownerId = ownerId; abilities.setControllerId(ownerId); - leftHalveCard.getAbilities().setControllerId(ownerId); - leftHalveCard.setOwnerId(ownerId); - rightHalveCard.getAbilities().setControllerId(ownerId); - rightHalveCard.setOwnerId(ownerId); + leftHalfCard.getAbilities().setControllerId(ownerId); + leftHalfCard.setOwnerId(ownerId); + rightHalfCard.getAbilities().setControllerId(ownerId); + rightHalfCard.setOwnerId(ownerId); } @Override public List getWatchers() { List allWatchers = new ArrayList(); - switch (activeCardHalve) { + switch (activeCardHalf) { case LEFT: - allWatchers.addAll(leftHalveCard.getWatchers()); + allWatchers.addAll(leftHalfCard.getWatchers()); break; case RIGHT: - allWatchers.addAll(rightHalveCard.getWatchers()); + allWatchers.addAll(rightHalfCard.getWatchers()); break; } return allWatchers; @@ -224,37 +224,37 @@ public abstract class SplitCard> extends CardImpl { /* * The left side card of the split card */ -class leftHalveCard extends CardImpl { +class leftHalfCard extends CardImpl { - public leftHalveCard(UUID ownerId, int cardNumber, String name, Rarity rarity, CardType[] cardTypes, String costs) { + public leftHalfCard(UUID ownerId, int cardNumber, String name, Rarity rarity, CardType[] cardTypes, String costs) { super(ownerId, cardNumber, name, rarity, cardTypes, costs); } - public leftHalveCard(final leftHalveCard card) { + public leftHalfCard(final leftHalfCard card) { super(card); } @Override - public leftHalveCard copy() { - return new leftHalveCard(this); + public leftHalfCard copy() { + return new leftHalfCard(this); } } /* * The right side card of the split card */ -class rightHalveCard extends CardImpl { +class rightHalfCard extends CardImpl { - public rightHalveCard(UUID ownerId, int cardNumber, String name, Rarity rarity, CardType[] cardTypes, String costs) { + public rightHalfCard(UUID ownerId, int cardNumber, String name, Rarity rarity, CardType[] cardTypes, String costs) { super(ownerId, cardNumber, name, rarity, cardTypes, costs); } - public rightHalveCard(final rightHalveCard card) { + public rightHalfCard(final rightHalfCard card) { super(card); } @Override - public rightHalveCard copy() { - return new rightHalveCard(this); + public rightHalfCard copy() { + return new rightHalfCard(this); } }