From 14f415518db23870ca915d818d57ee18af4448a1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 17 Jun 2020 08:19:09 -0400 Subject: [PATCH] Implemented Alchemist's Gift --- .../src/mage/cards/a/AlchemistsGift.java | 73 +++++++++++++++++++ Mage.Sets/src/mage/sets/CoreSet2021.java | 1 + 2 files changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/a/AlchemistsGift.java diff --git a/Mage.Sets/src/mage/cards/a/AlchemistsGift.java b/Mage.Sets/src/mage/cards/a/AlchemistsGift.java new file mode 100644 index 0000000000..52653791ad --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/AlchemistsGift.java @@ -0,0 +1,73 @@ +package mage.cards.a; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.LifelinkAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class AlchemistsGift extends CardImpl { + + public AlchemistsGift(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); + + // Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn. + this.getSpellAbility().addEffect(new AlchemistsGiftEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private AlchemistsGift(final AlchemistsGift card) { + super(card); + } + + @Override + public AlchemistsGift copy() { + return new AlchemistsGift(this); + } +} + +class AlchemistsGiftEffect extends OneShotEffect { + + AlchemistsGiftEffect() { + super(Outcome.Benefit); + staticText = "Target creature gets +1/+1 and gains your choice of deathtouch or lifelink until end of turn."; + } + + private AlchemistsGiftEffect(final AlchemistsGiftEffect effect) { + super(effect); + } + + @Override + public AlchemistsGiftEffect copy() { + return new AlchemistsGiftEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player == null) { + return false; + } + Ability ability = player.chooseUse( + outcome, "Deathtouch or lifelink?", null, + "Deathtouch", "Lifelink", source, game + ) ? DeathtouchAbility.getInstance() : LifelinkAbility.getInstance(); + game.addEffect(new BoostSourceEffect(1, 1, Duration.EndOfTurn), ability); + game.addEffect(new GainAbilitySourceEffect(ability, Duration.EndOfTurn), ability); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2021.java b/Mage.Sets/src/mage/sets/CoreSet2021.java index c2106adb39..5f07ff7383 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2021.java +++ b/Mage.Sets/src/mage/sets/CoreSet2021.java @@ -34,6 +34,7 @@ public final class CoreSet2021 extends ExpansionSet { this.maxCardNumberInBooster = 274; cards.add(new SetCardInfo("Adherent of Hope", 321, Rarity.COMMON, mage.cards.a.AdherentOfHope.class)); + cards.add(new SetCardInfo("Alchemist's Gift", 87, Rarity.COMMON, mage.cards.a.AlchemistsGift.class)); cards.add(new SetCardInfo("Alpine Houndmaster", 215, Rarity.UNCOMMON, mage.cards.a.AlpineHoundmaster.class)); cards.add(new SetCardInfo("Alpine Watchdog", 2, Rarity.COMMON, mage.cards.a.AlpineWatchdog.class)); cards.add(new SetCardInfo("Angelic Ascension", 3, Rarity.UNCOMMON, mage.cards.a.AngelicAscension.class));