Skip to content

MedicCatcher.js

kyleady edited this page Jan 24, 2018 · 1 revision

Purpose

Updates Medic.js's Max Healing Attribute whenever a token's bar3 value is changed.

Usage

on("change:attribute:current")

If any graphic that represents a character has their bar3 increased above their Max Healing, this is interpreted as the character receiving proper care. Their Max Healing attribute (if it exists) is increased to the character's new bar3 value. However, if the Max Healing would go above the character's max bar3 value, it is reduced to that max value. The GM is alerted to the change in Max Healing.

If you have multiple tokens linked to the same character (perhaps on different pages) this event will trigger for each token. This is fine because this function is idempotent. It sets the Max Healing value to the new value the first time and then notices there is nothing to change each time after that.

Warning: This function will not trigger if you change a character's Wounds attribute from the character sheet while there is no token in the entire campaign that has its bar3 linked to the character's Wounds.

Requirements

Clone this wiki locally