diff --git a/Mage.Sets/src/mage/cards/r/RydiaSummonerOfMist.java b/Mage.Sets/src/mage/cards/r/RydiaSummonerOfMist.java new file mode 100644 index 00000000000..9b91b5a8772 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RydiaSummonerOfMist.java @@ -0,0 +1,105 @@ +package mage.cards.r; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.ActivateAsSorceryActivatedAbility; +import mage.abilities.common.LandfallAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.GetXValue; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldWithCounterTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetadjustment.ManaValueTargetAdjuster; +import mage.target.targetpointer.FixedTarget; +import mage.util.CardUtil; + +import java.util.Optional; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RydiaSummonerOfMist extends CardImpl { + + private static final FilterCard filter = new FilterCard("Saga card with mana value X from your graveyard"); + + static { + filter.add(SubType.SAGA.getPredicate()); + } + + public RydiaSummonerOfMist(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SHAMAN); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Landfall -- Whenever a land you control enters, you may discard a card. If you do, draw a card. + this.addAbility(new LandfallAbility(new DoIfCostPaid( + new DrawCardSourceControllerEffect(1), new DiscardCardCost() + ))); + + // Summon -- {X}, {T}: Return target Saga card with mana value X from your graveyard to the battlefield with a finality counter on it. It gains haste until end of turn. Activate only as a sorcery. + Ability ability = new ActivateAsSorceryActivatedAbility(new RydiaSummonerOfMistEffect(), new ManaCostsImpl<>("{X}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + ability.setTargetAdjuster(new ManaValueTargetAdjuster(GetXValue.instance, ComparisonType.EQUAL_TO)); + this.addAbility(ability.withFlavorWord("Summon")); + } + + private RydiaSummonerOfMist(final RydiaSummonerOfMist card) { + super(card); + } + + @Override + public RydiaSummonerOfMist copy() { + return new RydiaSummonerOfMist(this); + } +} + +class RydiaSummonerOfMistEffect extends ReturnFromGraveyardToBattlefieldWithCounterTargetEffect { + + RydiaSummonerOfMistEffect() { + super(CounterType.FINALITY.createInstance()); + } + + private RydiaSummonerOfMistEffect(final RydiaSummonerOfMistEffect effect) { + super(effect); + } + + @Override + public RydiaSummonerOfMistEffect copy() { + return new RydiaSummonerOfMistEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + super.apply(game, source); + Optional.ofNullable(getTargetPointer().getFirst(game, source)) + .map(game::getCard) + .map(card -> CardUtil.getPermanentFromCardPutToBattlefield(card, game)) + .ifPresent(permanent -> game.addEffect( + new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn) + .setTargetPointer(new FixedTarget(permanent, game)), source)); + return true; + } + + @Override + public String getText(Mode mode) { + return super.getText(mode) + ". It gains haste until end of turn"; + } +} diff --git a/Mage.Sets/src/mage/sets/FinalFantasy.java b/Mage.Sets/src/mage/sets/FinalFantasy.java index 54151fec48b..1f7596d8caa 100644 --- a/Mage.Sets/src/mage/sets/FinalFantasy.java +++ b/Mage.Sets/src/mage/sets/FinalFantasy.java @@ -428,6 +428,8 @@ public final class FinalFantasy extends ExpansionSet { cards.add(new SetCardInfo("Rufus Shinra", 238, Rarity.UNCOMMON, mage.cards.r.RufusShinra.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Rufus Shinra", 503, Rarity.UNCOMMON, mage.cards.r.RufusShinra.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Rydia's Return", 198, Rarity.UNCOMMON, mage.cards.r.RydiasReturn.class)); + cards.add(new SetCardInfo("Rydia, Summoner of Mist", 239, Rarity.UNCOMMON, mage.cards.r.RydiaSummonerOfMist.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Rydia, Summoner of Mist", 504, Rarity.UNCOMMON, mage.cards.r.RydiaSummonerOfMist.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sabotender", 153, Rarity.COMMON, mage.cards.s.Sabotender.class)); cards.add(new SetCardInfo("Sage's Nouliths", 582, Rarity.COMMON, mage.cards.s.SagesNouliths.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Sage's Nouliths", 70, Rarity.COMMON, mage.cards.s.SagesNouliths.class, NON_FULL_USE_VARIOUS)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index a1dbb5f203c..5bb9740d7f5 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -57887,6 +57887,7 @@ Noctis, Prince of Lucis|Final Fantasy|235|R|{1}{W}{U}{B}|Legendary Creature - Hu Omega, Heartless Evolution|Final Fantasy|236|U|{5}{G}{U}|Legendary Artifact Creature - Robot|8|8|Wave Cannon -- When Omega enters, for each opponent, tap up to one target nonland permanent that opponent controls. Put X stun counters on each of those permanents and you gain X life, where X is the number of nonbasic lands you control.| Rinoa Heartilly|Final Fantasy|237|U|{3}{G}{W}|Legendary Creature - Human Rebel Warlock|4|4|When Rinoa Heartilly enters, create Angelo, a legendary 1/1 green and white Dog creature token.$Angelo Cannon -- Whenever Rinoa Heartilly attacks, another target creature you control gets +1/+1 until end of turn for each creature you control.| Rufus Shinra|Final Fantasy|238|U|{1}{W}{B}|Legendary Creature - Human Noble|2|4|Whenever Rufus Shinra attacks, if you don't control a creature named Darkstar, create Darkstar, a legendary 2/2 white and black Dog creature token.| +Rydia, Summoner of Mist|Final Fantasy|239|U|{R}{G}|Legendary Creature - Human Shaman|1|2|Landfall -- Whenever a land you control enters, you may discard a card. If you do, draw a card.$Summon -- {X}, {T}: Return target Saga card with mana value X from your graveyard to the battlefield with a finality counter on it. It gains haste until end of turn. Activate only as a sorcery.| Serah Farron|Final Fantasy|240|R|{1}{G}{W}|Legendary Creature - Human Citizen|2|2|The first legendary creature spell you cast each turn costs {2} less to cast.$At the beginning of combat on your turn, if you control two or more other legendary creatures, you may transform Serah Farron.| Crystallized Serah|Final Fantasy|240|R||Legendary Artifact|||The first legendary creature spell you cast each turn costs {2} less to cast.$Legendary creatures you control get +2/+2.| Shantotto, Tactician Magician|Final Fantasy|241|U|{1}{U}{R}|Legendary Creature - Dwarf Wizard|0|4|Whenever you cast a noncreature spell, Shantotto gets +X/+0 until end of turn, where X is the amount of mana spent to cast that spell. If X is 4 or more, draw a card.| @@ -58197,6 +58198,7 @@ Noctis, Prince of Lucis|Final Fantasy|500|R|{1}{W}{U}{B}|Legendary Creature - Hu Omega, Heartless Evolution|Final Fantasy|501|U|{5}{G}{U}|Legendary Artifact Creature - Robot|8|8|Wave Cannon -- When Omega enters, for each opponent, tap up to one target nonland permanent that opponent controls. Put X stun counters on each of those permanents and you gain X life, where X is the number of nonbasic lands you control.| Rinoa Heartilly|Final Fantasy|502|U|{3}{G}{W}|Legendary Creature - Human Rebel Warlock|4|4|When Rinoa Heartilly enters, create Angelo, a legendary 1/1 green and white Dog creature token.$Angelo Cannon -- Whenever Rinoa Heartilly attacks, another target creature you control gets +1/+1 until end of turn for each creature you control.| Rufus Shinra|Final Fantasy|503|U|{1}{W}{B}|Legendary Creature - Human Noble|2|4|Whenever Rufus Shinra attacks, if you don't control a creature named Darkstar, create Darkstar, a legendary 2/2 white and black Dog creature token.| +Rydia, Summoner of Mist|Final Fantasy|504|U|{R}{G}|Legendary Creature - Human Shaman|1|2|Landfall -- Whenever a land you control enters, you may discard a card. If you do, draw a card.$Summon -- {X}, {T}: Return target Saga card with mana value X from your graveyard to the battlefield with a finality counter on it. It gains haste until end of turn. Activate only as a sorcery.| Sephiroth, Planet's Heir|Final Fantasy|505|M|{4}{U}{B}|Legendary Creature - Human Avatar Soldier|4|4|Vigilance$When Sephiroth enters, creatures your opponents control get -2/-2 until end of turn.$Whenever a creature an opponent controls dies, put a +1/+1 counter on Sephiroth.| Serah Farron|Final Fantasy|506|R|{1}{G}{W}|Legendary Creature - Human Citizen|2|2|The first legendary creature spell you cast each turn costs {2} less to cast.$At the beginning of combat on your turn, if you control two or more other legendary creatures, you may transform Serah Farron.| Crystallized Serah|Final Fantasy|506|R||Legendary Artifact|||The first legendary creature spell you cast each turn costs {2} less to cast.$Legendary creatures you control get +2/+2.|