From fb80bc06c454eca1cea242adb139f5607d0bc181 Mon Sep 17 00:00:00 2001 From: Susucre <34709007+Susucre@users.noreply.github.com> Date: Mon, 19 Jun 2023 04:39:11 +0200 Subject: [PATCH] [LTC] Implement Forth Eorlingas! (#10467) Also added the 2/2 Human Knight token used by a few LTC cards. --- .../src/mage/cards/f/ForthEorlingas.java | 85 +++++++++++++++++++ .../sets/TalesOfMiddleEarthCommander.java | 1 + 2 files changed, 86 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/ForthEorlingas.java diff --git a/Mage.Sets/src/mage/cards/f/ForthEorlingas.java b/Mage.Sets/src/mage/cards/f/ForthEorlingas.java new file mode 100644 index 0000000000..1be968185d --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/ForthEorlingas.java @@ -0,0 +1,85 @@ +package mage.cards.f; + +import java.util.UUID; + +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.BecomesMonarchSourceEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.game.Game; +import mage.game.events.DamagedEvent; +import mage.game.events.DamagedPlayerBatchEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.HumanKnightToken; + +/** + * + * @author Susucr + */ +public final class ForthEorlingas extends CardImpl { + + public ForthEorlingas(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{W}"); + + + // Create X 2/2 red Human Knight creature tokens with trample and haste. + this.getSpellAbility().addEffect(new CreateTokenEffect( + new HumanKnightToken(), ManacostVariableValue.REGULAR, false, false + )); + + // Whenever one or more creatures you control deal combat damage to one or more players this turn, you become the monarch. + this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new ForthEorlingasTriggeredAbility())); + } + + private ForthEorlingas(final ForthEorlingas card) { + super(card); + } + + @Override + public ForthEorlingas copy() { + return new ForthEorlingas(this); + } +} + +class ForthEorlingasTriggeredAbility extends DelayedTriggeredAbility { + + public ForthEorlingasTriggeredAbility() { + super(new BecomesMonarchSourceEffect(), Duration.EndOfTurn, false); + this.setTriggerPhrase("Whenever one or more creatures you control deal combat damage to one or more players this turn, "); + } + + public ForthEorlingasTriggeredAbility(ForthEorlingasTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER_BATCH; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + DamagedPlayerBatchEvent dEvent = (DamagedPlayerBatchEvent) event; + for (DamagedEvent damagedEvent : dEvent.getEvents()) { + if (!damagedEvent.isCombatDamage()) { + continue; + } + Permanent permanent = game.getPermanent(damagedEvent.getSourceId()); + if (permanent != null && permanent.isControlledBy(getControllerId())) { + return true; + } + } + return false; + } + + @Override + public ForthEorlingasTriggeredAbility copy() { + return new ForthEorlingasTriggeredAbility(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java index 7478aa3446..db289d0599 100644 --- a/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java +++ b/Mage.Sets/src/mage/sets/TalesOfMiddleEarthCommander.java @@ -92,6 +92,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet { cards.add(new SetCardInfo("Flooded Grove", 309, Rarity.RARE, mage.cards.f.FloodedGrove.class)); cards.add(new SetCardInfo("Forbidden Alchemy", 191, Rarity.COMMON, mage.cards.f.ForbiddenAlchemy.class)); cards.add(new SetCardInfo("Foreboding Ruins", 310, Rarity.RARE, mage.cards.f.ForebodingRuins.class)); + cards.add(new SetCardInfo("Forth Eorlingas!", 56, Rarity.RARE, mage.cards.f.ForthEorlingas.class)); cards.add(new SetCardInfo("Fortified Village", 311, Rarity.RARE, mage.cards.f.FortifiedVillage.class)); cards.add(new SetCardInfo("Frontier Warmonger", 217, Rarity.RARE, mage.cards.f.FrontierWarmonger.class)); cards.add(new SetCardInfo("Frontline Medic", 169, Rarity.RARE, mage.cards.f.FrontlineMedic.class));