Data model change

This commit is contained in:
sladecraven 2022-07-25 19:13:52 +02:00
parent dbf9c01cd7
commit 918d69e677
5 changed files with 55 additions and 108 deletions

View File

@ -80,7 +80,7 @@ export class CrucibleActor extends Actor {
/* -------------------------------------------- */
getEncumbranceCapacity() {
return this.data.data.statistics.str.value * 25
return 1;
}
/* -------------------------------------------- */
@ -129,9 +129,6 @@ export class CrucibleActor extends Actor {
/* -------------------------------------------- */
getSkills() {
let comp = duplicate(this.data.items.filter(item => item.type == 'skill') || []);
for (let c of comp) {
c.data.dice = CrucibleUtility.getDiceFromLevel(c.data.level);
}
return comp;
}

View File

@ -86,6 +86,8 @@ export class CrucibleUtility {
const templatePaths = [
'systems/fvtt-crucible-rpg/templates/editor-notes-gm.html',
'systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html',
'systems/fvtt-crucible-rpg/templates/partial-actor-status.html',
'systems/fvtt-crucible-rpg/templates/partial-options-abilities.html',
'systems/fvtt-crucible-rpg/templates/partial-item-nav.html',
'systems/fvtt-crucible-rpg/templates/partial-item-description.html',

View File

@ -22,36 +22,43 @@
"str":{
"label": "Strength",
"abbrev": "str",
"col": 1,
"value": 1
},
"agi":{
"label": "Agility",
"abbrev": "agi",
"col": 1,
"value": 1
},
"dex":{
"label": "Dexterity",
"abbrev": "dex",
"col": 1,
"value": 1
},
"con":{
"label": "Constitution",
"abbrev": "con",
"col": 1,
"value": 1
},
"int":{
"label": "Intelligence",
"abbrev": "int",
"col": 2,
"value": 1
},
"wit":{
"label": "Wits",
"abbrev": "wit",
"col": 2,
"value": 1
},
"cha":{
"label": "Charisma",
"abbrev": "cha",
"col": 2,
"value": 1
}
},

View File

@ -11,60 +11,28 @@
<div class="flexrow">
<div class="stat-item">
<ul>
{{#each data.statistics as |stat key|}}
{{#if (eq stat.col 1)}}
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-stat-block.html stat=stat key=key}}
{{#each data.abilities as |ability key|}}
{{#if (eq ability.col 1)}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}}
{{/if}}
{{/each}}
<li class="item flexrow list-item color-class-pool item-stat-roll" data-attr-key="pool">
<span class="stat-icon">
<img class="stat-icon" src="icons/dice/d12black.svg">
</span>
<span class="stat-label stat-margin" name="pool">
<h4 class="stat-text-white stat-margin"><a class="generic-pool-roll stat-margin"
data-stat-key="pool">Dice Pool</a></h4>
</span>
</li>
</ul>
</div>
<div class="stat-item">
<ul>
{{#each data.statistics as |stat key|}}
{{#if (eq stat.col 2)}}
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-stat-block.html stat=stat key=key}}
{{#each data.abilities as |ability key|}}
{{#if (eq ability.col 2)}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html ability=ability key=key}}
{{/if}}
{{/each}}
<li class="item flexrow list-item color-class-mr item-stat-roll" data-attr-key="mr">
<span class="stat-icon">
<img class="stat-icon" src="systems/fvtt-pegasus-rpg/images/icons/MR.webp">
</span>
<span class="stat-label stat-margin" name="mr">
<h4 class="stat-text-white stat-margin"><a class="roll-stat stat-margin" data-stat-key="mr">MR</a>
</h4>
</span>
<select class="status-small-label color-class-common" type="text" name="data.mr.value"
value="{{data.mr.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.mr.value}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
<input type="text" class="input-numeric-short padd-right status-small-label color-class-common"
name="data.mr.mod" value="{{data.mr.mod}}" data-dtype="Number" {{#unless
@root.editScore}}disabled{{/unless}} />
</li>
</ul>
</div>
<div class="stat-item status-block">
{{> systems/fvtt-pegasus-rpg/templates/partial-actor-status.html}}
{{> systems/fvtt-crucible-rpg/templates/partial-actor-status.html}}
</div>
<!--
<label class="status-small-label">Active NRG</label>
<input type="text" class="padd-right status-small-label no-grow" name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
-->
</div>
</div>
</div>
@ -73,9 +41,9 @@
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="skills">Skills</a>
<a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="specs">Specialisations</a>
<a class="item" data-tab="powers">Powers/Abilities</a>
<a class="item" data-tab="lore">Lore</a>
<a class="item" data-tab="equipment">Equipment</a>
<a class="item" data-tab="biodata">Biography</a>
</nav>
@ -83,6 +51,41 @@
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Skills Tab --}}
<div class="tab items" data-group="primary" data-tab="skills">
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Skills</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Ability</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Score</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Background</label>
</span>
</li>
{{#each skills as |skill key|}}
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{skill._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{skill.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{skill.name}}</a></span>
<span class="item-field-label-short">{{upper skill.data.ability}}</span>
<span class="item-field-label-short">{{skill.data.dice}}</span>
<span class="item-field-label-long">&nbsp;-&nbsp;</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
{{!-- Combat Tab --}}
<div class="tab fight" data-group="primary" data-tab="combat">
<div class="flexcol">
@ -317,55 +320,9 @@
</div>
</div>
{{!-- Other Tab --}}
<div class="tab items" data-group="primary" data-tab="specs">
<ul class="stat-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Specialisations</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Stat</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Dice</label>
</span>
<span class="item-field-label-long">
<label class="short-label">Powergroup</label>
</span>
</li>
{{#each specs as |spec key|}}
<li class="item stat flexrow list-item list-item-shadow" data-item-id="{{spec._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{spec.img}}" /></a>
<span class="item-name-label"><a class="roll-spec">{{spec.name}}</a></span>
<span class="item-field-label-short">{{upper spec.data.statistic}}</span>
<span class="item-field-label-short">{{spec.data.dice}}</span>
{{#if spec.data.ispowergroup}}
{{#if spec.data.powersactivated}}
<span class="item-field-label-long"><a class="spec-group-deactivate">Deactivate</a></span>
{{else}}
<span class="item-field-label-long"><a class="spec-group-activate">Activate</a></span>
{{/if}}
{{else}}
<span class="item-field-label-long">&nbsp;-&nbsp;</span>
{{/if}}
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Powers Tab --}}
<div class="tab fight" data-group="primary" data-tab="powers">
<div class="tab fight" data-group="primary" data-tab="lore">
<div class="flexcol">

View File

@ -1,16 +0,0 @@
<li class="item flexrow list-item color-class-{{lower stat.abbrev}} item-stat-roll" data-attr-key="{{key}}">
<span class="stat-icon">
<img class="stat-icon" src="systems/fvtt-pegasus-rpg/images/icons/{{stat.abbrev}}.webp">
</span>
<span class="stat-label stat-margin" name="{{key}}">
<h4 class="stat-text-white stat-margin"><a class="roll-stat stat-margin" data-stat-key="{{key}}">{{stat.abbrev}}</a></h4>
</span>
<select class="status-small-label color-class-common" type="text" name="data.statistics.{{key}}.value" value="{{stat.value}}"
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select stat.value}}
{{{@root.optionsDiceList}}}
{{/select}}
</select>
<input type="text" class="input-numeric-short padd-right status-small-label color-class-common" name="data.statistics.{{key}}.mod" value="{{stat.mod}}"
data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}} />
</li>