From 149c79992629a292450f720a72a79cf6ddb27632 Mon Sep 17 00:00:00 2001 From: Evan Kranzler <theelk801@gmail.com> Date: Sat, 5 Feb 2022 23:47:29 -0500 Subject: [PATCH] [NEO] Implemented When We Were Young --- .../src/mage/cards/w/WhenWeWereYoung.java | 69 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + 2 files changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/w/WhenWeWereYoung.java diff --git a/Mage.Sets/src/mage/cards/w/WhenWeWereYoung.java b/Mage.Sets/src/mage/cards/w/WhenWeWereYoung.java new file mode 100644 index 0000000000..480437d5b4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WhenWeWereYoung.java @@ -0,0 +1,69 @@ +package mage.cards.w; + +import mage.abilities.Ability; +import mage.abilities.condition.common.ControlArtifactAndEnchantmentCondition; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.hint.common.ControlArtifactAndEnchantmentHint; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WhenWeWereYoung extends CardImpl { + + public WhenWeWereYoung(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{W}"); + + // Up to two target creatures each get +2/+2 until end of turn. If you control an artifact and an enchantment, those creatures also gain lifelink until end of turn. + this.getSpellAbility().addEffect(new WhenWeWereYoungEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 2)); + this.getSpellAbility().addHint(ControlArtifactAndEnchantmentHint.instance); + } + + private WhenWeWereYoung(final WhenWeWereYoung card) { + super(card); + } + + @Override + public WhenWeWereYoung copy() { + return new WhenWeWereYoung(this); + } +} + +class WhenWeWereYoungEffect extends OneShotEffect { + + WhenWeWereYoungEffect() { + super(Outcome.Benefit); + staticText = "up to two target creatures each get +2/+2 until end of turn. " + + "If you control an artifact and an enchantment, " + + "those creatures also gain lifelink until end of turn"; + } + + private WhenWeWereYoungEffect(final WhenWeWereYoungEffect effect) { + super(effect); + } + + @Override + public WhenWeWereYoungEffect copy() { + return new WhenWeWereYoungEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.addEffect(new BoostTargetEffect(2, 2), source); + if (ControlArtifactAndEnchantmentCondition.instance.apply(game, source)) { + game.addEffect(new GainAbilityTargetEffect(LifelinkAbility.getInstance()), source); + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 1824f45599..34e678fb14 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -277,6 +277,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Wanderer's Intervention", 41, Rarity.COMMON, mage.cards.w.WanderersIntervention.class)); cards.add(new SetCardInfo("Weaver of Harmony", 213, Rarity.RARE, mage.cards.w.WeaverOfHarmony.class)); cards.add(new SetCardInfo("Webspinner Cuff", 214, Rarity.UNCOMMON, mage.cards.w.WebspinnerCuff.class)); + cards.add(new SetCardInfo("When We Were Young", 43, Rarity.UNCOMMON, mage.cards.w.WhenWeWereYoung.class)); cards.add(new SetCardInfo("Wind-Scarred Crag", 282, Rarity.COMMON, mage.cards.w.WindScarredCrag.class)); cards.add(new SetCardInfo("You Are Already Dead", 129, Rarity.COMMON, mage.cards.y.YouAreAlreadyDead.class));