From a7cbd54f6e079539e8ec53f7e65dbe0221233fb6 Mon Sep 17 00:00:00 2001 From: Noah Gleason Date: Sat, 30 Jun 2018 16:13:15 -0400 Subject: [PATCH] Fix Booby Trap --- Mage.Sets/src/mage/cards/b/BoobyTrap.java | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BoobyTrap.java b/Mage.Sets/src/mage/cards/b/BoobyTrap.java index b14cc765dc..ed7c8d844b 100644 --- a/Mage.Sets/src/mage/cards/b/BoobyTrap.java +++ b/Mage.Sets/src/mage/cards/b/BoobyTrap.java @@ -1,15 +1,12 @@ package mage.cards.b; -import java.util.UUID; - -import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.AsEntersBattlefieldAbility; -import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; -import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.costs.common.SacrificeSourceCost; -import mage.abilities.effects.Effect; -import mage.abilities.effects.common.*; +import mage.abilities.effects.common.ChooseACardNameEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DoIfCostPaid; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -20,20 +17,17 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.players.Player; -import mage.target.Target; -import mage.target.TargetImpl; -import mage.target.common.TargetOpponent; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** - * * @author noahg */ public final class BoobyTrap extends CardImpl { public BoobyTrap(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}"); - // As Booby Trap enters the battlefield, name a card other than a basic land card and choose an opponent. AsEntersBattlefieldAbility etbAbility = new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NOT_BASIC_LAND_NAME)); @@ -58,7 +52,7 @@ public final class BoobyTrap extends CardImpl { class BoobyTrapTriggeredAbility extends TriggeredAbilityImpl { public BoobyTrapTriggeredAbility() { - super(Zone.BATTLEFIELD, new DoIfCostPaid(new DamageTargetEffect(10), new SacrificeSourceCost()), false); + super(Zone.BATTLEFIELD, new DoIfCostPaid(new DamageTargetEffect(10, true, "that player"), new SacrificeSourceCost(), "", false), false); } public BoobyTrapTriggeredAbility(BoobyTrapTriggeredAbility ability) { @@ -72,15 +66,15 @@ class BoobyTrapTriggeredAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { - Player controller = game.getPlayer(sourceId); - if (event.getPlayerId() == null || game.getState() == null || controller == null){ + Player controller = game.getPlayer(getControllerId()); + if (event.getPlayerId() == null || game.getState() == null || controller == null) { return false; } - if (event.getPlayerId().equals(game.getState().getValue(getSourceId()+ChooseOpponentEffect.VALUE_KEY))){ + if (event.getPlayerId().equals(game.getState().getValue(getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY))) { Card drawn = game.getCard(event.getTargetId()); - if (drawn != null){ + if (drawn != null) { controller.revealCards(this, new CardsImpl(drawn), game); - if(drawn.getName().equals(game.getState().getValue(getSourceId() + ChooseACardNameEffect.INFO_KEY))){ + if (drawn.getName().equals(game.getState().getValue(getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { //Set target this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); return true; @@ -94,4 +88,10 @@ class BoobyTrapTriggeredAbility extends TriggeredAbilityImpl { public BoobyTrapTriggeredAbility copy() { return new BoobyTrapTriggeredAbility(this); } + + @Override + public String getRule() { + return "The chosen player reveals each card he or she draws.\n" + + "When the chosen player draws the named card, sacrifice {this}. If you do, {this} deals 10 damage to that player."; + } } \ No newline at end of file