From 400c5c810f3dc4d36f13c7e143fb40a201a74cb7 Mon Sep 17 00:00:00 2001 From: Thomas Winwood Date: Sat, 13 Apr 2019 13:08:48 +0100 Subject: [PATCH] Implement Rod of Spanking --- Mage.Sets/src/mage/cards/r/RodOfSpanking.java | 80 +++++++++++++++++++ Mage.Sets/src/mage/sets/Unhinged.java | 1 + 2 files changed, 81 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RodOfSpanking.java diff --git a/Mage.Sets/src/mage/cards/r/RodOfSpanking.java b/Mage.Sets/src/mage/cards/r/RodOfSpanking.java new file mode 100644 index 0000000000..34c2506033 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RodOfSpanking.java @@ -0,0 +1,80 @@ + +package mage.cards.r; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.UntapSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author North + */ +public final class RodOfSpanking extends CardImpl { + + public RodOfSpanking(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[] { CardType.ARTIFACT }, "{1}"); + + // 2, T: Rod of Spanking deals 1 damage to target player. Then untap Rod of + // Spanking unless that player says "Thank you, sir. May I have another?" + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RodOfSpankingEffect(), new GenericManaCost(2)); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public RodOfSpanking(final RodOfSpanking card) { + super(card); + } + + @Override + public RodOfSpanking copy() { + return new RodOfSpanking(this); + } +} + +class RodOfSpankingEffect extends OneShotEffect { + + public RodOfSpankingEffect() { + super(Outcome.Benefit); + staticText = "{this} deals 1 damage to target player. Then untap {this} unless that player says \"Thank you, sir. May I have another?\""; + } + + public RodOfSpankingEffect(final RodOfSpankingEffect effect) { + super(effect); + } + + @Override + public RodOfSpankingEffect copy() { + return new RodOfSpankingEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player target = game.getPlayer(source.getFirstTarget()); + new DamageTargetEffect(1).apply(game, source); + if (target != null) { + if (target.chooseUse(Outcome.Untap, "Say \"Thank you, sir. May I have another?\"", source, game)) { + game.informPlayers(target.getLogName() + ": Thank you, sir. May I have another?"); + } else { + new UntapSourceEffect().apply(game, source); + } + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/Unhinged.java b/Mage.Sets/src/mage/sets/Unhinged.java index aadbc3577d..8e3e0bdeb5 100644 --- a/Mage.Sets/src/mage/sets/Unhinged.java +++ b/Mage.Sets/src/mage/sets/Unhinged.java @@ -43,6 +43,7 @@ public final class Unhinged extends ExpansionSet { cards.add(new SetCardInfo("Old Fogey", 106, Rarity.RARE, mage.cards.o.OldFogey.class)); cards.add(new SetCardInfo("Plains", 136, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Rare-B-Gone", 119, Rarity.RARE, mage.cards.r.RareBGone.class)); + cards.add(new SetCardInfo("Rod of Spanking", 127, Rarity.UNCOMMON, mage.cards.r.RodOfSpanking.class)); cards.add(new SetCardInfo("Six-y Beast", 89, Rarity.UNCOMMON, mage.cards.s.SixyBeast.class)); cards.add(new SetCardInfo("Swamp", 138, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Symbol Status", 114, Rarity.UNCOMMON, mage.cards.s.SymbolStatus.class));