From 0b54c3879db156616fbbc2cc1d2b2d3b4d045a7a Mon Sep 17 00:00:00 2001 From: theelk801 Date: Sun, 5 Nov 2023 13:43:33 -0500 Subject: [PATCH] [LCI] Implement Malamet Battle Glyph --- .../src/mage/cards/m/MalametBattleGlyph.java | 68 +++++++++++++++++++ .../src/mage/sets/TheLostCavernsOfIxalan.java | 1 + 2 files changed, 69 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MalametBattleGlyph.java diff --git a/Mage.Sets/src/mage/cards/m/MalametBattleGlyph.java b/Mage.Sets/src/mage/cards/m/MalametBattleGlyph.java new file mode 100644 index 00000000000..bb4f86d0799 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MalametBattleGlyph.java @@ -0,0 +1,68 @@ +package mage.cards.m; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.FightTargetsEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MalametBattleGlyph extends CardImpl { + + public MalametBattleGlyph(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{G}"); + + // Choose target creature you control and target creature you don't control. If the creature you control entered the battlefield this turn, put a +1/+1 counter on it. Then those creatures fight each other. + this.getSpellAbility().addEffect(new MalametBattleGlyphEffect()); + this.getSpellAbility().addEffect(new FightTargetsEffect().setText("then those creatures fight each other")); + this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL)); + } + + private MalametBattleGlyph(final MalametBattleGlyph card) { + super(card); + } + + @Override + public MalametBattleGlyph copy() { + return new MalametBattleGlyph(this); + } +} + +class MalametBattleGlyphEffect extends OneShotEffect { + + MalametBattleGlyphEffect() { + super(Outcome.Benefit); + staticText = "choose target creature you control and target creature you don't control. " + + "If the creature you control entered the battlefield this turn, put a +1/+1 counter on it"; + } + + private MalametBattleGlyphEffect(final MalametBattleGlyphEffect effect) { + super(effect); + } + + @Override + public MalametBattleGlyphEffect copy() { + return new MalametBattleGlyphEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + return permanent != null + && permanent.getTurnsOnBattlefield() == 0 + && permanent.addCounters(CounterType.P1P1.createInstance(), source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java index b2ff690a49f..a024df57c08 100644 --- a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java +++ b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java @@ -192,6 +192,7 @@ public final class TheLostCavernsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Kutzil's Flanker", 20, Rarity.RARE, mage.cards.k.KutzilsFlanker.class)); cards.add(new SetCardInfo("Locus of Enlightenment", 55, Rarity.MYTHIC, mage.cards.l.LocusOfEnlightenment.class)); cards.add(new SetCardInfo("Lodestone Needle", 62, Rarity.UNCOMMON, mage.cards.l.LodestoneNeedle.class)); + cards.add(new SetCardInfo("Malamet Battle Glyph", 198, Rarity.UNCOMMON, mage.cards.m.MalametBattleGlyph.class)); cards.add(new SetCardInfo("Malamet Brawler", 199, Rarity.COMMON, mage.cards.m.MalametBrawler.class)); cards.add(new SetCardInfo("Malamet Scythe", 200, Rarity.COMMON, mage.cards.m.MalametScythe.class)); cards.add(new SetCardInfo("Malamet Veteran", 201, Rarity.COMMON, mage.cards.m.MalametVeteran.class));