Merge pull request #2899 from tool4ever/fixsba

Effect cleanup can prevent any LTB trigger
This commit is contained in:
Anthony Calosa
2023-04-22 07:22:10 +08:00
committed by GitHub
3 changed files with 6 additions and 1 deletions

View File

@@ -1439,6 +1439,8 @@ public class GameAction {
}
setHoldCheckingStaticAbilities(false);
// important to collect first otherwise if a static fires it will mess up registered ones from LKI
game.getTriggerHandler().collectTriggerForWaiting();
if (game.getTriggerHandler().runWaitingTriggers()) {
checkAgain = true;
}

View File

@@ -68,6 +68,9 @@ public class RollDiceEffect extends SpellAbilityEffect {
return rollDiceForPlayer(sa, player, amount, sides, 0, 0, null);
}
private static int rollDiceForPlayer(SpellAbility sa, Player player, int amount, int sides, int ignore, int modifier, List<Integer> rollsResult) {
if (amount == 0) {
return 0;
}
int advantage = getRollAdvange(player);
amount += advantage;
int total = 0;

View File

@@ -180,7 +180,7 @@ public class TriggerHandler {
return FileSection.parseToMap(trigParse, FileSection.DOLLAR_SIGN_KV_SEPARATOR);
}
private void collectTriggerForWaiting() {
public void collectTriggerForWaiting() {
for (final TriggerWaiting wt : waitingTriggers) {
if (wt.getTriggers() != null)
continue;