Skip to content

About

allows characters to appear multiple times in an intiative roll

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

multiple-intiatives

A FoundryVTT module that automatically creates multiple combatant entries on the initiative tracker when a specific minimum initiative bonus threshold is met.

Features

  • Automatically detects grants a creature extra turns depending on how high it's base initiative value is. Also, it allots buffs/debuffs if a natural 20 or a natural 1 are rolled.

Installation

  1. Download from (link: FoundryVTT multiple initiatives)

Example

With default settings:

  • When a creature has a base initiative score is higher (without rolling) they will receive extra turns. For example a creature has a base intiative bonus of 50, it will create entries with:

    • 50 + roll (original)
    • 30 (50 - 20)
    • 10 (50 - 40)
  • When a creature rolls a Natural 20, 2 things happen:

  1. (on the first round only) It is given a 2nd turn, and it is boosted by +100
  2. Its original roll (and the boosted roll) gain a +10

This is per creature: if three creatures each roll a Natural 20 on round 1, all three get their own bonus turn. The bonus turns are removed at the start of round 2.

  • When a character with a +0 initiative rolls a 20: (1st turn):

  • 130 (boosted)

  • 30 (original)

  • At the start of each new round every creature rerolls initiative, and the active turn is moved back to the top of the new order automatically, so you never have to click the first combatant yourself. These are controlled by the "Reroll Initiative Each Round" and "Reset Turn On New Round" settings.

    • Rerolling starts from round 2, so the initiative you rolled before combat began is kept.
    • No roll dialog appears, for the automatic reroll or for rolls you make yourself. Hold Shift to bring it back, or turn off "Skip Reroll Prompt" / "Skip Initiative Prompt".
    • The Natural 20 and Natural 1 adjustments apply to each round's new roll. The Natural 20 bonus turn is still round 1 only.
  • When a creature rolls a Natural 1, 1 thing happens:

  1. they receive a -10 to their total initiative roll
  • When a character with a +0 initiative rolls a 1:
  • (-9) (debuffed)

How It Works

The module utilizes the updateCombatant, updateCombat, deleteCombat hooks in FoundryVTT's initiative system to manipulate initiative values in real time. When it detects that a combatant has rolled the target initiative value, it automatically creates additional combatant entries with the partitioned initiative values.

Extra turn entries are scoped to the individual combatant, so multiple tokens of the same actor each get their own independent set of extra turns, named after the token.

The per-round reroll goes through FoundryVTT's own Combat#rollInitiative, so it uses the Pathfinder 1e initiative formula and posts normal initiative chat cards. The module's extra turn entries are excluded from it.

Pathfinder 1e shows a roll dialog before every initiative roll, which would mean clicking a pop-up on each round advance. The module suppresses it by passing skipDialog, wrapping Combat#rollInitiative through libWrapper when that module is installed and patching the method directly otherwise. Holding Shift still opens the dialog, so nothing is lost.

The turn marker is repositioned by the module rather than by FoundryVTT. The extra entries the module removes at the start of round 2 sort to the very top of the tracker, so the row being deleted is normally the one the marker is on, and FoundryVTT v13 does not reliably choose a replacement in that case. The module therefore sets the turn itself on every forward round change. Pressing "Previous Round" is left alone, and if the world's "Skip Defeated" tracker setting is enabled the marker lands on the first non-defeated combatant instead of the literal first row. This can be turned off with the "Reset Turn On New Round" setting, which is separate from "Enable Multiple Turns".

FoundryVTT has no way to mark a combatant as "cannot roll initiative", and some roll paths (notably the Pathfinder 1e actor sheet's Roll Initiative button, which rerolls for GMs) will roll every combatant belonging to an actor - including the extra turn entries. The module therefore records each entry's intended initiative and restores it if anything overwrites it.

Development

Tests run outside FoundryVTT against a mock in test/mock-foundry.mjs:

npm test        # or: node --test test/

No dependencies are required. package.json is development tooling only and is not part of the module manifest.

About

allows characters to appear multiple times in an intiative roll

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages