Implemented Mayhem Devil

This commit is contained in:
Evan Kranzler 2019-04-05 19:48:54 -04:00
parent c3da15493a
commit 5622b9823d
2 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,73 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.common.TargetAnyTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class MayhemDevil extends CardImpl {
public MayhemDevil(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{R}");
this.subtype.add(SubType.DEVIL);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Whenever a player sacrifices a permanent, Mayhem Devil deals 1 damage to any target.
this.addAbility(new MayhemDevilTriggeredAbility());
}
private MayhemDevil(final MayhemDevil card) {
super(card);
}
@Override
public MayhemDevil copy() {
return new MayhemDevil(this);
}
}
class MayhemDevilTriggeredAbility extends TriggeredAbilityImpl {
MayhemDevilTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(1));
this.addTarget(new TargetAnyTarget());
}
private MayhemDevilTriggeredAbility(final MayhemDevilTriggeredAbility ability) {
super(ability);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return true;
}
@Override
public MayhemDevilTriggeredAbility copy() {
return new MayhemDevilTriggeredAbility(this);
}
@Override
public String getRule() {
return "Whenever a player sacrifices a permanent, {this} deals 1 damage to any target.";
}
}

View file

@ -88,6 +88,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Loxodon Sergeant", 21, Rarity.COMMON, mage.cards.l.LoxodonSergeant.class));
cards.add(new SetCardInfo("Makeshift Battalion", 22, Rarity.COMMON, mage.cards.m.MakeshiftBattalion.class));
cards.add(new SetCardInfo("Massacre Girl", 99, Rarity.RARE, mage.cards.m.MassacreGirl.class));
cards.add(new SetCardInfo("Mayhem Devil", 204, Rarity.UNCOMMON, mage.cards.m.MayhemDevil.class));
cards.add(new SetCardInfo("Merfolk Skydiver", 205, Rarity.UNCOMMON, mage.cards.m.MerfolkSkydiver.class));
cards.add(new SetCardInfo("Mizzium Tank", 138, Rarity.RARE, mage.cards.m.MizziumTank.class));
cards.add(new SetCardInfo("Mountain", 260, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));