Manage wounds

This commit is contained in:
2021-02-16 21:14:13 +01:00
parent de4bdb2403
commit cfcc3b3201
8 changed files with 119 additions and 34 deletions

View File

@ -14,7 +14,7 @@ export class SoSActorSheet extends ActorSheet {
classes: ["sos", "sheet", "actor"],
template: "systems/foundryvtt-shadows-over-sol/templates/actor-sheet.html",
width: 640,
//height: 720,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editStatSkill: false
@ -40,6 +40,10 @@ export class SoSActorSheet extends ActorSheet {
data.data.weapons = this.actor.data.items.filter( item => item.type == 'weapon');
data.data.armors = this.actor.data.items.filter( item => item.type == 'armor');
data.data.totalEncumbrance = SoSUtility.computeEncumbrance(this.actor.data.items);
data.data.wounds = duplicate(this.actor.data.data.wounds);
data.data.isGM = game.user.isGM;
data.data.currentWounds = this.actor.computeCurrentWounds();
data.data.totalWounds = this.actor.data.data.scores.wound.value;
data.data.subculture = this.actor.data.items.find( item => item.type == 'subculture');
data.data.geneline = this.actor.data.items.find( item => item.type == 'geneline');
@ -113,6 +117,11 @@ export class SoSActorSheet extends ActorSheet {
//console.log("Competence changed :", skillName);
this.actor.updateSkillExperience(skillName, parseInt(event.target.value));
});
html.find('.wound-value').change((event) => {
let woundName = event.currentTarget.attributes.woundname.value;
//console.log("Competence changed :", skillName);
this.actor.updateWound(woundName, parseInt(event.target.value));
});
html.find('.reset-deck-full').click((event) => {
this.actor.resetDeckFull();
this.render(true);