Implemented Aria of Flame

This commit is contained in:
Evan Kranzler 2019-05-25 15:56:29 -04:00
parent 2f16054f6a
commit 8ad8ca204b
2 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,85 @@
package mage.cards.a;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.CountersSourceCount;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetPlayerOrPlaneswalker;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AriaOfFlame extends CardImpl {
private static final DynamicValue xValue = new CountersSourceCount(CounterType.VERSE);
public AriaOfFlame(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}");
// When Aria of Flame enters the battlefield, each opponent gains 10 life.
this.addAbility(new EntersBattlefieldTriggeredAbility(new AriaOfFlameEffect()));
// Whenever you cast an instant or sorcery spell, put a verse counter on Aria of Flame, then it deals damage equal to the number of verse counters on it to target player or planeswalker.
Ability ability = new SpellCastControllerTriggeredAbility(
new AddCountersSourceEffect(CounterType.VERSE.createInstance()),
StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false,
"Whenever you cast an instant or sorcery spell,put a verse counter on {this}, " +
"then it deals damage equal to the number of verse counters on it " +
"to target player or planeswalker."
);
ability.addEffect(new DamageTargetEffect(xValue));
ability.addTarget(new TargetPlayerOrPlaneswalker());
this.addAbility(ability);
}
private AriaOfFlame(final AriaOfFlame card) {
super(card);
}
@Override
public AriaOfFlame copy() {
return new AriaOfFlame(this);
}
}
class AriaOfFlameEffect extends OneShotEffect {
AriaOfFlameEffect() {
super(Outcome.Benefit);
staticText = "each opponent gains 10 life";
}
private AriaOfFlameEffect(AriaOfFlameEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID playerId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(playerId);
if (player != null) {
player.gainLife(10, game, source);
}
}
return true;
}
@Override
public AriaOfFlameEffect copy() {
return new AriaOfFlameEffect(this);
}
}

View file

@ -29,6 +29,7 @@ public final class ModernHorizons extends ExpansionSet {
cards.add(new SetCardInfo("Abominable Treefolk", 194, Rarity.UNCOMMON, mage.cards.a.AbominableTreefolk.class));
cards.add(new SetCardInfo("Altar of Dementia", 218, Rarity.RARE, mage.cards.a.AltarOfDementia.class));
cards.add(new SetCardInfo("Archmage's Charm", 40, Rarity.RARE, mage.cards.a.ArchmagesCharm.class));
cards.add(new SetCardInfo("Aria of Flame", 118, Rarity.RARE, mage.cards.a.AriaOfFlame.class));
cards.add(new SetCardInfo("Ayula's Influence", 156, Rarity.RARE, mage.cards.a.AyulasInfluence.class));
cards.add(new SetCardInfo("Ayula, Queen Among Bears", 155, Rarity.RARE, mage.cards.a.AyulaQueenAmongBears.class));
cards.add(new SetCardInfo("Battle Screech", 4, Rarity.UNCOMMON, mage.cards.b.BattleScreech.class));