From 2c9716c79f11966f492aa5a84d2334d4770254d2 Mon Sep 17 00:00:00 2001 From: Grath <1895280+Grath@users.noreply.github.com> Date: Thu, 22 Aug 2024 21:33:01 -0400 Subject: [PATCH] [BLC] Implement Tempt with Bunnies (#12702) Also revise Tempt with Vengeance to use a separate CreateTokenEffect for each opponent, per the ruling. --- .../src/mage/cards/t/TemptWithBunnies.java | 93 +++++++++++++++++++ .../src/mage/cards/t/TemptWithVengeance.java | 11 ++- .../src/mage/sets/BloomburrowCommander.java | 1 + 3 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/t/TemptWithBunnies.java diff --git a/Mage.Sets/src/mage/cards/t/TemptWithBunnies.java b/Mage.Sets/src/mage/cards/t/TemptWithBunnies.java new file mode 100644 index 00000000000..85af3ec04c5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TemptWithBunnies.java @@ -0,0 +1,93 @@ +package mage.cards.t; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.token.RabbitToken; +import mage.game.permanent.token.Token; +import mage.players.Player; + +/** + * + * @author Grath + */ +public final class TemptWithBunnies extends CardImpl { + + public TemptWithBunnies(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{W}"); + + // Tempting offer -- Draw a card and create a 1/1 white Rabbit creature token. Then each opponent may draw a + // card and create a 1/1 white Rabbit creature token. For each opponent who does, you draw a card and you + // create a 1/1 white Rabbit creature token. + this.getSpellAbility().addEffect(new TemptWithBunniesEffect()); + } + + private TemptWithBunnies(final TemptWithBunnies card) { + super(card); + } + + @Override + public TemptWithBunnies copy() { + return new TemptWithBunnies(this); + } +} + +class TemptWithBunniesEffect extends OneShotEffect { + + TemptWithBunniesEffect() { + super(Outcome.PutLandInPlay); + this.staticText = "Tempting offer — Draw a card and create a 1/1 white Rabbit creature token. Then each opponent may draw a card and create a 1/1 white Rabbit creature token. For each opponent who does, you draw a card and you create a 1/1 white Rabbit creature token."; + } + + private TemptWithBunniesEffect(final TemptWithBunniesEffect effect) { + super(effect); + } + + @Override + public TemptWithBunniesEffect copy() { + return new TemptWithBunniesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + + controller.drawCards(1, source, game); + Token tokenCopy = new RabbitToken(); + tokenCopy.putOntoBattlefield(1, game, source, source.getControllerId(), false, false); + + int opponentsAddedTokens = 0; + for (UUID playerId : game.getOpponents(controller.getId())) { + Player opponent = game.getPlayer(playerId); + if (opponent != null) { + if (opponent.chooseUse(outcome, "Draw a card and create a Rabbit token?", source, game)) { + opponent.drawCards(1, source, game); + opponentsAddedTokens++; + tokenCopy.putOntoBattlefield(1, game, source, playerId, false, false); + } + } + } + if (opponentsAddedTokens > 0) { + // Each batch of tokens is independent, per ruling: + // After each opponent has decided, the effect happens simultaneously for each one who accepted the + // offer. Then, the effect happens again for you a number of times equal to the number of opponents who + // accepted. + // (2024-07-26) + for (int i = 0; i < opponentsAddedTokens; i++) { + controller.drawCards(1, source, game); + tokenCopy.putOntoBattlefield(opponentsAddedTokens, game, source, source.getControllerId(), false, false); + } + } + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/t/TemptWithVengeance.java b/Mage.Sets/src/mage/cards/t/TemptWithVengeance.java index dcf5c20014c..552a9b634dd 100644 --- a/Mage.Sets/src/mage/cards/t/TemptWithVengeance.java +++ b/Mage.Sets/src/mage/cards/t/TemptWithVengeance.java @@ -68,13 +68,20 @@ class TemptWithVengeanceEffect extends OneShotEffect { Player opponent = game.getPlayer(playerId); if (opponent != null) { if (opponent.chooseUse(outcome, "Create " + xValue + " Elemental tokens?", source, game)) { - opponentsAddedTokens += xValue; + opponentsAddedTokens++; tokenCopy.putOntoBattlefield(xValue, game, source, playerId, false, false); } } } if (opponentsAddedTokens > 0) { - tokenCopy.putOntoBattlefield(opponentsAddedTokens, game, source, source.getControllerId(), false, false); + // Each batch of tokens is independent, per ruling: + // After each opponent has decided, the effect happens simultaneously for each one who accepted the + // offer. Then, the effect happens again for you a number of times equal to the number of opponents who + // accepted. + // (2013-10-17) + for (int i = 0; i < opponentsAddedTokens; i++) { + tokenCopy.putOntoBattlefield(opponentsAddedTokens, game, source, source.getControllerId(), false, false); + } } return true; } diff --git a/Mage.Sets/src/mage/sets/BloomburrowCommander.java b/Mage.Sets/src/mage/sets/BloomburrowCommander.java index 3449a645e2b..4db6aa31a6e 100644 --- a/Mage.Sets/src/mage/sets/BloomburrowCommander.java +++ b/Mage.Sets/src/mage/sets/BloomburrowCommander.java @@ -285,6 +285,7 @@ public final class BloomburrowCommander extends ExpansionSet { cards.add(new SetCardInfo("Temple of Mystery", 342, Rarity.RARE, mage.cards.t.TempleOfMystery.class)); cards.add(new SetCardInfo("Temple of Plenty", 343, Rarity.RARE, mage.cards.t.TempleOfPlenty.class)); cards.add(new SetCardInfo("Temple of Triumph", 344, Rarity.RARE, mage.cards.t.TempleOfTriumph.class)); + cards.add(new SetCardInfo("Tempt with Bunnies", 13, Rarity.RARE, mage.cards.t.TemptWithBunnies.class)); cards.add(new SetCardInfo("Tempt with Discovery", 124, Rarity.RARE, mage.cards.t.TemptWithDiscovery.class)); cards.add(new SetCardInfo("Tendershoot Dryad", 242, Rarity.RARE, mage.cards.t.TendershootDryad.class)); cards.add(new SetCardInfo("Tenuous Truce", 159, Rarity.RARE, mage.cards.t.TenuousTruce.class));