From 6d7f42e5d7c0fc2c976fd9ab7f4625b44543435f Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 28 Mar 2024 10:56:31 -0400 Subject: [PATCH] [OTJ] Implement Loan Shark --- Mage.Sets/src/mage/cards/l/LoanShark.java | 64 +++++++++++++++++++ .../mage/sets/OutlawsOfThunderJunction.java | 1 + 2 files changed, 65 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/l/LoanShark.java diff --git a/Mage.Sets/src/mage/cards/l/LoanShark.java b/Mage.Sets/src/mage/cards/l/LoanShark.java new file mode 100644 index 00000000000..607539083cc --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LoanShark.java @@ -0,0 +1,64 @@ +package mage.cards.l; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.PlotAbility; +import mage.abilities.keyword.StormAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.game.Game; +import mage.watchers.common.SpellsCastWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class LoanShark extends CardImpl { + + public LoanShark(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.SHARK); + this.subtype.add(SubType.ROGUE); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // When Loan Shark enters the battlefield, if you've cast two or more spells this turn, draw a card. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new DrawCardSourceControllerEffect(1)), + LoanSharkCondition.instance, "When {this} enters the battlefield, " + + "if you've cast two or more spells this turn, draw a card." + ).addHint(StormAbility.getHint())); + + // Plot {3}{U} + this.addAbility(new PlotAbility(this, "{3}{U}")); + } + + private LoanShark(final LoanShark card) { + super(card); + } + + @Override + public LoanShark copy() { + return new LoanShark(this); + } +} + +enum LoanSharkCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + return game + .getState() + .getWatcher(SpellsCastWatcher.class) + .getCount(source.getControllerId()) >= 2; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java index ce4454275dc..f6edaca26c2 100644 --- a/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java +++ b/Mage.Sets/src/mage/sets/OutlawsOfThunderJunction.java @@ -57,6 +57,7 @@ public final class OutlawsOfThunderJunction extends ExpansionSet { cards.add(new SetCardInfo("Jolene, Plundering Pugilist", 210, Rarity.UNCOMMON, mage.cards.j.JolenePlunderingPugilist.class)); cards.add(new SetCardInfo("Kraum, Violent Cacophony", 214, Rarity.UNCOMMON, mage.cards.k.KraumViolentCacophony.class)); cards.add(new SetCardInfo("Lavaspur Boots", 243, Rarity.UNCOMMON, mage.cards.l.LavaspurBoots.class)); + cards.add(new SetCardInfo("Loan Shark", 55, Rarity.COMMON, mage.cards.l.LoanShark.class)); cards.add(new SetCardInfo("Lonely Arroyo", 260, Rarity.COMMON, mage.cards.l.LonelyArroyo.class)); cards.add(new SetCardInfo("Lush Oasis", 261, Rarity.COMMON, mage.cards.l.LushOasis.class)); cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));