From 283b27e26ce5d0c43c621d19044f0e63190d988b Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Jul 2013 16:30:39 +0200 Subject: [PATCH] * Haunted Plate Mail - Fixed that it gave +2/+2 instead of +4/+4. --- .../mage/sets/magic2014/HauntedPlateMail.java | 43 ++++++------------- 1 file changed, 12 insertions(+), 31 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2014/HauntedPlateMail.java b/Mage.Sets/src/mage/sets/magic2014/HauntedPlateMail.java index bc661b8b25..9d0a87e125 100644 --- a/Mage.Sets/src/mage/sets/magic2014/HauntedPlateMail.java +++ b/Mage.Sets/src/mage/sets/magic2014/HauntedPlateMail.java @@ -30,10 +30,12 @@ package mage.sets.magic2014; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; -import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.costs.CostImpl; +import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.effects.common.continious.BecomesCreatureSourceEffect; import mage.abilities.effects.common.continious.BoostEnchantedEffect; import mage.abilities.keyword.EquipAbility; @@ -44,6 +46,7 @@ import mage.constants.Outcome; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.permanent.token.Token; @@ -59,9 +62,14 @@ public class HauntedPlateMail extends CardImpl { this.subtype.add("Equipment"); // Equipped creature gets +4/+4. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(4, 4))); // {0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HauntedPlateMailToken(), "", Duration.Custom), new HauntedPlateMailCost()); + Ability ability = new ConditionalActivatedAbility( + Zone.BATTLEFIELD, + new BecomesCreatureSourceEffect(new HauntedPlateMailToken(),"", Duration.EndOfTurn), + new ManaCostsImpl("{0}"), + new ControlsPermanentCondition(new FilterCreaturePermanent(), ControlsPermanentCondition.CountType.EQUAL_TO, 0), + "{0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures."); this.addAbility(ability); // Equip {4} this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl("{4}"))); @@ -77,33 +85,6 @@ public class HauntedPlateMail extends CardImpl { } } -class HauntedPlateMailCost extends CostImpl { - - public HauntedPlateMailCost() { - this.text = "Activate this ability only if you control no creatures"; - } - - public HauntedPlateMailCost(final HauntedPlateMailCost cost) { - super(cost); - } - - @Override - public boolean canPay(UUID sourceId, UUID controllerId, Game game) { - return !game.getBattlefield().contains(new FilterControlledCreaturePermanent(), controllerId, 1, game); - } - - @Override - public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { - this.paid = true; - return paid; - } - - @Override - public HauntedPlateMailCost copy() { - return new HauntedPlateMailCost(this); - } -} - class HauntedPlateMailToken extends Token { public HauntedPlateMailToken() { @@ -114,4 +95,4 @@ class HauntedPlateMailToken extends Token { power = new MageInt(4); toughness = new MageInt(4); } -} \ No newline at end of file +}