Make Items with mods equippable (#11)
Changes: + Items that can influence you stats are equippable + only equipped items influence your stats + Armor now influences your stats + move mods into a partial for easier changes
This commit is contained in:
@@ -8,7 +8,12 @@
|
||||
<tbody>
|
||||
{{#each data.calc.gear.effects as |item itemId|}}
|
||||
<tr data-item="{{itemId}}">
|
||||
<td class="padding edit-item">{{item.label}}</td>
|
||||
<td class="padding">
|
||||
<span class="edit-item">{{item.label}}</span>
|
||||
{{#if item.equipped}}
|
||||
<span class="spell-process">{{localize "midgard5.active"}}</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
||||
@@ -84,7 +84,12 @@
|
||||
<tbody>
|
||||
{{#each data.calc.gear.armor as |item itemId|}}
|
||||
<tr data-item="{{itemId}}">
|
||||
<td class="padding edit-item">{{item.label}}</td>
|
||||
<td class="padding">
|
||||
<span class="edit-item">{{item.label}}</span>
|
||||
{{#if item.equipped}}
|
||||
<span class="spell-process">{{localize "midgard5.equipped"}}</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="fixed-value">{{actorItemValue ../actor._id itemId "lpProtection"}}</td>
|
||||
<td class="fixed-value">{{actorItemValue ../actor._id itemId "apProtection"}}</td>
|
||||
<td class="fixed-value">{{actorItemValue ../actor._id itemId "stats.attackBonus"}}</td>
|
||||
@@ -107,7 +112,12 @@
|
||||
<tbody>
|
||||
{{#each data.calc.gear.items as |item itemId|}}
|
||||
<tr data-item="{{itemId}}">
|
||||
<td class="padding edit-item">{{item.label}}</td>
|
||||
<td class="padding">
|
||||
<span class="edit-item">{{item.label}}</span>
|
||||
{{#if item.equipped}}
|
||||
<span class="spell-process">{{localize "midgard5.equipped"}}</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
||||
@@ -6,10 +6,25 @@
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="flexrow">
|
||||
<span>
|
||||
<input id="data.equipped" type="checkbox" name="data.equipped" {{checked data.equipped}} />
|
||||
<label for="data.equipped">{{localize "midgard5.equipped"}}</label>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}} />
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{localize "midgard5.actor-lp"}}</td>
|
||||
<td><input name="data.lpProtection" type="text" value="{{data.lpProtection}}" data-dtype="Number" /></td>
|
||||
|
||||
|
||||
<td>{{localize "midgard5.actor-ap"}}</td>
|
||||
<td><input name="data.apProtection" type="text" value="{{data.apProtection}}" data-dtype="Number" /></td>
|
||||
</tr>
|
||||
@@ -17,21 +32,24 @@
|
||||
<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.defenseBonus"}}</td>
|
||||
<td><input name="data.stats.defenseBonus" type="text" value="{{data.stats.defenseBonus}}" data-dtype="Number" /></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>{{localize "midgard5.movementRange"}}</td>
|
||||
<td><input name="data.stats.movementBonus" type="text" value="{{data.stats.movementBonus}}" data-dtype="Number" /></td>
|
||||
|
||||
|
||||
<td>{{localize "midgard5.actor-gw-long"}}</td>
|
||||
<td><input name="data.attributeMod.gw" type="text" value="{{data.attributeMod.gw}}" data-dtype="Number" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
|
||||
|
||||
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</form>
|
||||
@@ -6,10 +6,20 @@
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
<td colspan=4>
|
||||
<div class="flexrow">
|
||||
<span>
|
||||
<input id="data.equipped" type="checkbox" name="data.equipped" {{checked data.equipped}}>
|
||||
<label for="data.equipped">{{localize "midgard5.active"}}</label>
|
||||
</span>
|
||||
<span>
|
||||
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="flexrow">
|
||||
<span>{{localize "midgard5.item-value"}}</span>
|
||||
@@ -19,59 +29,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Mods</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><button class="add-mod">+</button></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each data.mods as |mod modId|}}
|
||||
<tr>
|
||||
<td>
|
||||
<select class="select-mod-type" name="data.mods.{{modId}}.type" data-type="String">
|
||||
{{#select mod.type}}
|
||||
<option value="attribute">{{localize "midgard5.attribute"}}</option>
|
||||
<option value="stat">{{localize "midgard5.bonus"}}</option>
|
||||
<option value="skill">{{localize "midgard5.skill"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
|
||||
|
||||
<td>
|
||||
<select class="select-id" name="data.mods.{{modId}}.id" data-type="String">
|
||||
{{#select mod.id}}
|
||||
<option value="">{{localize "midgard5.no-skill"}}</option>
|
||||
{{#each (lookup ../data.calc.mods modId) as |name key|}}
|
||||
<option value="{{key}}">{{name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<select class="select-mod-operation" name="data.mods.{{modId}}.operation" data-type="String">
|
||||
{{#select mod.operation}}
|
||||
{{#if (eq mod.type "attribute")}}
|
||||
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
|
||||
{{/if}}
|
||||
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
|
||||
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
|
||||
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
|
||||
@@ -6,10 +6,20 @@
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
<td colspan=4>
|
||||
<div class="flexrow">
|
||||
<span>
|
||||
<input id="data.equipped" type="checkbox" name="data.equipped" {{checked data.equipped}}>
|
||||
<label for="data.equipped">{{localize "midgard5.equipped"}}</label>
|
||||
</span>
|
||||
<span>
|
||||
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="flexrow">
|
||||
<span>{{localize "midgard5.item-value"}}</span>
|
||||
@@ -19,59 +29,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Mods</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><button class="add-mod">+</button></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each data.mods as |mod modId|}}
|
||||
<tr>
|
||||
<td>
|
||||
<select class="select-mod-type" name="data.mods.{{modId}}.type" data-type="String">
|
||||
{{#select mod.type}}
|
||||
<option value="attribute">{{localize "midgard5.attribute"}}</option>
|
||||
<option value="stat">{{localize "midgard5.bonus"}}</option>
|
||||
<option value="skill">{{localize "midgard5.skill"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
|
||||
|
||||
<td>
|
||||
<select class="select-id" name="data.mods.{{modId}}.id" data-type="String">
|
||||
{{#select mod.id}}
|
||||
<option value="">{{localize "midgard5.no-skill"}}</option>
|
||||
{{#each (lookup ../data.calc.mods modId) as |name key|}}
|
||||
<option value="{{key}}">{{name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<select class="select-mod-operation" name="data.mods.{{modId}}.operation" data-type="String">
|
||||
{{#select mod.operation}}
|
||||
{{#if (eq mod.type "attribute")}}
|
||||
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
|
||||
{{/if}}
|
||||
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
|
||||
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
|
||||
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
|
||||
@@ -85,9 +85,9 @@
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
{{!-- {{else}}
|
||||
{{else}}
|
||||
<span>{{localize "midgard5.assignItemToCharacter"}}</span>
|
||||
{{/if}} --}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Mods</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><button class="add-mod">+</button></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each mods as |mod modId|}}
|
||||
<tr>
|
||||
<td>
|
||||
<select class="select-mod-type" name="data.mods.{{modId}}.type" data-type="String">
|
||||
{{#select mod.type}}
|
||||
<option value="attribute">{{localize "midgard5.attribute"}}</option>
|
||||
<option value="stat">{{localize "midgard5.bonus"}}</option>
|
||||
<option value="skill">{{localize "midgard5.skill"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<select class="select-id" name="data.mods.{{modId}}.id" data-type="String">
|
||||
{{#select mod.id}}
|
||||
<option value="">{{localize "midgard5.no-skill"}}</option>
|
||||
{{#each (lookup ../calc.mods modId) as |name key|}}
|
||||
<option value="{{key}}">{{name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<select class="select-mod-operation" name="data.mods.{{modId}}.operation" data-type="String">
|
||||
{{#select mod.operation}}
|
||||
{{#if (eq mod.type "attribute")}}
|
||||
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
|
||||
{{/if}}
|
||||
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
|
||||
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
|
||||
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user