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:
Hanmac
2016-07-20 11:26:47 +00:00
parent 3e6771ca85
commit fc7f9407ca
3 changed files with 59 additions and 64 deletions

View File

@@ -2887,8 +2887,6 @@ public class CardFactoryUtil {
final boolean intrinsic = kws == null;
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");
@@ -2909,12 +2907,25 @@ public class CardFactoryUtil {
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("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")) {
final StringBuilder trigExalted = new StringBuilder(
@@ -3607,7 +3618,7 @@ public class CardFactoryUtil {
card.addTrigger(stormTrigger);
} // Storm
if (hasKeyword(card, "Cascade") != -1) {
for (int i = 0; i < card.getAmountOfKeyword("Cascade"); i++) {
addTriggerAbility("Cascade", card, null);
} // Cascade
@@ -3664,20 +3675,8 @@ public class CardFactoryUtil {
ripplePos = hasKeyword(card, "Ripple", n + 1);
} // Ripple
final int dethrone = card.getAmountOfKeyword("Dethrone");
card.removeIntrinsicKeyword("Dethrone");
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);
for (int i = 0; i < card.getAmountOfKeyword("Dethrone"); i++) {
addTriggerAbility("Dethrone", card, null);
} // Dethrone
final int exploit = card.getAmountOfKeyword("Exploit");

View File

@@ -4,8 +4,6 @@ Types:Creature Shapeshifter
PT:0/0
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:DBCopy:DB$ Clone | Defined$ ChosenCard | AddKeywords$ Haste | AddTriggers$ DacksDuplicateDethrone | AddSVars$ DacksDuplicateSVar
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:DBCopy:DB$ Clone | Defined$ ChosenCard | AddKeywords$ Haste & Dethrone
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.)

View File

@@ -3,9 +3,7 @@ ManaCost:1 U B R
Types:Legendary Creature Human Wizard
PT:3/3
K:Dethrone
S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddTrigger$ MarchesaTrig | AddSVar$ DethroneCounters | 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
S:Mode$ Continuous | Affected$ Creature.Other+YouCtrl | AddKeyword$ Dethrone | Description$ Other creatures you control have dethrone.
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:DBReturn:DB$ ChangeZone | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True