From 89b5678cf45aaca38fbe7bd81e05bdf058375921 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 31 Jan 2022 08:35:03 -0500 Subject: [PATCH] [NEO] Implemented Life of Toshiro Umezawa / Memory of Toshiro --- .../mage/cards/l/LifeOfToshiroUmezawa.java | 62 +++++++++++++++++++ .../src/mage/cards/m/MemoryOfToshiro.java | 45 ++++++++++++++ .../src/mage/sets/KamigawaNeonDynasty.java | 2 + .../mage/abilities/common/SagaAbility.java | 9 ++- 4 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/l/LifeOfToshiroUmezawa.java create mode 100644 Mage.Sets/src/mage/cards/m/MemoryOfToshiro.java diff --git a/Mage.Sets/src/mage/cards/l/LifeOfToshiroUmezawa.java b/Mage.Sets/src/mage/cards/l/LifeOfToshiroUmezawa.java new file mode 100644 index 0000000000..1a1f049cdf --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LifeOfToshiroUmezawa.java @@ -0,0 +1,62 @@ +package mage.cards.l; + +import mage.abilities.Mode; +import mage.abilities.common.SagaAbility; +import mage.abilities.effects.Effects; +import mage.abilities.effects.common.ExileSagaAndReturnTransformedEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SagaChapter; +import mage.constants.SubType; +import mage.target.Targets; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class LifeOfToshiroUmezawa extends CardImpl { + + public LifeOfToshiroUmezawa(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + + this.subtype.add(SubType.SAGA); + this.secondSideCardClazz = mage.cards.m.MemoryOfToshiro.class; + + // (As this Saga enters and after your draw step, add a lore counter.) + SagaAbility sagaAbility = new SagaAbility(this); + + // I, II — Choose one — + // • Target creature gets +2/+2 until end of turn. + // • Target creature gets -1/-1 until end of turn. + // • You gain 2 life. + Mode mode = new Mode(new BoostTargetEffect(-1, -1)); + mode.addTarget(new TargetCreaturePermanent()); + sagaAbility.addChapterEffect( + this, SagaChapter.CHAPTER_I, SagaChapter.CHAPTER_II, + new Effects(new BoostTargetEffect(2, 2)), + new Targets(new TargetCreaturePermanent()), false, + mode, new Mode(new GainLifeEffect(2)) + ); + + // 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 LifeOfToshiroUmezawa(final LifeOfToshiroUmezawa card) { + super(card); + } + + @Override + public LifeOfToshiroUmezawa copy() { + return new LifeOfToshiroUmezawa(this); + } +} diff --git a/Mage.Sets/src/mage/cards/m/MemoryOfToshiro.java b/Mage.Sets/src/mage/cards/m/MemoryOfToshiro.java new file mode 100644 index 0000000000..31ad7b2995 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MemoryOfToshiro.java @@ -0,0 +1,45 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.mana.ConditionalColoredManaAbility; +import mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MemoryOfToshiro extends CardImpl { + + public MemoryOfToshiro(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, ""); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SAMURAI); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + this.color.setBlack(true); + this.nightCard = true; + + // {T}, Pay 1 life: Add {B}. Spend this mana only to cast an instant or sorcery spell. + Ability ability = new ConditionalColoredManaAbility(Mana.BlackMana(1), new InstantOrSorcerySpellManaBuilder()); + ability.addCost(new PayLifeCost(1)); + this.addAbility(ability); + } + + private MemoryOfToshiro(final MemoryOfToshiro card) { + super(card); + } + + @Override + public MemoryOfToshiro copy() { + return new MemoryOfToshiro(this); + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 0921f2ccc9..680e2d024b 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -59,8 +59,10 @@ public final class KamigawaNeonDynasty extends ExpansionSet { 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)); + cards.add(new SetCardInfo("Life of Toshiro Umezawa", 108, Rarity.UNCOMMON, mage.cards.l.LifeOfToshiroUmezawa.class)); cards.add(new SetCardInfo("Lion Sash", 26, Rarity.RARE, mage.cards.l.LionSash.class)); cards.add(new SetCardInfo("Lizard Blades", 153, Rarity.RARE, mage.cards.l.LizardBlades.class)); + cards.add(new SetCardInfo("Memory of Toshiro", 108, Rarity.UNCOMMON, mage.cards.m.MemoryOfToshiro.class)); cards.add(new SetCardInfo("Michiko's Reign of Truth", 29, Rarity.UNCOMMON, mage.cards.m.MichikosReignOfTruth.class)); cards.add(new SetCardInfo("Mountain", 299, Rarity.LAND, mage.cards.basiclands.Mountain.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Nameless Conqueror", 162, Rarity.COMMON, mage.cards.n.NamelessConqueror.class)); diff --git a/Mage/src/main/java/mage/abilities/common/SagaAbility.java b/Mage/src/main/java/mage/abilities/common/SagaAbility.java index cf64bd766e..8182325dce 100644 --- a/Mage/src/main/java/mage/abilities/common/SagaAbility.java +++ b/Mage/src/main/java/mage/abilities/common/SagaAbility.java @@ -1,6 +1,7 @@ package mage.abilities.common; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.TriggeredAbility; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.effects.Effect; @@ -75,10 +76,9 @@ public class SagaAbility extends SimpleStaticAbility { addChapterEffect(card, fromChapter, toChapter, effects, targets, false); } - public void addChapterEffect(Card card, SagaChapter fromChapter, SagaChapter toChapter, Effects effects, Targets targets, boolean optional) { - ChapterTriggeredAbility ability; + public void addChapterEffect(Card card, SagaChapter fromChapter, SagaChapter toChapter, Effects effects, Targets targets, boolean optional, Mode... modes) { for (int i = fromChapter.getNumber(); i <= toChapter.getNumber(); i++) { - ability = new ChapterTriggeredAbility(null, SagaChapter.getChapter(i), toChapter, optional); + ChapterTriggeredAbility ability = new ChapterTriggeredAbility(null, SagaChapter.getChapter(i), toChapter, optional); for (Effect effect : effects) { if (effect != null) { ability.addEffect(effect.copy()); @@ -89,6 +89,9 @@ public class SagaAbility extends SimpleStaticAbility { ability.addTarget(target.copy()); } } + for (Mode mode : modes) { + ability.addMode(mode.copy()); + } if (i > fromChapter.getNumber()) { ability.setRuleVisible(false); }