From 4eba575ce375487daffd94a480894311d66ba609 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 1 Sep 2024 10:17:59 -0400 Subject: [PATCH] [DSK] Implement Winter, Misanthropic Guide --- .../mage/cards/w/WinterMisanthropicGuide.java | 91 +++++++++++++++++++ .../src/mage/sets/DuskmournHouseOfHorror.java | 1 + 2 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/w/WinterMisanthropicGuide.java diff --git a/Mage.Sets/src/mage/cards/w/WinterMisanthropicGuide.java b/Mage.Sets/src/mage/cards/w/WinterMisanthropicGuide.java new file mode 100644 index 00000000000..f6df98bcf64 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WinterMisanthropicGuide.java @@ -0,0 +1,91 @@ +package mage.cards.w; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.effects.common.DrawCardAllEffect; +import mage.abilities.hint.common.CardTypesInGraveyardHint; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WinterMisanthropicGuide extends CardImpl { + + public WinterMisanthropicGuide(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}{G}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WARLOCK); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // Ward {2} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{2}"))); + + // At the beginning of your upkeep, each player draws two cards. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new DrawCardAllEffect(2), TargetController.YOU, false + )); + + // Delirium -- As long as there are four or more card types among cards in your graveyard, each opponent's maximum hand size is equal to seven minus the number of those card types. + this.addAbility(new SimpleStaticAbility(new WinterMisanthropicGuideEffect()) + .setAbilityWord(AbilityWord.DELIRIUM) + .addHint(CardTypesInGraveyardHint.YOU)); + } + + private WinterMisanthropicGuide(final WinterMisanthropicGuide card) { + super(card); + } + + @Override + public WinterMisanthropicGuide copy() { + return new WinterMisanthropicGuide(this); + } +} + +class WinterMisanthropicGuideEffect extends ContinuousEffectImpl { + + WinterMisanthropicGuideEffect() { + super(Duration.WhileOnBattlefield, Layer.PlayerEffects, SubLayer.NA, Outcome.Neutral); + staticText = "as long as there are four or more card types among cards in your graveyard, " + + "each opponent's maximum hand size is equal to seven minus the number of those card types"; + } + + private WinterMisanthropicGuideEffect(final WinterMisanthropicGuideEffect effect) { + super(effect); + } + + @Override + public WinterMisanthropicGuideEffect copy() { + return new WinterMisanthropicGuideEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int count = CardTypesInGraveyardCount.YOU.calculate(game, source, this); + if (count < 4) { + return false; + } + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + Player player = game.getPlayer(opponentId); + if (player == null) { + continue; + } + player.setMaxHandSize(Math.max(7 - count, 0)); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java index 0cd15a068f5..61c515429a5 100644 --- a/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java +++ b/Mage.Sets/src/mage/sets/DuskmournHouseOfHorror.java @@ -39,6 +39,7 @@ public final class DuskmournHouseOfHorror extends ExpansionSet { cards.add(new SetCardInfo("Swamp", 274, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("The Wandering Rescuer", 41, Rarity.MYTHIC, mage.cards.t.TheWanderingRescuer.class)); cards.add(new SetCardInfo("Toby, Beastie Befriender", 35, Rarity.RARE, mage.cards.t.TobyBeastieBefriender.class)); + cards.add(new SetCardInfo("Winter, Misanthropic Guide", 240, Rarity.RARE, mage.cards.w.WinterMisanthropicGuide.class)); cards.add(new SetCardInfo("Zimone, All-Questioning", 241, Rarity.RARE, mage.cards.z.ZimoneAllQuestioning.class)); } }