Hi there, In a custom character sheet, I'm currently using a HP system which is similar to Fate. So players can suffer 3 scratchs condition, 1 hurt condition and 1 very hurt condition and then, fall unconscious. In game, the character sheet is designed to look this way : The sheet workers included in my character sheet are currently checking the boxes according to the ''wound'' result from an attack. When the Hurt and or Very hurt options are checked, a minus 1/-2 is applied to all rolls. The thing is, describing wounds this way doesn't fell right. It's not intuitive and I would prefer to have a hp_current / hp_max format with a bar on the token and everything. To this effect, I've created a section relative to HP and max HP: <h4>Santé et blessures :</h4>
<span class="sheet-table-header">PV Actuels</span>
<span class="sheet-table-header">/</span>
<span class="sheet-table-header">PV Max</span>
<br>
<input align="right" type="number" name="attr_hp" value="0">
<span class="sheet-table-data sheet-center">/</span>
<input align="right" type="number" name="attr_hpmax" disabled value="@{HP-formula}">
<input align="right" disabled=true type="hidden" name="attr_hpmax" title="@{HP-formula}" value="10*@{body} + 10*@{mass_scale} + @{body} + @{mind} + @{will} + @{agility}">
Now, I need to link the wounded level in the checkbox (Niveau de blessure) to the HP value. What I want is something like this : If HP is within 100% and 51% of HPmax = no box checked. If HP is within 50% and 26% of HPmax = Hurt (blessure) box is checked. If HP is 25% or below HPmax = Very Hurt (blessure grave) is checked. I intend to ditch the Scratch (égratignures) boxes and deal with HP total. I do like the idea of decreased efficiency though and that's why I wish to keep the hurt and very hurt boxes. I've seen some code out there (Gigs) that I think I could use but I'm currently not used to Java. It's the next thing I'm studying though! on('change:hp change:hp_max' function(eventInfo){ getAttrs(['hp','hp_max'], function(values) { let current = +values.hp||0; let max = +values.hp_max||0; let wounded = (current < max) ? 1: 0; setAttrs({ wounded: wounded }); }); }); I need help to create this. Thanks a lot!