mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Implemented Seasoned Pyromancer
This commit is contained in:
parent
9f49aa99c8
commit
7fd25d5ce8
2 changed files with 103 additions and 0 deletions
102
Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java
Normal file
102
Mage.Sets/src/mage/cards/s/SeasonedPyromancer.java
Normal file
|
@ -0,0 +1,102 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.ExileSourceFromGraveCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.YoungPyromancerElementalToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SeasonedPyromancer extends CardImpl {
|
||||
|
||||
public SeasonedPyromancer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
|
||||
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Seasoned Pyromancer enters the battlefield, discard two cards, then draw two cards. For each nonland card discarded this way, create a 1/1 red Elemental creature token.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SeasonedPyromancerEffect()));
|
||||
|
||||
// {3}{R}{R}, Exile Seasoned Pyromancer from your graveyard: Create two 1/1 red Elemental creature tokens.
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
Zone.GRAVEYARD,
|
||||
new CreateTokenEffect(new YoungPyromancerElementalToken(), 2),
|
||||
new ManaCostsImpl("{3}{R}{R}")
|
||||
);
|
||||
ability.addCost(new ExileSourceFromGraveCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private SeasonedPyromancer(final SeasonedPyromancer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeasonedPyromancer copy() {
|
||||
return new SeasonedPyromancer(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SeasonedPyromancerEffect extends OneShotEffect {
|
||||
|
||||
SeasonedPyromancerEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "discard two cards, then draw two cards. " +
|
||||
"For each nonland card discarded this way, " +
|
||||
"create a 1/1 red Elemental creature token.";
|
||||
}
|
||||
|
||||
private SeasonedPyromancerEffect(final SeasonedPyromancerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeasonedPyromancerEffect copy() {
|
||||
return new SeasonedPyromancerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
TargetCard target = new TargetCardInHand(2, StaticFilters.FILTER_CARD);
|
||||
if (!player.choose(outcome, player.getHand(), target, game)) {
|
||||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl(target.getTargets());
|
||||
int nonlands = 0;
|
||||
for (Card card : cards.getCards(game)) {
|
||||
if (player.discard(card, source, game) && !card.isLand()) {
|
||||
nonlands++;
|
||||
}
|
||||
}
|
||||
player.drawCards(2, game);
|
||||
if (nonlands > 0) {
|
||||
return new CreateTokenEffect(new YoungPyromancerElementalToken(), nonlands).apply(game, source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -42,6 +42,7 @@ public final class ModernHorizons extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Martyr's Soul", 19, Rarity.COMMON, mage.cards.m.MartyrsSoul.class));
|
||||
cards.add(new SetCardInfo("Prismatic View", 244, Rarity.RARE, mage.cards.p.PrismaticView.class));
|
||||
cards.add(new SetCardInfo("Prohibit", 64, Rarity.COMMON, mage.cards.p.Prohibit.class));
|
||||
cards.add(new SetCardInfo("Seasoned Pyromancer", 145, Rarity.MYTHIC, mage.cards.s.SeasonedPyromancer.class));
|
||||
cards.add(new SetCardInfo("Serra the Benevolent", 26, Rarity.MYTHIC, mage.cards.s.SerraTheBenevolent.class));
|
||||
cards.add(new SetCardInfo("Snow-Covered Forest", 254, Rarity.COMMON, mage.cards.s.SnowCoveredForest.class));
|
||||
cards.add(new SetCardInfo("Snow-Covered Island", 251, Rarity.COMMON, mage.cards.s.SnowCoveredIsland.class));
|
||||
|
|
Loading…
Reference in a new issue