From af8f21ff1d086da039e56ee2cd5b11026a101b53 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 13 Jul 2021 09:01:41 -0400 Subject: [PATCH] [AFC] Implemented Belt of Giant Strength --- .../src/mage/cards/b/BeltOfGiantStrength.java | 60 +++++++++++++++++++ .../mage/sets/ForgottenRealmsCommander.java | 1 + 2 files changed, 61 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java diff --git a/Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java b/Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java new file mode 100644 index 00000000000..2e89bfc7796 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/BeltOfGiantStrength.java @@ -0,0 +1,60 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.CostAdjuster; +import mage.abilities.effects.common.continuous.SetPowerToughnessEnchantedEffect; +import mage.abilities.keyword.EquipAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class BeltOfGiantStrength extends CardImpl { + + public BeltOfGiantStrength(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}{G}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Equipped creature has base power and toughness 10/10. + this.addAbility(new SimpleStaticAbility(new SetPowerToughnessEnchantedEffect(10, 10) + .setText("equipped creature has base power and toughness 10/10"))); + + // Equip {10}. This ability costs {X} less to activate where X is the power of the creature it targets. + EquipAbility ability = new EquipAbility(10); + ability.setCostReduceText("This ability costs {X} less to activate where X is the power of the creature it targets."); + ability.setCostAdjuster(BeltOfGiantStrengthAdjuster.instance); + this.addAbility(ability); + } + + private BeltOfGiantStrength(final BeltOfGiantStrength card) { + super(card); + } + + @Override + public BeltOfGiantStrength copy() { + return new BeltOfGiantStrength(this); + } +} + +enum BeltOfGiantStrengthAdjuster implements CostAdjuster { + instance; + + @Override + public void adjustCosts(Ability ability, Game game) { + Permanent permanent = game.getPermanent(ability.getFirstTarget()); + if (permanent == null) { + return; + } + CardUtil.reduceCost(ability, Integer.max(permanent.getPower().getValue(), 0)); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java b/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java index 7d85e57819b..168808e06b4 100644 --- a/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java +++ b/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java @@ -38,6 +38,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet { cards.add(new SetCardInfo("Beast Within", 152, Rarity.UNCOMMON, mage.cards.b.BeastWithin.class)); cards.add(new SetCardInfo("Bedevil", 179, Rarity.RARE, mage.cards.b.Bedevil.class)); cards.add(new SetCardInfo("Behemoth Sledge", 180, Rarity.UNCOMMON, mage.cards.b.BehemothSledge.class)); + cards.add(new SetCardInfo("Belt of Giant Strength", 38, Rarity.RARE, mage.cards.b.BeltOfGiantStrength.class)); cards.add(new SetCardInfo("Bituminous Blast", 181, Rarity.UNCOMMON, mage.cards.b.BituminousBlast.class)); cards.add(new SetCardInfo("Bogardan Hellkite", 115, Rarity.MYTHIC, mage.cards.b.BogardanHellkite.class)); cards.add(new SetCardInfo("Bojuka Bog", 226, Rarity.COMMON, mage.cards.b.BojukaBog.class));