From 326772398664c091920ffe0149377083e8f87679 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 23 Apr 2025 13:50:53 -0400 Subject: [PATCH] [WHO] Implement Blink --- Mage.Sets/src/mage/cards/b/Blink.java | 89 +++++++++++++++++++ Mage.Sets/src/mage/sets/DoctorWho.java | 4 +- .../game/permanent/token/AlienAngelToken.java | 72 +++++++++++++++ 3 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/b/Blink.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/AlienAngelToken.java diff --git a/Mage.Sets/src/mage/cards/b/Blink.java b/Mage.Sets/src/mage/cards/b/Blink.java new file mode 100644 index 00000000000..13b72066c3e --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/Blink.java @@ -0,0 +1,89 @@ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.keyword.InvestigateEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SagaChapter; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.AlienAngelToken; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Blink extends CardImpl { + + public Blink(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{B}"); + + this.subtype.add(SubType.SAGA); + + // (As this Saga enters and after your draw step, add a lore counter. Sacrifice after IV.) + SagaAbility sagaAbility = new SagaAbility(this, SagaChapter.CHAPTER_IV); + + // I, III -- Choose target creature. Its owner shuffles it into their library, then investigates. + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II, + new BlinkEffect(), new TargetCreaturePermanent() + ); + + // II, IV -- Create a 2/2 black Alien Angel artifact creature token with first strike, vigilance, and "Whenever an opponent casts a creature spell, this permanent isn't a creature until end of turn." + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_III, SagaChapter.CHAPTER_IV, + new CreateTokenEffect(new AlienAngelToken()) + ); + this.addAbility(sagaAbility); + } + + private Blink(final Blink card) { + super(card); + } + + @Override + public Blink copy() { + return new Blink(this); + } +} + +class BlinkEffect extends OneShotEffect { + + BlinkEffect() { + super(Outcome.Benefit); + staticText = "choose target creature. Its owner shuffles it into their library, then investigates"; + } + + private BlinkEffect(final BlinkEffect effect) { + super(effect); + } + + @Override + public BlinkEffect copy() { + return new BlinkEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent == null) { + return false; + } + Player player = game.getPlayer(permanent.getOwnerId()); + if (player == null) { + return false; + } + player.shuffleCardsToLibrary(permanent, game, source); + InvestigateEffect.doInvestigate(player.getId(), 1, game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index c7bac1779a6..1ccc665efe1 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -103,8 +103,8 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Blasphemous Act", 224, Rarity.RARE, mage.cards.b.BlasphemousAct.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Blasphemous Act", 472, Rarity.RARE, mage.cards.b.BlasphemousAct.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Blasphemous Act", 815, Rarity.RARE, mage.cards.b.BlasphemousAct.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Blink", 116, Rarity.RARE, mage.cards.b.Blink.class, NON_FULL_USE_VARIOUS)); - //cards.add(new SetCardInfo("Blink", 721, Rarity.RARE, mage.cards.b.Blink.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Blink", 116, Rarity.RARE, mage.cards.b.Blink.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Blink", 721, Rarity.RARE, mage.cards.b.Blink.class, NON_FULL_USE_VARIOUS)); //cards.add(new SetCardInfo("Bowie Base One", 571, Rarity.COMMON, mage.cards.b.BowieBaseOne.class)); cards.add(new SetCardInfo("Canopy Vista", 1072, Rarity.RARE, mage.cards.c.CanopyVista.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Canopy Vista", 258, Rarity.RARE, mage.cards.c.CanopyVista.class, NON_FULL_USE_VARIOUS)); diff --git a/Mage/src/main/java/mage/game/permanent/token/AlienAngelToken.java b/Mage/src/main/java/mage/game/permanent/token/AlienAngelToken.java new file mode 100644 index 00000000000..c871d9e464a --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/AlienAngelToken.java @@ -0,0 +1,72 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.ContinuousEffectImpl; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.constants.*; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * @author TheElk801 + */ +public final class AlienAngelToken extends TokenImpl { + + public AlienAngelToken() { + super("Alien Angel Token", "2/2 black Alien Angel artifact creature token with first strike, vigilance, and \"Whenever an opponent casts a creature spell, this token isn't a creature until end of turn.\""); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + color.setBlack(true); + subtype.add(SubType.ALIEN); + subtype.add(SubType.ANGEL); + power = new MageInt(2); + toughness = new MageInt(2); + + addAbility(FirstStrikeAbility.getInstance()); + addAbility(VigilanceAbility.getInstance()); + addAbility(new SpellCastOpponentTriggeredAbility( + new AlienAngelTokenEffect(), StaticFilters.FILTER_SPELL_A_CREATURE, false + )); + } + + private AlienAngelToken(final AlienAngelToken token) { + super(token); + } + + public AlienAngelToken copy() { + return new AlienAngelToken(this); + } +} + +class AlienAngelTokenEffect extends ContinuousEffectImpl { + + AlienAngelTokenEffect() { + super(Duration.EndOfTurn, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.UnboostCreature); + staticText = "this token isn't a creature until end of turn"; + } + + private AlienAngelTokenEffect(final AlienAngelTokenEffect effect) { + super(effect); + } + + @Override + public AlienAngelTokenEffect copy() { + return new AlienAngelTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + if (permanent == null) { + discard(); + return false; + } + permanent.removeAllSubTypes(game, SubTypeSet.CreatureType); + permanent.removeCardType(game, CardType.CREATURE); + return true; + } +}