Implemented Wildfire Elemental

This commit is contained in:
Evan Kranzler 2019-06-27 08:30:04 -04:00
parent 2af3ce58b0
commit 2d7c24c46d
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,77 @@
package mage.cards.w;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class WildfireElemental extends CardImpl {
public WildfireElemental(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
this.subtype.add(SubType.ELEMENTAL);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Whenever an opponent is dealt noncombat damage, creatures you control get +1/+0 until end of turn.
this.addAbility(new WildfireElementalTriggeredAbility());
}
private WildfireElemental(final WildfireElemental card) {
super(card);
}
@Override
public WildfireElemental copy() {
return new WildfireElemental(this);
}
}
class WildfireElementalTriggeredAbility extends TriggeredAbilityImpl {
WildfireElementalTriggeredAbility() {
super(Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Duration.EndOfTurn), false);
}
private WildfireElementalTriggeredAbility(final WildfireElementalTriggeredAbility ability) {
super(ability);
}
@Override
public WildfireElementalTriggeredAbility copy() {
return new WildfireElementalTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
return !damageEvent.isCombatDamage()
&& game.getOpponents(controllerId).contains(event.getTargetId());
}
@Override
public String getRule() {
return "Whenever an opponent is dealt noncombat damage, " +
"creatures you control get +1/+0 until end of turn.";
}
}

View file

@ -328,6 +328,7 @@ public final class CoreSet2020 extends ExpansionSet {
cards.add(new SetCardInfo("Wakeroot Elemental", 202, Rarity.RARE, mage.cards.w.WakerootElemental.class));
cards.add(new SetCardInfo("Warden of Evos Isle", 79, Rarity.UNCOMMON, mage.cards.w.WardenOfEvosIsle.class));
cards.add(new SetCardInfo("Waterkin Shaman", 288, Rarity.UNCOMMON, mage.cards.w.WaterkinShaman.class));
cards.add(new SetCardInfo("Wildfire Elemental", 297, Rarity.COMMON, mage.cards.w.WildfireElemental.class));
cards.add(new SetCardInfo("Wind-Scarred Crag", 260, Rarity.COMMON, mage.cards.w.WindScarredCrag.class));
cards.add(new SetCardInfo("Winged Words", 80, Rarity.COMMON, mage.cards.w.WingedWords.class));
cards.add(new SetCardInfo("Wolfkin Bond", 203, Rarity.COMMON, mage.cards.w.WolfkinBond.class));