From 8142c4b2ecf8751de23ceb7596e0015d0463328b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 18 Oct 2022 19:07:34 -0400 Subject: [PATCH] [UNF] Implemented Clowning Around --- .../src/mage/cards/c/ClowningAround.java | 73 +++++++++++++++++++ Mage.Sets/src/mage/sets/Unfinity.java | 1 + 2 files changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/ClowningAround.java diff --git a/Mage.Sets/src/mage/cards/c/ClowningAround.java b/Mage.Sets/src/mage/cards/c/ClowningAround.java new file mode 100644 index 00000000000..dbe1cd8d576 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/ClowningAround.java @@ -0,0 +1,73 @@ +package mage.cards.c; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.Game; +import mage.game.permanent.token.ClownRobotToken; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ClowningAround extends CardImpl { + + public ClowningAround(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{W}"); + + // Create two 1/1 white Clown Robot artifact creature tokens, then roll a six-sided die. If the result is equal to or less than the number of Robots you control, create a 1/1 white Clown Robot artifact creature token. + this.getSpellAbility().addEffect(new CreateTokenEffect(new ClownRobotToken(), 2)); + this.getSpellAbility().addEffect(new ClowningAroundEffect()); + } + + private ClowningAround(final ClowningAround card) { + super(card); + } + + @Override + public ClowningAround copy() { + return new ClowningAround(this); + } +} + +class ClowningAroundEffect extends OneShotEffect { + + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.ROBOT); + + ClowningAroundEffect() { + super(Outcome.Benefit); + staticText = ", then roll a six-sided die. If the result is equal to or less " + + "than the number of Robots you control, create a 1/1 white Clown Robot artifact creature token"; + } + + private ClowningAroundEffect(final ClowningAroundEffect effect) { + super(effect); + } + + @Override + public ClowningAroundEffect copy() { + return new ClowningAroundEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + int roll = player.rollDice(outcome, source, game, 6); + if (roll <= game.getBattlefield().count(filter, source.getControllerId(), source, game)) { + new ClownRobotToken().putOntoBattlefield(1, game, source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/Unfinity.java b/Mage.Sets/src/mage/sets/Unfinity.java index fff6af331c0..0952403beff 100644 --- a/Mage.Sets/src/mage/sets/Unfinity.java +++ b/Mage.Sets/src/mage/sets/Unfinity.java @@ -26,6 +26,7 @@ public final class Unfinity extends ExpansionSet { cards.add(new SetCardInfo("Breeding Pool", 286, Rarity.RARE, mage.cards.b.BreedingPool.class)); cards.add(new SetCardInfo("Circuits Act", 103, Rarity.COMMON, mage.cards.c.CircuitsAct.class)); cards.add(new SetCardInfo("Clown Car", 186, Rarity.RARE, mage.cards.c.ClownCar.class)); + cards.add(new SetCardInfo("Clowning Around", 6, Rarity.COMMON, mage.cards.c.ClowningAround.class)); cards.add(new SetCardInfo("Dissatisfied Customer", 72, Rarity.COMMON, mage.cards.d.DissatisfiedCustomer.class)); cards.add(new SetCardInfo("Embiggen", 137, Rarity.COMMON, mage.cards.e.Embiggen.class)); cards.add(new SetCardInfo("Forest", 239, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS));