From 7bc69ba1da396a2e41d71a330eebe6a281a1028c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 18 Apr 2013 16:06:32 +0200 Subject: [PATCH] Changed create token handling of Hero of Bladehold and Army of the Damned. Minor formating to Budoka Gardener. Fixed #195. Bug concerning Budoka Gardener #194 was already fixed with changes to the handling of continious effects committed yesterday. --- .../championsofkamigawa/BudokaGardener.java | 17 ++++--- .../mage/sets/innistrad/ArmyOfTheDamned.java | 41 +--------------- .../mirrodinbesieged/HeroOfBladehold.java | 47 +++---------------- 3 files changed, 20 insertions(+), 85 deletions(-) diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java index 27f3a89e44..a431708ac9 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/BudokaGardener.java @@ -27,7 +27,12 @@ */ package mage.sets.championsofkamigawa; -import mage.Constants.*; +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -52,8 +57,6 @@ import mage.game.permanent.Permanent; import mage.game.permanent.token.Token; import mage.target.common.TargetCardInHand; -import java.util.UUID; - /** * @author Loki @@ -73,9 +76,12 @@ public class BudokaGardener extends CardImpl { // {T}: You may put a land card from your hand onto the battlefield. If you control ten or more lands, flip Budoka Gardener. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BudokaGardenerEffect(), new TapSourceCost()); - ability.addTarget(new TargetCardInHand(new FilterLandCard())); + ability.addTarget(new TargetCardInHand(0, 1, new FilterLandCard())); this.addAbility(ability); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new DokaiWeaverofLife()), FlippedCondition.getInstance(), ""))); + + Ability flipAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new CopyTokenEffect(new DokaiWeaverofLife()), FlippedCondition.getInstance(), "{this} becomes Dokai, Weaver of Life")); + ability.setRuleVisible(false); + this.addAbility(flipAbility); } public BudokaGardener(final BudokaGardener card) { @@ -156,4 +162,3 @@ class DokaiWeaverofLifeToken extends Token { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(controlledLands, controlledLands, Duration.WhileOnBattlefield))); } } - diff --git a/Mage.Sets/src/mage/sets/innistrad/ArmyOfTheDamned.java b/Mage.Sets/src/mage/sets/innistrad/ArmyOfTheDamned.java index ba29dcf8e6..67803965a8 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ArmyOfTheDamned.java +++ b/Mage.Sets/src/mage/sets/innistrad/ArmyOfTheDamned.java @@ -29,18 +29,13 @@ package mage.sets.innistrad; import java.util.UUID; import mage.Constants.CardType; -import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.Constants.TimingRule; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.ZombieToken; -import mage.players.Player; /** @@ -55,7 +50,7 @@ public class ArmyOfTheDamned extends CardImpl { this.color.setBlack(true); // Put thirteen 2/2 black Zombie creature tokens onto the battlefield tapped. - this.getSpellAbility().addEffect(new ArmyOfTheDamnedEffect()); + this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken(), 13, true, false)); // Flashback {7}{B}{B}{B} this.addAbility(new FlashbackAbility(new ManaCostsImpl("{7}{B}{B}{B}"), TimingRule.SORCERY)); @@ -70,35 +65,3 @@ public class ArmyOfTheDamned extends CardImpl { return new ArmyOfTheDamned(this); } } - -class ArmyOfTheDamnedEffect extends OneShotEffect { - - public ArmyOfTheDamnedEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "Put thirteen 2/2 black Zombie creature tokens onto the battlefield tapped"; - } - - public ArmyOfTheDamnedEffect(final ArmyOfTheDamnedEffect effect) { - super(effect); - } - - @Override - public ArmyOfTheDamnedEffect copy() { - return new ArmyOfTheDamnedEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - ZombieToken token = new ZombieToken(); - for (int i = 0; i < 13; i++) { - token.putOntoBattlefield(1, game, source.getId(), source.getControllerId()); - Permanent permanent = game.getPermanent(token.getLastAddedToken()); - permanent.setTapped(true); - } - return true; - } - return false; - } -} diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfBladehold.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfBladehold.java index d523ce17a9..9f73110e26 100644 --- a/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfBladehold.java +++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/HeroOfBladehold.java @@ -29,20 +29,14 @@ package mage.sets.mirrodinbesieged; import java.util.UUID; - import mage.Constants.CardType; -import mage.Constants.Outcome; import mage.Constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; -import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.BattleCryAbility; import mage.cards.CardImpl; -import mage.game.Game; -import mage.game.permanent.Permanent; import mage.game.permanent.token.SoldierToken; -import mage.players.Player; /** * @author Loki @@ -57,8 +51,13 @@ public class HeroOfBladehold extends CardImpl { this.color.setWhite(true); this.power = new MageInt(3); this.toughness = new MageInt(4); + + // Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.) this.addAbility(new BattleCryAbility()); - this.addAbility(new AttacksTriggeredAbility(new HeroOfBladeholdEffect(), false)); + + // Whenever Hero of Bladehold attacks, put two 1/1 white Soldier creature tokens onto the battlefield tapped and attacking. + this.addAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new SoldierToken(), 2, true, true), false)); + } public HeroOfBladehold(final HeroOfBladehold card) { @@ -71,35 +70,3 @@ public class HeroOfBladehold extends CardImpl { } } - -class HeroOfBladeholdEffect extends OneShotEffect { - HeroOfBladeholdEffect() { - super(Outcome.PutCreatureInPlay); - staticText = "put two 1/1 white Soldier creature tokens onto the battlefield tapped and attacking"; - } - - HeroOfBladeholdEffect(final HeroOfBladeholdEffect effect) { - super(effect); - } - - @Override - public boolean apply(Game game, Ability source) { - SoldierToken token = new SoldierToken(); - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - for (int i = 0; i < 2; i++) { - token.putOntoBattlefield(1, game, source.getId(), source.getControllerId()); - Permanent p = game.getPermanent(token.getLastAddedToken()); - p.setTapped(true); - game.getCombat().addAttackingCreature(p.getId(), game); - } - } - return true; - } - - @Override - public HeroOfBladeholdEffect copy() { - return new HeroOfBladeholdEffect(this); - } - -} \ No newline at end of file