Squashed commit of the following:

commit 250fc499ae
Author: Byroks <byroks@gmail.com>
Date:   Thu Nov 30 16:17:04 2023 +0100

    v2.1.0

commit 28595e7dd0
Author: Byroks <byroks@gmail.com>
Date:   Thu Nov 30 15:50:59 2023 +0100

    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

commit 8095785fc2
Author: Byroks <byroks@gmail.com>
Date:   Wed Nov 29 10:14:49 2023 +0100

    Movement stat (#10)

    Changes:
     + make movement stat work and be moddable by effects

commit e141839055
Merge: 14e005c 0bfa224
Author: Byroks <byroks@gmail.com>
Date:   Tue Nov 28 19:50:38 2023 +0100

    Merge branch 'main' into develop

commit 14e005cb0a
Author: Byroks <byroks@gmail.com>
Date:   Tue Nov 28 19:48:14 2023 +0100

    v2.0.0

commit c635c54f24
Author: Byroks <byroks@gmail.com>
Date:   Tue Nov 28 19:42:38 2023 +0100

    Dev Kampfkünste Items & Integration (#7)

    Changes:
     + add kampfkuenste template
     + add kampfkuenste tab
     + make kampfkuenste rollable
     + update localization

commit e27f4209e5
Author: Byroks <byroks@gmail.com>
Date:   Mon Nov 27 20:05:20 2023 +0100

    Squashed commit of the following:

    commit 0bfa224dae
    Author: Byroks <byroks@gmail.com>
    Date:   Mon Nov 27 19:56:05 2023 +0100

        V1.3.1 (#6)

        * v1.3.1

        * v1.3.1

        * update .gitingore

    commit 35a6b0fae9
    Author: Byroks <byroks@gmail.com>
    Date:   Mon Nov 27 19:48:56 2023 +0100

        v1.3.1

    commit db21ca93b0
    Author: Byroks <byroks@gmail.com>
    Date:   Sun Nov 26 13:13:13 2023 +0100

        subtract ap when casting spell

        Changes:
         + subtract AP when casting a spell
This commit is contained in:
Byroks 2023-11-30 16:19:25 +01:00
parent 16df142d45
commit 024f0b9c42
18 changed files with 152 additions and 134 deletions

View File

@ -197,6 +197,8 @@
"midgard5.defensive-weapon": "Verteidigungswaffe", "midgard5.defensive-weapon": "Verteidigungswaffe",
"midgard5.no-skill": "Keine Fertigkeit", "midgard5.no-skill": "Keine Fertigkeit",
"midgard5.magic": "magisch", "midgard5.magic": "magisch",
"midgard5.equipped": "Ausgerüstet",
"midgard5.active": "Aktiv",
"midgard5.rangedWeapon": "Schusswaffe", "midgard5.rangedWeapon": "Schusswaffe",
"midgard5.assignItemToCharacter": "Füge Gegenstand einem Charakter hinzu, um Fähigkeit auwählen zu können", "midgard5.assignItemToCharacter": "Füge Gegenstand einem Charakter hinzu, um Fähigkeit auwählen zu können",

View File

@ -1,6 +1,6 @@
{ {
"name": "foundry-system-midgard5", "name": "foundry-system-midgard5",
"version": "2.0.0", "version": "2.1.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -13,8 +13,7 @@
"resistanceBody": 0, "resistanceBody": 0,
"spellBonus": 0 "spellBonus": 0
}, },
"equippable": false, "equipped": false,
"equipped": true,
"attributeMod": { "attributeMod": {
"st": 0, "st": 0,
"gs": 0, "gs": 0,
@ -43,4 +42,4 @@
"XD0IpWT6bN4AJiYQ": 3 "XD0IpWT6bN4AJiYQ": 3
}, },
"_id": "pV1hNavlQGJ9UaEf" "_id": "pV1hNavlQGJ9UaEf"
} }

View File

@ -13,6 +13,7 @@ const preloadTemplates = async (): Promise<Handlebars.TemplateDelegate<any>[]> =
"sheets/character/spells.hbs", "sheets/character/spells.hbs",
"sheets/character/kampfkuenste.hbs", "sheets/character/kampfkuenste.hbs",
"sheets/character/effects.hbs", "sheets/character/effects.hbs",
"sheets/partial/mod.hbs",
"sheets/item/rolls.hbs", "sheets/item/rolls.hbs",
"chat/roll-m5.hbs", "chat/roll-m5.hbs",
]; ];

View File

@ -145,7 +145,7 @@ export interface M5CharacterCalculatedData {
damageBonus: M5ModResult; damageBonus: M5ModResult;
attackBonus: M5ModResult; attackBonus: M5ModResult;
defenseBonus: M5ModResult; defenseBonus: M5ModResult;
movementBonus: M5ModResult; movement: M5ModResult;
resistanceMind: M5ModResult; resistanceMind: M5ModResult;
resistanceBody: M5ModResult; resistanceBody: M5ModResult;
spellCasting: M5ModResult; spellCasting: M5ModResult;

View File

@ -58,7 +58,7 @@ export class M5Character extends Actor {
damageBonus: { value: 0, mods: [] }, damageBonus: { value: 0, mods: [] },
attackBonus: { value: 0, mods: [] }, attackBonus: { value: 0, mods: [] },
defenseBonus: { value: 0, mods: [] }, defenseBonus: { value: 0, mods: [] },
movementBonus: { value: 0, mods: [] }, movement: { value: 0, mods: [] },
resistanceMind: { value: 0, mods: [] }, resistanceMind: { value: 0, mods: [] },
resistanceBody: { value: 0, mods: [] }, resistanceBody: { value: 0, mods: [] },
spellCasting: { value: 0, mods: [] }, spellCasting: { value: 0, mods: [] },
@ -121,7 +121,7 @@ export class M5Character extends Actor {
ret.stats.damageBonus = this.modResult(Math.floor(ret.attributes.st.value / 20) + Math.floor(ret.attributes.gs.value / 30) - 3); ret.stats.damageBonus = this.modResult(Math.floor(ret.attributes.st.value / 20) + Math.floor(ret.attributes.gs.value / 30) - 3);
ret.stats.attackBonus = this.modResult(ret.attributes.gs.bonus); ret.stats.attackBonus = this.modResult(ret.attributes.gs.bonus);
ret.stats.defenseBonus = this.modResult(ret.attributes.gw.bonus); ret.stats.defenseBonus = this.modResult(ret.attributes.gw.bonus);
ret.stats.movementBonus = this.modResult(0); ret.stats.movement = this.modResult(data.movement);
ret.stats.resistanceMind = this.modResult( ret.stats.resistanceMind = this.modResult(
(data.info.magicUsing ? 2 : 0) + ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.in.bonus : this.raceBonus(data.info.race)) (data.info.magicUsing ? 2 : 0) + ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.in.bonus : this.raceBonus(data.info.race))
); );
@ -138,7 +138,7 @@ export class M5Character extends Actor {
const aggregate = new M5ModAggregate(data, ret); const aggregate = new M5ModAggregate(data, ret);
context.items context.items
?.filter((item) => item.type === "item" || item.type === "effect") ?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor") && item.system.equipped)
.forEach((item) => { .forEach((item) => {
const mods = item.system.mods; const mods = item.system.mods;
//console.log("Actor item mods", mods) //console.log("Actor item mods", mods)
@ -166,6 +166,7 @@ export class M5Character extends Actor {
label: label, label: label,
magic: item.system.magic, magic: item.system.magic,
calc: item.system.calc, calc: item.system.calc,
equipped: item.system?.equipped,
}; };
}); });
} }
@ -185,6 +186,7 @@ export class M5Character extends Actor {
label: label, label: label,
magic: item.system.magic, magic: item.system.magic,
calc: item.system.calc, calc: item.system.calc,
equipped: item.system?.equipped,
}; };
}); });
} }
@ -267,6 +269,7 @@ export class M5Character extends Actor {
label: label, label: label,
magic: item.system.magic, magic: item.system.magic,
calc: item.system.calc, calc: item.system.calc,
equipped: item.system?.equipped,
}; };
}); });
} }

View File

@ -31,7 +31,7 @@ export default class M5ModAggregate {
this.push({ type: M5ModType.STAT, id: M5Stats.DEFENSE, operation: M5ModOperation.SET, value: calc.stats.defenseBonus.value }, characterString); this.push({ type: M5ModType.STAT, id: M5Stats.DEFENSE, operation: M5ModOperation.SET, value: calc.stats.defenseBonus.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.ATTACK, operation: M5ModOperation.SET, value: calc.stats.attackBonus.value }, characterString); this.push({ type: M5ModType.STAT, id: M5Stats.ATTACK, operation: M5ModOperation.SET, value: calc.stats.attackBonus.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DAMAGE, operation: M5ModOperation.SET, value: calc.stats.damageBonus.value }, characterString); this.push({ type: M5ModType.STAT, id: M5Stats.DAMAGE, operation: M5ModOperation.SET, value: calc.stats.damageBonus.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.MOVEMENT, operation: M5ModOperation.SET, value: calc.stats.movementBonus.value }, characterString); this.push({ type: M5ModType.STAT, id: M5Stats.MOVEMENT, operation: M5ModOperation.SET, value: calc.stats.movement.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_MIND, operation: M5ModOperation.SET, value: calc.stats.resistanceMind.value }, characterString); this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_MIND, operation: M5ModOperation.SET, value: calc.stats.resistanceMind.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_BODY, operation: M5ModOperation.SET, value: calc.stats.resistanceBody.value }, characterString); this.push({ type: M5ModType.STAT, id: M5Stats.RESISTANCE_BODY, operation: M5ModOperation.SET, value: calc.stats.resistanceBody.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.SPELL_CASTING, operation: M5ModOperation.SET, value: calc.stats.spellCasting.value }, characterString); this.push({ type: M5ModType.STAT, id: M5Stats.SPELL_CASTING, operation: M5ModOperation.SET, value: calc.stats.spellCasting.value }, characterString);

View File

@ -105,6 +105,11 @@ export class M5Item extends Item {
calc.fw += skillData.fw; calc.fw += skillData.fw;
} }
} }
} else if (itemType === "armor") {
itemData.mods[0] = { type: "stat", id: "defenseBonus", operation: "add", value: itemData.stats.defenseBonus };
itemData.mods[1] = { type: "stat", id: "attackBonus", operation: "add", value: itemData.stats.attackBonus };
itemData.mods[2] = { type: "stat", id: "movement", operation: "add", value: itemData.stats.movementBonus };
itemData.mods[3] = { type: "attribute", id: "gw", operation: "add100", value: itemData.attributeMod.gw };
} else if (itemType === "spell") { } else if (itemType === "spell") {
calc.fw = 0; calc.fw = 0;
if (actor) { if (actor) {
@ -134,8 +139,10 @@ export class M5Item extends Item {
itemData.rolls.formulas[0].label = skill.name; itemData.rolls.formulas[0].label = skill.name;
} }
} }
} else if (itemType === "item" || itemType === "effect") { }
if (itemData?.mods) {
calc.mods = {}; calc.mods = {};
Object.keys(itemData?.mods).forEach((key) => { Object.keys(itemData?.mods).forEach((key) => {
const mod = itemData.mods[key]; const mod = itemData.mods[key];
const modCalc = {}; const modCalc = {};
@ -243,6 +250,7 @@ export class M5Item extends Item {
} }
const roll = new M5Roll(rollData, this.actor, item.name); const roll = new M5Roll(rollData, this.actor, item.name);
console.log(roll);
return roll.toMessage(); return roll.toMessage();
} else { } else {
ChatMessage.create({ ChatMessage.create({

View File

@ -3,7 +3,7 @@
"name": "midgard5", "name": "midgard5",
"title": "Midgard 5. Edition", "title": "Midgard 5. Edition",
"description": "The German RPG Midgard 5. Edition", "description": "The German RPG Midgard 5. Edition",
"version": "2.0.0", "version": "2.1.0",
"compatibility": { "compatibility": {
"minimum": "10", "minimum": "10",
"verified": "11", "verified": "11",
@ -89,8 +89,8 @@
"primaryTokenAttribute": "lp", "primaryTokenAttribute": "lp",
"secondaryTokenAttribute": "ap", "secondaryTokenAttribute": "ap",
"url": "https://github.com/Byroks/foundry-vtt-system-midgard5", "url": "https://github.com/Byroks/foundry-vtt-system-midgard5",
"manifest": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.0.0/system.json", "manifest": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.1.0/system.json",
"download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.0.0/midgard5-v2.0.0.zip", "download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v2.1.0/midgard5-v2.1.0.zip",
"initiative": "@c.calc.attributes.gw.value", "initiative": "@c.calc.attributes.gw.value",
"license": "LICENSE.txt" "license": "LICENSE.txt"
} }

View File

@ -350,7 +350,8 @@
"formulas": {}, "formulas": {},
"output": "" "output": ""
}, },
"calc": {} "calc": {},
"mods": {}
}, },
"spell": { "spell": {
"templates": ["itemDescription", "spellSelection"], "templates": ["itemDescription", "spellSelection"],

View File

@ -56,7 +56,7 @@
<td>{{localize "midgard5.luckPoints"}}</td> <td>{{localize "midgard5.luckPoints"}}</td>
<td><input name="data.gp" type="text" value="{{data.gp}}" data-dtype="Number" /></td> <td><input name="data.gp" type="text" value="{{data.gp}}" data-dtype="Number" /></td>
<td>{{localize "Bewegungsweite"}}</td> <td>{{localize "Bewegungsweite"}}</td>
<td><input name="data.movement" type="text" value="{{data.movement}}" data-dtype="Number" /></td> <td><input name="data.movement" type="text" value="{{data.calc.stats.movement.value}}" data-dtype="Number" /></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -8,7 +8,12 @@
<tbody> <tbody>
{{#each data.calc.gear.effects as |item itemId|}} {{#each data.calc.gear.effects as |item itemId|}}
<tr data-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> <td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr> </tr>
{{/each}} {{/each}}

View File

@ -84,7 +84,12 @@
<tbody> <tbody>
{{#each data.calc.gear.armor as |item itemId|}} {{#each data.calc.gear.armor as |item itemId|}}
<tr data-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 "lpProtection"}}</td>
<td class="fixed-value">{{actorItemValue ../actor._id itemId "apProtection"}}</td> <td class="fixed-value">{{actorItemValue ../actor._id itemId "apProtection"}}</td>
<td class="fixed-value">{{actorItemValue ../actor._id itemId "stats.attackBonus"}}</td> <td class="fixed-value">{{actorItemValue ../actor._id itemId "stats.attackBonus"}}</td>
@ -107,7 +112,12 @@
<tbody> <tbody>
{{#each data.calc.gear.items as |item itemId|}} {{#each data.calc.gear.items as |item itemId|}}
<tr data-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> <td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr> </tr>
{{/each}} {{/each}}

View File

@ -6,10 +6,25 @@
<div class="sheet-content"> <div class="sheet-content">
<table> <table>
<tbody> <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> <tr>
<td>{{localize "midgard5.actor-lp"}}</td> <td>{{localize "midgard5.actor-lp"}}</td>
<td><input name="data.lpProtection" type="text" value="{{data.lpProtection}}" data-dtype="Number" /></td> <td><input name="data.lpProtection" type="text" value="{{data.lpProtection}}" data-dtype="Number" /></td>
<td>{{localize "midgard5.actor-ap"}}</td> <td>{{localize "midgard5.actor-ap"}}</td>
<td><input name="data.apProtection" type="text" value="{{data.apProtection}}" data-dtype="Number" /></td> <td><input name="data.apProtection" type="text" value="{{data.apProtection}}" data-dtype="Number" /></td>
</tr> </tr>
@ -17,21 +32,24 @@
<tr> <tr>
<td>{{localize "midgard5.attackBonus"}}</td> <td>{{localize "midgard5.attackBonus"}}</td>
<td><input name="data.stats.attackBonus" type="text" value="{{data.stats.attackBonus}}" data-dtype="Number" /></td> <td><input name="data.stats.attackBonus" type="text" value="{{data.stats.attackBonus}}" data-dtype="Number" /></td>
<td>{{localize "midgard5.defenseBonus"}}</td> <td>{{localize "midgard5.defenseBonus"}}</td>
<td><input name="data.stats.defenseBonus" type="text" value="{{data.stats.defenseBonus}}" data-dtype="Number" /></td> <td><input name="data.stats.defenseBonus" type="text" value="{{data.stats.defenseBonus}}" data-dtype="Number" /></td>
</tr> </tr>
<tr> <tr>
<td>{{localize "midgard5.movementRange"}}</td> <td>{{localize "midgard5.movementRange"}}</td>
<td><input name="data.stats.movementBonus" type="text" value="{{data.stats.movementBonus}}" data-dtype="Number" /></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>{{localize "midgard5.actor-gw-long"}}</td>
<td><input name="data.attributeMod.gw" type="text" value="{{data.attributeMod.gw}}" data-dtype="Number" /></td> <td><input name="data.attributeMod.gw" type="text" value="{{data.attributeMod.gw}}" data-dtype="Number" /></td>
</tr> </tr>
</tbody> </tbody>
</table> </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}} {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div> </div>
</form> </form>

View File

@ -6,10 +6,20 @@
<div class="sheet-content"> <div class="sheet-content">
<table> <table>
<tr> <tr>
<td> <td colspan=4>
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}> <div class="flexrow">
<label for="data.magic">{{localize "midgard5.magic"}}</label> <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> </td>
</tr>
<tr>
<td> <td>
<div class="flexrow"> <div class="flexrow">
<span>{{localize "midgard5.item-value"}}</span> <span>{{localize "midgard5.item-value"}}</span>
@ -19,59 +29,8 @@
</tr> </tr>
</table> </table>
<table> {{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
<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>
<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}} {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div> </div>

View File

@ -6,10 +6,20 @@
<div class="sheet-content"> <div class="sheet-content">
<table> <table>
<tr> <tr>
<td> <td colspan=4>
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}> <div class="flexrow">
<label for="data.magic">{{localize "midgard5.magic"}}</label> <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> </td>
</tr>
<tr>
<td> <td>
<div class="flexrow"> <div class="flexrow">
<span>{{localize "midgard5.item-value"}}</span> <span>{{localize "midgard5.item-value"}}</span>
@ -19,59 +29,8 @@
</tr> </tr>
</table> </table>
<table> {{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}
<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>
<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}} {{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div> </div>

View File

@ -85,9 +85,9 @@
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
{{!-- {{else}} {{else}}
<span>{{localize "midgard5.assignItemToCharacter"}}</span> <span>{{localize "midgard5.assignItemToCharacter"}}</span>
{{/if}} --}} {{/if}}
</td> </td>
</tbody> </tbody>
</table> </table>

View File

@ -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>