added support for fate and wounds.
This commit is contained in:
@@ -186,6 +186,12 @@ export class TokenHelper{
|
||||
return this.system.getProficiency(token);
|
||||
}
|
||||
|
||||
/* WFRP 4E */
|
||||
getFate(token) {
|
||||
return this.system.getFate(token)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Conditions
|
||||
*/
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user