TriggerSpellAbilityCast: extra flag for spent Snow shares color with card

This commit is contained in:
Hans Mackowiak
2021-02-04 14:33:57 +01:00
parent 78af85bacc
commit dee961c603
2 changed files with 31 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ import java.util.Set;
import com.google.common.collect.Sets;
import forge.card.ColorSet;
import forge.game.Game;
import forge.game.GameEntity;
import forge.game.GameObject;
@@ -32,6 +33,7 @@ import forge.game.card.CardCollection;
import forge.game.card.CardLists;
import forge.game.card.CardUtil;
import forge.game.cost.Cost;
import forge.game.mana.Mana;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.SpellAbilityStackInstance;
@@ -261,6 +263,22 @@ public class TriggerSpellAbilityCast extends Trigger {
return false;
}
}
if (hasParam("SnowSpentForCardsColor")) {
boolean found = false;
for (Mana m : spellAbility.getPayingMana()) {
if (!m.isSnow()) {
continue;
}
if (cast.determineColor().sharesColorWith(ColorSet.fromMask(m.getColor()))) {
found = true;
break;
}
}
if (!found) {
return false;
}
}
return true;
}

View File

@@ -0,0 +1,13 @@
Name:Boreal Outrider
ManaCost:2 G
Types:Snow Creature Elf Warrior
PT:3/2
T:Mode$ SpellCast | ValidCard$ Creature | ValidActivatingPlayer$ You | Execute$ TrigEffect | TriggerZones$ Battlefield | SnowSpentForCardsColor$ True | TriggerDescription$ Whenever you cast a creature spell, if {S} of any of that spells colors was spent to cast it, that creature enters the battlefield with an additional +1/+1 counter on it. ({S} is mana from a snow source.)
SVar:TrigEffect:DB$ Effect | RememberObjects$ TriggeredCard | ReplacementEffects$ ETBCreat | SVars$ DBPutP1P1,ToBattlefield,DBExile | References$ ETBCreat,DBPutP1P1,ToBattlefield,DBExile
SVar:ETBCreat:Event$ Moved | ValidCard$ Card.IsRemembered | Destination$ Battlefield | ReplaceWith$ DBPutP1P1 | Description$ That creature enters the battlefield with an additional +1/+1 counter on it.
SVar:DBPutP1P1:DB$ PutCounter | Defined$ ReplacedCard | CounterType$ P1P1 | ETB$ True | CounterNum$ 1 | SubAbility$ ToBattlefield
SVar:ToBattlefield:DB$ InternalEtbReplacement | SubAbility$ DBExile
SVar:DBExile:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
DeckHints:Type$Snow
DeckHas:Ability$Counters
Oracle:Whenever you cast a creature spell, if {S} of any of that spells colors was spent to cast it, that creature enters the battlefield with an additional +1/+1 counter on it. ({S} is mana from a snow source.)