From e33df42a88b823703bc0732842df98ea5884acde Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 8 Feb 2022 21:09:43 -0500 Subject: [PATCH] [NEC] Implemented Ascendant Acolyte --- .../src/mage/cards/a/AscendantAcolyte.java | 89 +++++++++++++++++++ .../src/mage/sets/NeonDynastyCommander.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AscendantAcolyte.java diff --git a/Mage.Sets/src/mage/cards/a/AscendantAcolyte.java b/Mage.Sets/src/mage/cards/a/AscendantAcolyte.java new file mode 100644 index 0000000000..dfeafe2aa0 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AscendantAcolyte.java @@ -0,0 +1,89 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DoubleCountersSourceEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +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.SubType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AscendantAcolyte extends CardImpl { + + public AscendantAcolyte(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{G}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.MONK); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Ascendant Acolyte enters the battlefield with a +1/+1 counter on it for each +1/+1 counter among other creatures you control. + this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect( + CounterType.P1P1.createInstance(), AscendantAcolyteValue.instance, true + ), "with a +1/+1 counter on it for each +1/+1 counter among other creatures you control").addHint(AscendantAcolyteValue.getHint())); + + // At the beginning of your upkeep, double the number of +1/+1 counters on Ascendant Acolyte. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new DoubleCountersSourceEffect(CounterType.P1P1), TargetController.YOU, false + )); + } + + private AscendantAcolyte(final AscendantAcolyte card) { + super(card); + } + + @Override + public AscendantAcolyte copy() { + return new AscendantAcolyte(this); + } +} + +enum AscendantAcolyteValue implements DynamicValue { + instance; + private static final Hint hint = new ValueHint( + "Total +1/+1 counters on other creatures you control", instance + ); + + public static Hint getHint() { + return hint; + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return game.getBattlefield() + .getActivePermanents( + StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, + sourceAbility.getControllerId(), + sourceAbility.getSourceId(), game + ).stream() + .mapToInt(permanent -> permanent.getCounters(game).getCount(CounterType.P1P1)) + .sum(); + } + + @Override + public AscendantAcolyteValue copy() { + return this; + } + + @Override + public String getMessage() { + return ""; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/NeonDynastyCommander.java b/Mage.Sets/src/mage/sets/NeonDynastyCommander.java index 1f69eedb27..594478c1e6 100644 --- a/Mage.Sets/src/mage/sets/NeonDynastyCommander.java +++ b/Mage.Sets/src/mage/sets/NeonDynastyCommander.java @@ -27,6 +27,7 @@ public final class NeonDynastyCommander extends ExpansionSet { cards.add(new SetCardInfo("Arcane Signet", 144, Rarity.COMMON, mage.cards.a.ArcaneSignet.class)); cards.add(new SetCardInfo("Arcanist's Owl", 135, Rarity.UNCOMMON, mage.cards.a.ArcanistsOwl.class)); cards.add(new SetCardInfo("Armed and Armored", 80, Rarity.UNCOMMON, mage.cards.a.ArmedAndArmored.class)); + cards.add(new SetCardInfo("Ascendant Acolyte", 24, Rarity.RARE, mage.cards.a.AscendantAcolyte.class)); cards.add(new SetCardInfo("Azorius Signet", 145, Rarity.UNCOMMON, mage.cards.a.AzoriusSignet.class)); cards.add(new SetCardInfo("Bear Umbra", 113, Rarity.RARE, mage.cards.b.BearUmbra.class)); cards.add(new SetCardInfo("Beast Within", 114, Rarity.UNCOMMON, mage.cards.b.BeastWithin.class));