mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
CardFactoryUtil: add Dethrone into addTriggerAbility, also rewrite it for Cascade, can't have the loop inside.
Dack's Duplicate & Marchesa, the Black Rose : updated to use addKeyword for Dethrone
This commit is contained in:
@@ -2887,8 +2887,6 @@ public class CardFactoryUtil {
|
|||||||
final boolean intrinsic = kws == null;
|
final boolean intrinsic = kws == null;
|
||||||
|
|
||||||
if (keyword.equals("Cascade")) {
|
if (keyword.equals("Cascade")) {
|
||||||
final int cascade = intrinsic ? card.getAmountOfKeyword("Cascade") : 1;
|
|
||||||
if (cascade != -1) {
|
|
||||||
final StringBuilder trigScript = new StringBuilder(
|
final StringBuilder trigScript = new StringBuilder(
|
||||||
"Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigCascade | Secondary$ " +
|
"Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigCascade | Secondary$ " +
|
||||||
"True | TriggerDescription$ Cascade - CARDNAME");
|
"True | TriggerDescription$ Cascade - CARDNAME");
|
||||||
@@ -2909,12 +2907,25 @@ public class CardFactoryUtil {
|
|||||||
card.setSVar("CascadeCleanup", "DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True");
|
card.setSVar("CascadeCleanup", "DB$ Cleanup | ClearRemembered$ True | ClearImprinted$ True");
|
||||||
final Trigger cascadeTrigger = TriggerHandler.parseTrigger(trigScript.toString(), card, intrinsic);
|
final Trigger cascadeTrigger = TriggerHandler.parseTrigger(trigScript.toString(), card, intrinsic);
|
||||||
|
|
||||||
for (int i = 0; i < cascade; i++) {
|
|
||||||
final Trigger cardTrigger = card.addTrigger(cascadeTrigger);
|
final Trigger cardTrigger = card.addTrigger(cascadeTrigger);
|
||||||
if (!intrinsic) {
|
if (!intrinsic) {
|
||||||
kws.addTrigger(cardTrigger);
|
kws.addTrigger(cardTrigger);
|
||||||
}
|
}
|
||||||
}
|
} else if (keyword.equals("Dethrone")) {
|
||||||
|
final StringBuilder trigScript = new StringBuilder(
|
||||||
|
"Mode$ Attacks | ValidCard$ Card.Self | Attacked$ Player.withMostLife | Secondary$ True | "
|
||||||
|
+ "TriggerZones$ Battlefield | Execute$ DethroneCounters | TriggerDescription$"
|
||||||
|
+ " Dethrone (" + Keyword.getInstance("Dethrone").getReminderText() + ")");
|
||||||
|
|
||||||
|
final String abString = "DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | "
|
||||||
|
+ "CounterNum$ 1";
|
||||||
|
card.setSVar("DethroneCounters", abString);
|
||||||
|
final Trigger dethroneTrigger = TriggerHandler.parseTrigger(trigScript.toString(), card, intrinsic);
|
||||||
|
|
||||||
|
|
||||||
|
final Trigger cardTrigger = card.addTrigger(dethroneTrigger);
|
||||||
|
if (!intrinsic) {
|
||||||
|
kws.addTrigger(cardTrigger);
|
||||||
}
|
}
|
||||||
} else if (keyword.equals("Exalted")) {
|
} else if (keyword.equals("Exalted")) {
|
||||||
final StringBuilder trigExalted = new StringBuilder(
|
final StringBuilder trigExalted = new StringBuilder(
|
||||||
@@ -3607,7 +3618,7 @@ public class CardFactoryUtil {
|
|||||||
card.addTrigger(stormTrigger);
|
card.addTrigger(stormTrigger);
|
||||||
} // Storm
|
} // Storm
|
||||||
|
|
||||||
if (hasKeyword(card, "Cascade") != -1) {
|
for (int i = 0; i < card.getAmountOfKeyword("Cascade"); i++) {
|
||||||
addTriggerAbility("Cascade", card, null);
|
addTriggerAbility("Cascade", card, null);
|
||||||
} // Cascade
|
} // Cascade
|
||||||
|
|
||||||
@@ -3664,20 +3675,8 @@ public class CardFactoryUtil {
|
|||||||
ripplePos = hasKeyword(card, "Ripple", n + 1);
|
ripplePos = hasKeyword(card, "Ripple", n + 1);
|
||||||
} // Ripple
|
} // Ripple
|
||||||
|
|
||||||
final int dethrone = card.getAmountOfKeyword("Dethrone");
|
for (int i = 0; i < card.getAmountOfKeyword("Dethrone"); i++) {
|
||||||
card.removeIntrinsicKeyword("Dethrone");
|
addTriggerAbility("Dethrone", card, null);
|
||||||
for (int i = 0; i < dethrone; i++) {
|
|
||||||
final StringBuilder trigScript = new StringBuilder(
|
|
||||||
"Mode$ Attacks | ValidCard$ Card.Self | Attacked$ Player.withMostLife | "
|
|
||||||
+ "TriggerZones$ Battlefield | Execute$ DethroneCounters | TriggerDescription$"
|
|
||||||
+ " Dethrone (Whenever this creature attacks the player with the most life or "
|
|
||||||
+ "tied for the most life, put a +1/+1 counter on it.)");
|
|
||||||
|
|
||||||
final String abString = "DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | "
|
|
||||||
+ "CounterNum$ 1";
|
|
||||||
card.setSVar("DethroneCounters", abString);
|
|
||||||
final Trigger cascadeTrigger = TriggerHandler.parseTrigger(trigScript.toString(), card, true);
|
|
||||||
card.addTrigger(cascadeTrigger);
|
|
||||||
} // Dethrone
|
} // Dethrone
|
||||||
|
|
||||||
final int exploit = card.getAmountOfKeyword("Exploit");
|
final int exploit = card.getAmountOfKeyword("Exploit");
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ Types:Creature Shapeshifter
|
|||||||
PT:0/0
|
PT:0/0
|
||||||
K:ETBReplacement:Copy:ChooseCreature:Optional
|
K:ETBReplacement:Copy:ChooseCreature:Optional
|
||||||
SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | AILogic$ AtLeast1 | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone. (Whenever it attacks the player with the most life or tied for most life, put a +1/+1 counter on it.)
|
SVar:ChooseCreature:DB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | AILogic$ AtLeast1 | SpellDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone. (Whenever it attacks the player with the most life or tied for most life, put a +1/+1 counter on it.)
|
||||||
SVar:DBCopy:DB$ Clone | Defined$ ChosenCard | AddKeywords$ Haste | AddTriggers$ DacksDuplicateDethrone | AddSVars$ DacksDuplicateSVar
|
SVar:DBCopy:DB$ Clone | Defined$ ChosenCard | AddKeywords$ Haste & Dethrone
|
||||||
SVar:DacksDuplicateDethrone:Mode$ Attacks | ValidCard$ Card.Self | Attacked$ Player.withMostLife | TriggerZones$ Battlefield | Execute$ DacksDuplicateSVar | TriggerDescription$ Dethrone (Whenever this creature attacks the player with the most life or tied for the most life, put a +1/+1 counter on it.)
|
|
||||||
SVar:DacksDuplicateSVar:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1
|
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/dacks_duplicate.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/dacks_duplicate.jpg
|
||||||
Oracle:You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone. (Whenever it attacks the player with the most life or tied for most life, put a +1/+1 counter on it.)
|
Oracle:You may have Dack's Duplicate enter the battlefield as a copy of any creature on the battlefield except it gains haste and dethrone. (Whenever it attacks the player with the most life or tied for most life, put a +1/+1 counter on it.)
|
||||||
|
|||||||
@@ -3,9 +3,7 @@ ManaCost:1 U B R
|
|||||||
Types:Legendary Creature Human Wizard
|
Types:Legendary Creature Human Wizard
|
||||||
PT:3/3
|
PT:3/3
|
||||||
K:Dethrone
|
K:Dethrone
|
||||||
S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddTrigger$ MarchesaTrig | AddSVar$ DethroneCounters | Description$ Other creatures you control have dethrone.
|
S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddKeyword$ Dethrone | Description$ Other creatures you control have dethrone.
|
||||||
SVar:MarchesaTrig:Mode$ Attacks | ValidCard$ Card.Self | Attacked$ Player.withMostLife | TriggerZones$ Battlefield | Execute$ DethroneCounters | TriggerDescription$ Dethrone (Whenever this creature attacks the player with the most life or tied for the most life, put a +1/+1 counter on it.)
|
|
||||||
SVar:DethroneCounters:DB$ PutCounter | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1
|
|
||||||
T:Mode$ ChangesZone | ValidCard$ Card.YouCtrl+counters_GE1_P1P1 | Origin$ Battlefield | Destination$ Graveyard | DelayedTrigger$ DelTrigReturn | TriggerZones$ Battlefield | TriggerDescription$ Whenever a creature you control with a +1/+1 counter on it dies, return that card to the battlefield under your control at the beginning of the next end step.
|
T:Mode$ ChangesZone | ValidCard$ Card.YouCtrl+counters_GE1_P1P1 | Origin$ Battlefield | Destination$ Graveyard | DelayedTrigger$ DelTrigReturn | TriggerZones$ Battlefield | TriggerDescription$ Whenever a creature you control with a +1/+1 counter on it dies, return that card to the battlefield under your control at the beginning of the next end step.
|
||||||
SVar:DelTrigReturn:Mode$ Phase | Phase$ End Of Turn | Execute$ DBReturn | TriggerDescription$ Return that card to the battlefield at the beginning under your control of the next end step.
|
SVar:DelTrigReturn:Mode$ Phase | Phase$ End Of Turn | Execute$ DBReturn | TriggerDescription$ Return that card to the battlefield at the beginning under your control of the next end step.
|
||||||
SVar:DBReturn:DB$ ChangeZone | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True
|
SVar:DBReturn:DB$ ChangeZone | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True
|
||||||
|
|||||||
Reference in New Issue
Block a user