mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58: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.
|
||||
}
|
||||
|
||||
10
forge-gui/res/cardsfolder/upcoming/elvish_warmaster.txt
Normal file
10
forge-gui/res/cardsfolder/upcoming/elvish_warmaster.txt
Normal 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.
|
||||
Reference in New Issue
Block a user