Trigger: make ActivationLimit work for all trigger

This commit is contained in:
Hans Mackowiak
2021-02-03 14:14:17 +01:00
parent 3f1ae63f93
commit cfba5460a7
4 changed files with 17 additions and 6 deletions

View File

@@ -277,7 +277,6 @@ public abstract class Trigger extends TriggerReplacementBase {
* @return a boolean.
*/
public final boolean requirementsCheck(Game game) {
if (hasParam("APlayerHasMoreLifeThanEachOther")) {
int highestLife = Integer.MIN_VALUE; // Negative base just in case a few Lich's or Platinum Angels are running around
final List<Player> healthiest = new ArrayList<>();

View File

@@ -171,11 +171,6 @@ public class TriggerChangesZone extends Trigger {
}
}
/* this trigger can only be activated once per turn, verify it hasn't already run */
if (hasParam("ActivationLimit")) {
return this.getActivationsThisTurn() < Integer.parseInt(getParam("ActivationLimit"));
}
return true;
}

View File

@@ -410,6 +410,13 @@ public class TriggerHandler {
return false; // Not the right mode.
}
/* this trigger can only be activated once per turn, verify it hasn't already run */
if (regtrig.hasParam("ActivationLimit")) {
if (regtrig.getActivationsThisTurn() >= Integer.parseInt(regtrig.getParam("ActivationLimit"))) {
return false;
}
}
if (!regtrig.requirementsCheck(game)) {
return false; // Conditions aren't right.
}