Add weapon item handling

This commit is contained in:
mstein
2022-06-10 14:27:28 +02:00
parent 0f06d4020b
commit 7f7e305722
11 changed files with 252 additions and 88 deletions
+18
View File
@@ -0,0 +1,18 @@
<table>
<thead>
<tr>
<th>{{localize "ITEM.TypeWeapon"}}</th>
<th>{{localize "midgard5.ew"}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each data.calc.gear.weapons as |weapon itemId|}}
<tr data-item="{{itemId}}">
<td class="padding edit-item">{{weapon.label}}</td>
<td class="center">{{weapon.calc.ew}}</td>
<td><button class="roll-weapon-button">{{localize "midgard5.roll"}}</button></td>
</tr>
{{/each}}
</tbody>
</table>
+6 -6
View File
@@ -10,8 +10,8 @@
</thead>
<tbody>
{{#each data.calc.skills.general as |skill skillId|}}
<tr data-skill="{{skillId}}">
<td class="padding edit-skill">{{skill.label}}</td>
<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>
@@ -41,8 +41,8 @@
</thead>
<tbody>
{{#each data.calc.skills.language as |skill skillId|}}
<tr data-skill="{{skillId}}">
<td class="padding edit-skill">{{skill.label}}</td>
<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>
@@ -73,8 +73,8 @@
</thead>
<tbody>
{{#each data.calc.skills.combat as |skill skillId|}}
<tr data-skill="{{skillId}}">
<td class="padding edit-skill">{{skill.label}}</td>
<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 />
+50 -1
View File
@@ -4,7 +4,56 @@
<h1><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
</header>
<div class="sheet-content">
<table>
<tbody>
<tr>
<td colspan=2>
<input id="data.defensive" type="checkbox" name="data.defensive" {{checked data.defensive}}>
<label for="data.defensive">{{localize "midgard5.defensive-weapon"}}</label>
</td>
<td>
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
<label for="data.magic">{{localize "midgard5.magic"}}</label>
</td>
<td>
<input id="data.ranged" type="checkbox" name="data.ranged" {{checked data.ranged}}>
<label for="data.ranged">{{localize "midgard5.rangedWeapon"}}</label>
</td>
</tr>
<tr>
<td>{{localize "midgard5.base-damage"}}</td>
<td>
{{#if data.defensive}}
<span>Not available for defensive weapons</span>
{{else}}
<input name="data.damageBase" type="text" value="{{data.damageBase}}" data-dtype="String" />
{{/if}}
</td>
<td>{{localize "midgard5.weapon-skill"}}</td>
<td>
{{#if data.calc.combatSkills}}
<select class="select-skill" name="data.skillId" data-type="String">
{{#select data.skillId}}
<option value="">{{localize "midgard5.no-skill"}}</option>
{{#each data.calc.combatSkills as |skill key|}}
<option value="{{key}}">{{skill.label}}</option>
{{/each}}
{{/select}}
</select>
{{else}}
<span>Assign item to character to select weapon skill</span>
{{/if}}
</td>
</tr>
<tr>
<td>{{localize "midgard5.attackBonus"}}</td>
<td><input name="data.stats.attackBonus" type="text" value="{{data.stats.attackBonus}}" data-dtype="Number" /></td>
<td>{{localize "midgard5.damageBonus"}}</td>
<td><input name="data.stats.damageBonus" type="text" value="{{data.stats.damageBonus}}" data-dtype="Number" /></td>
</tr>
</tbody>
</table>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</form>