From 1388972d4cd1c9f207473a35953a123e09681b99 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Mon, 30 Oct 2023 10:24:19 -0400 Subject: [PATCH] [LCI] Implement Nicanzil, Current Conductor --- .../cards/n/NicanzilCurrentConductor.java | 95 +++++++++++++++++++ .../src/mage/sets/TheLostCavernsOfIxalan.java | 1 + .../effects/keyword/ExploreSourceEffect.java | 3 +- .../java/mage/game/events/ExploredEvent.java | 22 +++++ Utils/mtg-cards-data.txt | 1 + 5 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/n/NicanzilCurrentConductor.java create mode 100644 Mage/src/main/java/mage/game/events/ExploredEvent.java diff --git a/Mage.Sets/src/mage/cards/n/NicanzilCurrentConductor.java b/Mage.Sets/src/mage/cards/n/NicanzilCurrentConductor.java new file mode 100644 index 00000000000..d6121e4de26 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NicanzilCurrentConductor.java @@ -0,0 +1,95 @@ +package mage.cards.n; + +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.events.ExploredEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class NicanzilCurrentConductor extends CardImpl { + + public NicanzilCurrentConductor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{U}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.MERFOLK); + this.subtype.add(SubType.SCOUT); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Whenever a creature you control explores a land card, you may put a land card from your hand onto the battlefield tapped. + this.addAbility(new NicanzilCurrentConductorTriggeredAbility( + new PutCardFromHandOntoBattlefieldEffect( + StaticFilters.FILTER_CARD_LAND_A, false, true + ), true + )); + + // Whenever a creature you control explores a nonland card, put a +1/+1 counter on Nicanzil, Current Conductor. + this.addAbility(new NicanzilCurrentConductorTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false + )); + } + + private NicanzilCurrentConductor(final NicanzilCurrentConductor card) { + super(card); + } + + @Override + public NicanzilCurrentConductor copy() { + return new NicanzilCurrentConductor(this); + } +} + +class NicanzilCurrentConductorTriggeredAbility extends TriggeredAbilityImpl { + + private final boolean isLand; + + NicanzilCurrentConductorTriggeredAbility(Effect effect, boolean isLand) { + super(Zone.BATTLEFIELD, effect); + this.isLand = isLand; + this.setTriggerPhrase("Whenever a creature you control explores a " + (isLand ? "" : "non") + "land card, "); + } + + private NicanzilCurrentConductorTriggeredAbility(final NicanzilCurrentConductorTriggeredAbility ability) { + super(ability); + this.isLand = ability.isLand; + } + + @Override + public NicanzilCurrentConductorTriggeredAbility copy() { + return new NicanzilCurrentConductorTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.EXPLORED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + ExploredEvent eEvent = (ExploredEvent) event; + Permanent permanent = game.getPermanent(eEvent.getTargetId()); + return permanent != null + && permanent.isCreature(game) + && permanent.isControlledBy(getControllerId()) + && eEvent.getCard() != null + && eEvent.getCard().isLand(game) == isLand; + } +} diff --git a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java index 7b9ab5a1dd6..5caf0a16044 100644 --- a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java +++ b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java @@ -93,6 +93,7 @@ public final class TheLostCavernsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Mischievous Pup", 25, Rarity.UNCOMMON, mage.cards.m.MischievousPup.class)); cards.add(new SetCardInfo("Mountain", 290, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Mountain", 399, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Nicanzil, Current Conductor", 236, Rarity.UNCOMMON, mage.cards.n.NicanzilCurrentConductor.class)); cards.add(new SetCardInfo("Nurturing Bristleback", 203, Rarity.COMMON, mage.cards.n.NurturingBristleback.class)); cards.add(new SetCardInfo("Ojer Axonil, Deepest Might", 158, Rarity.MYTHIC, mage.cards.o.OjerAxonilDeepestMight.class)); cards.add(new SetCardInfo("Ojer Taq, Deepest Foundation", 26, Rarity.MYTHIC, mage.cards.o.OjerTaqDeepestFoundation.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java index 6da0b161d4a..ebd7bc8f682 100644 --- a/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/keyword/ExploreSourceEffect.java @@ -10,6 +10,7 @@ import mage.constants.Outcome; import mage.constants.Zone; import mage.counters.CounterType; import mage.game.Game; +import mage.game.events.ExploredEvent; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; @@ -99,7 +100,7 @@ public class ExploreSourceEffect extends OneShotEffect { game.getState().processAction(game); // 701.40b A permanent “explores” after the process described in rule 701.40a is complete, even if some or all of // those actions were impossible. - game.fireEvent(GameEvent.getEvent(GameEvent.EventType.EXPLORED, permanentId, source, permanent.getControllerId())); + game.fireEvent(new ExploredEvent(permanent, source, card)); } return true; } diff --git a/Mage/src/main/java/mage/game/events/ExploredEvent.java b/Mage/src/main/java/mage/game/events/ExploredEvent.java new file mode 100644 index 00000000000..af6e0181c32 --- /dev/null +++ b/Mage/src/main/java/mage/game/events/ExploredEvent.java @@ -0,0 +1,22 @@ +package mage.game.events; + +import mage.abilities.Ability; +import mage.cards.Card; +import mage.game.permanent.Permanent; + +/** + * @author TheElk801 + */ +public class ExploredEvent extends GameEvent { + + private final Card card; + + public ExploredEvent(Permanent permanent, Ability source, Card card) { + super(EventType.EXPLORED, permanent.getId(), source, permanent.getControllerId()); + this.card = card; + } + + public Card getCard() { + return card; + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index aa86fe932a9..ddf8dabdc91 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -12212,6 +12212,7 @@ Journey On|The Lost Caverns of Ixalan|231|R|{G}|Sorcery - Adventure|2|3|Create X Master's Guide-Mural|The Lost Caverns of Ixalan|233|U|{3}{W}{U}|Artifact|||When Master's Guide-Mural enters the battlefield, create a 4/4 white and blue Golem artifact creature token.$Craft with artifact {4}{W}{W}{U}| Master's Manufactory|The Lost Caverns of Ixalan|233|U||Artifact|||{T}: Create a 4/4 white and blue Golem artifact creature token. Activate only if Master's Manufactory or another artifact entered the battlefield under your control this turn.| The Mycotyrant|The Lost Caverns of Ixalan|235|M|{1}{B}{G}|Legendary Creature - Elder Fungus|*|*|Trample$The Mycotyrant's power and toughness are each equal to the number of creatures you control that are Fungi and/or Saprolings.$At the beginning of your end step, create X 1/1 black Fungus creature tokens with "This creature can't block," where X is the number of times you descended this turn.| +Nicanzil, Current Conductor|The Lost Caverns of Ixalan|236|U|{G}{U}|Legendary Creature - Merfolk Scout|2|3|Whenever a creature you control explores a land card, you may put a land card from your hand onto the battlefield tapped.$Whenever a creature you control explores a nonland card, put a +1/+1 counter on Nicanzil, Current Conductor.| Palani's Hatcher|The Lost Caverns of Ixalan|237|R|{3}{R}{G}|Creature - Dinosaur|5|3|Other Dinosaurs you control have haste.$When Palani's Hatcher enters the battlefield, create two 0/1 green Dinosaur Egg creature tokens.$At the beginning of combat on your turn, if you control one or more Eggs, sacrifice an Egg, then create a 3/3 green Dinosaur creature token.| Quintorius Kand|The Lost Caverns of Ixalan|238|M|{3}{R}{W}|Legendary Planeswalker - Quintorius|4|Whenever you cast a spell from exile, Quintorius Kand deals 2 damage to each opponent and you gain 2 life.$+1: Create a 3/2 red and white Spirit creature token.$-3: Discover 4.$-6: Exile any number of target cards from your graveyard. Add {R} for each card exiled this way. You may play those cards this turn.| Saheeli, the Sun's Brilliance|The Lost Caverns of Ixalan|239|M|{U}{R}|Legendary Creature - Human Artificer|2|2|{U}{R}, {T}: Create a token that's a copy of another target creature or artifact you control, except it's an artifact in addition to its other types. It gains haste. Sacrifice it at the beginning of the next end step.|