From 249b7528ff7c73ec2ccbf467aa53f6aad3f9be4a Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 16 Apr 2019 08:26:00 -0400 Subject: [PATCH] Implemented Jace, Arcane Strategist --- .../mage/cards/j/JaceArcaneStrategist.java | 108 ++++++++++++++++++ Mage.Sets/src/mage/sets/WarOfTheSpark.java | 1 + 2 files changed, 109 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/j/JaceArcaneStrategist.java diff --git a/Mage.Sets/src/mage/cards/j/JaceArcaneStrategist.java b/Mage.Sets/src/mage/cards/j/JaceArcaneStrategist.java new file mode 100644 index 0000000000..bbaeeef62d --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JaceArcaneStrategist.java @@ -0,0 +1,108 @@ +package mage.cards.j; + +import mage.abilities.LoyaltyAbility; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.combat.CantBeBlockedAllEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class JaceArcaneStrategist extends CardImpl { + + public JaceArcaneStrategist(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{U}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.JACE); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(4)); + + // Whenever you draw your second card each turn, put a +1/+1 counter on target creature you control. + this.addAbility(new JaceArcaneStrategistTriggeredAbility()); + + // +1: Draw a card. + this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1)); + + // -7: Creatures you control can't be blocked this turn. + this.addAbility(new LoyaltyAbility(new CantBeBlockedAllEffect( + StaticFilters.FILTER_CONTROLLED_CREATURE, Duration.EndOfTurn + ), -7)); + } + + private JaceArcaneStrategist(final JaceArcaneStrategist card) { + super(card); + } + + @Override + public JaceArcaneStrategist copy() { + return new JaceArcaneStrategist(this); + } +} + +class JaceArcaneStrategistTriggeredAbility extends TriggeredAbilityImpl { + + private boolean triggeredOnce = false; + private boolean triggeredTwice = false; + + JaceArcaneStrategistTriggeredAbility() { + super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false); + this.addTarget(new TargetControlledCreaturePermanent()); + } + + private JaceArcaneStrategistTriggeredAbility(final JaceArcaneStrategistTriggeredAbility ability) { + super(ability); + this.triggeredOnce = ability.triggeredOnce; + this.triggeredTwice = ability.triggeredTwice; + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DREW_CARD + || event.getType() == GameEvent.EventType.END_PHASE_POST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.END_PHASE_POST) { + triggeredOnce = triggeredTwice = false; + return false; + } + if (event.getType() == GameEvent.EventType.DREW_CARD + && event.getPlayerId().equals(controllerId)) { + if (triggeredOnce) { + if (triggeredTwice) { + return false; + } else { + triggeredTwice = true; + return true; + } + } else { + triggeredOnce = true; + return false; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever you draw your second card each turn, put a +1/+1 counter on target creature you control."; + } + + @Override + public JaceArcaneStrategistTriggeredAbility copy() { + return new JaceArcaneStrategistTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/WarOfTheSpark.java b/Mage.Sets/src/mage/sets/WarOfTheSpark.java index 64d4529910..79b3ff929d 100644 --- a/Mage.Sets/src/mage/sets/WarOfTheSpark.java +++ b/Mage.Sets/src/mage/sets/WarOfTheSpark.java @@ -117,6 +117,7 @@ public final class WarOfTheSpark extends ExpansionSet { cards.add(new SetCardInfo("Jace's Projection", 272, Rarity.UNCOMMON, mage.cards.j.JacesProjection.class)); cards.add(new SetCardInfo("Jace's Ruse", 273, Rarity.RARE, mage.cards.j.JacesRuse.class)); cards.add(new SetCardInfo("Jace's Triumph", 55, Rarity.UNCOMMON, mage.cards.j.JacesTriumph.class)); + cards.add(new SetCardInfo("Jace, Arcane Strategist", 270, Rarity.MYTHIC, mage.cards.j.JaceArcaneStrategist.class)); cards.add(new SetCardInfo("Jace, Wielder of Mysteries", 54, Rarity.RARE, mage.cards.j.JaceWielderOfMysteries.class)); cards.add(new SetCardInfo("Jaya's Greeting", 136, Rarity.COMMON, mage.cards.j.JayasGreeting.class)); cards.add(new SetCardInfo("Jaya, Venerated Firemage", 135, Rarity.UNCOMMON, mage.cards.j.JayaVeneratedFiremage.class));