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.
}

View File

@@ -0,0 +1,10 @@
Name:Elvish Warmaster
ManaCost:1 G
Types:Creature Elf Warrior
PT:2/2
T:Mode$ ChangesZoneAll | ValidCards$ Elf.Other+YouCtrl | Destination$ Battlefield | TriggerZones$ Battlefield | ActivationLimit$ 1 | Execute$ TrigToken | TriggerDescription$ Whenever one or more other Elves enter the battlefield under your control, create a 1/1 green Elf Warrior creature token. This ability triggers only once each turn.
SVar:TrigToken:DB$ Token | TokenAmount$ 1 |TokenScript$ g_1_1_elf_warrior | TokenOwner$ You
A:AB$ PumpAll | Cost$ 5 G G | ValidCards$ Elf.YouCtrl | KW$ Deathtouch | NumAtt$ +2 | NumDef$ +2 | SpellDescription$ Elves you control get +2/+2 and gain deathtouch until end of turn.
DeckHints:Type$Elf
DeckHas:Ability$Token
Oracle:Whenever one or more other Elves enter the battlefield under your control, create a 1/1 green Elf Warrior creature token. This ability triggers only once each turn.\n{5}{G}{G}: Elves you control get +2/+2 and gain deathtouch until end of turn.