WIP comit

with @solo
This commit is contained in:
Lyle hayhurst
2021-06-01 19:57:44 -05:00
parent ebdc1b5e5c
commit efbbdf7760
3 changed files with 122 additions and 1 deletions

View File

@@ -390,7 +390,7 @@ Hooks.on('updateToken',(scene,token)=>{
if (macroControl != undefined) macroControl.updateAll();
});
Hooks.on('updateActor',(scene,actor)=>{
Hooks.on('updateActor',(actor)=>{
if (enableModule == false || ready == false) return;
let children = canvas.tokens.children[0].children;
for (let i=0; i<children.length; i++){

View File

@@ -2,6 +2,7 @@ import {dnd5e} from "./dnd5e.js"
import {dnd35e} from "./dnd35e.js"
import {pf2e} from "./pf2e.js"
import {demonlord} from "./demonlord.js";
import {wfrp4} from "./wfrp4.js"
import {compatibleCore} from "../misc.js";
export class TokenHelper{
@@ -14,6 +15,7 @@ export class TokenHelper{
if (game.system.id == 'D35E' || game.system.id == 'pf1') this.system = new dnd35e();
else if (game.system.id == 'pf2e') this.system = new pf2e();
else if (game.system.id == 'demonlord') this.system = new demonlord();
else if (game.system.id == 'wfrp4') this.system = new wfrp4();
else this.system = new dnd5e(); //default to dnd5e
}

119
src/systems/wfrp4.js Normal file
View File

@@ -0,0 +1,119 @@
import {compatibleCore} from "../misc.js";
export class wfrp4{
constructor(){
}
getHP(token) {
const wounds = token.actor.data.data.status.wounds
return {
value: wounds.value,
max: wounds.max
}
}
getTempHP(token) {
return;
}
getAC(token) {
return;
}
getShieldHP(token) {
return;
}
getSpeed(token) {
return;
}
getInitiative(token) {
return;
}
toggleInitiative(token) {
return;
}
getPassivePerception(token) {
return;
}
getPassiveInvestigation(token) {
return;
}
getAbility(token, ability) {
return;
}
getAbilityModifier(token, ability) {
return;
}
getAbilitySave(token, ability) {
return;
}
getSkill(token, skill) {
return;
}
getProficiency(token) {
return;
}
getConditionIcon(condition) {
return;
}
getConditionActive(token,condition) {
return;
}
async toggleCondition(token,condition) {
if (condition == undefined) condition = 'removeAll';
if (condition == 'removeAll'){
for( let effect of token.actor.effects)
await effect.delete();
}
else {
const effect = CONFIG.statusEffects.find(e => e.id === condition);
await token.toggleEffect(effect);
}
return true;
}
/**
* Roll
*/
roll(token,roll,options,ability,skill,save) {
return;
}
/**
* Items
*/
getItems(token,itemType) {
if (itemType == undefined) itemType = 'any';
const allItems = token.actor.items;
if (itemType == 'any') return allItems.filter(i => i.type == 'item');
}
getItemUses(item) {
return {available: item.data.data.quantity};
}
/**
* Spells
*/
getSpells(token,level) {
return;
}
getSpellUses(token,level,item) {
return;
}
}