From 8267d7d7704fd0878861e0070b10422b4f1f0072 Mon Sep 17 00:00:00 2001 From: 4825764518 <100122841+4825764518@users.noreply.github.com> Date: Thu, 13 Mar 2025 01:01:25 -0400 Subject: [PATCH] [DRC] Implement Priest of the Crossing (#13394) * Implement Priest of the Crossing * Add common dynamic value for "creatures that died under your control this turn" --- Mage.Sets/src/mage/cards/b/BodyCount.java | 38 ++-------------- .../src/mage/cards/c/CallousSellSword.java | 34 ++------------ .../src/mage/cards/p/PriestOfTheCrossing.java | 45 +++++++++++++++++++ Mage.Sets/src/mage/cards/s/SeasonOfLoss.java | 36 ++------------- .../src/mage/sets/AetherdriftCommander.java | 2 + .../common/CreaturesYouControlDiedCount.java | 33 ++++++++++++++ 6 files changed, 90 insertions(+), 98 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/p/PriestOfTheCrossing.java create mode 100644 Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesYouControlDiedCount.java diff --git a/Mage.Sets/src/mage/cards/b/BodyCount.java b/Mage.Sets/src/mage/cards/b/BodyCount.java index 604c95394aa..cafd38ccaab 100644 --- a/Mage.Sets/src/mage/cards/b/BodyCount.java +++ b/Mage.Sets/src/mage/cards/b/BodyCount.java @@ -1,9 +1,7 @@ package mage.cards.b; -import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.effects.Effect; +import mage.abilities.dynamicvalue.common.CreaturesYouControlDiedCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.ValueHint; @@ -11,8 +9,6 @@ import mage.abilities.keyword.SpectacleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.game.Game; -import mage.watchers.common.CreaturesDiedWatcher; import java.util.UUID; @@ -22,14 +18,14 @@ import java.util.UUID; public final class BodyCount extends CardImpl { private static final Hint hint = new ValueHint( - "Creatures that died under your control this turn", BodyCountValue.instance + "Creatures that died under your control this turn", CreaturesYouControlDiedCount.instance ); public BodyCount(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}"); // Draw a card for each creature that died under your control this turn. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(BodyCountValue.instance)); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(CreaturesYouControlDiedCount.instance)); this.getSpellAbility().addHint(hint); // Spectacle {B} @@ -44,30 +40,4 @@ public final class BodyCount extends CardImpl { public BodyCount copy() { return new BodyCount(this); } -} - -enum BodyCountValue implements DynamicValue { - instance; - - @Override - public int calculate(Game game, Ability sourceAbility, Effect effect) { - return game.getState() - .getWatcher(CreaturesDiedWatcher.class) - .getAmountOfCreaturesDiedThisTurnByController(sourceAbility.getControllerId()); - } - - @Override - public BodyCountValue copy() { - return this; - } - - @Override - public String getMessage() { - return "creature that died under your control this turn"; - } - - @Override - public String toString() { - return "1"; - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/c/CallousSellSword.java b/Mage.Sets/src/mage/cards/c/CallousSellSword.java index ced7dc1aa8e..a727344100e 100644 --- a/Mage.Sets/src/mage/cards/c/CallousSellSword.java +++ b/Mage.Sets/src/mage/cards/c/CallousSellSword.java @@ -3,8 +3,7 @@ package mage.cards.c; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldAbility; -import mage.abilities.dynamicvalue.DynamicValue; -import mage.abilities.effects.Effect; +import mage.abilities.dynamicvalue.common.CreaturesYouControlDiedCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageWithPowerFromOneToAnotherTargetEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -21,7 +20,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.common.TargetAnyTarget; import mage.target.common.TargetControlledCreaturePermanent; -import mage.watchers.common.CreaturesDiedWatcher; import java.util.UUID; @@ -33,7 +31,7 @@ public final class CallousSellSword extends AdventureCard { private static final FilterAnyTarget filterSecondTarget = new FilterAnyTarget("any other target"); private static final Hint hint = new ValueHint( - "Creatures that died under your control this turn", CallousSellSwordValue.instance + "Creatures that died under your control this turn", CreaturesYouControlDiedCount.instance ); public CallousSellSword(UUID ownerId, CardSetInfo setInfo) { @@ -48,7 +46,7 @@ public final class CallousSellSword extends AdventureCard { this.addAbility(new EntersBattlefieldAbility( new AddCountersSourceEffect( CounterType.P1P1.createInstance(0), - CallousSellSwordValue.instance, true + CreaturesYouControlDiedCount.instance, true ).setText("with a +1/+1 counter on it for each creature that died under your control this turn.") ).addHint(hint)); @@ -72,32 +70,6 @@ public final class CallousSellSword extends AdventureCard { } } -enum CallousSellSwordValue implements DynamicValue { - instance; - - @Override - public int calculate(Game game, Ability sourceAbility, Effect effect) { - return game.getState() - .getWatcher(CreaturesDiedWatcher.class) - .getAmountOfCreaturesDiedThisTurnByController(sourceAbility.getControllerId()); - } - - @Override - public CallousSellSwordValue copy() { - return this; - } - - @Override - public String getMessage() { - return "creature that died under your control this turn"; - } - - @Override - public String toString() { - return "1"; - } -} - class CallousSellSwordSacrificeFirstTargetEffect extends OneShotEffect { CallousSellSwordSacrificeFirstTargetEffect() { diff --git a/Mage.Sets/src/mage/cards/p/PriestOfTheCrossing.java b/Mage.Sets/src/mage/cards/p/PriestOfTheCrossing.java new file mode 100644 index 00000000000..f35d63dfdad --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PriestOfTheCrossing.java @@ -0,0 +1,45 @@ +package mage.cards.p; + +import mage.MageInt; +import mage.abilities.dynamicvalue.common.CreaturesYouControlDiedCount; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.triggers.BeginningOfEndStepTriggeredAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.filter.StaticFilters; + +import java.util.UUID; + +public class PriestOfTheCrossing extends CardImpl { + public PriestOfTheCrossing(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); + + this.addSubType(SubType.ZOMBIE); + this.addSubType(SubType.BIRD); + this.addSubType(SubType.CLERIC); + + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // At the beginning of each end step, put X +1/+1 counters on each creature you control, where X is the number of creatures that died under your control this turn. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + new AddCountersAllEffect(CounterType.P1P1.createInstance(), CreaturesYouControlDiedCount.instance, StaticFilters.FILTER_CONTROLLED_CREATURE) + .setText("put X +1/+1 counters on each creature you control, where X is the number of creatures that died under your control this turn"))); + } + + public PriestOfTheCrossing(PriestOfTheCrossing card) { + super(card); + } + + @Override + public PriestOfTheCrossing copy() { + return new PriestOfTheCrossing(this); + } +} diff --git a/Mage.Sets/src/mage/cards/s/SeasonOfLoss.java b/Mage.Sets/src/mage/cards/s/SeasonOfLoss.java index edb864fad0b..552af8c9acc 100644 --- a/Mage.Sets/src/mage/cards/s/SeasonOfLoss.java +++ b/Mage.Sets/src/mage/cards/s/SeasonOfLoss.java @@ -1,10 +1,9 @@ package mage.cards.s; -import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount; -import mage.abilities.effects.Effect; +import mage.abilities.dynamicvalue.common.CreaturesYouControlDiedCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.LoseLifeOpponentsEffect; import mage.abilities.effects.common.SacrificeAllEffect; @@ -13,8 +12,6 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.StaticFilters; -import mage.game.Game; -import mage.watchers.common.CreaturesDiedWatcher; import java.util.UUID; @@ -37,7 +34,7 @@ public final class SeasonOfLoss extends CardImpl { this.getSpellAbility().getModes().getMode().withPawPrintValue(1); // {P}{P} -- Draw a card for each creature you controlled that died this turn. - Mode mode2 = new Mode(new DrawCardSourceControllerEffect(SeasonOfLossValue.instance)); + Mode mode2 = new Mode(new DrawCardSourceControllerEffect(CreaturesYouControlDiedCount.instance)); this.getSpellAbility().addMode(mode2.withPawPrintValue(2)); // {P}{P}{P} -- Each opponent loses X life, where X is the number of creature cards in your graveyard. @@ -56,31 +53,4 @@ public final class SeasonOfLoss extends CardImpl { public SeasonOfLoss copy() { return new SeasonOfLoss(this); } -} - -// Based on CallousSellSwordValue -enum SeasonOfLossValue implements DynamicValue { - instance; - - @Override - public int calculate(Game game, Ability sourceAbility, Effect effect) { - return game.getState() - .getWatcher(CreaturesDiedWatcher.class) - .getAmountOfCreaturesDiedThisTurnByController(sourceAbility.getControllerId()); - } - - @Override - public SeasonOfLossValue copy() { - return this; - } - - @Override - public String getMessage() { - return "creature that died under your control this turn"; - } - - @Override - public String toString() { - return "1"; - } -} +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/AetherdriftCommander.java b/Mage.Sets/src/mage/sets/AetherdriftCommander.java index e7c4cd86c29..10328d49a35 100644 --- a/Mage.Sets/src/mage/sets/AetherdriftCommander.java +++ b/Mage.Sets/src/mage/sets/AetherdriftCommander.java @@ -125,6 +125,8 @@ public final class AetherdriftCommander extends ExpansionSet { cards.add(new SetCardInfo("Pia and Kiran Nalaar", 105, Rarity.RARE, mage.cards.p.PiaAndKiranNalaar.class)); cards.add(new SetCardInfo("Plague Belcher", 97, Rarity.RARE, mage.cards.p.PlagueBelcher.class)); cards.add(new SetCardInfo("Prairie Stream", 167, Rarity.RARE, mage.cards.p.PrairieStream.class)); + cards.add(new SetCardInfo("Priest of the Crossing", 6, Rarity.RARE, mage.cards.p.PriestOfTheCrossing.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Priest of the Crossing", 22, Rarity.RARE, mage.cards.p.PriestOfTheCrossing.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Prophet of the Scarab", 9, Rarity.RARE, mage.cards.p.ProphetOfTheScarab.class)); cards.add(new SetCardInfo("Pull from Tomorrow", 81, Rarity.RARE, mage.cards.p.PullFromTomorrow.class)); cards.add(new SetCardInfo("Reality Shift", 39, Rarity.UNCOMMON, mage.cards.r.RealityShift.class)); diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesYouControlDiedCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesYouControlDiedCount.java new file mode 100644 index 00000000000..8b17ff9e9ac --- /dev/null +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/CreaturesYouControlDiedCount.java @@ -0,0 +1,33 @@ +package mage.abilities.dynamicvalue.common; + +import mage.abilities.Ability; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.game.Game; +import mage.watchers.common.CreaturesDiedWatcher; + +public enum CreaturesYouControlDiedCount implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return game.getState() + .getWatcher(CreaturesDiedWatcher.class) + .getAmountOfCreaturesDiedThisTurnByController(sourceAbility.getControllerId()); + } + + @Override + public CreaturesYouControlDiedCount copy() { + return this; + } + + @Override + public String getMessage() { + return "creature that died under your control this turn"; + } + + @Override + public String toString() { + return "1"; + } +}