- JavaScript 96.8%
- CSS 3.2%
| foundry-vtt-autorelease@167c4b41c1 | ||
| lang | ||
| scripts | ||
| styles | ||
| .gitmodules | ||
| module.json | ||
| README.md | ||
Battle Immersion
"AI" disclosure
Some or all of the code in this repository was generated with the assistance of LLM-based tools.
AI-generated code is not automatically owned by the person who generated it. No claim of ownership is made over third-party code or material included in this repository.
If you believe any code in this repository infringes your copyright, please contact me with the relevant details and I will review the matter and remove the material if appropriate.
This repository is intended for personal use only. The code is provided "as is", without warranties of any kind. I accept no responsibility or liability for any damage, data loss, security issues or other consequences resulting from its use.
Use this code at your own risk. You have been warned.
About
A Foundry VTT module for the Dragonbane system that makes combat feel more immersive.
When combat starts it:
- Fades out the currently playing audio
- Plays an encounter sting, then switches to a combat theme
- Unhides hidden combatant tokens (configurable per token)
- Pans and zooms the camera to the first combatant
During and after combat it:
- Removes enemies from the combat tracker when they are marked dead
- Ends combat with a victory theme when no enemies remain
- Resumes the audio that was playing before combat
Compatibility
- Foundry VTT 14
- Dragonbane/Drakar och Demoner 4.x
- Works alongside Year Zero Combat (tracker changes are left to that module)
Installation
In Foundry VTT, go to Add-on Modules → Install module and enter the manifest url: https://code.chuggybumba.com/thanius/battle-immersion/raw/branch/main/module.json
Configuration
Each theme phase (Encounter, Combat, Victory) takes a playlist, an optional single sound, and a "Play only once" toggle. Leave the sound empty to allow all songs in the playlist.
Themes can be set in three places:
- Module settings: default themes for every combat.
- Scene configuration: the Battle theme section overrides the module defaults for that scene.
- Token configuration: the Battle theme tab overrides the scene for combats that include that token. Hostile tokens win over neutral tokens.
The token configuration also has Unhide token when engaged (on by default) in its appearance settings.
Enemies and victory
Tokens with Hostile or Neutral disposition count as enemies. An enemy is handled as dead when it is marked defeated in the combat tracker or gets the dead status effect from the token HUD.
When the last enemy dies, combat ends without the confirmation dialog and the Victory theme plays. Deleting a combat manually does not play the Victory theme.
Integration
The module listens to Foundry hooks:
combatStartcombatEnd/deleteCombatupdateCombatant(defeated toggle)createActiveEffect(dead status effect)