From 8580c0a196f6cf39e87e7e537bcf1e928d6b8a1a Mon Sep 17 00:00:00 2001 From: Daniel Bomar Date: Sat, 16 Jan 2021 12:31:22 -0600 Subject: [PATCH] [KHM] Implemented Arni Brokenbrow --- .../src/mage/cards/a/ArniBrokenbrow.java | 83 +++++++++++++++++++ Mage.Sets/src/mage/sets/Kaldheim.java | 1 + Utils/mtg-cards-data.txt | 2 +- 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java diff --git a/Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java b/Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java new file mode 100644 index 00000000000..547c814053a --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArniBrokenbrow.java @@ -0,0 +1,83 @@ +package mage.cards.a; + +import java.util.UUID; +import mage.MageInt; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.dynamicvalue.common.GreatestPowerAmongControlledCreaturesValue; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.SetPowerSourceEffect; +import mage.abilities.keyword.BoastAbility; +import mage.constants.*; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author weirddan455 + */ +public final class ArniBrokenbrow extends CardImpl { + + public ArniBrokenbrow(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.BERSERKER); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Haste + this.addAbility(HasteAbility.getInstance()); + + // Boast — {1}: You may change Arni Brokenbrow's base power to 1 plus the greatest power among creatures you control until end of turn. + this.addAbility(new BoastAbility(new ArniBrokenbrowEffect(), new GenericManaCost(1))); + } + + private ArniBrokenbrow(final ArniBrokenbrow card) { + super(card); + } + + @Override + public ArniBrokenbrow copy() { + return new ArniBrokenbrow(this); + } +} + +class ArniBrokenbrowEffect extends OneShotEffect { + + public ArniBrokenbrowEffect() { + super(Outcome.BoostCreature); + staticText = "you may change {this}'s base power to 1 plus the greatest power among creatures you control until end of turn"; + } + + private ArniBrokenbrowEffect(final ArniBrokenbrowEffect effect) { + super(effect); + } + + @Override + public ArniBrokenbrowEffect copy() { + return new ArniBrokenbrowEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + MageObject mageObject = game.getObject(source.getSourceId()); + if (controller != null && mageObject != null) { + int power = GreatestPowerAmongControlledCreaturesValue.instance.calculate(game, source, this) + 1; + if (controller.chooseUse(outcome,"Change base power of " + mageObject.getLogName() + " to " + + power + " until end of turn?", source, game + )) { + game.addEffect(new SetPowerSourceEffect(StaticValue.get(power), Duration.EndOfTurn), source); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index 7400913ac6e..1fb500aaf95 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -70,6 +70,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Arachnoform", 159, Rarity.COMMON, mage.cards.a.Arachnoform.class)); cards.add(new SetCardInfo("Arctic Treeline", 249, Rarity.COMMON, mage.cards.a.ArcticTreeline.class)); cards.add(new SetCardInfo("Armed and Armored", 379, Rarity.UNCOMMON, mage.cards.a.ArmedAndArmored.class)); + cards.add(new SetCardInfo("Arni Brokenbrow", 120, Rarity.RARE, mage.cards.a.ArniBrokenbrow.class)); cards.add(new SetCardInfo("Arni Slays the Troll", 201, Rarity.UNCOMMON, mage.cards.a.ArniSlaysTheTroll.class)); cards.add(new SetCardInfo("Ascendant Spirit", 43, Rarity.RARE, mage.cards.a.AscendantSpirit.class)); cards.add(new SetCardInfo("Augury Raven", 44, Rarity.COMMON, mage.cards.a.AuguryRaven.class)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 3810d1e7993..25afc8fa73c 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -40111,7 +40111,7 @@ Valki, God of Lies|Kaldheim|114|M|{1}{B}|Legendary Creature - God|2|1|When Valki Varragoth, Bloodsky Sire|Kaldheim|115|R|{2}{B}|Legendary Creature - Demon Rogue|2|3|Deathtouch$Boast — {1}{B}: Target player search their library for a card, then shuffles their library and puts that card on top of it.| Village Rites|Kaldheim|117|C|{B}|Instant|||As an additional cost to cast this spell, sacrifice a creature.$Draw two cards.| Withercrown|Kaldheim|119|C|{1}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature has base power 0 and has "At the beginning of your upkeep, you lose 1 life unless you sacrifice this creature."| -Arni Brokenbow|Kaldheim|120|R|{2}{R}|Legendary Creature - Human Berserker|3|3|Haste$Boast — {1}: You may change Arni Brokenbow's base power to 1 plus the greatest power among creatures you control until end of turn.| +Arni Brokenbrow|Kaldheim|120|R|{2}{R}|Legendary Creature - Human Berserker|3|3|Haste$Boast — {1}: You may change Arni Brokenbrow's base power to 1 plus the greatest power among creatures you control until end of turn.| Axgard Cavalry|Kaldheim|121|C|{1}{R}|Creature - Dwarf Berserker|2|2|{T}: Target creature gains haste until end of turn.| Basalt Ravager|Kaldheim|122|U|{3}{R}|Creature - Giant Wizard|4|2|When Basalt Ravager enters the battlefield, it deals X damage to any target, where X is the greatest number of creatures you control that have a creature type in common.| Calamity Bearer|Kaldheim|125|R|{2}{R}{R}|Creature - Giant Berserker|3|4|If a Giant source you control would deal damage to a permanent or player, it deals double that damage to that permanent or player instead.|