mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
CardFactoryUtil: move Cascade to addTriggerAbility
Maelstrom Nexus: turn Trigger into Static with Keyword
This commit is contained in:
@@ -2886,7 +2886,37 @@ public class CardFactoryUtil {
|
|||||||
public static void addTriggerAbility(final String keyword, final Card card, final KeywordsChange kws) {
|
public static void addTriggerAbility(final String keyword, final Card card, final KeywordsChange kws) {
|
||||||
final boolean intrinsic = kws == null;
|
final boolean intrinsic = kws == null;
|
||||||
|
|
||||||
if (keyword.equals("Exalted")) {
|
if (keyword.equals("Cascade")) {
|
||||||
|
final int cascade = intrinsic ? card.getAmountOfKeyword("Cascade") : 1;
|
||||||
|
if (cascade != -1) {
|
||||||
|
final StringBuilder trigScript = new StringBuilder(
|
||||||
|
"Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigCascade | Secondary$ " +
|
||||||
|
"True | TriggerDescription$ Cascade - CARDNAME");
|
||||||
|
|
||||||
|
final String abString = "AB$ DigUntil | Cost$ 0 | Defined$ You | Amount$ 1 | Valid$ "
|
||||||
|
+ "Card.nonLand+cmcLTCascadeX | FoundDestination$ Exile | RevealedDestination$"
|
||||||
|
+ " Exile | References$ CascadeX | ImprintRevealed$ True | RememberFound$ True"
|
||||||
|
+ " | SubAbility$ CascadeCast";
|
||||||
|
final String dbCascadeCast = "DB$ Play | Defined$ Remembered | WithoutManaCost$ True | "
|
||||||
|
+ "Optional$ True | SubAbility$ CascadeMoveToLib";
|
||||||
|
final String dbMoveToLib = "DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered,Card.IsImprinted"
|
||||||
|
+ " | Origin$ Exile | Destination$ Library | RandomOrder$ True | LibraryPosition$ -1"
|
||||||
|
+ " | SubAbility$ CascadeCleanup";
|
||||||
|
card.setSVar("TrigCascade", abString);
|
||||||
|
card.setSVar("CascadeCast", dbCascadeCast);
|
||||||
|
card.setSVar("CascadeMoveToLib", dbMoveToLib);
|
||||||
|
card.setSVar("CascadeX", "Count$CardManaCost");
|
||||||
|
card.setSVar("CascadeCleanup", "DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True");
|
||||||
|
final Trigger cascadeTrigger = TriggerHandler.parseTrigger(trigScript.toString(), card, intrinsic);
|
||||||
|
|
||||||
|
for (int i = 0; i < cascade; i++) {
|
||||||
|
final Trigger cardTrigger = card.addTrigger(cascadeTrigger);
|
||||||
|
if (!intrinsic) {
|
||||||
|
kws.addTrigger(cardTrigger);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (keyword.equals("Exalted")) {
|
||||||
final StringBuilder trigExalted = new StringBuilder(
|
final StringBuilder trigExalted = new StringBuilder(
|
||||||
"Mode$ Attacks | ValidCard$ Creature.YouCtrl | Alone$ True | "
|
"Mode$ Attacks | ValidCard$ Creature.YouCtrl | Alone$ True | "
|
||||||
+ "Execute$ ExaltedPump | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ "
|
+ "Execute$ ExaltedPump | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ "
|
||||||
@@ -3576,29 +3606,9 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
card.addTrigger(stormTrigger);
|
card.addTrigger(stormTrigger);
|
||||||
} // Storm
|
} // Storm
|
||||||
final int cascade = card.getAmountOfKeyword("Cascade");
|
|
||||||
for (int i = 0; i < cascade; i++) {
|
|
||||||
final StringBuilder trigScript = new StringBuilder(
|
|
||||||
"Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigCascade | Secondary$ " +
|
|
||||||
"True | TriggerDescription$ Cascade - CARDNAME");
|
|
||||||
|
|
||||||
final String abString = "AB$ DigUntil | Cost$ 0 | Defined$ You | Amount$ 1 | Valid$ "
|
if (hasKeyword(card, "Cascade") != -1) {
|
||||||
+ "Card.nonLand+cmcLTCascadeX | FoundDestination$ Exile | RevealedDestination$"
|
addTriggerAbility("Cascade", card, null);
|
||||||
+ " Exile | References$ CascadeX | ImprintRevealed$ True | RememberFound$ True"
|
|
||||||
+ " | SubAbility$ CascadeCast";
|
|
||||||
final String dbCascadeCast = "DB$ Play | Defined$ Remembered | WithoutManaCost$ True | "
|
|
||||||
+ "Optional$ True | SubAbility$ CascadeMoveToLib";
|
|
||||||
final String dbMoveToLib = "DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered,Card.IsImprinted"
|
|
||||||
+ " | Origin$ Exile | Destination$ Library | RandomOrder$ True | LibraryPosition$ -1"
|
|
||||||
+ " | SubAbility$ CascadeCleanup";
|
|
||||||
card.setSVar("TrigCascade", abString);
|
|
||||||
card.setSVar("CascadeCast", dbCascadeCast);
|
|
||||||
card.setSVar("CascadeMoveToLib", dbMoveToLib);
|
|
||||||
card.setSVar("CascadeX", "Count$CardManaCost");
|
|
||||||
card.setSVar("CascadeCleanup", "DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True");
|
|
||||||
final Trigger cascadeTrigger = TriggerHandler.parseTrigger(trigScript.toString(), card, true);
|
|
||||||
|
|
||||||
card.addTrigger(cascadeTrigger);
|
|
||||||
} // Cascade
|
} // Cascade
|
||||||
|
|
||||||
if (hasKeyword(card, "Recover") != -1) {
|
if (hasKeyword(card, "Recover") != -1) {
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
Name:Maelstrom Nexus
|
Name:Maelstrom Nexus
|
||||||
ManaCost:W U B R G
|
ManaCost:W U B R G
|
||||||
Types:Enchantment
|
Types:Enchantment
|
||||||
T:Mode$ SpellCast | ValidCard$ Card.YouCtrl | CheckSVar$ Y | SVarCompare$ EQ1 | NoResolvingCheck$ True | TriggerZones$ Battlefield | Execute$ MaelstromCascade | TriggerDescription$ The first spell you cast each turn has cascade. (When you cast your first spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom in a random order.)
|
|
||||||
SVar:MaelstromCascade:AB$ DigUntil | Cost$ 0 | Defined$ You | Amount$ 1 | Valid$ Card.nonLand+cmcLTX | FoundDestination$ Exile | RevealedDestination$ Exile | References$ X | ImprintRevealed$ True | RememberFound$ True | SubAbility$ DBCast
|
S:Mode$ Continuous | Affected$ Card.YouCtrl | AffectedZone$ Exile,Graveyard,Hand,Library,Command | CheckSVar$ Y | SVarCompare$ EQ1 | AddKeyword$ Cascade | Description$ The first spell you cast each turn has cascade.
|
||||||
SVar:DBCast:DB$ Play | Defined$ Remembered | WithoutManaCost$ True | Optional$ True | SubAbility$ DBMoveToLib
|
|
||||||
SVar:DBMoveToLib:DB$ ChangeZoneAll | ChangeType$ Card.IsRemembered,Card.IsImprinted | Origin$ Exile | Destination$ Library | RandomOrder$ True | LibraryPosition$ -1 | SubAbility$ DBCleanup
|
|
||||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True
|
|
||||||
SVar:X:Count$TriggeredCardManaCost
|
|
||||||
SVar:Y:Count$ThisTurnCast_Card.YouCtrl
|
SVar:Y:Count$ThisTurnCast_Card.YouCtrl
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/maelstrom_nexus.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/maelstrom_nexus.jpg
|
||||||
Oracle:The first spell you cast each turn has cascade. (When you cast your first spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom in a random order.)
|
Oracle:The first spell you cast each turn has cascade. (When you cast your first spell, exile cards from the top of your library until you exile a nonland card that costs less. You may cast it without paying its mana cost. Put the exiled cards on the bottom in a random order.)
|
||||||
|
|||||||
Reference in New Issue
Block a user