Skip to content

Commit cb829da

Browse files
committed
[FIN] Implement Stiltzkin, Moogle Merchant
1 parent 8e6c16d commit cb829da

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
package mage.cards.s;
2+
3+
import java.util.UUID;
4+
import mage.MageInt;
5+
import mage.constants.SubType;
6+
import mage.constants.SuperType;
7+
import mage.filter.StaticFilters;
8+
import mage.game.Game;
9+
import mage.game.permanent.Permanent;
10+
import mage.target.common.TargetControlledPermanent;
11+
import mage.target.common.TargetOpponent;
12+
import mage.target.targetpointer.FixedTarget;
13+
import mage.abilities.Ability;
14+
import mage.abilities.common.SimpleActivatedAbility;
15+
import mage.abilities.costs.common.TapSourceCost;
16+
import mage.abilities.costs.mana.GenericManaCost;
17+
import mage.abilities.effects.OneShotEffect;
18+
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
19+
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
20+
import mage.abilities.keyword.LifelinkAbility;
21+
import mage.cards.CardImpl;
22+
import mage.cards.CardSetInfo;
23+
import mage.constants.CardType;
24+
import mage.constants.Duration;
25+
import mage.constants.Outcome;
26+
27+
/**
28+
* @author balazskristof
29+
*/
30+
public final class StiltzkinMoogleMerchant extends CardImpl {
31+
32+
public StiltzkinMoogleMerchant(UUID ownerId, CardSetInfo setInfo) {
33+
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
34+
35+
this.supertype.add(SuperType.LEGENDARY);
36+
this.subtype.add(SubType.MOOGLE);
37+
this.power = new MageInt(1);
38+
this.toughness = new MageInt(2);
39+
40+
// Lifelink
41+
this.addAbility(LifelinkAbility.getInstance());
42+
43+
// {2}, {T}: Target opponent gains control of another target permanent you control. If they do, you draw a card.
44+
Ability ability = new SimpleActivatedAbility(new StiltzkinMoogleMerchantEffect(), new GenericManaCost(2));
45+
ability.addCost(new TapSourceCost());
46+
ability.addTarget(new TargetOpponent());
47+
ability.addTarget(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_ANOTHER_PERMANENT));
48+
this.addAbility(ability);
49+
}
50+
51+
private StiltzkinMoogleMerchant(final StiltzkinMoogleMerchant card) {
52+
super(card);
53+
}
54+
55+
@Override
56+
public StiltzkinMoogleMerchant copy() {
57+
return new StiltzkinMoogleMerchant(this);
58+
}
59+
}
60+
61+
class StiltzkinMoogleMerchantEffect extends OneShotEffect {
62+
63+
StiltzkinMoogleMerchantEffect() {
64+
super(Outcome.Benefit);
65+
staticText = "Target opponent gains control of another target permanent you control. If they do, you draw a card.";
66+
}
67+
68+
private StiltzkinMoogleMerchantEffect(StiltzkinMoogleMerchantEffect effect) {
69+
super(effect);
70+
}
71+
72+
@Override
73+
public StiltzkinMoogleMerchantEffect copy() {
74+
return new StiltzkinMoogleMerchantEffect(this);
75+
}
76+
77+
@Override
78+
public boolean apply(Game game, Ability source) {
79+
Permanent permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
80+
if (permanent == null) {
81+
return false;
82+
}
83+
UUID opponent = getTargetPointer().getFirst(game, source);
84+
game.addEffect(new GainControlTargetEffect(
85+
Duration.Custom, true, opponent
86+
).setTargetPointer(new FixedTarget(permanent.getId(), game)), source);
87+
game.processAction();
88+
if (permanent.isControlledBy(opponent)) {
89+
new DrawCardSourceControllerEffect(1).apply(game, source);
90+
return true;
91+
}
92+
return false;
93+
}
94+
}
95+

Mage.Sets/src/mage/sets/FinalFantasy.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ private FinalFantasy() {
2626
cards.add(new SetCardInfo("Sin, Spira's Punishment", 242, Rarity.RARE, mage.cards.s.SinSpirasPunishment.class, NON_FULL_USE_VARIOUS));
2727
cards.add(new SetCardInfo("Sin, Spira's Punishment", 348, Rarity.RARE, mage.cards.s.SinSpirasPunishment.class, NON_FULL_USE_VARIOUS));
2828
cards.add(new SetCardInfo("Sin, Spira's Punishment", 508, Rarity.RARE, mage.cards.s.SinSpirasPunishment.class, NON_FULL_USE_VARIOUS));
29+
cards.add(new SetCardInfo("Stiltzkin, Moogle Merchant", 34, Rarity.RARE, mage.cards.s.StiltzkinMoogleMerchant.class, NON_FULL_USE_VARIOUS));
30+
cards.add(new SetCardInfo("Stiltzkin, Moogle Merchant", 327, Rarity.RARE, mage.cards.s.StiltzkinMoogleMerchant.class, NON_FULL_USE_VARIOUS));
2931
cards.add(new SetCardInfo("Summon: Shiva", 78, Rarity.UNCOMMON, mage.cards.s.SummonShiva.class));
3032
cards.add(new SetCardInfo("Tonberry", 122, Rarity.UNCOMMON, mage.cards.t.Tonberry.class));
3133
}

Mage/src/main/java/mage/constants/SubType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ public enum SubType {
274274
MONGOOSE("Mongoose", SubTypeSet.CreatureType),
275275
MONK("Monk", SubTypeSet.CreatureType),
276276
MONKEY("Monkey", SubTypeSet.CreatureType),
277+
MOOGLE("Moogle", SubTypeSet.CreatureType),
277278
MOONFOLK("Moonfolk", SubTypeSet.CreatureType),
278279
MOUNT("Mount", SubTypeSet.CreatureType),
279280
MOUSE("Mouse", SubTypeSet.CreatureType),

0 commit comments

Comments
 (0)