mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Implemented Slaying Fire
This commit is contained in:
parent
f39495f310
commit
3179d35167
4 changed files with 88 additions and 2 deletions
42
Mage.Sets/src/mage/cards/s/SlayingFire.java
Normal file
42
Mage.Sets/src/mage/cards/s/SlayingFire.java
Normal 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> — 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);
|
||||
}
|
||||
}
|
|
@ -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("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("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("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class));
|
||||
cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,12 @@
|
|||
|
||||
package mage.constants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public enum AbilityWord {
|
||||
|
||||
ADDENDUM("Addendum"),
|
||||
ADAMANT("Adamant"),
|
||||
BATTALION("Battalion"),
|
||||
BLOODRUSH("Bloodrush"),
|
||||
CHANNEL("Channel"),
|
||||
|
|
Loading…
Reference in a new issue