[FIN] Implement Stiltzkin, Moogle Merchant (#13443)

This commit is contained in:
Balázs Kristóf 2025-04-05 20:13:23 +02:00 committed by GitHub
parent cdebbe151b
commit 6f524b69c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,95 @@
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetOpponent;
import mage.target.targetpointer.FixedTarget;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
/**
* @author balazskristof
*/
public final class StiltzkinMoogleMerchant extends CardImpl {
public StiltzkinMoogleMerchant(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.MOOGLE);
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// Lifelink
this.addAbility(LifelinkAbility.getInstance());
// {2}, {T}: Target opponent gains control of another target permanent you control. If they do, you draw a card.
Ability ability = new SimpleActivatedAbility(new StiltzkinMoogleMerchantEffect(), new GenericManaCost(2));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetOpponent());
ability.addTarget(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_PERMANENT));
this.addAbility(ability);
}
private StiltzkinMoogleMerchant(final StiltzkinMoogleMerchant card) {
super(card);
}
@Override
public StiltzkinMoogleMerchant copy() {
return new StiltzkinMoogleMerchant(this);
}
}
class StiltzkinMoogleMerchantEffect extends OneShotEffect {
StiltzkinMoogleMerchantEffect() {
super(Outcome.Benefit);
staticText = "Target opponent gains control of another target permanent you control. If they do, you draw a card.";
}
private StiltzkinMoogleMerchantEffect(StiltzkinMoogleMerchantEffect effect) {
super(effect);
}
@Override
public StiltzkinMoogleMerchantEffect copy() {
return new StiltzkinMoogleMerchantEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (permanent == null) {
return false;
}
UUID opponent = getTargetPointer().getFirst(game, source);
game.addEffect(new GainControlTargetEffect(
Duration.Custom, true, opponent
).setTargetPointer(new FixedTarget(permanent.getId(), game)), source);
game.processAction();
if (permanent.isControlledBy(opponent)) {
new DrawCardSourceControllerEffect(1).apply(game, source);
return true;
}
return false;
}
}

View file

@ -26,6 +26,8 @@ public final class FinalFantasy extends ExpansionSet {
cards.add(new SetCardInfo("Sin, Spira's Punishment", 242, Rarity.RARE, mage.cards.s.SinSpirasPunishment.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Sin, Spira's Punishment", 348, Rarity.RARE, mage.cards.s.SinSpirasPunishment.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Sin, Spira's Punishment", 508, Rarity.RARE, mage.cards.s.SinSpirasPunishment.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Stiltzkin, Moogle Merchant", 34, Rarity.RARE, mage.cards.s.StiltzkinMoogleMerchant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Stiltzkin, Moogle Merchant", 327, Rarity.RARE, mage.cards.s.StiltzkinMoogleMerchant.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Summon: Shiva", 78, Rarity.UNCOMMON, mage.cards.s.SummonShiva.class));
cards.add(new SetCardInfo("Tonberry", 122, Rarity.UNCOMMON, mage.cards.t.Tonberry.class));
}

View file

@ -274,6 +274,7 @@ public enum SubType {
MONGOOSE("Mongoose", SubTypeSet.CreatureType),
MONK("Monk", SubTypeSet.CreatureType),
MONKEY("Monkey", SubTypeSet.CreatureType),
MOOGLE("Moogle", SubTypeSet.CreatureType),
MOONFOLK("Moonfolk", SubTypeSet.CreatureType),
MOUNT("Mount", SubTypeSet.CreatureType),
MOUSE("Mouse", SubTypeSet.CreatureType),