From ff252a3bdb571e366342d9fcaaab6857ea06c0a7 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Thu, 18 Jul 2024 14:54:59 -0400 Subject: [PATCH] [BLB] Implement Valley Flamecaller --- .../src/mage/cards/v/ValleyFlamecaller.java | 91 +++++++++++++++++++ Mage.Sets/src/mage/sets/Bloomburrow.java | 1 + 2 files changed, 92 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/v/ValleyFlamecaller.java diff --git a/Mage.Sets/src/mage/cards/v/ValleyFlamecaller.java b/Mage.Sets/src/mage/cards/v/ValleyFlamecaller.java new file mode 100644 index 00000000000..93ab7796f03 --- /dev/null +++ b/Mage.Sets/src/mage/cards/v/ValleyFlamecaller.java @@ -0,0 +1,91 @@ +package mage.cards.v; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ValleyFlamecaller extends CardImpl { + + public ValleyFlamecaller(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add(SubType.LIZARD); + this.subtype.add(SubType.WARLOCK); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // If a Lizard, Mouse, Otter, or Raccoon you control would deal damage to a permanent or player, it deals that much damage plus 1 instead. + this.addAbility(new SimpleStaticAbility(new ValleyFlamecallerEffect())); + } + + private ValleyFlamecaller(final ValleyFlamecaller card) { + super(card); + } + + @Override + public ValleyFlamecaller copy() { + return new ValleyFlamecaller(this); + } +} + +class ValleyFlamecallerEffect extends ReplacementEffectImpl { + + ValleyFlamecallerEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "if a Lizard, Mouse, Otter, or Raccoon you control would deal damage " + + "to a permanent or player, it deals that much damage plus 1 instead"; + } + + private ValleyFlamecallerEffect(final ValleyFlamecallerEffect effect) { + super(effect); + } + + @Override + public ValleyFlamecallerEffect copy() { + return new ValleyFlamecallerEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + switch (event.getType()) { + case DAMAGE_PERMANENT: + case DAMAGE_PLAYER: + return true; + default: + return false; + } + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId()); + return permanent != null + && permanent.isControlledBy(permanent.getControllerId()) + && (permanent.hasSubtype(SubType.LIZARD, game) + || permanent.hasSubtype(SubType.MOUSE, game) + || permanent.hasSubtype(SubType.OTTER, game) + || permanent.hasSubtype(SubType.RACCOON, game)); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.overflowInc(event.getAmount(), 1)); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Bloomburrow.java b/Mage.Sets/src/mage/sets/Bloomburrow.java index 75a02c1a642..f9e19c0eac4 100644 --- a/Mage.Sets/src/mage/sets/Bloomburrow.java +++ b/Mage.Sets/src/mage/sets/Bloomburrow.java @@ -193,6 +193,7 @@ public final class Bloomburrow extends ExpansionSet { cards.add(new SetCardInfo("Treeguard Duo", 200, Rarity.COMMON, mage.cards.t.TreeguardDuo.class)); cards.add(new SetCardInfo("Treetop Sentries", 201, Rarity.COMMON, mage.cards.t.TreetopSentries.class)); cards.add(new SetCardInfo("Uncharted Haven", 261, Rarity.COMMON, mage.cards.u.UnchartedHaven.class)); + cards.add(new SetCardInfo("Valley Flamecaller", 158, Rarity.RARE, mage.cards.v.ValleyFlamecaller.class)); cards.add(new SetCardInfo("Valley Mightcaller", 202, Rarity.RARE, mage.cards.v.ValleyMightcaller.class)); cards.add(new SetCardInfo("Valley Rally", 159, Rarity.UNCOMMON, mage.cards.v.ValleyRally.class)); cards.add(new SetCardInfo("Valley Rotcaller", 119, Rarity.RARE, mage.cards.v.ValleyRotcaller.class));