From db7a5b50011ada800ebe3c1ef3bd0b971570c0bd Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 11 Nov 2021 08:29:47 -0500 Subject: [PATCH] [VOW] Implemented Creepy Puppeteer --- .../src/mage/cards/c/CreepyPuppeteer.java | 95 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 96 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java diff --git a/Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java b/Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java new file mode 100644 index 0000000000..4e3abebfd7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CreepyPuppeteer.java @@ -0,0 +1,95 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CreepyPuppeteer extends CardImpl { + + public CreepyPuppeteer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Whenever Creepy Puppeteer attacks, if you attacked with exactly one other creature this combat, you may have that creature's base power and toughness become 4/3 until end of turn. + this.addAbility(new CreepyPuppeteerTriggeredAbility()); + } + + private CreepyPuppeteer(final CreepyPuppeteer card) { + super(card); + } + + @Override + public CreepyPuppeteer copy() { + return new CreepyPuppeteer(this); + } +} + +class CreepyPuppeteerTriggeredAbility extends TriggeredAbilityImpl { + + CreepyPuppeteerTriggeredAbility() { + super(Zone.BATTLEFIELD, new SetPowerToughnessTargetEffect(4, 3, Duration.EndOfTurn), true); + } + + private CreepyPuppeteerTriggeredAbility(final CreepyPuppeteerTriggeredAbility ability) { + super(ability); + } + + @Override + public CreepyPuppeteerTriggeredAbility copy() { + return new CreepyPuppeteerTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (!isControlledBy(game.getCombat().getAttackingPlayerId()) + || !game.getCombat().getAttackers().contains(getSourceId()) + || game.getCombat().getAttackers().size() != 2) { + return false; + } + UUID otherAttacker = game + .getCombat() + .getAttackers() + .stream() + .filter(uuid -> !getSourceId().equals(uuid)) + .findFirst() + .orElse(null); + if (otherAttacker == null) { + return false; + } + this.getEffects().setTargetPointer(new FixedTarget(otherAttacker, game)); + return true; + } + + @Override + public String getRule() { + return "Whenever {this} attacks, if you attacked with exactly one other creature this combat, " + + "you may have that creature's base power and toughness become 4/3 until end of turn."; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 4362ac08f5..060896a285 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -94,6 +94,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Courier Bat", 102, Rarity.COMMON, mage.cards.c.CourierBat.class)); cards.add(new SetCardInfo("Cradle of Safety", 54, Rarity.COMMON, mage.cards.c.CradleOfSafety.class)); cards.add(new SetCardInfo("Crawling Infestation", 193, Rarity.UNCOMMON, mage.cards.c.CrawlingInfestation.class)); + cards.add(new SetCardInfo("Creepy Puppeteer", 151, Rarity.RARE, mage.cards.c.CreepyPuppeteer.class)); cards.add(new SetCardInfo("Cruel Witness", 55, Rarity.COMMON, mage.cards.c.CruelWitness.class)); cards.add(new SetCardInfo("Crushing Canopy", 194, Rarity.COMMON, mage.cards.c.CrushingCanopy.class)); cards.add(new SetCardInfo("Cultivator Colossus", 195, Rarity.MYTHIC, mage.cards.c.CultivatorColossus.class));