forked from External/mage
Implemented Metathran Aerostat
This commit is contained in:
parent
6d84b32448
commit
c5f5afb7e8
3 changed files with 87 additions and 1 deletions
85
Mage.Sets/src/mage/cards/m/MetathranAerostat.java
Normal file
85
Mage.Sets/src/mage/cards/m/MetathranAerostat.java
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PutCardFromHandOntoBattlefieldEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.constants.SubType;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MetathranAerostat extends CardImpl {
|
||||
|
||||
public MetathranAerostat(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
|
||||
|
||||
this.subtype.add(SubType.METATHRAN);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// {X}{U}: You may put a creature card with converted mana cost X from your hand onto the battlefield. If you do, return Metathran Aerostat to its owner's hand.
|
||||
this.addAbility(new SimpleActivatedAbility(new MetathranAerostatEffect(), new ManaCostsImpl("{X}{U}")));
|
||||
}
|
||||
|
||||
public MetathranAerostat(final MetathranAerostat card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MetathranAerostat copy() {
|
||||
return new MetathranAerostat(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MetathranAerostatEffect extends OneShotEffect {
|
||||
|
||||
public MetathranAerostatEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "You may put a creature card with converted mana cost "
|
||||
+ "X from your hand onto the battlefield. "
|
||||
+ "If you do, return {this} to its owner's hand";
|
||||
}
|
||||
|
||||
public MetathranAerostatEffect(final MetathranAerostatEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MetathranAerostatEffect copy() {
|
||||
return new MetathranAerostatEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int xValue = source.getManaCostsToPay().getX();
|
||||
FilterCreatureCard filter = new FilterCreatureCard("a creature with converted mana cost " + xValue);
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, xValue));
|
||||
if (new PutCardFromHandOntoBattlefieldEffect(filter).apply(game, source)) {
|
||||
return new ReturnToHandSourceEffect(true).apply(game, source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -166,6 +166,7 @@ public final class Invasion extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Maniacal Rage", 155, Rarity.COMMON, mage.cards.m.ManiacalRage.class));
|
||||
cards.add(new SetCardInfo("Manipulate Fate", 60, Rarity.UNCOMMON, mage.cards.m.ManipulateFate.class));
|
||||
cards.add(new SetCardInfo("Marauding Knight", 110, Rarity.RARE, mage.cards.m.MaraudingKnight.class));
|
||||
cards.add(new SetCardInfo("Metathran Aerostat", 61, Rarity.RARE, mage.cards.m.MetathranAerostat.class));
|
||||
cards.add(new SetCardInfo("Metathran Transport", 62, Rarity.UNCOMMON, mage.cards.m.MetathranTransport.class));
|
||||
cards.add(new SetCardInfo("Metathran Zombie", 63, Rarity.COMMON, mage.cards.m.MetathranZombie.class));
|
||||
cards.add(new SetCardInfo("Meteor Storm", 256, Rarity.RARE, mage.cards.m.MeteorStorm.class));
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class PutCardFromHandOntoBattlefieldEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue