Put ForColor for Call of the Spirit Dragons (#7348)

* Support for Call the Spirit Dragons

* ~ better ChoiceTitle

* ~ add AI flags
This commit is contained in:
Hans Mackowiak
2025-04-05 17:14:43 +02:00
committed by GitHub
parent 76086ffd35
commit e2972acad0
2 changed files with 33 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import forge.card.MagicColor;
import forge.game.Game;
import forge.game.GameEntity;
import forge.game.GameEntityCounterTable;
@@ -618,6 +619,23 @@ public class CountersPutEffect extends SpellAbilityEffect {
for (String k : keywords) {
resolvePerType(sa, placer, CounterType.getType(k), counterAmount, table, false);
}
} else if (sa.hasParam("ForColor")) {
Iterable<String> oldColors = card.getChosenColors();
CounterType counterType = null;
try {
counterType = chooseTypeFromList(sa, sa.getParam("CounterType"), null, placer.getController());
} catch (Exception e) {
System.out.println("Counter type doesn't match, nor does an SVar exist with the type name.");
return;
}
for (String color : MagicColor.Constant.ONLY_COLORS) {
card.setChosenColors(Lists.newArrayList(color));
if (sa.getOriginalParam("ChoiceTitle") != null) {
sa.getMapParams().put("ChoiceTitle", sa.getOriginalParam("ChoiceTitle").replace("chosenColor", color));
}
resolvePerType(sa, placer, counterType, counterAmount, table, true);
}
card.setChosenColors(Lists.newArrayList(oldColors));
} else {
CounterType counterType = null;
if (!sa.hasParam("EachExistingCounter") && !sa.hasParam("EachFromSource")

View File

@@ -0,0 +1,15 @@
Name:Call the Spirit Dragons
ManaCost:W U B R G
Types:Enchantment
S:Mode$ Continuous | Affected$ Dragon.YouCtrl | AddKeyword$ Indestructible | Description$ Dragons you control have indestructible.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ PutCounter | TriggerDescription$ At the beginning of your upkeep, for each color, put a +1/+1 counter on a Dragon you control of that color. If you put +1/+1 counters on five Dragons this way, you win the game.
SVar:PutCounter:DB$ PutCounter | Choices$ Dragon.ChosenColor+YouCtrl | ChoiceTitle$ Choose a Dragon for chosenColor | CounterType$ P1P1 | CounterNum$ 1 | RememberPut$ True | ForColor$ True | SubAbility$ WinGame
SVar:WinGame:DB$ WinsGame | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ5 | SubAbility$ DBCleanup | SpellDescription$ If you put +1/+1 counters on five Dragons this way, you win the game.
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Count$RememberedSize
DeckNeeds:Type$Dragon
DeckHas:Ability$Counters
AI:RemoveDeck:Random
SVar:NeedsToPlay:Creature.Dragon+YouCtrl
Oracle:Dragons you control have indestructible.\nAt the beginning of your upkeep, for each color, put a +1/+1 counter on a Dragon you control of that color. If you put +1/+1 counters on five Dragons this way, you win the game.