mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Trigger: make ActivationLimit work for all trigger
This commit is contained in:
@@ -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<>();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user