diff --git a/Mage.Sets/src/mage/cards/k/KirinTouchedOrochi.java b/Mage.Sets/src/mage/cards/k/KirinTouchedOrochi.java new file mode 100644 index 0000000000..77aa764a2c --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KirinTouchedOrochi.java @@ -0,0 +1,134 @@ +package mage.cards.k; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.Card; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.counters.CounterType; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterNoncreatureCard; +import mage.game.Game; +import mage.game.permanent.token.SpiritToken; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class KirinTouchedOrochi extends CardImpl { + + private static final FilterCreatureCard filter = new FilterCreatureCard("creature card from a graveyard"); + private static final FilterNoncreatureCard filter2 = new FilterNoncreatureCard("noncreature card from a graveyard"); + + public KirinTouchedOrochi(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, ""); + + this.subtype.add(SubType.SNAKE); + this.subtype.add(SubType.MONK); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + this.color.setGreen(true); + this.nightCard = true; + + // Whenever Kirin-Touched Orochi attacks, choose one — + // • Exile target creature card from a graveyard. When you do, create a 1/1 colorless Spirit creature token. + Ability ability = new AttacksTriggeredAbility(new KirinTouchedOrochiTokenEffect()); + ability.addTarget(new TargetCardInGraveyard(filter)); + + // • Exile target noncreature card from a graveyard. When you do, put a +1/+1 counter on target creature you control. + Mode mode = new Mode(new KirinTouchedOrochiCounterEffect()); + mode.addTarget(new TargetCardInGraveyard(filter2)); + ability.addMode(mode); + this.addAbility(ability); + } + + private KirinTouchedOrochi(final KirinTouchedOrochi card) { + super(card); + } + + @Override + public KirinTouchedOrochi copy() { + return new KirinTouchedOrochi(this); + } +} + +class KirinTouchedOrochiTokenEffect extends OneShotEffect { + + public KirinTouchedOrochiTokenEffect() { + super(Outcome.Exile); + this.staticText = "Exile target creature card from a graveyard. When you do, create a 1/1 colorless Spirit creature token"; + } + + private KirinTouchedOrochiTokenEffect(final KirinTouchedOrochiTokenEffect effect) { + super(effect); + } + + @Override + public KirinTouchedOrochiTokenEffect copy() { + return new KirinTouchedOrochiTokenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + UUID targetId = source.getFirstTarget(); + Card card = game.getCard(targetId); + if (controller == null || card == null || game.getState().getZone(targetId) != Zone.GRAVEYARD) { + return false; + } + if (!controller.moveCards(card, Zone.EXILED, source, game)) { + return false; + } + ReflexiveTriggeredAbility reflexiveTokenAbility = new ReflexiveTriggeredAbility(new CreateTokenEffect(new SpiritToken()), false); + game.fireReflexiveTriggeredAbility(reflexiveTokenAbility, source); + return true; + } +} + +class KirinTouchedOrochiCounterEffect extends OneShotEffect { + + public KirinTouchedOrochiCounterEffect() { + super(Outcome.Exile); + this.staticText = "Exile target noncreature card from a graveyard. When you do, put a +1/+1 counter on target creature you control"; + } + + private KirinTouchedOrochiCounterEffect(final KirinTouchedOrochiCounterEffect effect) { + super(effect); + } + + @Override + public KirinTouchedOrochiCounterEffect copy() { + return new KirinTouchedOrochiCounterEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + UUID targetId = source.getFirstTarget(); + Card card = game.getCard(targetId); + if (controller == null || card == null || game.getState().getZone(targetId) != Zone.GRAVEYARD) { + return false; + } + if (!controller.moveCards(card, Zone.EXILED, source, game)) { + return false; + } + ReflexiveTriggeredAbility reflexiveCounterAbility = new ReflexiveTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), false); + reflexiveCounterAbility.addTarget(new TargetControlledCreaturePermanent()); + game.fireReflexiveTriggeredAbility(reflexiveCounterAbility, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/t/TeachingsOfTheKirin.java b/Mage.Sets/src/mage/cards/t/TeachingsOfTheKirin.java new file mode 100644 index 0000000000..7b0d51758c --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TeachingsOfTheKirin.java @@ -0,0 +1,62 @@ +package mage.cards.t; + +import java.util.UUID; + +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.ExileSagaAndReturnTransformedEffect; +import mage.abilities.effects.common.MillCardsControllerEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.keyword.TransformAbility; +import mage.constants.SagaChapter; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.counters.CounterType; +import mage.game.permanent.token.SpiritToken; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author weirddan455 + */ +public final class TeachingsOfTheKirin extends CardImpl { + + public TeachingsOfTheKirin(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + + this.subtype.add(SubType.SAGA); + this.secondSideCardClazz = mage.cards.k.KirinTouchedOrochi.class; + + // (As this Saga enters and after your draw step, add a lore counter.) + SagaAbility sagaAbility = new SagaAbility(this); + + // I - Mill three cards. Create a 1/1 colorless Spirit creature token. + sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_I, + new MillCardsControllerEffect(3), + new CreateTokenEffect(new SpiritToken()) + ); + + // II — Put a +1/+1 counter on target creature you control. + sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_II, SagaChapter.CHAPTER_II, + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), + new TargetControlledCreaturePermanent() + ); + + // III — Exile this Saga, then return it to the battlefield transformed under your control. + this.addAbility(new TransformAbility()); + sagaAbility.addChapterEffect(this, SagaChapter.CHAPTER_III, new ExileSagaAndReturnTransformedEffect()); + + this.addAbility(sagaAbility); + } + + private TeachingsOfTheKirin(final TeachingsOfTheKirin card) { + super(card); + } + + @Override + public TeachingsOfTheKirin copy() { + return new TeachingsOfTheKirin(this); + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 1d662bb0c0..6f6a9d6cdd 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -87,6 +87,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Kairi, the Swirling Sky", 60, Rarity.MYTHIC, mage.cards.k.KairiTheSwirlingSky.class)); cards.add(new SetCardInfo("Kaito Shizuki", 226, Rarity.MYTHIC, mage.cards.k.KaitoShizuki.class)); cards.add(new SetCardInfo("Kappa Tech-Wrecker", 198, Rarity.UNCOMMON, mage.cards.k.KappaTechWrecker.class)); + cards.add(new SetCardInfo("Kirin-Touched Orochi", 212, Rarity.RARE, mage.cards.k.KirinTouchedOrochi.class)); cards.add(new SetCardInfo("Kodama of the West Tree", 199, Rarity.MYTHIC, mage.cards.k.KodamaOfTheWestTree.class)); cards.add(new SetCardInfo("Kyodai, Soul of Kamigawa", 23, Rarity.RARE, mage.cards.k.KyodaiSoulOfKamigawa.class)); cards.add(new SetCardInfo("Leech Gauntlet", 106, Rarity.UNCOMMON, mage.cards.l.LeechGauntlet.class)); @@ -132,6 +133,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Swamp", 287, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Takenuma, Abandoned Mire", 278, Rarity.RARE, mage.cards.t.TakenumaAbandonedMire.class)); cards.add(new SetCardInfo("Tamiyo's Compleation", 83, Rarity.COMMON, mage.cards.t.TamiyosCompleation.class)); + cards.add(new SetCardInfo("Teachings of the Kirin", 212, Rarity.RARE, mage.cards.t.TeachingsOfTheKirin.class)); cards.add(new SetCardInfo("Tempered in Solitude", 165, Rarity.UNCOMMON, mage.cards.t.TemperedInSolitude.class)); cards.add(new SetCardInfo("The Fall of Lord Konda", 12, Rarity.UNCOMMON, mage.cards.t.TheFallOfLordKonda.class)); cards.add(new SetCardInfo("The Modern Age", 66, Rarity.COMMON, mage.cards.t.TheModernAge.class));