From f3ea9c15cff5862b85e0a716f4c124399b9ec68d Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 12 Apr 2020 20:24:30 -0400 Subject: [PATCH] Implemented Startling Development --- .../mage/cards/s/StartlingDevelopment.java | 45 +++++++++++++++++++ .../src/mage/sets/IkoriaLairOfBehemoths.java | 1 + .../BecomesCreatureTargetEffect.java | 11 ++++- 3 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/s/StartlingDevelopment.java diff --git a/Mage.Sets/src/mage/cards/s/StartlingDevelopment.java b/Mage.Sets/src/mage/cards/s/StartlingDevelopment.java new file mode 100644 index 0000000000..020f29e7d5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/StartlingDevelopment.java @@ -0,0 +1,45 @@ +package mage.cards.s; + +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.game.permanent.token.custom.CreatureToken; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class StartlingDevelopment extends CardImpl { + + public StartlingDevelopment(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + // Until end of turn, target creature becomes a blue Serpent with base power and toughness 4/4. + this.getSpellAbility().addEffect(new BecomesCreatureTargetEffect( + new CreatureToken( + 4, 4, "blue Serpent with base power and toughness 4/4" + ).withColor("U").withSubType(SubType.SERPENT), + false, false, Duration.EndOfTurn + ).setRemoveSubtypes(true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + // Cycling {1} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{1}"))); + } + + private StartlingDevelopment(final StartlingDevelopment card) { + super(card); + } + + @Override + public StartlingDevelopment copy() { + return new StartlingDevelopment(this); + } +} diff --git a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java index 1264382dd3..af653af9a4 100644 --- a/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java +++ b/Mage.Sets/src/mage/sets/IkoriaLairOfBehemoths.java @@ -275,6 +275,7 @@ public final class IkoriaLairOfBehemoths extends ExpansionSet { cards.add(new SetCardInfo("Spontaneous Flight", 33, Rarity.COMMON, mage.cards.s.SpontaneousFlight.class)); cards.add(new SetCardInfo("Springjaw Trap", 241, Rarity.COMMON, mage.cards.s.SpringjawTrap.class)); cards.add(new SetCardInfo("Sprite Dragon", 211, Rarity.UNCOMMON, mage.cards.s.SpriteDragon.class)); + cards.add(new SetCardInfo("Startling Development", 68, Rarity.COMMON, mage.cards.s.StartlingDevelopment.class)); cards.add(new SetCardInfo("Sudden Spinnerets", 171, Rarity.COMMON, mage.cards.s.SuddenSpinnerets.class)); cards.add(new SetCardInfo("Suffocating Fumes", 100, Rarity.COMMON, mage.cards.s.SuffocatingFumes.class)); cards.add(new SetCardInfo("Survivors' Bond", 172, Rarity.COMMON, mage.cards.s.SurvivorsBond.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java index 07151c6fa4..dfcabb361b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java @@ -22,6 +22,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { protected boolean addStillALandText; protected boolean loseName; protected boolean keepAbilities; + protected boolean removeSubtypes = false; public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration) { @@ -41,7 +42,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { * @param duration */ public BecomesCreatureTargetEffect(Token token, boolean loseAllAbilities, boolean stillALand, Duration duration, boolean loseName, - boolean keepAbilities) { + boolean keepAbilities) { super(duration, Outcome.BecomeCreature); this.token = token; this.loseAllAbilities = loseAllAbilities; @@ -86,6 +87,9 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { permanent.getCardType().clear(); // remove all CardTypes permanent.getSubtype(game).addAll(token.getSubtype(game)); } else { + if (removeSubtypes) { + permanent.getSubtype(game).clear(); + } for (SubType t : token.getSubtype(game)) { if (!permanent.hasSubtype(t, game)) { permanent.getSubtype(game).add(t); @@ -149,6 +153,11 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { return result; } + public BecomesCreatureTargetEffect setRemoveSubtypes(boolean removeSubtypes) { + this.removeSubtypes = removeSubtypes; + return this; + } + @Override public boolean apply(Game game, Ability source) { return false;