mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[AFC] Implemented Minn, Wily Illusionist
This commit is contained in:
parent
70b040473b
commit
b72febb316
3 changed files with 148 additions and 0 deletions
99
Mage.Sets/src/mage/cards/m/MinnWilyIllusionist.java
Normal file
99
Mage.Sets/src/mage/cards/m/MinnWilyIllusionist.java
Normal file
|
@ -0,0 +1,99 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.common.DrawSecondCardTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterPermanentCard;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.MinnWilyIllusionistToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MinnWilyIllusionist extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterControlledCreaturePermanent(SubType.ILLUSION, "an Illusion you control");
|
||||
|
||||
public MinnWilyIllusionist(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.GNOME);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever you draw your second card each turn, create a 1/1 blue Illusion creature token with "This creature gets +1/+0 for each other Illusion you control."
|
||||
this.addAbility(new DrawSecondCardTriggeredAbility(
|
||||
new CreateTokenEffect(new MinnWilyIllusionistToken()), false
|
||||
));
|
||||
|
||||
// Whenever an Illusion you control dies, you may put a permanent card with mana value less than or equal to that creature's power from your hand onto the battlefield.
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new MinnWilyIllusionistEffect(), false, filter));
|
||||
}
|
||||
|
||||
private MinnWilyIllusionist(final MinnWilyIllusionist card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MinnWilyIllusionist copy() {
|
||||
return new MinnWilyIllusionist(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MinnWilyIllusionistEffect extends OneShotEffect {
|
||||
|
||||
MinnWilyIllusionistEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "you may put a permanent card with mana value less than or equal " +
|
||||
"to that creature's power from your hand onto the battlefield";
|
||||
}
|
||||
|
||||
private MinnWilyIllusionistEffect(final MinnWilyIllusionistEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MinnWilyIllusionistEffect copy() {
|
||||
return new MinnWilyIllusionistEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = (Permanent) getValue("creatureDied");
|
||||
if (player == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
FilterCard filterCard = new FilterPermanentCard(
|
||||
"permanent card with mana value "
|
||||
+ permanent.getPower().getValue() + " or less"
|
||||
);
|
||||
filterCard.add(new ManaValuePredicate(ComparisonType.FEWER_THAN, permanent.getPower().getValue() + 1));
|
||||
TargetCardInHand target = new TargetCardInHand(0, 1, filterCard);
|
||||
player.choose(Outcome.PutCardInPlay, player.getHand(), target, game);
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
return player.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
|
@ -144,6 +144,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Meteor Golem", 210, Rarity.UNCOMMON, mage.cards.m.MeteorGolem.class));
|
||||
cards.add(new SetCardInfo("Midnight Pathlighter", 52, Rarity.RARE, mage.cards.m.MidnightPathlighter.class));
|
||||
cards.add(new SetCardInfo("Mind Stone", 211, Rarity.UNCOMMON, mage.cards.m.MindStone.class));
|
||||
cards.add(new SetCardInfo("Minn, Wily Illusionist", 16, Rarity.RARE, mage.cards.m.MinnWilyIllusionist.class));
|
||||
cards.add(new SetCardInfo("Mishra's Factory", 248, Rarity.UNCOMMON, mage.cards.m.MishrasFactory.class));
|
||||
cards.add(new SetCardInfo("Moonsilver Spear", 212, Rarity.RARE, mage.cards.m.MoonsilverSpear.class));
|
||||
cards.add(new SetCardInfo("Mortuary Mire", 249, Rarity.COMMON, mage.cards.m.MortuaryMire.class));
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MinnWilyIllusionistToken extends TokenImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent(SubType.ILLUSION);
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter);
|
||||
|
||||
public MinnWilyIllusionistToken() {
|
||||
super("Illusion", "1/1 blue Illusion creature token with \"This creature gets +1/+0 for each other Illusion you control.\"");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlue(true);
|
||||
subtype.add(SubType.ILLUSION);
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
addAbility(new SimpleStaticAbility(new BoostSourceEffect(
|
||||
xValue, StaticValue.get(0), Duration.WhileOnBattlefield
|
||||
).setText("this creature gets +1/+0 for each other Illusion you control")));
|
||||
}
|
||||
|
||||
public MinnWilyIllusionistToken(final MinnWilyIllusionistToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public MinnWilyIllusionistToken copy() {
|
||||
return new MinnWilyIllusionistToken(this);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue