Implemented Slaying Fire

This commit is contained in:
Evan Kranzler 2019-09-04 23:12:11 -04:00
parent f39495f310
commit 3179d35167
4 changed files with 88 additions and 2 deletions

View file

@ -0,0 +1,42 @@
package mage.cards.s;
import mage.abilities.condition.common.AdamantCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.target.common.TargetAnyTarget;
import mage.watchers.common.ManaSpentToCastWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SlayingFire extends CardImpl {
public SlayingFire(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{R}");
// Slaying Fire deals 3 damage to any target.
// Adamant If at least three red mana was spent to cast this spell, it deals 4 damage instead.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetEffect(4), new DamageTargetEffect(3),
AdamantCondition.RED, "{this} deals 3 damage to any target." +
"<br><i>Adamant</i> &mdash; If at least three red mana was spent to cast this spell, " +
"it deals 4 damage instead."
));
this.getSpellAbility().addTarget(new TargetAnyTarget());
this.getSpellAbility().addWatcher(new ManaSpentToCastWatcher());
}
private SlayingFire(final SlayingFire card) {
super(card);
}
@Override
public SlayingFire copy() {
return new SlayingFire(this);
}
}

View file

@ -39,6 +39,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class)); cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class));
cards.add(new SetCardInfo("Rankle, Master of Pranks", 356, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class)); cards.add(new SetCardInfo("Rankle, Master of Pranks", 356, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class));
cards.add(new SetCardInfo("Run Away Together", 62, Rarity.COMMON, mage.cards.r.RunAwayTogether.class)); cards.add(new SetCardInfo("Run Away Together", 62, Rarity.COMMON, mage.cards.r.RunAwayTogether.class));
cards.add(new SetCardInfo("Slaying Fire", 143, Rarity.COMMON, mage.cards.s.SlayingFire.class));
cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class)); cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class));
cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class)); cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class));
cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class)); cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class));

View file

@ -0,0 +1,44 @@
package mage.abilities.condition.common;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.constants.AbilityType;
import mage.constants.ColoredManaSymbol;
import mage.game.Game;
import mage.watchers.common.ManaSpentToCastWatcher;
/**
* @author TheElk801
*/
public enum AdamantCondition implements Condition {
WHITE(ColoredManaSymbol.W),
BLUE(ColoredManaSymbol.U),
BLACK(ColoredManaSymbol.B),
RED(ColoredManaSymbol.R),
GREEN(ColoredManaSymbol.G);
protected ColoredManaSymbol coloredManaSymbol;
private AdamantCondition(ColoredManaSymbol coloredManaSymbol) {
this.coloredManaSymbol = coloredManaSymbol;
}
@Override
public boolean apply(Game game, Ability source) {
if (source.getAbilityType() == AbilityType.SPELL) {
return (source.getManaCostsToPay().getPayment().getColor(coloredManaSymbol) > 0);
}
ManaSpentToCastWatcher watcher = game.getState().getWatcher(ManaSpentToCastWatcher.class, source.getSourceId());
if (watcher == null) {
return false;
}
Mana payment = watcher.getAndResetLastPayment();
if (payment == null) {
return false;
}
return payment.getColor(coloredManaSymbol) > 2;
}
}

View file

@ -1,13 +1,12 @@
package mage.constants; package mage.constants;
/** /**
*
* @author LevelX2 * @author LevelX2
*/ */
public enum AbilityWord { public enum AbilityWord {
ADDENDUM("Addendum"), ADDENDUM("Addendum"),
ADAMANT("Adamant"),
BATTALION("Battalion"), BATTALION("Battalion"),
BLOODRUSH("Bloodrush"), BLOODRUSH("Bloodrush"),
CHANNEL("Channel"), CHANNEL("Channel"),