mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[KHM] Implemented Blood on the Snow (#7428)
* [KHM] Implemented Blood on the Snow * [KHM] Blood on the Snow - Changed target text * [KHM] Blood on the Snow - Fixed rule text
This commit is contained in:
parent
f826bb1aa5
commit
c3a862d336
3 changed files with 102 additions and 0 deletions
93
Mage.Sets/src/mage/cards/b/BloodOnTheSnow.java
Normal file
93
Mage.Sets/src/mage/cards/b/BloodOnTheSnow.java
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
package mage.cards.b;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.Mode;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.DestroyAllEffect;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.filter.predicate.Predicates;
|
||||||
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author weirddan455
|
||||||
|
*/
|
||||||
|
public final class BloodOnTheSnow extends CardImpl {
|
||||||
|
|
||||||
|
public BloodOnTheSnow(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{B}{B}");
|
||||||
|
|
||||||
|
this.addSuperType(SuperType.SNOW);
|
||||||
|
|
||||||
|
// Choose one —
|
||||||
|
// • Destroy all creatures.
|
||||||
|
this.getSpellAbility().addEffect(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_CREATURES));
|
||||||
|
|
||||||
|
// • Destroy all planeswalkers.
|
||||||
|
Mode mode = new Mode(new DestroyAllEffect(StaticFilters.FILTER_PERMANENT_PLANESWALKERS));
|
||||||
|
|
||||||
|
// Then return a creature or planeswalker card with converted mana cost X or less
|
||||||
|
// from your graveyard to the battlefield, where X is the amount of {S} spent to cast this spell.
|
||||||
|
this.getSpellAbility().addEffect(new BloodOnTheSnowEffect());
|
||||||
|
mode.addEffect(new BloodOnTheSnowEffect());
|
||||||
|
this.getSpellAbility().addMode(mode);
|
||||||
|
this.getSpellAbility().appendToRule(
|
||||||
|
"Then return a creature or planeswalker card with converted mana cost X or less"
|
||||||
|
+ " from your graveyard to the battlefield, where X is the amount of {S} spent to cast this spell."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private BloodOnTheSnow(final BloodOnTheSnow card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BloodOnTheSnow copy() {
|
||||||
|
return new BloodOnTheSnow(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BloodOnTheSnowEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
public BloodOnTheSnowEffect() {
|
||||||
|
super(Outcome.PutCardInPlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
private BloodOnTheSnowEffect(final BloodOnTheSnowEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BloodOnTheSnowEffect copy() {
|
||||||
|
return new BloodOnTheSnowEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
if (controller != null) {
|
||||||
|
int snow = source.getManaCostsToPay().getUsedManaToPay().getSnow();
|
||||||
|
FilterCard filter = new FilterCard("a creature or planeswalker card with CMC " + snow + " or less from your graveyard");
|
||||||
|
filter.add(Predicates.or(CardType.CREATURE.getPredicate(), CardType.PLANESWALKER.getPredicate()));
|
||||||
|
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, snow + 1));
|
||||||
|
TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(1, 1, filter, true);
|
||||||
|
controller.chooseTarget(outcome, target, source, game);
|
||||||
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
|
if (card != null) {
|
||||||
|
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -106,6 +106,7 @@ public final class Kaldheim extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Blessing of Frost", 161, Rarity.RARE, mage.cards.b.BlessingOfFrost.class));
|
cards.add(new SetCardInfo("Blessing of Frost", 161, Rarity.RARE, mage.cards.b.BlessingOfFrost.class));
|
||||||
cards.add(new SetCardInfo("Blightstep Pathway", 252, Rarity.RARE, mage.cards.b.BlightstepPathway.class));
|
cards.add(new SetCardInfo("Blightstep Pathway", 252, Rarity.RARE, mage.cards.b.BlightstepPathway.class));
|
||||||
cards.add(new SetCardInfo("Blizzard Brawl", 162, Rarity.UNCOMMON, mage.cards.b.BlizzardBrawl.class));
|
cards.add(new SetCardInfo("Blizzard Brawl", 162, Rarity.UNCOMMON, mage.cards.b.BlizzardBrawl.class));
|
||||||
|
cards.add(new SetCardInfo("Blood on the Snow", 79, Rarity.RARE, mage.cards.b.BloodOnTheSnow.class));
|
||||||
cards.add(new SetCardInfo("Bloodline Pretender", 235, Rarity.UNCOMMON, mage.cards.b.BloodlinePretender.class));
|
cards.add(new SetCardInfo("Bloodline Pretender", 235, Rarity.UNCOMMON, mage.cards.b.BloodlinePretender.class));
|
||||||
cards.add(new SetCardInfo("Bloodsky Berserker", 80, Rarity.UNCOMMON, mage.cards.b.BloodskyBerserker.class));
|
cards.add(new SetCardInfo("Bloodsky Berserker", 80, Rarity.UNCOMMON, mage.cards.b.BloodskyBerserker.class));
|
||||||
cards.add(new SetCardInfo("Boreal Outrider", 163, Rarity.UNCOMMON, mage.cards.b.BorealOutrider.class));
|
cards.add(new SetCardInfo("Boreal Outrider", 163, Rarity.UNCOMMON, mage.cards.b.BorealOutrider.class));
|
||||||
|
|
|
@ -72,6 +72,7 @@ public abstract class AbilityImpl implements Ability {
|
||||||
protected List<Hint> hints = new ArrayList<>();
|
protected List<Hint> hints = new ArrayList<>();
|
||||||
protected Outcome customOutcome = null; // uses for AI decisions instead effects
|
protected Outcome customOutcome = null; // uses for AI decisions instead effects
|
||||||
protected MageIdentifier identifier; // used to identify specific ability (e.g. to match with corresponding watcher)
|
protected MageIdentifier identifier; // used to identify specific ability (e.g. to match with corresponding watcher)
|
||||||
|
protected String appendToRule = null;
|
||||||
|
|
||||||
public AbilityImpl(AbilityType abilityType, Zone zone) {
|
public AbilityImpl(AbilityType abilityType, Zone zone) {
|
||||||
this.id = UUID.randomUUID();
|
this.id = UUID.randomUUID();
|
||||||
|
@ -742,6 +743,10 @@ public abstract class AbilityImpl implements Ability {
|
||||||
return usesStack;
|
return usesStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void appendToRule(String appendToRule) {
|
||||||
|
this.appendToRule = appendToRule;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRule() {
|
public String getRule() {
|
||||||
return getRule(false);
|
return getRule(false);
|
||||||
|
@ -785,6 +790,9 @@ public abstract class AbilityImpl implements Ability {
|
||||||
if (abilityWord != null) {
|
if (abilityWord != null) {
|
||||||
rule = "<i>" + abilityWord + "</i> — " + Character.toUpperCase(rule.charAt(0)) + rule.substring(1);
|
rule = "<i>" + abilityWord + "</i> — " + Character.toUpperCase(rule.charAt(0)) + rule.substring(1);
|
||||||
}
|
}
|
||||||
|
if (appendToRule != null) {
|
||||||
|
rule = rule.concat(appendToRule);
|
||||||
|
}
|
||||||
return rule;
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue