YDMU: Darigaaz, Shivan Champion and support (#1639)

* darigaaz_shivan_champion.txt

* MakeCardEffect support "WithCounter" and "FaceDown"
This commit is contained in:
Northmoc
2022-10-04 04:46:33 -04:00
committed by GitHub
parent 1c3ed5e1ff
commit 95e986e124
2 changed files with 31 additions and 1 deletions

View File

@@ -9,12 +9,14 @@ import com.google.common.collect.Lists;
import forge.StaticData;
import forge.card.ICardFace;
import forge.game.Game;
import forge.game.GameEntityCounterTable;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils;
import forge.game.ability.SpellAbilityEffect;
import forge.game.card.Card;
import forge.game.card.*;
import forge.game.card.CardCollection;
import forge.game.card.CardZoneTable;
import forge.game.card.CounterType;
import forge.game.player.Player;
import forge.game.player.PlayerCollection;
import forge.game.spellability.SpellAbility;
@@ -101,9 +103,23 @@ public class MakeCardEffect extends SpellAbilityEffect {
}
final CardZoneTable triggerList = new CardZoneTable();
GameEntityCounterTable counterTable = new GameEntityCounterTable();
CardCollection madeCards = new CardCollection();
for (final Card c : cards) {
if (sa.hasParam("WithCounter") && zone != null && zone.equals(ZoneType.Battlefield)) {
c.addEtbCounter(CounterType.getType(sa.getParam("WithCounter")),
AbilityUtils.calculateAmount(source, sa.getParamOrDefault("WithCounterNum", "1"), sa),
player);
}
Card made = game.getAction().moveTo(zone, c, sa, moveParams);
if (sa.hasParam("WithCounter") && zone != null && !zone.equals(ZoneType.Battlefield)) {
made.addCounter(CounterType.getType(sa.getParam("WithCounter")),
AbilityUtils.calculateAmount(source, sa.getParamOrDefault("WithCounterNum", "1"), sa),
player, counterTable);
}
if (sa.hasParam("FaceDown")) {
made.turnFaceDown(true);
}
triggerList.put(ZoneType.None, made.getZone().getZoneType(), made);
madeCards.add(made);
if (sa.hasParam("RememberMade")) {
@@ -114,6 +130,7 @@ public class MakeCardEffect extends SpellAbilityEffect {
}
}
triggerList.triggerChangesZoneAll(game, sa);
counterTable.replaceCounterEffect(game, sa, true);
if (sa.hasParam("Conjure")) {
final Map<AbilityKey, Object> runParams = AbilityKey.newMap();

View File

@@ -0,0 +1,13 @@
Name:Darigaaz, Shivan Champion
ManaCost:2 B R G
Types:Legendary Creature Dragon
PT:5/5
K:Flying
T:Mode$ Phase | Phase$ End of Turn | Execute$ TrigDraft | ValidPlayer$ You | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your end step, conjure a random card from CARDNAME's spellbook into exile face down with three egg counters on it. It gains "At the beginning of your upkeep, if this card is exiled, remove an egg counter from it. Then if it has no egg counters on it, put it onto the battlefield."
SVar:TrigDraft:DB$ MakeCard | Conjure$ True | AtRandom$ True | Spellbook$ Shivan Dragon,Moonveil Regent,Terror of the Peaks,Leyline Tyrant,Immersturm Predator,Manaform Hellkite,Bone Dragon,Demanding Dragon,Skarrgan Hellkite,Thunderbreak Regent,Black Dragon,Skyship Stalker,Red Dragon | WithCounter$ EGG | WithCounterNum$ 3 | Zone$ Exile | FaceDown$ True | RememberMade$ True | SubAbility$ DBAnimate
SVar:DBAnimate:DB$ Animate | Defined$ Remembered | Duration$ Permanent | Triggers$ TrigRemoveEgg | SubAbility$ DBCleanup
SVar:TrigRemoveEgg:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Exile | Execute$ DBRemoveCounter | TriggerDescription$ At the beginning of your upkeep, if this card is exiled, remove an egg counter from it. Then if it has no egg counters on it, put it onto the battlefield.
SVar:DBRemoveCounter:DB$ RemoveCounter | CounterType$ EGG | SubAbility$ DBReturn
SVar:DBReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Battlefield | ConditionDefined$ Self | ConditionPresent$ Card.counters_EQ0_EGG
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
Oracle:Flying\nAt the beginning of your end step, conjure a random card from Darigaaz, Shivan Champion's spellbook into exile face down with three egg counters on it. It gains "At the beginning of your upkeep, if this card is exiled, remove an egg counter from it. Then if it has no egg counters on it, put it onto the battlefield."