Implemented Scorch Spitter

This commit is contained in:
Evan Kranzler 2019-06-26 07:33:57 -04:00
parent 2220fe3c7d
commit deed6cb76a
2 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,79 @@
package mage.cards.s;
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.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ScorchSpitter extends CardImpl {
public ScorchSpitter(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}");
this.subtype.add(SubType.ELEMENTAL);
this.subtype.add(SubType.LIZARD);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Whenever Scorch Spitter attacks, it deals 1 damage to the player or planeswalker it's attacking.
this.addAbility(new ScorchSpitterTriggeredAbility());
}
private ScorchSpitter(final ScorchSpitter card) {
super(card);
}
@Override
public ScorchSpitter copy() {
return new ScorchSpitter(this);
}
}
class ScorchSpitterTriggeredAbility extends TriggeredAbilityImpl {
ScorchSpitterTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(1));
}
private ScorchSpitterTriggeredAbility(final ScorchSpitterTriggeredAbility ability) {
super(ability);
}
@Override
public ScorchSpitterTriggeredAbility copy() {
return new ScorchSpitterTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ATTACKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (sourceId.equals(event.getSourceId())) {
this.getEffects().get(0).setTargetPointer(
new FixedTarget(game.getCombat().getDefenderId(event.getTargetId()), game)
);
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever {this} attacks, it deals 1 damage to the player or planeswalker its attacking";
}
}

View file

@ -258,6 +258,7 @@ public final class CoreSet2020 extends ExpansionSet {
cards.add(new SetCardInfo("Savannah Sage", 284, Rarity.COMMON, mage.cards.s.SavannahSage.class));
cards.add(new SetCardInfo("Scheming Symmetry", 113, Rarity.RARE, mage.cards.s.SchemingSymmetry.class));
cards.add(new SetCardInfo("Scholar of the Ages", 74, Rarity.UNCOMMON, mage.cards.s.ScholarOfTheAges.class));
cards.add(new SetCardInfo("Scorch Spitter", 159, Rarity.COMMON, mage.cards.s.ScorchSpitter.class));
cards.add(new SetCardInfo("Scoured Barrens", 251, Rarity.COMMON, mage.cards.s.ScouredBarrens.class));
cards.add(new SetCardInfo("Scuttlemutt", 238, Rarity.UNCOMMON, mage.cards.s.Scuttlemutt.class));
cards.add(new SetCardInfo("Season of Growth", 191, Rarity.UNCOMMON, mage.cards.s.SeasonOfGrowth.class));