From 5845630af9dac46348152863465e0532320bf157 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Fri, 17 Dec 2021 18:45:39 -0500 Subject: [PATCH] [NEO] Implemented Kaito Shizuki --- Mage.Sets/src/mage/cards/k/KaitoShizuki.java | 90 +++++++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 1 + .../src/main/java/mage/constants/SubType.java | 1 + .../command/emblems/KaitoShizukiEmblem.java | 39 ++++++++ .../mage/game/permanent/token/NinjaToken.java | 35 ++++++++ 5 files changed, 166 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KaitoShizuki.java create mode 100644 Mage/src/main/java/mage/game/command/emblems/KaitoShizukiEmblem.java create mode 100644 Mage/src/main/java/mage/game/permanent/token/NinjaToken.java diff --git a/Mage.Sets/src/mage/cards/k/KaitoShizuki.java b/Mage.Sets/src/mage/cards/k/KaitoShizuki.java new file mode 100644 index 0000000000..55f0322f2c --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KaitoShizuki.java @@ -0,0 +1,90 @@ +package mage.cards.k; + +import mage.abilities.Ability; +import mage.abilities.LoyaltyAbility; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.RaidCondition; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.GetEmblemEffect; +import mage.abilities.effects.common.PhaseOutSourceEffect; +import mage.abilities.effects.common.discard.DiscardControllerEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.abilities.hint.common.RaidHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.command.emblems.KaitoShizukiEmblem; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.NinjaToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class KaitoShizuki extends CardImpl { + + private static final Hint hint = new ConditionHint( + KaitoShizukiCondition.instance, "This permanent entered the battlefield this turn" + ); + private static final Condition condition = new InvertCondition(RaidCondition.instance); + + public KaitoShizuki(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{U}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.KAITO); + this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3)); + + // At the beginning of your end step, if Kaito Shizuki entered the battlefield this turn, he phases out. + this.addAbility(new BeginningOfEndStepTriggeredAbility( + Zone.BATTLEFIELD, new PhaseOutSourceEffect().setText("he phases out"), + TargetController.YOU, KaitoShizukiCondition.instance, false + ).addHint(hint)); + + // +1: Draw a card. Then discard a card unless you attacked this turn. + Ability ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1); + ability.addEffect(new ConditionalOneShotEffect( + new DiscardControllerEffect(1), condition, + "Then discard a card unless you attacked this turn" + )); + this.addAbility(ability.addHint(RaidHint.instance)); + + // −2: Create a 1/1 blue Ninja creature token with "This creature can't be blocked." + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new NinjaToken()), -2)); + + // −7: You get an emblem with "Whenever a creature you control deals combat damage to a player, search your library for a blue or black creature card, put it onto the battlefield, then shuffle." + this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new KaitoShizukiEmblem()), -7)); + } + + private KaitoShizuki(final KaitoShizuki card) { + super(card); + } + + @Override + public KaitoShizuki copy() { + return new KaitoShizuki(this); + } +} + +enum KaitoShizukiCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + return permanent != null && permanent.getTurnsOnBattlefield() == 0; + } + + @Override + public String toString() { + return "if {this} entered the battlefield this turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 8a88031678..446f258989 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -24,6 +24,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Atsushi, the Blazing Sky", 134, Rarity.MYTHIC, mage.cards.a.AtsushiTheBlazingSky.class)); cards.add(new SetCardInfo("Forest", 301, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Island", 295, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS)); + cards.add(new SetCardInfo("Kaito Shizuki", 226, Rarity.MYTHIC, mage.cards.k.KaitoShizuki.class)); cards.add(new SetCardInfo("Mountain", 299, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Plains", 293, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Swamp", 297, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS)); diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index c684e9ee5a..31cb8739ff 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -427,6 +427,7 @@ public enum SubType { HUATLI("Huatli", SubTypeSet.PlaneswalkerType), JACE("Jace", SubTypeSet.PlaneswalkerType), JESKA("Jeska", SubTypeSet.PlaneswalkerType), + KAITO("Kaito", SubTypeSet.PlaneswalkerType), KARN("Karn", SubTypeSet.PlaneswalkerType), KASMINA("Kasmina", SubTypeSet.PlaneswalkerType), KAYA("Kaya", SubTypeSet.PlaneswalkerType), diff --git a/Mage/src/main/java/mage/game/command/emblems/KaitoShizukiEmblem.java b/Mage/src/main/java/mage/game/command/emblems/KaitoShizukiEmblem.java new file mode 100644 index 0000000000..5ef5421733 --- /dev/null +++ b/Mage/src/main/java/mage/game/command/emblems/KaitoShizukiEmblem.java @@ -0,0 +1,39 @@ +package mage.game.command.emblems; + +import mage.ObjectColor; +import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.constants.SetTargetPointer; +import mage.filter.FilterCard; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.command.Emblem; +import mage.target.common.TargetCardInLibrary; + +/** + * @author TheElk801 + */ +public final class KaitoShizukiEmblem extends Emblem { + + private static final FilterCard filter = new FilterCreatureCard("a blue or black creature card"); + + static { + filter.add(Predicates.or( + new ColorPredicate(ObjectColor.BLUE), + new ColorPredicate(ObjectColor.BLACK) + )); + } + + // −7: You get an emblem with "Whenever a creature you control deals combat damage to a player, search your library for a blue or black creature card, put it onto the battlefield, then shuffle." + public KaitoShizukiEmblem() { + this.setName("Emblem Kaito"); + this.setExpansionSetCodeForImage("NEO"); + this.getAbilities().add(new DealsDamageToAPlayerAllTriggeredAbility( + new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), + StaticFilters.FILTER_CONTROLLED_A_CREATURE, false, + SetTargetPointer.NONE, true + )); + } +} diff --git a/Mage/src/main/java/mage/game/permanent/token/NinjaToken.java b/Mage/src/main/java/mage/game/permanent/token/NinjaToken.java new file mode 100644 index 0000000000..c877036d55 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/NinjaToken.java @@ -0,0 +1,35 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.Arrays; + +/** + * @author TheElk801 + */ +public final class NinjaToken extends TokenImpl { + + public NinjaToken() { + super("Ninja Token", "1/1 blue Ninja creature token with \"This creature can't be blocked.\""); + cardType.add(CardType.CREATURE); + color.setBlue(true); + subtype.add(SubType.NINJA); + power = new MageInt(1); + toughness = new MageInt(1); + + this.addAbility(new SimpleStaticAbility(new CantBeBlockedSourceEffect().setText("this creature can't be blocked"))); + availableImageSetCodes = Arrays.asList("NEO"); + } + + private NinjaToken(final NinjaToken token) { + super(token); + } + + public NinjaToken copy() { + return new NinjaToken(this); + } +}