From 81cfdcda01afdd02f8ddb7d8a07edf21767f22a8 Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Wed, 1 May 2024 22:10:16 +0200 Subject: [PATCH] implement [PIP] Vault 12, The Necropolis --- .../mage/cards/v/Vault12TheNecropolis.java | 113 ++++++++++++++++++ Mage.Sets/src/mage/sets/Fallout.java | 1 + 2 files changed, 114 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/Vault12TheNecropolis.java diff --git a/Mage.Sets/src/mage/cards/v/Vault12TheNecropolis.java b/Mage.Sets/src/mage/cards/v/Vault12TheNecropolis.java new file mode 100644 index 00000000000..37fae7b3a21 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/Vault12TheNecropolis.java @@ -0,0 +1,113 @@ +package mage.cards.v; + +import mage.abilities.Ability; +import mage.abilities.common.SagaAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.effects.common.counter.AddCountersPlayersEffect; +import mage.abilities.hint.Hint; +import mage.abilities.hint.ValueHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SagaChapter; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.game.permanent.token.ZombieMutantToken; +import mage.players.Player; + +import java.util.Objects; +import java.util.UUID; + +/** + * @author Susucr + */ +public final class Vault12TheNecropolis extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = + new FilterControlledCreaturePermanent("creature you control that's a Zombie or Mutant"); + + static { + filter.add(Predicates.or(SubType.ZOMBIE.getPredicate(), SubType.MUTANT.getPredicate())); + } + + + public Vault12TheNecropolis(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); + + this.subtype.add(SubType.SAGA); + + // (As this Saga enters and after your draw step, add a lore counter. Sacrifice after III.) + SagaAbility sagaAbility = new SagaAbility(this); + + // I -- Each player gets three rad counters. + sagaAbility.addChapterEffect(this, + SagaChapter.CHAPTER_I, + new AddCountersPlayersEffect(CounterType.RAD.createInstance(3), TargetController.EACH_PLAYER) + ); + + // II -- Create X 2/2 black Zombie Mutant creature tokens, where X is the total number of rad counters among players. + sagaAbility.addChapterEffect(this, + SagaChapter.CHAPTER_II, + new CreateTokenEffect(new ZombieMutantToken(), Vault12TheNecropolisValue.instance) + .setText("Create X 2/2 black Zombie Mutant creature tokens, " + + "where X is the total number of rad counters among players") + ); + sagaAbility.addHint(Vault12TheNecropolisValue.hint); + + // III -- Put two +1/+1 counters on each creature you control that's a Zombie or Mutant. + sagaAbility.addChapterEffect(this, + SagaChapter.CHAPTER_III, + new AddCountersAllEffect(CounterType.P1P1.createInstance(2), filter) + ); + + this.addAbility(sagaAbility); + } + + private Vault12TheNecropolis(final Vault12TheNecropolis card) { + super(card); + } + + @Override + public Vault12TheNecropolis copy() { + return new Vault12TheNecropolis(this); + } +} + +enum Vault12TheNecropolisValue implements DynamicValue { + instance; + + public static final Hint hint = new ValueHint("total Rad counters", instance); + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + Player player = game.getPlayer(sourceAbility.getControllerId()); + if (player == null) { + return 0; + } + return game + .getState() + .getPlayersInRange(sourceAbility.getControllerId(), game) + .stream() + .map(game::getPlayer) + .filter(Objects::nonNull) + .mapToInt(p -> p.getCounters().getCount(CounterType.RAD)) + .sum(); + } + + @Override + public Vault12TheNecropolisValue copy() { + return this; + } + + @Override + public String getMessage() { + return ""; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index b0ef878e8e7..34046f642b3 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -352,6 +352,7 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Valorous Stance", 174, Rarity.UNCOMMON, mage.cards.v.ValorousStance.class)); cards.add(new SetCardInfo("Vandalblast", 355, Rarity.UNCOMMON, mage.cards.v.Vandalblast.class)); cards.add(new SetCardInfo("Vault 101: Birthday Party", 28, Rarity.RARE, mage.cards.v.Vault101BirthdayParty.class)); + cards.add(new SetCardInfo("Vault 12: The Necropolis", 51, Rarity.RARE, mage.cards.v.Vault12TheNecropolis.class)); cards.add(new SetCardInfo("Vault 21: House Gambit", 69, Rarity.RARE, mage.cards.v.Vault21HouseGambit.class)); cards.add(new SetCardInfo("Vault 75: Middle School", 27, Rarity.RARE, mage.cards.v.Vault75MiddleSchool.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Vault 75: Middle School", 555, Rarity.RARE, mage.cards.v.Vault75MiddleSchool.class, NON_FULL_USE_VARIOUS));