Adds gear and spells as items.

Adds custom roll logic, inclusing chat message.
This commit is contained in:
mstein
2022-06-19 00:18:41 +02:00
parent ca82fa119f
commit 8b6bfd2efb
33 changed files with 1334 additions and 482 deletions
@@ -35,34 +35,49 @@
<td>{{localize "midgard5.actor-st-long"}}</td>
<td><input name="data.attributes.st.value" type="text" value="{{data.attributes.st.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.st.bonus" type="text" value="{{data.attributes.st.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="st" /></td>
<td>{{localize "midgard5.actor-gs-long"}}</td>
<td><input name="data.attributes.gs.value" type="text" value="{{data.attributes.gs.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.gs.bonus" type="text" value="{{data.attributes.gs.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="gs" /></td>
<td>{{localize "midgard5.actor-gw-long"}}</td>
<td><input name="data.attributes.gw.value" type="text" value="{{data.attributes.gw.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.gw.bonus" type="text" value="{{data.attributes.gw.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="gw" /></td>
</tr>
<tr>
<td>{{localize "midgard5.actor-ko-long"}}</td>
<td><input name="data.attributes.ko.value" type="text" value="{{data.attributes.ko.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.ko.bonus" type="text" value="{{data.attributes.ko.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="ko" /></td>
<td>{{localize "midgard5.actor-in-long"}}</td>
<td><input name="data.attributes.in.value" type="text" value="{{data.attributes.in.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.in.bonus" type="text" value="{{data.attributes.in.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="in" /></td>
<td>{{localize "midgard5.actor-zt-long"}}</td>
<td><input name="data.attributes.zt.value" type="text" value="{{data.attributes.zt.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.zt.bonus" type="text" value="{{data.attributes.zt.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="zt" /></td>
</tr>
<tr>
<td>{{localize "midgard5.actor-au-long"}}</td>
<td><input name="data.attributes.au.value" type="text" value="{{data.attributes.au.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.au.bonus" type="text" value="{{data.attributes.au.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="au" /></td>
<td>{{localize "midgard5.actor-pa-long"}}</td>
<td><input name="data.attributes.pa.value" type="text" value="{{data.attributes.pa.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.pa.bonus" type="text" value="{{data.attributes.pa.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="pa" /></td>
<td>{{localize "midgard5.actor-wk-long"}}</td>
<td><input name="data.attributes.wk.value" type="text" value="{{data.attributes.wk.value}}" data-dtype="Number" /></td>
<td><input name="data.attributes.wk.bonus" type="text" value="{{data.attributes.wk.bonus}}" data-dtype="Number" placeholder="Bonus" /></td>
<td><button class="roll-button roll-attribute-button" data-attribute="wk" /></td>
</tr>
</tbody>
</table>
+55 -3
View File
@@ -7,12 +7,64 @@
</tr>
</thead>
<tbody>
{{#each data.calc.gear.weapons as |weapon itemId|}}
{{#each data.calc.gear.weapons as |item itemId|}}
<tr data-item="{{itemId}}">
<td class="padding edit-item">{{weapon.label}}</td>
<td class="center">{{weapon.calc.ew}}</td>
<td class="padding edit-item">{{item.label}}</td>
<td class="center">{{item.calc.ew}}</td>
<td><button class="roll-weapon-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
<tr data-item="{{itemId}}">
<td class="padding edit-item">{{localize "midgard5.brawl"}}</td>
<td class="center">{{data.calc.stats.brawlEw}}</td>
<td><button class="roll-brawl-button">{{localize "midgard5.roll"}}</button></td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>{{localize "ITEM.TypeDefensiveWeapon"}}</th>
<th>{{localize "midgard5.ew"}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each data.calc.gear.defensiveWeapons as |item itemId|}}
<tr data-item="{{itemId}}">
<td class="padding edit-item">{{item.label}}</td>
<td class="center">{{item.calc.ew}}</td>
<td><button class="roll-weapon-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
</tbody>
</table>
<table>
<thead>
<tr>
<th>{{localize "ITEM.TypeArmor"}}</th>
<th>{{localize "midgard5.actor-lp-short"}}</th>
<th>{{localize "midgard5.actor-ap-short"}}</th>
<th>{{localize "midgard5.attackBonus-short"}}</th>
<th>{{localize "midgard5.defenseBonus-short"}}</th>
<th>B</th>
<th>Gw</th>
</tr>
</thead>
<tbody>
{{#each data.calc.gear.armor as |item itemId|}}
<tr data-item="{{itemId}}">
<td class="padding edit-item">{{item.label}}</td>
<td class="center">{{actorItemValue ../actor._id itemId "lpProtection"}}</td>
<td class="center">{{actorItemValue ../actor._id itemId "apProtection"}}</td>
<td class="center">{{actorItemValue ../actor._id itemId "stats.attackBonus"}}</td>
<td class="center">{{actorItemValue ../actor._id itemId "stats.defenseBonus"}}</td>
<td class="center">{{actorItemValue ../actor._id itemId "stats.movementBonus"}}</td>
<td class="center">{{actorItemValue ../actor._id itemId "attributeMod.gw"}}</td>
</tr>
{{/each}}
</tbody>
</table>
+4
View File
@@ -26,5 +26,9 @@
{{> "systems/midgard5/templates/sheets/character/gear.hbs"}}
</div>
<div class="tab base_values flexcol" data-group="primary" data-tab="spells">
{{> "systems/midgard5/templates/sheets/character/spells.hbs"}}
</div>
</section>
</form>
+21 -31
View File
@@ -18,14 +18,6 @@
<td><button class="roll-learned-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
<tr class="new-skill">
<td class="padding">{{localize "midgard5.new-skill"}}</td>
<td></td>
<td></td>
<td></td>
<td><button data-skilltype="general" class="create-skill-button">{{localize "midgard5.learn"}}</button></td>
</tr>
</tbody>
</table>
@@ -49,14 +41,29 @@
<td><button class="roll-learned-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
</tbody>
</table>
<tr class="new-skill">
<td class="padding">{{localize "midgard5.new-skill"}}</td>
<td></td>
<td></td>
<td></td>
<td><button data-skilltype="language" class="create-skill-button">{{localize "midgard5.learn"}}</button></td>
<table>
<thead>
<tr>
<th>{{localize "midgard5.innate-ability"}}</th>
<th>{{localize "midgard5.fw"}}</th>
<th>{{localize "midgard5.bonus"}}</th>
<th>{{localize "midgard5.ew"}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each data.calc.skills.innate as |skill skillId|}}
<tr data-item="{{skillId}}">
<td class="padding edit-item">{{skill.label}}</td>
<td class="center">{{skill.fw}}</td>
<td class="center">{{skill.calc.bonus}}</td>
<td class="center">{{skill.calc.ew}}</td>
<td><button class="roll-learned-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
</tbody>
</table>
@@ -64,7 +71,6 @@
<thead>
<tr>
<th>{{localize "midgard5.weapon-skill"}}</th>
<th>{{localize "midgard5.special"}}</th>
<th>{{localize "midgard5.fw"}}</th>
<th>{{localize "midgard5.bonus"}}</th>
<th>{{localize "midgard5.ew"}}</th>
@@ -75,28 +81,12 @@
{{#each data.calc.skills.combat as |skill skillId|}}
<tr data-item="{{skillId}}">
<td class="padding edit-item">{{skill.label}}</td>
<td class="center">
{{#if (eq skillId ../data.skills.preferredCombatSkill)}}
<input type="checkbox" checked />
{{else}}
<input type="checkbox" class="change-special-combat-skill" />
{{/if}}
</td>
<td class="center">{{skill.fw}}</td>
<td class="center">{{skill.calc.bonus}}</td>
<td class="center">{{skill.calc.ew}}</td>
<td><button class="roll-learned-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
<tr class="new-skill">
<td class="padding">{{localize "midgard5.new-skill"}}</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td><button data-skilltype="combat" class="create-skill-button">{{localize "midgard5.learn"}}</button></td>
</tr>
</tbody>
</table>
+21
View File
@@ -0,0 +1,21 @@
<table>
<thead>
<tr>
<th>{{localize "ITEM.TypeSpell"}}</th>
<th>{{localize "midgard5.ew"}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each data.calc.spells as |item itemId|}}
<tr data-item="{{itemId}}">
<td class="padding edit-item">
<span>{{item.label}}</span>
<span class="spell-process">{{localize item.process}}</span>
</td>
<td class="center">{{item.calc.ew}}</td>
<td><button class="roll-weapon-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
</tbody>
</table>