From 47cd85b436174b2144c1a076f65001abcc08468b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 31 Mar 2019 16:48:23 -0400 Subject: [PATCH] Implemented Arlinn, Voice of the Pack --- .../mage/cards/a/ArlinnVoiceOfThePack.java | 89 +++++++++++++++++++ Mage.Sets/src/mage/sets/WarOfTheSpark.java | 1 + 2 files changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java diff --git a/Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java b/Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java new file mode 100644 index 0000000000..df2157c094 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArlinnVoiceOfThePack.java @@ -0,0 +1,89 @@ +package mage.cards.a; + +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.WolfToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ArlinnVoiceOfThePack extends CardImpl { + + public ArlinnVoiceOfThePack(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{G}{G}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.ARLINN); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(7)); + + // Each creature you control that's a Wolf or Werewolf enters the battlefield with an additional +1/+1 counter on it. + this.addAbility(new SimpleStaticAbility(new ArlinnVoiceOfThePackReplacementEffect())); + + // -2: Create a 2/2 green Wolf creature token. + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new WolfToken()), -2)); + } + + private ArlinnVoiceOfThePack(final ArlinnVoiceOfThePack card) { + super(card); + } + + @Override + public ArlinnVoiceOfThePack copy() { + return new ArlinnVoiceOfThePack(this); + } +} + +class ArlinnVoiceOfThePackReplacementEffect extends ReplacementEffectImpl { + + ArlinnVoiceOfThePackReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + staticText = "Each creature you control that's a Wolf or Werewolf " + + "enters the battlefield with an additional +1/+1 counter on it"; + } + + private ArlinnVoiceOfThePackReplacementEffect(final ArlinnVoiceOfThePackReplacementEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + return creature != null && creature.isControlledBy(source.getControllerId()) + && creature.isCreature() + && (creature.hasSubtype(SubType.WOLF, game) + || creature.hasSubtype(SubType.WEREWOLF, game)); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); + if (creature != null) { + creature.addCounters(CounterType.P1P1.createInstance(), source, game, event.getAppliedEffects()); + } + return false; + } + + @Override + public ArlinnVoiceOfThePackReplacementEffect copy() { + return new ArlinnVoiceOfThePackReplacementEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/WarOfTheSpark.java b/Mage.Sets/src/mage/sets/WarOfTheSpark.java index f41a7a0342..4316db0a79 100644 --- a/Mage.Sets/src/mage/sets/WarOfTheSpark.java +++ b/Mage.Sets/src/mage/sets/WarOfTheSpark.java @@ -26,6 +26,7 @@ public final class WarOfTheSpark extends ExpansionSet { cards.add(new SetCardInfo("Ajani's Pridemate", 4, Rarity.UNCOMMON, mage.cards.a.AjanisPridemate.class)); cards.add(new SetCardInfo("Ajani, the Greathearted", 184, Rarity.RARE, mage.cards.a.AjaniTheGreathearted.class)); cards.add(new SetCardInfo("Arlinn's Wolf", 151, Rarity.COMMON, mage.cards.a.ArlinnsWolf.class)); + cards.add(new SetCardInfo("Arlinn, Voice of the Pack", 150, Rarity.UNCOMMON, mage.cards.a.ArlinnVoiceOfThePack.class)); cards.add(new SetCardInfo("Dreadhorde Invasion", 86, Rarity.RARE, mage.cards.d.DreadhordeInvasion.class)); cards.add(new SetCardInfo("Flux Channeler", 52, Rarity.UNCOMMON, mage.cards.f.FluxChanneler.class)); cards.add(new SetCardInfo("Forest", 262, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));