Start 0.8 support

This commit is contained in:
sladecraven 2021-05-22 23:20:23 +02:00
parent 8ab4c68924
commit 6ebc11c518
5 changed files with 130 additions and 88 deletions

View File

@ -23,34 +23,48 @@ export class SoSActorSheet extends ActorSheet {
/* -------------------------------------------- */ /* -------------------------------------------- */
getData() { getData() {
let data = super.getData(); const objectData = SoSUtility.data(this.object);
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: foundry.utils.deepClone(this.object.data),
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner
};
this.actor.checkDeck(); this.actor.checkDeck();
data.data.edgecard = this.actor.getEdgesCard(); formData.edgecard = this.actor.getEdgesCard();
data.data.deckSize = this.actor.getDeckSize(); formData.deckSize = this.actor.getDeckSize();
data.data.skills = this.actor.data.items.filter( item => item.type == 'skill').sort( (a, b) => { formData.skills = this.actor.data.items.filter( item => item.type == 'skill').sort( (a, b) => {
if ( a.name > b.name ) return 1; if ( a.name > b.name ) return 1;
return -1; return -1;
}); });
data.data.skill1 = data.data.skills.slice(0, Math.ceil(data.data.skills.length/2) ) formData.skill1 = formData.skills.slice(0, Math.ceil(formData.skills.length/2) )
data.data.skill2 = data.data.skills.slice(Math.ceil(data.data.skills.length/2), data.data.skills.length ) formData.skill2 = formData.skills.slice(Math.ceil(formData.skills.length/2), formData.skills.length )
data.data.consequences = this.actor.data.items.filter( item => item.type == 'consequence').sort( (a, b) => { formData.consequences = this.actor.data.items.filter( item => item.type == 'consequence').sort( (a, b) => {
if ( a.name > b.name ) return 1; if ( a.name > b.name ) return 1;
return -1; return -1;
}); });
data.data.gears = this.actor.data.items.filter( item => item.type == 'gear').concat( this.actor.data.items.filter( item => item.type == 'container') ); formData.gears = this.actor.data.items.filter( item => item.type == 'gear').concat( this.actor.data.items.filter( item => item.type == 'container') );
// Build the gear tree // Build the gear tree
data.data.gearsRoot = data.data.gears.filter(item => item.data.containerid == ""); formData.gearsRoot = formData.gears.filter(item => item.data.containerid == "");
for ( let container of data.data.gearsRoot) { for ( let container of formData.gearsRoot) {
if ( container.type == 'container') { if ( container.type == 'container') {
container.data.contains = [] container.data.contains = []
container.data.containerEnc = 0; container.data.containerEnc = 0;
for (let gear of data.data.gears) { for (let gear of data.data.gears) {
if ( gear.data.containerid == container._id) { if ( gear.data.containerid == container.id) {
container.data.contains.push( gear ); container.data.contains.push( gear );
if ( !gear.data.neg && !gear.data.software ) { if ( !gear.data.neg && !gear.data.software ) {
container.data.containerEnc += (gear.big > 0) ? gear.big : 1; container.data.containerEnc += (gear.big > 0) ? gear.big : 1;
@ -60,25 +74,25 @@ export class SoSActorSheet extends ActorSheet {
} }
} }
data.data.weapons = this.actor.data.items.filter( item => item.type == 'weapon'); formData.weapons = this.actor.data.items.filter( item => item.type == 'weapon');
data.data.armors = this.actor.data.items.filter( item => item.type == 'armor'); formData.armors = this.actor.data.items.filter( item => item.type == 'armor');
data.data.totalEncumbrance = SoSUtility.computeEncumbrance(this.actor.data.items); formData.totalEncumbrance = SoSUtility.computeEncumbrance(this.actor.data.items);
data.data.wounds = duplicate(this.actor.data.data.wounds); formData.wounds = duplicate(this.actor.data.data.wounds);
data.data.isGM = game.user.isGM; formData.isGM = game.user.isGM;
data.data.currentWounds = this.actor.computeCurrentWounds(); formData.currentWounds = this.actor.computeCurrentWounds();
data.data.totalWounds = this.actor.data.data.scores.wound.value; formData.totalWounds = this.actor.data.data.scores.wound.value;
data.data.subcultureList = this.actor.data.items.filter( item => item.type == 'subculture'); formData.subcultureList = this.actor.data.items.filter( item => item.type == 'subculture');
if ( data.data.subculture != "" ) { // background.subculture contains the main subculture ID if ( formData.subculture != "" ) { // background.subculture contains the main subculture ID
data.data.mainSubculture = data.data.subcultureList.find( subc => subc._id == data.data.subculture); formData.mainSubculture = formData.subcultureList.find( subc => subc._id == data.data.subculture);
} }
data.data.languageList = this.actor.data.items.filter( item => item.type == 'language'); formData.languageList = this.actor.data.items.filter( item => item.type == 'language');
data.data.weaknessList = this.actor.data.items.filter( item => item.type == 'weakness'); formData.weaknessList = this.actor.data.items.filter( item => item.type == 'weakness');
data.data.geneline = this.actor.data.items.find( item => item.type == 'geneline'); formData.geneline = this.actor.data.items.find( item => item.type == 'geneline');
data.data.editStatSkill = this.options.editStatSkill; formData.editStatSkill = this.options.editStatSkill;
//console.log("stats", data);
return data; console.log("stats", formData);
return formData;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -94,7 +108,7 @@ export class SoSActorSheet extends ActorSheet {
// Update Inventory Item // Update Inventory Item
html.find('.item-edit').click(ev => { html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item"); const li = $(ev.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("item-id")); const item = this.actor.items.get(li.data("item-id"));
item.sheet.render(true); item.sheet.render(true);
}); });
html.find('.item-equip').click(ev => { html.find('.item-equip').click(ev => {
@ -163,7 +177,7 @@ export class SoSActorSheet extends ActorSheet {
const li = $(event.currentTarget).parents(".item"); const li = $(event.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("item-id")); const item = this.actor.getOwnedItem(li.data("item-id"));
let severity = $(event.currentTarget).val(); let severity = $(event.currentTarget).val();
this.actor.updateOwnedItem( { _id: item._id, 'data.severity': severity}); this.actor.updateOwnedItem( { id: item.id, 'data.severity': severity});
this.render(true); this.render(true);
}); });
html.find('.lock-unlock-sheet').click((event) => { html.find('.lock-unlock-sheet').click((event) => {

View File

@ -34,17 +34,19 @@ export class SoSActor extends Actor {
return actor; return actor;
} }
data.items = []; let items = [];
let compendiumName = "foundryvtt-shadows-over-sol.skills"; let compendiumName = "foundryvtt-shadows-over-sol.skills";
if ( compendiumName ) { if ( compendiumName ) {
let skills = await SoSUtility.loadCompendium(compendiumName); let skills = await SoSUtility.loadCompendium(compendiumName);
data.items = data.items.concat( skills ); items = skills.map(i => i.toObject());
} }
compendiumName = "foundryvtt-shadows-over-sol.consequences"; compendiumName = "foundryvtt-shadows-over-sol.consequences";
if ( compendiumName ) { if ( compendiumName ) {
let consequences = await SoSUtility.loadCompendium(compendiumName) let consequences = await SoSUtility.loadCompendium(compendiumName)
data.items = data.items.concat(consequences); items = items.concat( consequences.map(i => i.toObject()) );
} }
data.items = items;
console.log(data);
return super.create(data, options); return super.create(data, options);
} }

View File

@ -56,8 +56,8 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */ /* -------------------------------------------- */
// Define custom Entity classes // Define custom Entity classes
CONFIG.Actor.entityClass = SoSActor; CONFIG.Actor.documentClass = SoSActor;
CONFIG.Combat.entityClass = SoSCombat; CONFIG.Combat.documentClass = SoSCombat;
CONFIG.SoS = { CONFIG.SoS = {
} }
@ -83,8 +83,8 @@ Hooks.once("init", async function () {
function welcomeMessage() { function welcomeMessage() {
//ChatUtility.removeMyChatMessageContaining('<div id="welcome-message-sos">'); //ChatUtility.removeMyChatMessageContaining('<div id="welcome-message-sos">');
ChatMessage.create({ ChatMessage.create({
user: game.user._id, user: game.user.id,
whisper: [game.user._id], whisper: [game.user.id],
content: `<div id="welcome-message-sos"><span class="rdd-roll-part">Welcome !</div> content: `<div id="welcome-message-sos"><span class="rdd-roll-part">Welcome !</div>
` }); ` });
} }

View File

@ -8,7 +8,7 @@ const severity2malus = { "none": 0, "light": -1, "moderate": -2, "severe": -3, "
const severity2bonus = { "none": 0, "light": 1, "moderate": 2, "severe": 3, "critical": 4}; const severity2bonus = { "none": 0, "light": 1, "moderate": 2, "severe": 3, "critical": 4};
/* -------------------------------------------- */ /* -------------------------------------------- */
export class SoSUtility extends Entity { export class SoSUtility {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async preloadHandlebarsTemplates() { static async preloadHandlebarsTemplates() {
@ -55,6 +55,32 @@ export class SoSUtility extends Entity {
} }
} }
/* -------------------------------------------- */
static data(it) {
if (it instanceof Actor || it instanceof Item || it instanceof Combatant) {
return it.data;
}
return it;
}
/* -------------------------------------------- */
static templateData(it) {
return SoSUtility.data(it)?.data ?? {}
}
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium);
return await pack?.getDocuments() ?? [];
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await SoSUtility.loadCompendiumData(compendium);
return compendiumData.filter(filter);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static async loadCompendiumNames(compendium) { static async loadCompendiumNames(compendium) {
const pack = game.packs.get(compendium); const pack = game.packs.get(compendium);
@ -64,13 +90,13 @@ export class SoSUtility extends Entity {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) { /*static async loadCompendium(compendium, filter = item => true) {
let compendiumItems = await SoSUtility.loadCompendiumNames(compendium); let compendiumItems = await SoSUtility.loadCompendiumNames(compendium);
const pack = game.packs.get(compendium); const pack = game.packs.get(compendium);
let list = []; let list = [];
for (let compendiumItem of compendiumItems) { for (let compendiumItem of compendiumItems) {
await pack.getEntity(compendiumItem._id).then(it => { await pack.getEntity(compendiumItem.id).then(it => {
const item = it.data; const item = it.data;
if (filter(item)) { if (filter(item)) {
list.push(item); list.push(item);
@ -78,7 +104,7 @@ export class SoSUtility extends Entity {
}); });
}; };
return list; return list;
} }*/
/* -------------------------------------------- */ /* -------------------------------------------- */
static updateCombat(combat, round, diff, id) { static updateCombat(combat, round, diff, id) {

View File

@ -5,8 +5,8 @@
<header class="sheet-header"> <header class="sheet-header">
<div class="header-fields"> <div class="header-fields">
<div class="flexrow"> <div class="flexrow">
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" /> <img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{data.name}}" />
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</div> </div>
</div> </div>
</header> </header>
@ -28,8 +28,8 @@
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol"> <div class="flex-group-left flexcol">
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="lock-unlock-sheet"><img class="small-button-container"
src="systems/foundryvtt-shadows-over-sol/img/icons/{{#if data.editStatSkill}}unlocked.svg{{else}}locked.svg{{/if}}" alt="lock/unlock" src="systems/foundryvtt-shadows-over-sol/img/icons/{{#if editStatSkill}}unlocked.svg{{else}}locked.svg{{/if}}" alt="lock/unlock"
>{{#if data.editStatSkill}}Lock{{else}}Unlock{{/if}}</a></span> >{{#if editStatSkill}}Lock{{else}}Unlock{{/if}}</a></span>
<ul class="stat-list alternate-list"> <ul class="stat-list alternate-list">
<li class="stat flexrow" > <li class="stat flexrow" >
<span class="stat-label flexrow tooltip tooltip-nobottom" name="statlabel">Stat name</span> <span class="stat-label flexrow tooltip tooltip-nobottom" name="statlabel">Stat name</span>
@ -37,7 +37,7 @@
<span class="stat-label flexrow tooltip tooltip-nobottom" name="statlabel">XP</span> <span class="stat-label flexrow tooltip tooltip-nobottom" name="statlabel">XP</span>
</li> </li>
{{#each data.stats as |stat key|}} {{#each data.data.stats as |stat key|}}
{{#if stat.isLevelUp}} {{#if stat.isLevelUp}}
<li class="stat flexrow xp-level-up" data-attribute="{{key}}"> <li class="stat flexrow xp-level-up" data-attribute="{{key}}">
<span class="stat-label flexrow tooltip tooltip-nobottom" name="data.stats.{{key}}.label"> <span class="stat-label flexrow tooltip tooltip-nobottom" name="data.stats.{{key}}.label">
@ -48,12 +48,12 @@
<li class="stat flexrow list-item" data-attribute="{{key}}"> <li class="stat flexrow list-item" data-attribute="{{key}}">
{{/if}} {{/if}}
<span class="stat-label flexrow tooltip tooltip-nobottom" name="data.stat.{{key}}.label"><a name={{key}}>{{localize stat.label}}</a></span> <span class="stat-label flexrow tooltip tooltip-nobottom" name="data.stat.{{key}}.label"><a name={{key}}>{{localize stat.label}}</a></span>
<select class="stat-value flexrow" type="text" name="data.stats.{{key}}.value" value="{{stat.value}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}}> <select class="stat-value flexrow" type="text" name="data.stats.{{key}}.value" value="{{stat.value}}" data-dtype="Number" {{#unless @root.editStatSkill}}disabled{{/unless}}>
{{#select stat.value}} {{#select stat.value}}
{{>"systems/foundryvtt-shadows-over-sol/templates/stat-option-list.html"}} {{>"systems/foundryvtt-shadows-over-sol/templates/stat-option-list.html"}}
{{/select}} {{/select}}
</select> </select>
<input class="stat-xp flexrow" type="text" name="data.stats.{{key}}.xp" value="{{stat.xp}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}} /> <input class="stat-xp flexrow" type="text" name="data.stats.{{key}}.xp" value="{{stat.xp}}" data-dtype="Number" {{#unless @root.editStatSkill}}disabled{{/unless}} />
<span class="flexrow"><img class="cardsuit-img" src="systems/foundryvtt-shadows-over-sol/img/cards/{{stat.cardsuit}}.webp" /></span> <span class="flexrow"><img class="cardsuit-img" src="systems/foundryvtt-shadows-over-sol/img/cards/{{stat.cardsuit}}.webp" /></span>
</li> </li>
{{/each}} {{/each}}
@ -66,14 +66,14 @@
<span class="generic-label flexrow tooltip tooltip-nobottom" name="statlabel">Value</span> <span class="generic-label flexrow tooltip tooltip-nobottom" name="statlabel">Value</span>
<span class="generic-label flexrow tooltip tooltip-nobottom" name="statlabel">Bonus/Malus</span> <span class="generic-label flexrow tooltip tooltip-nobottom" name="statlabel">Bonus/Malus</span>
</li> </li>
{{#each data.scores as |score key|}} {{#each data.data.scores as |score key|}}
<li class="stat flexrow list-item" data-attribute="{{key}}"> <li class="stat flexrow list-item" data-attribute="{{key}}">
<span class="generic-label flexrow tooltip tooltip-nobottom" name="data.scores.{{key}}.label">{{localize score.label}}</span> <span class="generic-label flexrow tooltip tooltip-nobottom" name="data.scores.{{key}}.label">{{localize score.label}}</span>
<input class="stat-value flexrow" type="text" name="data.scores.{{key}}.value" value="{{score.value}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}} /> <input class="stat-value flexrow" type="text" name="data.scores.{{key}}.value" value="{{score.value}}" data-dtype="Number" {{#unless @root.editStatSkill}}disabled{{/unless}} />
{{#if (eq key 'defense')}} {{#if (eq key 'defense')}}
<input class="stat-value flexrow" type="text" name="data.scores.{{key}}.critical" value="{{score.critical}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}} /> <input class="stat-value flexrow" type="text" name="data.scores.{{key}}.critical" value="{{score.critical}}" data-dtype="Number" {{#unless @root.editStatSkill}}disabled{{/unless}} />
{{/if}} {{/if}}
<input class="stat-value flexrow" type="text" name="data.scores.{{key}}.bonusmalus" value="{{score.bonusmalus}}" data-dtype="Number" {{#unless @root.data.editStatSkill}}disabled{{/unless}} /> <input class="stat-value flexrow" type="text" name="data.scores.{{key}}.bonusmalus" value="{{score.bonusmalus}}" data-dtype="Number" {{#unless @root.editStatSkill}}disabled{{/unless}} />
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
@ -81,7 +81,7 @@
</div> </div>
<div class="flexcol"> <div class="flexcol">
<h3 class="edge-name">Current deck size : {{data.deckSize}} cards</h3> <h3 class="edge-name">Current deck size : {{deckSize}} cards</h3>
<div class="flexrow"> <div class="flexrow">
<span class="edge-name"><a class="card-button reset-deck-full">Reset full deck and edges</a></span> <span class="edge-name"><a class="card-button reset-deck-full">Reset full deck and edges</a></span>
<span class="edge-name"><a class="card-button draw-new-edge">Draw a new Edge card</a></span> <span class="edge-name"><a class="card-button draw-new-edge">Draw a new Edge card</a></span>
@ -90,7 +90,7 @@
<span class="edge-name"> <span class="edge-name">
<h3 class="edge-name">Edge cards : </h3> <h3 class="edge-name">Edge cards : </h3>
<div class="flexrow"> <div class="flexrow">
{{#each data.edgecard as |card key|}} {{#each edgecard as |card key|}}
<div class="flexcol"> <div class="flexcol">
<img class="card-img" src="{{card.path}}" data-edit="img" title="{{card.cardName}}" /> <img class="card-img" src="{{card.path}}" data-edit="img" title="{{card.cardName}}" />
<span class="edge-name"><a class="card-button discard-card" data-discard="{{card.cardName}}">Discard</a></span> <span class="edge-name"><a class="card-button discard-card" data-discard="{{card.cardName}}">Discard</a></span>
@ -106,8 +106,8 @@
<div class="tab skills" data-group="primary" data-tab="skills"> <div class="tab skills" data-group="primary" data-tab="skills">
<div class="flexrow"> <div class="flexrow">
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="lock-unlock-sheet"><img class="small-button-container"
src="systems/foundryvtt-shadows-over-sol/img/icons/{{#if data.editStatSkill}}unlocked.svg{{else}}locked.svg{{/if}}" alt="lock/unlock" src="systems/foundryvtt-shadows-over-sol/img/icons/{{#if editStatSkill}}unlocked.svg{{else}}locked.svg{{/if}}" alt="lock/unlock"
>{{#if data.editStatSkill}}Lock{{else}}Unlock{{/if}}</a></span> >{{#if editStatSkill}}Lock{{else}}Unlock{{/if}}</a></span>
</div> </div>
<span class="generic-label">Skills</span> <span class="generic-label">Skills</span>
@ -115,11 +115,11 @@
<div class="flex-group-left flexcol skill-column"> <div class="flex-group-left flexcol skill-column">
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each data.skill1 as |skill key|}} {{#each skill1 as |skill key|}}
{{#if skill.data.isLevelUp}} {{#if skill.data.isLevelUp}}
<li class="item flexrow xp-level-up" data-item-id="{{skill._id}}"> <li class="item flexrow xp-level-up" data-item-id="{{skill.id}}">
{{else}} {{else}}
<li class="item flexrow list-item" data-item-id="{{skill._id}}"> <li class="item flexrow list-item" data-item-id="{{skill.id}}">
{{/if}} {{/if}}
<img class="sheet-skill-img" src="{{skill.img}}"/> <img class="sheet-skill-img" src="{{skill.img}}"/>
{{#if skill.data.isLevelUp}} {{#if skill.data.isLevelUp}}
@ -143,11 +143,11 @@
<div class="flex-group-left flexcol skill-column"> <div class="flex-group-left flexcol skill-column">
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each data.skill2 as |skill key|}} {{#each skill2 as |skill key|}}
{{#if skill.data.isLevelUp}} {{#if skill.data.isLevelUp}}
<li class="item flexrow xp-level-up" data-item-id="{{skill._id}}"> <li class="item flexrow xp-level-up" data-item-id="{{skill.id}}">
{{else}} {{else}}
<li class="item flexrow list-item" data-item-id="{{skill._id}}"> <li class="item flexrow list-item" data-item-id="{{skill.id}}">
{{/if}} {{/if}}
<img class="sheet-skill-img" src="{{skill.img}}"/> <img class="sheet-skill-img" src="{{skill.img}}"/>
{{#if skill.data.isLevelUp}} {{#if skill.data.isLevelUp}}
@ -174,24 +174,24 @@
{{!-- Consequences Tab --}} {{!-- Consequences Tab --}}
<div class="tab consequences" data-group="primary" data-tab="consequences"> <div class="tab consequences" data-group="primary" data-tab="consequences">
<span><a class="lock-unlock-sheet"><img class="small-button-container" <span><a class="lock-unlock-sheet"><img class="small-button-container"
src="systems/foundryvtt-shadows-over-sol/img/icons/{{#if data.editStatSkill}}unlocked.svg{{else}}locked.svg{{/if}}" alt="lock/unlock" src="systems/foundryvtt-shadows-over-sol/img/icons/{{#if editStatSkill}}unlocked.svg{{else}}locked.svg{{/if}}" alt="lock/unlock"
>{{#if data.editStatSkill}}Lock{{else}}Unlock{{/if}}</a></span> >{{#if editStatSkill}}Lock{{else}}Unlock{{/if}}</a></span>
<h4>Wounds & Conséquences</h4> <h4>Wounds & Conséquences</h4>
<div class="grid grid-2col"> <div class="grid grid-2col">
<div class="flex-group-left flexcol skill-column"> <div class="flex-group-left flexcol skill-column">
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
<li class="item flexrow list-item" data-wound-name="light"><h4>Wounds : </h4></li> <li class="item flexrow list-item" data-wound-name="light"><h4>Wounds : </h4></li>
<li class="item flexrow list-item" data-wound-name="light"><span class="skill-label">Light :</span> <li class="item flexrow list-item" data-wound-name="light"><span class="skill-label">Light :</span>
<input class="wound-value" type="text" woundname="light" value="{{numberFormat data.wounds.light decimals=0}}" data-dtype="number" {{#unless @root.data.editStatSkill}}disabled{{/unless}}/> <input class="wound-value" type="text" woundname="light" value="{{numberFormat data.wounds.light decimals=0}}" data-dtype="number" {{#unless @root.editStatSkill}}disabled{{/unless}}/>
</li> </li>
<li class="item flexrow list-item" data-wound-name="moderate"><span class="skill-label">Moderate :</span> <li class="item flexrow list-item" data-wound-name="moderate"><span class="skill-label">Moderate :</span>
<input class="wound-value" type="text" woundname="moderate" value="{{numberFormat data.wounds.moderate decimals=0}}" data-dtype="number" {{#unless @root.data.editStatSkill}}disabled{{/unless}}/> <input class="wound-value" type="text" woundname="moderate" value="{{numberFormat data.wounds.moderate decimals=0}}" data-dtype="number" {{#unless @root.editStatSkill}}disabled{{/unless}}/>
</li> </li>
<li class="item flexrow list-item" data-wound-name="severe"><span class="skill-label">Severe :</span> <li class="item flexrow list-item" data-wound-name="severe"><span class="skill-label">Severe :</span>
<input class="wound-value" type="text" woundname="severe" value="{{numberFormat data.wounds.severe decimals=0}}" data-dtype="number" {{#unless @root.data.editStatSkill}}disabled{{/unless}}/> <input class="wound-value" type="text" woundname="severe" value="{{numberFormat data.wounds.severe decimals=0}}" data-dtype="number" {{#unless @root.editStatSkill}}disabled{{/unless}}/>
</li> </li>
<li class="item flexrow list-item" data-wound-name="critical"><span class="skill-label">Critical :</span> <li class="item flexrow list-item" data-wound-name="critical"><span class="skill-label">Critical :</span>
<input class="wound-value" type="text" woundname="critical" value="{{numberFormat data.wounds.critical decimals=0}}" data-dtype="number" {{#unless @root.data.editStatSkill}}disabled{{/unless}}/> <input class="wound-value" type="text" woundname="critical" value="{{numberFormat data.wounds.critical decimals=0}}" data-dtype="number" {{#unless @root.editStatSkill}}disabled{{/unless}}/>
</li> </li>
<li class="item flexrow list-item" data-wound-name="critical"><span class="skill-label">Total :</span> <li class="item flexrow list-item" data-wound-name="critical"><span class="skill-label">Total :</span>
<span class="skill-label">{{data.currentWounds}} / {{data.totalWounds}}</span> <span class="skill-label">{{data.currentWounds}} / {{data.totalWounds}}</span>
@ -200,8 +200,8 @@
</div> </div>
<div class="flex-group-left flexcol skill-column"> <div class="flex-group-left flexcol skill-column">
<ul class="item-list alterne-list"> <ul class="item-list alterne-list">
{{#each data.consequences as |conseq key|}} {{#each consequences as |conseq key|}}
<li class="item flexrow list-item" data-item-id="{{conseq._id}}"> <li class="item flexrow list-item" data-item-id="{{conseq.id}}">
<img class="sheet-skill-img" src="{{conseq.img}}"/> <img class="sheet-skill-img" src="{{conseq.img}}"/>
<span class="conseq-label">{{conseq.name}}</span> <span class="conseq-label">{{conseq.name}}</span>
<select class="consequence-severity" type="text" name="conseq.data.severity" value="{{conseq.data.severity}}" data-dtype="String"> <select class="consequence-severity" type="text" name="conseq.data.severity" value="{{conseq.data.severity}}" data-dtype="String">
@ -227,12 +227,12 @@
{{!-- Gears Tab --}} {{!-- Gears Tab --}}
<div class="tab gears" data-group="primary" data-tab="gears"> <div class="tab gears" data-group="primary" data-tab="gears">
<div> <div>
<h4>Total Encumbrance : {{data.totalEncumbrance}} / {{data.stats.strength.value}}</h4> <h4>Total Encumbrance : {{totalEncumbrance}} / {{stats.strength.value}}</h4>
</div> </div>
<div><h4>Weapons</h4></div> <div><h4>Weapons</h4></div>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
{{#each data.weapons as |weapon key|}} {{#each weapons as |weapon key|}}
<li class="item flexrow list-item" data-item-id="{{weapon._id}}"> <li class="item flexrow list-item" data-item-id="{{weapon.id}}">
<img class="sheet-skill-img" src="{{weapon.img}}"/> <img class="sheet-skill-img" src="{{weapon.img}}"/>
<span class="weapon-label"><a>{{weapon.name}}</a></span> <span class="weapon-label"><a>{{weapon.name}}</a></span>
<div class="item-controls"> <div class="item-controls">
@ -245,8 +245,8 @@
</ul> </ul>
<div><h4>Armors</h4></div> <div><h4>Armors</h4></div>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
{{#each data.armors as |armor key|}} {{#each armors as |armor key|}}
<li class="item flexrow list-item" data-item-id="{{armor._id}}"> <li class="item flexrow list-item" data-item-id="{{armor.id}}">
<img class="sheet-skill-img" src="{{armor.img}}"/> <img class="sheet-skill-img" src="{{armor.img}}"/>
<span class="armor-label">{{armor.name}}</span> <span class="armor-label">{{armor.name}}</span>
<div class="item-controls"> <div class="item-controls">
@ -259,8 +259,8 @@
</ul> </ul>
<div><h4>Equipment/Gears</h4></div> <div><h4>Equipment/Gears</h4></div>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
{{#each data.gearsRoot as |gear key|}} {{#each gearsRoot as |gear key|}}
<li class="item flexrow list-item" data-item-id="{{gear._id}}"> <li class="item flexrow list-item" data-item-id="{{gear.id}}">
<img class="sheet-skill-img" src="{{gear.img}}"/> <img class="sheet-skill-img" src="{{gear.img}}"/>
<span class="conseq-label">{{gear.name}}</span> <span class="conseq-label">{{gear.name}}</span>
<div class="item-controls"> <div class="item-controls">
@ -271,7 +271,7 @@
</li> </li>
<ul class="item-list alternate-list list-item-margin1"> <ul class="item-list alternate-list list-item-margin1">
{{#each data.contains as |subgear key|}} {{#each data.contains as |subgear key|}}
<li class="item flexrow list-item" data-item-id="{{subgear._id}}"> <li class="item flexrow list-item" data-item-id="{{subgear.id}}">
<img class="sheet-skill-img" src="{{subgear.img}}"/> <img class="sheet-skill-img" src="{{subgear.img}}"/>
<span class="conseq-label">{{subgear.name}}</span> <span class="conseq-label">{{subgear.name}}</span>
<div class="item-controls"> <div class="item-controls">
@ -292,13 +292,13 @@
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
<li class="item flexrow list-item"> <li class="item flexrow list-item">
<label class="description-label generic-label">Geneline : </label> <label class="description-label generic-label">Geneline : </label>
<label class="description-label generic-label item-link"><a data-item-id="{{data.geneline._id}}">{{data.geneline.name}}</a></label> <label class="description-label generic-label item-link"><a data-item-id="{{data.geneline.id}}">{{data.geneline.name}}</a></label>
</li> </li>
<li class="item flexrow list-item"> <li class="item flexrow list-item">
<label class="description-label generic-label">Main Subculture :</label> <label class="description-label generic-label">Main Subculture :</label>
<select class="stat-value flexrow" type="text" name="data.subculture" value="{{data.subculture}}" data-dtype="String"> <select class="stat-value flexrow" type="text" name="data.subculture" value="{{data.subculture}}" data-dtype="String">
{{#select data.subculture}} {{#select subculture}}
{{#each data.subcultureList as |subculture key|}} {{#each subcultureList as |subculture key|}}
<option value="{{subculture.name}}">{{subculture.name}}</option> <option value="{{subculture.name}}">{{subculture.name}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
@ -339,8 +339,8 @@
<div class="flex-group-left flexcol genelang-column"> <div class="flex-group-left flexcol genelang-column">
<span class="description-label">Familiar Subcultures</span> <span class="description-label">Familiar Subcultures</span>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
{{#each data.subcultureList as |subculture key|}} {{#each subcultureList as |subculture key|}}
<li class="item flexrow list-item" data-item-id="{{subculture._id}}"> <li class="item flexrow list-item" data-item-id="{{subculture.id}}">
<img class="sheet-skill-img" src="{{subculture.img}}"/> <img class="sheet-skill-img" src="{{subculture.img}}"/>
<span class="conseq-label genelang-label">{{subculture.name}}</span> <span class="conseq-label genelang-label">{{subculture.name}}</span>
<div class="item-controls"> <div class="item-controls">
@ -354,8 +354,8 @@
<div class="flex-group-left flexcol genelang-column"> <div class="flex-group-left flexcol genelang-column">
<span class="description-label">Known Languages</span> <span class="description-label">Known Languages</span>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
{{#each data.languageList as |language key|}} {{#each languageList as |language key|}}
<li class="item flexrow list-item" data-item-id="{{language._id}}"> <li class="item flexrow list-item" data-item-id="{{language.id}}">
<img class="sheet-skill-img" src="{{language.img}}"/> <img class="sheet-skill-img" src="{{language.img}}"/>
<span class="conseq-label">{{language.name}}</span> <span class="conseq-label">{{language.name}}</span>
<div class="item-controls"> <div class="item-controls">
@ -369,8 +369,8 @@
<div class="flex-group-left flexcol genelang-column"> <div class="flex-group-left flexcol genelang-column">
<span class="description-label">Weaknesses</span> <span class="description-label">Weaknesses</span>
<ul class="item-list alternate-list"> <ul class="item-list alternate-list">
{{#each data.weaknessList as |weakness key|}} {{#each weaknessList as |weakness key|}}
<li class="item flexrow list-item" data-item-id="{{weakness._id}}"> <li class="item flexrow list-item" data-item-id="{{weakness.id}}">
<img class="sheet-skill-img" src="{{weakness.img}}"/> <img class="sheet-skill-img" src="{{weakness.img}}"/>
<span class="conseq-label">{{weakness.name}}</span> <span class="conseq-label">{{weakness.name}}</span>
<div class="item-controls"> <div class="item-controls">