added support for fate and wounds.

This commit is contained in:
Lyle hayhurst
2021-06-02 23:50:12 -05:00
parent 63bda666b5
commit 87a031ae44
5 changed files with 59 additions and 2 deletions

View File

@@ -186,6 +186,12 @@ export class TokenHelper{
return this.system.getProficiency(token);
}
/* WFRP 4E */
getFate(token) {
return this.system.getFate(token)
}
/**
* Conditions
*/

View File

@@ -5,12 +5,21 @@ export class wfrp4e {
}
getHP(token) {
getFate(token) {
return token.actor.data.data.status.fate.value
}
getWounds(token) {
const wounds = token.actor.data.data.status.wounds
return {
value: wounds.value,
max: wounds.max
}
}
getHP(token) {
return this.getWounds(token);
}
getTempHP(token) {

View File

@@ -94,7 +94,7 @@ export class TokenControl{
}
}
if (stats == 'HP') {
if (stats == 'HP' || stats == 'Wounds') {
const hp = tokenHelper.getHP(token);
txt += hp.value + "/" + hp.max;
@@ -135,6 +135,8 @@ export class TokenControl{
else if (stats == 'Save') txt += tokenHelper.getAbilitySave(token, settings.save);
else if (stats == 'Skill') txt += tokenHelper.getSkill(token, settings.skill);
else if (stats == 'Prof') txt += tokenHelper.getProficiency(token);
else if (stats == 'Fate') txt += tokenHelper.getFate(token)
if (settings.onClick == 'visibility') { //toggle visibility
if (MODULE.getPermission('TOKEN','VISIBILITY') == false ) {