From 9c19f0749455d2e80a648318f0080c87efa1821b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 5 Sep 2018 10:57:55 -0400 Subject: [PATCH] fixed various problems with Call to Arms --- Mage.Sets/src/mage/cards/c/CallToArms.java | 38 +++++++++++-------- .../common/MostCommonColorCondition.java | 7 ++-- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CallToArms.java b/Mage.Sets/src/mage/cards/c/CallToArms.java index 41037e04eaa..b577fb8583d 100644 --- a/Mage.Sets/src/mage/cards/c/CallToArms.java +++ b/Mage.Sets/src/mage/cards/c/CallToArms.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -41,19 +40,22 @@ public final class CallToArms extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); // As Call to Arms enters the battlefield, choose a color and an opponent. - Effect effect = new ChooseColorEffect(Outcome.Detriment); -// effect.setText("choose a color and an opponent"); - Ability ability = new AsEntersBattlefieldAbility(effect); - effect = new ChooseOpponentEffect(Outcome.Benefit); - effect.setText("then choose an opponent"); - ability.addEffect(effect); + Ability ability = new AsEntersBattlefieldAbility( + new ChooseColorEffect(Outcome.Detriment) + ); + ability.addEffect(new ChooseOpponentEffect( + Outcome.Benefit + ).setText("and an opponent")); this.addAbility(ability); // White creatures get +1/+1 as long as the chosen color is the most common color among nontoken permanents the chosen player controls but isn't tied for most common. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CallToArmsEffect())); + this.addAbility(new SimpleStaticAbility( + Zone.BATTLEFIELD, + new CallToArmsEffect() + )); // When the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice Call to Arms. - this.addAbility(new SacAbility()); + this.addAbility(new CallToArmsStateTriggeredAbility()); } public CallToArms(final CallToArms card) { @@ -76,7 +78,9 @@ class CallToArmsEffect extends ContinuousEffectImpl { public CallToArmsEffect() { super(Duration.WhileOnBattlefield, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.Benefit); - staticText = "The chosen player's maximum hand size is four"; + staticText = "White creatures get +1/+1 as long as the chosen color " + + "is the most common color among nontoken permanents " + + "the chosen player controls but isn't tied for most common."; } public CallToArmsEffect(final CallToArmsEffect effect) { @@ -107,19 +111,19 @@ class CallToArmsEffect extends ContinuousEffectImpl { } } -class SacAbility extends StateTriggeredAbility { +class CallToArmsStateTriggeredAbility extends StateTriggeredAbility { - public SacAbility() { + public CallToArmsStateTriggeredAbility() { super(Zone.BATTLEFIELD, new SacrificeSourceEffect()); } - public SacAbility(final SacAbility ability) { + public CallToArmsStateTriggeredAbility(final CallToArmsStateTriggeredAbility ability) { super(ability); } @Override - public SacAbility copy() { - return new SacAbility(this); + public CallToArmsStateTriggeredAbility copy() { + return new CallToArmsStateTriggeredAbility(this); } @Override @@ -139,7 +143,9 @@ class SacAbility extends StateTriggeredAbility { @Override public String getRule() { - return "When the chosen color isn't the most common color among nontoken permanents the chosen player controls or is tied for most common, sacrifice {this}"; + return "When the chosen color isn't the most common color " + + "among nontoken permanents the chosen player controls " + + "or is tied for most common, sacrifice {this}"; } } diff --git a/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java b/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java index 9e808722efd..d4a82233992 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/MostCommonColorCondition.java @@ -19,9 +19,9 @@ import mage.game.Game; */ public class MostCommonColorCondition implements Condition { - protected ObjectColor compareColor; - protected boolean isMono; - protected Predicate predicate; + protected final ObjectColor compareColor; + protected final boolean isMono; + protected final Predicate predicate; public MostCommonColorCondition(ObjectColor color) { this(color, false, null); @@ -31,6 +31,7 @@ public class MostCommonColorCondition implements Condition { public MostCommonColorCondition(ObjectColor color, boolean isMono, Predicate predicate) { this.compareColor = color; this.isMono = isMono; + this.predicate = predicate; } @Override