mr-ice / maptool-macros

place for maptool macros
2 stars 3 forks source link

dnd5e_applyHealth clobbers campaign property DeathSave #300

Closed trey-kirk-sp closed 3 years ago

trey-kirk-sp commented 3 years ago

"DeathSave" is a derived campaign property that's part of the family of:

StrengthSave,
DexteritySave,
ConstitutionSave,
IntelligenceSave,
WisdomSave,
CharismaSave,
DeathSave

with a formula of

{floor(bonus.deathSave + (Proficiency * max (proficiency.deathSave, proficiency.allSave)) + bonus.allSave)}

Unfortunately, ddn5e_applyHealth.command clashes with that property name:

    [h: deathSave = if (visible == 1 && (bar == "DSPass" || bar == "DSFail"), 1, 0)]

Which effectively overwrites the token's DeathSave property to 0 or 1. Just need to go into applyHealth and refactor that variable name.

trey-kirk-sp commented 3 years ago

Fixed in hash ea060ac0f