From 36bca500b865f2d66221c80b9e9d5dd582e4bb5e Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 4 Sep 2024 10:56:39 -0400 Subject: [PATCH] [DSK] Implement Patchwork Beastie --- .../src/mage/cards/p/PatchworkBeastie.java | 83 +++++++++++++++++++ .../src/mage/sets/DuskmournHouseOfHorror.java | 1 + 2 files changed, 84 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PatchworkBeastie.java diff --git a/Mage.Sets/src/mage/cards/p/PatchworkBeastie.java b/Mage.Sets/src/mage/cards/p/PatchworkBeastie.java new file mode 100644 index 00000000000..7500ab5a1f8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PatchworkBeastie.java @@ -0,0 +1,83 @@ +package mage.cards.p; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.DeliriumCondition; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.MillCardsControllerEffect; +import mage.abilities.hint.common.CardTypesInGraveyardHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class PatchworkBeastie extends CardImpl { + + public PatchworkBeastie(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{G}"); + + this.subtype.add(SubType.BEAST); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Delirium -- Patchwork Beastie can't attack or block unless there are four or more card types among cards in your graveyard. + this.addAbility(new SimpleStaticAbility(new PatchworkBeastieEffect()) + .setAbilityWord(AbilityWord.DELIRIUM) + .addHint(CardTypesInGraveyardHint.YOU)); + + // At the beginning of your upkeep, you may mill a card. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new MillCardsControllerEffect(1), TargetController.YOU, true + )); + } + + private PatchworkBeastie(final PatchworkBeastie card) { + super(card); + } + + @Override + public PatchworkBeastie copy() { + return new PatchworkBeastie(this); + } +} + +class PatchworkBeastieEffect extends RestrictionEffect { + + PatchworkBeastieEffect() { + super(Duration.WhileOnBattlefield); + staticText = "{this} can't attack or block unless there are four or more card types among cards in your graveyard"; + } + + private PatchworkBeastieEffect(final PatchworkBeastieEffect effect) { + super(effect); + } + + @Override + public PatchworkBeastieEffect copy() { + return new PatchworkBeastieEffect(this); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.getId().equals(source.getSourceId()) + && !DeliriumCondition.instance.apply(game, source); + } + + @Override + public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) { + return false; + } + + @Override + public boolean canAttack(Game game, boolean canUseChooseDialogs) { + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index b43847793e3..39efc6dbc11 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -52,6 +52,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet { cards.add(new SetCardInfo("Murky Sewer", 263, Rarity.COMMON, mage.cards.m.MurkySewer.class)); cards.add(new SetCardInfo("Neglected Manor", 264, Rarity.COMMON, mage.cards.n.NeglectedManor.class)); cards.add(new SetCardInfo("Patched Plaything", 24, Rarity.UNCOMMON, mage.cards.p.PatchedPlaything.class)); + cards.add(new SetCardInfo("Patchwork Beastie", 195, Rarity.UNCOMMON, mage.cards.p.PatchworkBeastie.class)); cards.add(new SetCardInfo("Peculiar Lighthouse", 265, Rarity.COMMON, mage.cards.p.PeculiarLighthouse.class)); cards.add(new SetCardInfo("Peer Past the Veil", 226, Rarity.RARE, mage.cards.p.PeerPastTheVeil.class)); cards.add(new SetCardInfo("Piranha Fly", 70, Rarity.COMMON, mage.cards.p.PiranhaFly.class));