diff --git a/Mage.Sets/src/mage/cards/t/TwoHandedAxe.java b/Mage.Sets/src/mage/cards/t/TwoHandedAxe.java new file mode 100644 index 00000000000..046e6997fd2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TwoHandedAxe.java @@ -0,0 +1,85 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.common.AttacksAttachedTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.EquipAbility; +import mage.cards.AdventureCard; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TwoHandedAxe extends AdventureCard { + + public TwoHandedAxe(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, new CardType[]{CardType.INSTANT}, "{2}{R}", "Sweeping Cleave", "{1}{R}"); + + this.subtype.add(SubType.EQUIPMENT); + + // Whenever equipped creature attacks, double its power until end of turn. + this.addAbility(new AttacksAttachedTriggeredAbility( + new TwoHandedAxeEffect(), AttachmentType.EQUIPMENT, false, true + )); + + // Equip {1}{R} + this.addAbility(new EquipAbility(Outcome.AddAbility, new ManaCostsImpl<>("{1}{R}"))); + + // Sweeping Cleave + // Target creature you control gains double strike until end of turn. + this.getSpellCard().getSpellAbility().addEffect(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance())); + this.getSpellCard().getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); + } + + private TwoHandedAxe(final TwoHandedAxe card) { + super(card); + } + + @Override + public TwoHandedAxe copy() { + return new TwoHandedAxe(this); + } +} + +class TwoHandedAxeEffect extends OneShotEffect { + + TwoHandedAxeEffect() { + super(Outcome.Benefit); + staticText = "double its power until end of turn"; + } + + private TwoHandedAxeEffect(final TwoHandedAxeEffect effect) { + super(effect); + } + + @Override + public TwoHandedAxeEffect copy() { + return new TwoHandedAxeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent == null || permanent.getPower().getValue() == 0) { + return false; + } + game.addEffect(new BoostTargetEffect( + permanent.getPower().getValue(), 0 + ).setTargetPointer(new FixedTarget(permanent, game)), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index a8627e03e71..150264e3a1d 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -163,6 +163,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Thrakkus the Butcher", 295, Rarity.UNCOMMON, mage.cards.t.ThrakkusTheButcher.class)); cards.add(new SetCardInfo("Thunderwave", 201, Rarity.UNCOMMON, mage.cards.t.Thunderwave.class)); cards.add(new SetCardInfo("Treasure Keeper", 341, Rarity.UNCOMMON, mage.cards.t.TreasureKeeper.class)); + cards.add(new SetCardInfo("Two-Handed Axe", 203, Rarity.UNCOMMON, mage.cards.t.TwoHandedAxe.class)); cards.add(new SetCardInfo("Tymora's Invoker", 101, Rarity.COMMON, mage.cards.t.TymorasInvoker.class)); cards.add(new SetCardInfo("Veteran Soldier", 48, Rarity.UNCOMMON, mage.cards.v.VeteranSoldier.class)); cards.add(new SetCardInfo("Viconia, Drow Apostate", 156, Rarity.UNCOMMON, mage.cards.v.ViconiaDrowApostate.class));