mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Big performance improvement: checkStatics is now only called in TriggerHandler when a static trigger was run.
This commit is contained in:
@@ -3,7 +3,7 @@ ManaCost:W B
|
||||
Types:Creature Zombie Soldier Warrior
|
||||
Text:no text
|
||||
PT:2/2
|
||||
T:Mode$ DamageDone | ValidSource$ Card.Self | Execute$ TrigChoice | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals damage, choose one <EFBFBD> Each player loses 1 life; or each player gains 1 life.
|
||||
T:Mode$ DamageDone | ValidSource$ Card.Self | Execute$ TrigChoice | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME deals damage, choose one - Each player loses 1 life; or each player gains 1 life.
|
||||
SVar:TrigChoice:AB$ GenericChoice | Cost$ 0 | Defined$ You | Choices$ SVar1,SVar2
|
||||
SVar:SVar1:DB$ LoseLife | Defined$ Each | LifeAmount$ 1 | ChoiceDescription$ Each player loses 1 life.
|
||||
SVar:SVar2:DB$ GainLife | Defined$ Each | LifeAmount$ 1 | ChoiceDescription$ Each player gains 1 life.
|
||||
|
||||
@@ -338,12 +338,13 @@ public class TriggerHandler {
|
||||
// triggers are running.
|
||||
final ArrayList<Trigger> delayedTriggersWorkingCopy = new ArrayList<Trigger>(this.delayedTriggers);
|
||||
CardList allCards = AllZoneUtil.getCardsInGame();
|
||||
boolean checkStatics = false;
|
||||
|
||||
// Static triggers
|
||||
for (final Card c : allCards) {
|
||||
for (final Trigger t : c.getTriggers()) {
|
||||
if (t.getMapParams().containsKey("Static")) {
|
||||
this.runSingleTrigger(t, mode, runParams);
|
||||
checkStatics |= this.runSingleTrigger(t, mode, runParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,9 +361,11 @@ public class TriggerHandler {
|
||||
* AllZone.getGameAction().checkStateEffects(true);
|
||||
* this.clearSuppression("Always");
|
||||
*/
|
||||
this.suppressMode("Always");
|
||||
AllZone.getGameAction().checkStaticAbilities();
|
||||
this.clearSuppression("Always");
|
||||
if (checkStatics) {
|
||||
this.suppressMode("Always");
|
||||
AllZone.getGameAction().checkStaticAbilities();
|
||||
this.clearSuppression("Always");
|
||||
}
|
||||
|
||||
// AP
|
||||
allCards = playerAP.getAllCards();
|
||||
|
||||
Reference in New Issue
Block a user