diff --git a/lang/de.json b/lang/de.json index 128e485..e090a6b 100644 --- a/lang/de.json +++ b/lang/de.json @@ -9,9 +9,10 @@ "ITEM.TypeArmor": "Rüstung", "ITEM.TypeSpell": "Zauber", - "midgard5.roll": "Würfeln", + "midgard5.doRoll": "Würfeln", "midgard5.learn": "Lernen", + "midgard5.label": "Bezeichnung", "midgard5.description": "Beschreibung", "midgard5.attribute": "Leiteigenschaft", "midgard5.skill": "Fertigkeit", @@ -158,6 +159,7 @@ "midgard5.no-skill": "Keine Fertigkeit", "midgard5.magic": "magisch", "midgard5.rangedWeapon": "Schusswaffe", + "midgard5.assignItemToCharacter": "Füge Gegenstand einem Charakter hinzu, um Fähigkeit auwählen zu können", "midgard5.pw": "Prüfwurf", "midgard5.attack": "Angriff", @@ -204,9 +206,9 @@ "midgard5.mod-operation-set": "Basiswert", "midgard5.mod-operation-fixed": "Fester Wert", - "midgard5.mod-stat-defense": "Abwehr", - "midgard5.mod-stat-attack": "Angriff", - "midgard5.mod-stat-damage": "Schaden", + "midgard5.mod-stat-defenseBonus": "Abwehrbonus", + "midgard5.mod-stat-attackBonus": "Angriffsbonus", + "midgard5.mod-stat-damageBonus": "Schadensbonus", "midgard5.mod-stat-movement": "Bewegung", "midgard5.mod-stat-resistanceMind": "Resistenz Geist", "midgard5.mod-stat-resistanceBody": "Resistenz Körper", @@ -219,5 +221,9 @@ "midgard5.mod-type": "Typ der Modifikation", "midgard5.mod-id": "Was soll modifiziert werden", "midgard5.mod-operation": "Wie soll modifiziert werden", - "midgard5.mod-value": "Wert" + "midgard5.mod-value": "Wert", + + "midgard5.type": "Typ", + "midgard5.formula": "Formel", + "midgard5.roll": "Wurf" } diff --git a/packs/items/blaupause-gegenstaende/fernkampfwaffe.json b/packs/items/blaupause-gegenstaende/fernkampfwaffe.json new file mode 100644 index 0000000..c94f54c --- /dev/null +++ b/packs/items/blaupause-gegenstaende/fernkampfwaffe.json @@ -0,0 +1,49 @@ +{ + "name": "Fernkampfwaffe", + "type": "weapon", + "img": "icons/svg/item-bag.svg", + "data": { + "description": "", + "stats": { + "damageBonus": 0, + "attackBonus": 0, + "defenseBonus": 0, + "movementBonus": 0, + "resistanceMind": 0, + "resistanceBody": 0, + "spellBonus": 0 + }, + "equippable": false, + "equipped": true, + "value": 0, + "magic": false, + "special": false, + "ranged": true, + "skillId": "", + "damageBase": "1d6", + "rolls": { + "formulas": { + "0": { + "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.attackBonus.value + @i.stats.attackBonus", + "label": "Angriff", + "enabled": true + }, + "1": { + "formula": "@i.damageBase + @i.stats.damageBonus", + "label": "Schaden", + "enabled": true + } + }, + "output": "" + }, + "calc": {} + }, + "effects": [], + "folder": null, + "sort": 0, + "permission": { + "default": 0, + "XD0IpWT6bN4AJiYQ": 3 + }, + "_id": "h1inVuRJQI42JTCs" +} \ No newline at end of file diff --git a/packs/items/blaupause-gegenstaende/fertigkeit.json b/packs/items/blaupause-gegenstaende/fertigkeit.json index 209f09f..d3308d1 100644 --- a/packs/items/blaupause-gegenstaende/fertigkeit.json +++ b/packs/items/blaupause-gegenstaende/fertigkeit.json @@ -50,7 +50,7 @@ "formulas": { "0": { "formula": "1d20 + @i.fw + @i.calc.bonus", - "type": "ew", + "enabled": true, "label": "EW" } }, diff --git a/packs/items/blaupause-gegenstaende/sprache.json b/packs/items/blaupause-gegenstaende/sprache.json index b8c42e2..09fa693 100644 --- a/packs/items/blaupause-gegenstaende/sprache.json +++ b/packs/items/blaupause-gegenstaende/sprache.json @@ -49,8 +49,8 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @i.fw + @i.calc.bonus", - "type": "ew", + "formula": "1d20 + @i.calc.fw + @i.calc.bonus", + "enabled": true, "label": "EW" } }, diff --git a/packs/items/blaupause-gegenstaende/verteidigungswaffe.json b/packs/items/blaupause-gegenstaende/verteidigungswaffe.json index d18521b..8944228 100644 --- a/packs/items/blaupause-gegenstaende/verteidigungswaffe.json +++ b/packs/items/blaupause-gegenstaende/verteidigungswaffe.json @@ -21,8 +21,8 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.defense + @c.calc.stats.defenseBonus + @i.stats.defenseBonus", - "type": "ew", + "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.defense.value + @c.calc.stats.defenseBonus.value + @i.stats.defenseBonus", + "enabled": true, "label": "Abwehr" } }, diff --git a/packs/items/blaupause-gegenstaende/waffe.json b/packs/items/blaupause-gegenstaende/waffe.json index 6ab308a..452dba6 100644 --- a/packs/items/blaupause-gegenstaende/waffe.json +++ b/packs/items/blaupause-gegenstaende/waffe.json @@ -23,13 +23,13 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.attackBonus + @i.stats.attackBonus", - "type": "ew", + "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.attackBonus.value + @i.stats.attackBonus", + "enabled": true, "label": "Angriff" }, "1": { - "formula": "@i.damageBase + @i.stats.damageBonus + @c.calc.stats.damageBonus", - "type": "dmg", + "formula": "@i.damageBase + @i.stats.damageBonus + @c.calc.stats.damageBonus.value", + "enabled": true, "label": "Schaden" } }, diff --git a/packs/items/blaupause-gegenstaende/waffenfertigkeit.json b/packs/items/blaupause-gegenstaende/waffenfertigkeit.json index 212decc..45b4b02 100644 --- a/packs/items/blaupause-gegenstaende/waffenfertigkeit.json +++ b/packs/items/blaupause-gegenstaende/waffenfertigkeit.json @@ -49,8 +49,8 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @i.fw + @i.calc.bonus", - "type": "ew", + "formula": "1d20 + @i.calc.fw + @i.calc.bonus", + "enabled": true, "label": "EW" } }, diff --git a/packs/items/blaupause-gegenstaende/zauber.json b/packs/items/blaupause-gegenstaende/zauber.json index f92fb69..4bc08c3 100644 --- a/packs/items/blaupause-gegenstaende/zauber.json +++ b/packs/items/blaupause-gegenstaende/zauber.json @@ -47,8 +47,8 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @c.calc.stats.spellCasting + @i.bonus", - "type": "ew", + "formula": "1d20 + @c.calc.stats.spellCasting.value + @i.bonus", + "enabled": true, "label": "Zaubern" } }, diff --git a/source/PreloadTemplates.ts b/source/PreloadTemplates.ts index 143e60e..dc3ddb9 100644 --- a/source/PreloadTemplates.ts +++ b/source/PreloadTemplates.ts @@ -11,6 +11,7 @@ const preloadTemplates = async (): Promise[]> = "sheets/character/skills.hbs", "sheets/character/gear.hbs", "sheets/character/spells.hbs", + "sheets/item/rolls.hbs", "chat/roll-m5.hbs" ] return loadTemplates(templates.map(s => rootPath + s)) diff --git a/source/module/M5Base.ts b/source/module/M5Base.ts index 83ee9de..717842b 100644 --- a/source/module/M5Base.ts +++ b/source/module/M5Base.ts @@ -1,3 +1,4 @@ +import { BooleanField } from "@league-of-foundry-developers/foundry-vtt-types/src/foundry/common/data/fields.mjs" export interface M5Skill { fw: number @@ -33,11 +34,13 @@ export interface M5RollData { } } -export interface M5RollResult { +export interface M5RollTemplate { formula: string label: string - type: string + enabled: boolean +} +export interface M5RollResult extends M5RollTemplate { total: number totalStr: string result: string @@ -67,9 +70,9 @@ export enum M5Attributes { } export enum M5Stats { - DEFENSE = "defense", - ATTACK = "attack", - DAMAGE = "damage", + DEFENSE = "defenseBonus", + ATTACK = "attackBonus", + DAMAGE = "damageBonus", MOVEMENT = "movement", RESISTANCE_MIND = "resistanceMind", RESISTANCE_BODY = "resistanceBody", diff --git a/source/module/actors/M5ModAggregate.ts b/source/module/actors/M5ModAggregate.ts index 0f0d2e3..953d7f4 100644 --- a/source/module/actors/M5ModAggregate.ts +++ b/source/module/actors/M5ModAggregate.ts @@ -28,7 +28,7 @@ export default class M5ModAggregate { this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.PA, operation: M5ModOperation.ADD_100, value: data.attributes.pa.bonus }, characterString) this.push({ type: M5ModType.ATTRIBUTE, id: M5Attributes.WK, operation: M5ModOperation.ADD_100, value: data.attributes.wk.bonus }, characterString) - this.push({ type: M5ModType.STAT, id: M5Stats.DEFENSE, operation: M5ModOperation.SET, value: calc.stats.defense.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.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) @@ -59,19 +59,10 @@ export default class M5ModAggregate { source: source } - let key = mod.id - // if (mod.type === M5ModType.ATTRIBUTE) { - // key = M5Attributes[mod.id] as string - // console.log("M5ModType.ATTRIBUTE", mod.id, key) - // } else if (mod.type === M5ModType.STAT) { - // key = M5Stats[mod.id] as string - // console.log("M5ModType.STAT", mod.id, key) - // } - - if (map.has(key)) - map.get(key).push(pair) + if (map.has(mod.id)) + map.get(mod.id).push(pair) else - map.set(key, [pair]) + map.set(mod.id, [pair]) } } diff --git a/source/module/items/M5Item.ts b/source/module/items/M5Item.ts index 022ead9..1f2ae16 100644 --- a/source/module/items/M5Item.ts +++ b/source/module/items/M5Item.ts @@ -65,7 +65,7 @@ export class M5Item extends Item { if (actor) { const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true }) if (actorCalc) { - calc.ew += actorCalc.stats.attackBonus + calc.ew += actorCalc.stats.attackBonus.value calc.combatSkills = actorCalc.skills.combat } @@ -108,7 +108,7 @@ export class M5Item extends Item { if (actor) { const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true }) if (actorCalc) { - calc.ew += actorCalc.stats.spellCasting + calc.ew += actorCalc.stats.spellCasting.value } } } else if (context.type === "item") { @@ -204,15 +204,17 @@ export class M5Item extends Item { const rollData = this.getRollData() formulaNames.forEach(formulaName => { const formula = item.data.rolls.formulas[formulaName] - rollData.rolls[formulaName] = { - formula: formula.formula, - label: formula.label, - type: formula.type, - result: "", - total: 0, - totalStr: "", - dice: {} - } as M5RollResult + if (formula) { + rollData.rolls[formulaName] = { + formula: formula.formula, + label: formula.label, + enabled: formula.enabled, + result: "", + total: 0, + totalStr: "", + dice: {} + } as M5RollResult + } }) const roll = new M5Roll(rollData, this.actor, item.name) diff --git a/source/module/rolls/M5Roll.ts b/source/module/rolls/M5Roll.ts index 90ab2db..bcbc679 100644 --- a/source/module/rolls/M5Roll.ts +++ b/source/module/rolls/M5Roll.ts @@ -17,19 +17,24 @@ export class M5Roll { // extends Roll // @ts-ignore //override evaluate(options?: InexactPartial): Evaluated> | Promise>> { evaluate() { + const indexMap = new Map() const rollNames = Object.keys(this.data.rolls) - const rolls = rollNames.map(rollName => { + const rolls = rollNames.filter(rollName => this.data.rolls[rollName].enabled).map((rollName, index) => { + indexMap.set(index, rollName) const formula = this.data.rolls[rollName] const roll = new Roll(formula.formula, this.data) return roll }) this.pool = PoolTerm.fromRolls(rolls) + console.log("evaluate", this._evaluated, this.pool) return this.pool.evaluate({ async: true }).then(results => { this._total = 0 results.rolls.forEach((roll, index) => { - const rollResult = this.data.rolls[index.toString()] as M5RollResult + const rollIndex = indexMap.get(index) + const rollResult = this.data.rolls[rollIndex] as M5RollResult + rollResult.result = roll.result rollResult.total = roll.total rollResult.totalStr = roll.total.toString() @@ -37,27 +42,29 @@ export class M5Roll { // extends Roll this._total += roll.total let rowRes = M5EwResult.TBD + let face100 = -1 + roll.dice.forEach((d, dIndex) => { rollResult.dice[dIndex.toString()] = d.total if (rowRes === M5EwResult.TBD && dIndex === 0) { - if (rollResult.type === "ew") { + if (d.faces === 20) { + //if (rollResult.type === "ew") { if (d.total === 1) rowRes = M5EwResult.FUMBLE else if (d.total === 20) rowRes = M5EwResult.CRITICAL else if (d.total >= 16) rowRes = M5EwResult.HIGH - } else if (rollResult.type === "pw") { - if (d.total === 1) - rowRes = M5EwResult.FUMBLE - else if (d.total === 20) - rowRes = M5EwResult.CRITICAL + } else if (d.faces === 100) { + face100 = d.total as number } } }) - if (rollResult.type === "ew") { + const parseResult = M5Roll.parseDiceSides(rollResult.formula) + //console.log("evaluate roll", parseResult) + if (parseResult?.sides === 20) { if (roll.total < 20) { if (rowRes === M5EwResult.TBD || rowRes === M5EwResult.HIGH) rowRes = M5EwResult.FAIL @@ -65,10 +72,18 @@ export class M5Roll { // extends Roll if (rowRes === M5EwResult.TBD) rowRes = M5EwResult.PASS } - } else if (rollResult.type === "pw") { - if (roll.total < 0) { + } else if (face100 >= 0) { + const threshold100 = roll.total + face100 + const threshold = Math.floor(threshold100 / 10) + if (face100 === 100) { + if (rowRes === M5EwResult.TBD) + rowRes = M5EwResult.FUMBLE + } else if (roll.total < 0) { if (rowRes === M5EwResult.TBD) rowRes = M5EwResult.FAIL + } else if (face100 <= threshold) { + if (rowRes === M5EwResult.TBD) + rowRes = M5EwResult.CRITICAL } else { if (rowRes === M5EwResult.TBD) rowRes = M5EwResult.PASS @@ -114,7 +129,7 @@ export class M5Roll { // extends Roll rollData.i = attribute.value + attribute.bonus rollData.rolls["0"] = { formula: "@i - 1d100", - type: "pw", + enabled: true, label: (game as Game).i18n.localize("midgard5.pw"), result: "", total: 0, @@ -135,7 +150,7 @@ export class M5Roll { // extends Roll rollData.rolls["0"] = { formula: "1d20 + @c.calc.stats.brawl + @c.calc.stats.attackBonus + @i.attackBonus", - type: "ew", + enabled: true, label: (game as Game).i18n.localize("midgard5.attack"), result: "", total: 0, @@ -146,7 +161,7 @@ export class M5Roll { // extends Roll rollData.rolls["1"] = { formula: "1d6 - 4 + @c.calc.stats.damageBonus + @i.damageBonus", - type: "dmg", + enabled: true, label: (game as Game).i18n.localize("midgard5.damage"), result: "", total: 0, @@ -157,4 +172,35 @@ export class M5Roll { // extends Roll return new M5Roll(rollData, actor, (game as Game).i18n.localize("midgard5.brawl")) } + + static parseDiceSides(formula: string): FormulaParseResult { + const ewMatcher: RegExp = /\d*[dD]20/g + const pwMatcher: RegExp = /(\d+)\s*\-\s*\d*[dD]100/g + + let res = formula.match(ewMatcher) + if (res && !!res[0]) { + return { + sides: 20, + type: "ew", + threshold: null + } + } + + res = formula.match(pwMatcher) + if (res && !!res[1]) { + return { + sides: 100, + type: "pw", + threshold: parseInt(res[1]) + } + } + + return null + } +} + +interface FormulaParseResult { + sides: number, + type: string, + threshold: number } diff --git a/source/module/sheets/M5ItemSheet.ts b/source/module/sheets/M5ItemSheet.ts index ee9b42d..8967253 100644 --- a/source/module/sheets/M5ItemSheet.ts +++ b/source/module/sheets/M5ItemSheet.ts @@ -1,5 +1,5 @@ import { M5Item } from "../items/M5Item" -import { M5Attributes, M5ItemMod, M5ModOperation, M5ModType } from "../M5Base" +import { M5Attributes, M5ItemMod, M5ModOperation, M5ModType, M5RollTemplate } from "../M5Base" export class M5ItemSheet extends ItemSheet { @@ -78,6 +78,54 @@ export class M5ItemSheet extends ItemSheet { this.render(false) }) + html.find(".roll-delete").on("click", async (event) => { + //console.log("roll-delete", this.item.data.data.rolls.formulas) + + let row = event.target.parentElement + let rollIndex = row.dataset["roll"] + while (!rollIndex) { + row = row.parentElement + if (!row) + return + rollIndex = row.dataset["roll"] + } + + const rolls = this.item.data.data.rolls.formulas + rolls[rollIndex] = null + + this.item.update({ + data: { + rolls: { + formulas: rolls + } + } + }) + this.render(false) + }) + + html.find(".roll-create").on("click", async (event) => { + const rolls = this.item.data.data.rolls.formulas + + const indeces = Object.keys(rolls).map(index => parseInt(index)).sort().reverse() + const index = (indeces.find(index => !!rolls[index.toString()]) ?? -1) + 1 + console.log("roll-create", rolls, indeces, index) + + rolls[index.toString()] = { + formula: "1d6", + label: (game as Game).i18n.localize("midgard5.roll"), + enabled: true + } as M5RollTemplate + + this.item.update({ + data: { + rolls: { + formulas: rolls + } + } + }) + this.render(false) + }) + // Drag & Drop if (["item"].includes(this.object.data?.type)) { const itemToItemAssociation = new DragDrop({ diff --git a/source/style/Character-sheet.less b/source/style/Character-sheet.less index e3f29c7..224ed1f 100644 --- a/source/style/Character-sheet.less +++ b/source/style/Character-sheet.less @@ -43,7 +43,7 @@ font-weight: bold; } - td { + td, th { padding: 0 0.5rem 0 0.5rem; &.center { diff --git a/source/style/item-sheet.less b/source/style/item-sheet.less index 7f14d0d..57133d6 100644 --- a/source/style/item-sheet.less +++ b/source/style/item-sheet.less @@ -1,20 +1,58 @@ // main: midgard5.less .midgard5.sheet.item { - form { - display: flex; - flex-direction: column; - } - .sheet-content { - height: 100%; - display: flex; - flex-direction: column; - .editor { - height: 100%; - } - } - .item-img { - height: 64px; - width: 64px; - } + form { + display: flex; + flex-direction: column; + } + .sheet-content { + height: 100%; + display: flex; + flex-direction: column; + .editor { + height: 100%; + } + } + .item-img { + height: 64px; + width: 64px; + } + + td, th { + padding: 0 0.5rem 0 0.5rem; + + &.center { + text-align: center; + } + + &.fixed-value { + width: 3rem; + text-align: center; + } + } + + table.rolls-table { + .col-enabled { + width: 3rem; + text-align: center; + } + + .col-create { + width: 3rem; + text-align: center; + + button { + background: rgba(255, 255, 255, 0.5); + } + } + + .col-delete { + width: 3rem; + text-align: center; + } + + .col-label { + width: 6rem; + } + } } diff --git a/source/template.json b/source/template.json index fef1056..1351519 100644 --- a/source/template.json +++ b/source/template.json @@ -112,9 +112,6 @@ "character": { "templates": ["characterBars", "attributes", "characterDescription", "characterHeader", "skills"], "calc": {} - }, - "vehicle": { - "templates": ["characterBars", "attributes"] } }, "Item": { @@ -217,7 +214,6 @@ "formulas": { "0": { "formula": "1d20 + @i.calc.fw + @i.calc.bonus", - "type": "ew", "label": "EW", "enabled": true } @@ -226,13 +222,6 @@ }, "calc": {} }, - "mod": { - "type": "", - "id": "", - "operation": "", - "value": 0, - "calc": {} - }, "item": { "templates": ["itemDescription", "equippable", "physical"], "rolls": { @@ -251,14 +240,12 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.attackBonus + @i.stats.attackBonus", - "type": "ew", + "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.attackBonus.value + @i.stats.attackBonus", "label": "Angriff", "enabled": true }, "1": { - "formula": "@i.damageBase + @i.stats.damageBonus + @c.calc.stats.damageBonus", - "type": "dmg", + "formula": "@i.damageBase + @i.stats.damageBonus + @c.calc.stats.damageBonus.value", "label": "Schaden", "enabled": true } @@ -274,8 +261,7 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.defense + @c.calc.stats.defenseBonus + @i.stats.defenseBonus", - "type": "ew", + "formula": "1d20 + @i.calc.fw + @i.calc.bonus + @i.calc.special + @c.calc.stats.defense.value + @c.calc.stats.defenseBonus.value + @i.stats.defenseBonus", "label": "Abwehr", "enabled": true } @@ -309,8 +295,7 @@ "rolls": { "formulas": { "0": { - "formula": "1d20 + @c.calc.stats.spellCasting + @i.bonus", - "type": "ew", + "formula": "1d20 + @c.calc.stats.spellCasting.value + @i.bonus", "label": "Zaubern", "enabled": true } diff --git a/templates/chat/roll-m5.hbs b/templates/chat/roll-m5.hbs index b131c07..b893ecb 100644 --- a/templates/chat/roll-m5.hbs +++ b/templates/chat/roll-m5.hbs @@ -5,52 +5,54 @@ {{#if (eq iType "spell")}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{/if}} {{#each rolls as |roll index|}} - - - - + {{#if roll.enabled}} + + + + + {{/if}} {{/each}}
{{localize "midgard5.actor-ap"}}{{i.ap}}
{{localize "midgard5.spell-castDuration"}}{{i.castDuration}}
{{localize "midgard5.spell-range"}}{{i.range}}
{{localize "midgard5.spell-effectTarget"}}{{localize (m5concat "midgard5.spell-target-" i.effectTarget)}}
{{localize "midgard5.spell-effectArea"}}{{i.effectArea}}
{{localize "midgard5.spell-effectDuration"}}{{i.effectDuration}}
{{localize "midgard5.spell-origin"}}{{i.origin}}
{{localize "midgard5.spell-type"}}{{localize (m5concat "midgard5.spell-type-" i.type)}}
{{localize "midgard5.spell-process"}}{{localize (m5concat "midgard5.spell-process-" i.process)}}
{{localize "midgard5.actor-ap"}}{{i.ap}}
{{localize "midgard5.spell-castDuration"}}{{i.castDuration}}
{{localize "midgard5.spell-range"}}{{i.range}}
{{localize "midgard5.spell-effectTarget"}}{{localize (m5concat "midgard5.spell-target-" i.effectTarget)}}
{{localize "midgard5.spell-effectArea"}}{{i.effectArea}}
{{localize "midgard5.spell-effectDuration"}}{{i.effectDuration}}
{{localize "midgard5.spell-origin"}}{{i.origin}}
{{localize "midgard5.spell-type"}}{{localize (m5concat "midgard5.spell-type-" i.type)}}
{{localize "midgard5.spell-process"}}{{localize (m5concat "midgard5.spell-process-" i.process)}}
{{roll.label}} - {{roll.totalStr}} - {{roll.result}} -
{{roll.label}} + {{roll.totalStr}} + {{roll.result}} +
diff --git a/templates/sheets/character/gear.hbs b/templates/sheets/character/gear.hbs index 18e56b9..70a2b91 100644 --- a/templates/sheets/character/gear.hbs +++ b/templates/sheets/character/gear.hbs @@ -2,9 +2,9 @@ {{localize "ITEM.TypeWeapon"}} - {{localize "midgard5.ew"}} - - + {{localize "midgard5.ew"}} + + @@ -30,9 +30,9 @@ {{localize "ITEM.TypeDefensiveWeapon"}} - {{localize "midgard5.ew"}} - - + {{localize "midgard5.ew"}} + + @@ -51,13 +51,13 @@ {{localize "ITEM.TypeArmor"}} - {{localize "midgard5.actor-lp-short"}} - {{localize "midgard5.actor-ap-short"}} - {{localize "midgard5.attackBonus-short"}} - {{localize "midgard5.defenseBonus-short"}} - B - Gw - + {{localize "midgard5.actor-lp-short"}} + {{localize "midgard5.actor-ap-short"}} + {{localize "midgard5.attackBonus-short"}} + {{localize "midgard5.defenseBonus-short"}} + B + Gw + @@ -80,12 +80,14 @@ {{localize "ITEM.TypeItem"}} + {{#each data.calc.gear.items as |item itemId|}} {{item.label}} + {{/each}} diff --git a/templates/sheets/item/defensiveWeapon.hbs b/templates/sheets/item/defensiveWeapon.hbs index 7e9e4cd..b80ec63 100644 --- a/templates/sheets/item/defensiveWeapon.hbs +++ b/templates/sheets/item/defensiveWeapon.hbs @@ -43,6 +43,9 @@ + + {{> "systems/midgard5/templates/sheets/item/rolls.hbs"}} + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} \ No newline at end of file diff --git a/templates/sheets/item/rolls.hbs b/templates/sheets/item/rolls.hbs new file mode 100644 index 0000000..e92d9be --- /dev/null +++ b/templates/sheets/item/rolls.hbs @@ -0,0 +1,22 @@ + + + + + + + + + + + {{#each data.rolls.formulas as |roll rollIndex|}} + {{#if roll}} + + + + + + + {{/if}} + {{/each}} + +
{{localize "midgard5.label"}}{{localize "midgard5.formula"}}
\ No newline at end of file diff --git a/templates/sheets/item/skill.hbs b/templates/sheets/item/skill.hbs index 879faf1..0414304 100644 --- a/templates/sheets/item/skill.hbs +++ b/templates/sheets/item/skill.hbs @@ -29,6 +29,8 @@ + {{> "systems/midgard5/templates/sheets/item/rolls.hbs"}} + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} \ No newline at end of file diff --git a/templates/sheets/item/spell.hbs b/templates/sheets/item/spell.hbs index 649064c..89865a9 100644 --- a/templates/sheets/item/spell.hbs +++ b/templates/sheets/item/spell.hbs @@ -62,6 +62,9 @@ + + {{> "systems/midgard5/templates/sheets/item/rolls.hbs"}} + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} \ No newline at end of file diff --git a/templates/sheets/item/weapon.hbs b/templates/sheets/item/weapon.hbs index a5809ed..892b31c 100644 --- a/templates/sheets/item/weapon.hbs +++ b/templates/sheets/item/weapon.hbs @@ -48,7 +48,7 @@ {{/select}} {{else}} - Assign item to character to select weapon skill + {{localize "midgard5.assignItemToCharacter"}} {{/if}} @@ -60,6 +60,9 @@ + + {{> "systems/midgard5/templates/sheets/item/rolls.hbs"}} + {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} \ No newline at end of file