module

RC Spent / Recoverable Ammo Tracker

Endorsements
0
Installs
0.21%
Comments
0
Latest version1.0.13
Minimum Core0.7.9
Compatible Core0.7.9
File size0 B
Last updated3 years ago
Created3 years ago
Authors
Languages
Systems Dnd5e
Project source Project URL
Read-me Readme URL
License License URL

RC Spent/Recoverable Ammo Tracker

 

Made for the DnD5e system. In 5e, after a combat, you can choose to spend 1 minute to recover half of expended ammo, rounding down. My players hated tracking their spent ammo each combat and trying to remember to recover it, so I made this module.

 

How it works:

  • When you create an encounter ("+" button in combat tab), it records the current quantity of any item with item.data.data.consumableType == 'ammo' (ie. arrows, crossbow bolts, etc.)
  • When you hit End Combat, it counts how much of each ammo type was spent
  • For spent ammo, it whispers to the actor how much was spent and how much can be recovered
  • The message includes a button, which both updates inventory and posts a public message indicating the recovered ammo
  • Tracking works fine across sessions/different devices, as all intermediate data is stored in flags on the actors

 

Assumptions/Known limitations:

  • Currently, this works by finding all actors linked with game users. If a player owns multiple actors, this may misbehave
    • The GameAmmoTracker class accepts an optional list of actors in the constructor. If you want to contribute controls/settings to improve this, be my guest.
  • Behavior is undefined when ammo is fully depleted
    • The message will post, but the recover button will not work since there will be no item in the character sheet to update the quantity on
    • This is a rare enough edge case that I couldn't be bothered to deal with it
  • Behavior is undefined if you create and end multiple combats at a time; I never do this.
    • I suppose I could listen on updateCombat instead of createCombat. If you care, make a PR :)
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x