-
Notifications
You must be signed in to change notification settings - Fork 0
Medic.js
Keeping track of healing in Black Crusade is not that difficult, but the entire point of all these API Commands it to avoid wasting time opening Character sheets, calculating values, and writing them down. This API Command allows players to heal up to the highest value they can heal to while recording their new highest healing value.
!Medic <x> (Players and GM)
Attempts to increase the bar3 (red bar) of the selected tokens by x. This bar is either linked to the Wounds Attribute or represents the Wounds Attribute unique to that token.
If the Max Healing attribute exists and bar3 would be increased beyond Max Healing's current value, bar3 is reduced to the Max Healing value.
If bar3 would be increased beyond its max value, bar3 is reduced to its max value.
Max Healing is now set to the token's bar3 through attrValue(). If it did not exist before, it exists now.
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.
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. This is highly unlikely to occur but it is worth knowing.
Characters must represent their Wounds with bar3, the red bar.