Implement Infernal Spawn of Evil

This commit is contained in:
Thomas Winwood 2019-04-08 05:09:42 +01:00
parent b1d3c53e2a
commit 64f9b95e10
2 changed files with 105 additions and 0 deletions

View file

@ -0,0 +1,104 @@
package mage.cards.i;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
import mage.abilities.condition.common.IsStepCondition;
import mage.abilities.costs.CompositeCost;
import mage.abilities.costs.Cost;
import mage.abilities.costs.CostImpl;
import mage.abilities.costs.common.RevealSourceFromYourHandCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponentOrPlaneswalker;
/**
*
* @author Ketsuban
*/
public final class InfernalSpawnOfEvil extends CardImpl {
public InfernalSpawnOfEvil(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[] { CardType.CREATURE }, "{6}{B}{B}{B}");
this.subtype.add(SubType.BEAST);
this.power = new MageInt(7);
this.toughness = new MageInt(7);
// Flying
this.addAbility(FlyingAbility.getInstance());
// First strike
this.addAbility(FirstStrikeAbility.getInstance());
// 1B, Reveal Infernal Spawn of Evil from your hand, Say "It's coming!":
// Infernal Spawn of Evil deals 1 damage to target opponent or planeswalker.
// Activate this ability only during your upkeep and only once each turn.
Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.HAND, new DamageTargetEffect(1),
new CompositeCost(
new ManaCostsImpl("{1}{B}"),
new CompositeCost(
new RevealSourceFromYourHandCost(),
new SayCost("It's coming!"),
"Reveal {this} from your hand, Say \"It's coming!\""),
"{1}{B}, Reveal {this} from your hand, Say \"It's coming!\""),
1, new IsStepCondition(PhaseStep.UPKEEP, true));
ability.addTarget(new TargetOpponentOrPlaneswalker());
this.addAbility(ability);
}
public InfernalSpawnOfEvil(final InfernalSpawnOfEvil card) {
super(card);
}
@Override
public InfernalSpawnOfEvil copy() {
return new InfernalSpawnOfEvil(this);
}
}
class SayCost extends CostImpl {
private String message;
public SayCost(String message) {
this.message = message;
}
public SayCost(SayCost cost) {
super(cost);
this.message = cost.message;
}
@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
return true;
}
@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
Player controller = game.getPlayer(controllerId);
if (controller == null) {
return false;
}
game.informPlayers(controller.getLogName() + ": " + message);
return true;
}
@Override
public Cost copy() {
return new SayCost(this);
}
}

View file

@ -39,6 +39,7 @@ public final class Unglued extends ExpansionSet {
cards.add(new SetCardInfo("Growth Spurt", 61, Rarity.COMMON, mage.cards.g.GrowthSpurt.class));
cards.add(new SetCardInfo("Hungry Hungry Heifer", 63, Rarity.UNCOMMON, mage.cards.h.HungryHungryHeifer.class));
cards.add(new SetCardInfo("Incoming!", 64, Rarity.RARE, mage.cards.i.Incoming.class));
cards.add(new SetCardInfo("Infernal Spawn of Evil", 33, Rarity.RARE, mage.cards.i.InfernalSpawnOfEvil.class));
cards.add(new SetCardInfo("Island", 85, Rarity.LAND, mage.cards.basiclands.Island.class, new CardGraphicInfo(FrameStyle.UGL_FULL_ART_BASIC, false)));
cards.add(new SetCardInfo("Jack-in-the-Mox", 75, Rarity.RARE, mage.cards.j.JackInTheMox.class));
cards.add(new SetCardInfo("Jalum Grifter", 47, Rarity.RARE, mage.cards.j.JalumGrifter.class));