mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +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
|
Types:Creature Zombie Soldier Warrior
|
||||||
Text:no text
|
Text:no text
|
||||||
PT:2/2
|
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: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: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.
|
SVar:SVar2:DB$ GainLife | Defined$ Each | LifeAmount$ 1 | ChoiceDescription$ Each player gains 1 life.
|
||||||
|
|||||||
@@ -338,12 +338,13 @@ public class TriggerHandler {
|
|||||||
// triggers are running.
|
// triggers are running.
|
||||||
final ArrayList<Trigger> delayedTriggersWorkingCopy = new ArrayList<Trigger>(this.delayedTriggers);
|
final ArrayList<Trigger> delayedTriggersWorkingCopy = new ArrayList<Trigger>(this.delayedTriggers);
|
||||||
CardList allCards = AllZoneUtil.getCardsInGame();
|
CardList allCards = AllZoneUtil.getCardsInGame();
|
||||||
|
boolean checkStatics = false;
|
||||||
|
|
||||||
// Static triggers
|
// Static triggers
|
||||||
for (final Card c : allCards) {
|
for (final Card c : allCards) {
|
||||||
for (final Trigger t : c.getTriggers()) {
|
for (final Trigger t : c.getTriggers()) {
|
||||||
if (t.getMapParams().containsKey("Static")) {
|
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);
|
* AllZone.getGameAction().checkStateEffects(true);
|
||||||
* this.clearSuppression("Always");
|
* this.clearSuppression("Always");
|
||||||
*/
|
*/
|
||||||
|
if (checkStatics) {
|
||||||
this.suppressMode("Always");
|
this.suppressMode("Always");
|
||||||
AllZone.getGameAction().checkStaticAbilities();
|
AllZone.getGameAction().checkStaticAbilities();
|
||||||
this.clearSuppression("Always");
|
this.clearSuppression("Always");
|
||||||
|
}
|
||||||
|
|
||||||
// AP
|
// AP
|
||||||
allCards = playerAP.getAllCards();
|
allCards = playerAP.getAllCards();
|
||||||
|
|||||||
Reference in New Issue
Block a user