From ea367c20057dc33274d6a55ab69aef0141992179 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Nov 2022 11:20:14 -0500 Subject: [PATCH] [BRO] Implement Military Discipline --- .../src/mage/cards/m/MilitaryDiscipline.java | 55 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 2 files changed, 56 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/m/MilitaryDiscipline.java diff --git a/Mage.Sets/src/mage/cards/m/MilitaryDiscipline.java b/Mage.Sets/src/mage/cards/m/MilitaryDiscipline.java new file mode 100644 index 0000000000..c788e09cbd --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MilitaryDiscipline.java @@ -0,0 +1,55 @@ +package mage.cards.m; + +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.FlashAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MilitaryDiscipline extends CardImpl { + + public MilitaryDiscipline(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + + this.subtype.add(SubType.AURA); + + // Flash + this.addAbility(FlashAbility.getInstance()); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + this.addAbility(new EnchantAbility(auraTarget)); + + // When Military Discipline enters the battlefield, enchanted creature gains first strike until end of turn. + this.addAbility(new EntersBattlefieldTriggeredAbility(new GainAbilityAttachedEffect( + FirstStrikeAbility.getInstance(), AttachmentType.AURA, Duration.EndOfTurn + ))); + + // Enchanted creature gets +1/+0. + this.addAbility(new SimpleStaticAbility(new BoostEnchantedEffect(1, 0))); + } + + private MilitaryDiscipline(final MilitaryDiscipline card) { + super(card); + } + + @Override + public MilitaryDiscipline copy() { + return new MilitaryDiscipline(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 8270fe69c9..6b50596bf4 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -157,6 +157,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Mechanized Warfare", 139, Rarity.RARE, mage.cards.m.MechanizedWarfare.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mechanized Warfare", 338, Rarity.RARE, mage.cards.m.MechanizedWarfare.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mightstone's Animation", 58, Rarity.COMMON, mage.cards.m.MightstonesAnimation.class)); + cards.add(new SetCardInfo("Military Discipline", 17, Rarity.COMMON, mage.cards.m.MilitaryDiscipline.class)); cards.add(new SetCardInfo("Mine Worker", 239, Rarity.COMMON, mage.cards.m.MineWorker.class)); cards.add(new SetCardInfo("Misery's Shadow", 107, Rarity.RARE, mage.cards.m.MiserysShadow.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Misery's Shadow", 330, Rarity.RARE, mage.cards.m.MiserysShadow.class, NON_FULL_USE_VARIOUS));