From 2e82539dabd933bb0463039699f44992658fe4a0 Mon Sep 17 00:00:00 2001 From: LeFrique Date: Fri, 1 Dec 2023 17:37:07 +0100 Subject: [PATCH] Fixed Operations and Combat Conditions --- lang/de.json | 4 ++++ packs/items/kampfzustaende/angeschlagen.json | 2 +- packs/items/kampfzustaende/benommen.json | 2 +- packs/items/kampfzustaende/blutend.json | 2 +- packs/items/kampfzustaende/eingeschuechtert.json | 2 +- packs/items/kampfzustaende/ermutigt.json | 2 +- packs/items/kampfzustaende/erschoepft.json | 2 +- packs/items/kampfzustaende/erzuernt.json | 2 +- packs/items/kampfzustaende/lahm.json | 2 +- packs/items/kampfzustaende/taumelnd.json | 2 +- packs/items/kampfzustaende/ueberrascht.json | 2 +- packs/items/kampfzustaende/verwirrt.json | 4 ++-- source/module/actors/M5ModAggregate.ts | 12 ++++++------ templates/sheets/partial/mod.hbs | 3 +++ 14 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lang/de.json b/lang/de.json index 1014c7f..b51472e 100644 --- a/lang/de.json +++ b/lang/de.json @@ -275,6 +275,10 @@ "midgard5.mod-operation-add": "Addieren", "midgard5.mod-operation-set": "Basiswert", "midgard5.mod-operation-fixed": "Fester Wert", + "midgard5.mod-operation-subtract": "Subtrahieren", + "midgard5.mod-operation-multiply": "Multiplizieren", + "midgard5.mod-operation-division": "Dividieren", + "midgard5.mod-stat-defenseBonus": "Abwehrbonus", "midgard5.mod-stat-attackBonus": "Angriffsbonus", diff --git a/packs/items/kampfzustaende/angeschlagen.json b/packs/items/kampfzustaende/angeschlagen.json index aea4fa8..6c499c2 100644 --- a/packs/items/kampfzustaende/angeschlagen.json +++ b/packs/items/kampfzustaende/angeschlagen.json @@ -1,7 +1,7 @@ { "name": "Angeschlagen", "type": "effect", - "img": "icons/tools/instruments/injury-pain-body-orange.web", + "img": "icons/skills/wounds/injury-pain-body-orange.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/benommen.json b/packs/items/kampfzustaende/benommen.json index f2b1c8f..d0a661d 100644 --- a/packs/items/kampfzustaende/benommen.json +++ b/packs/items/kampfzustaende/benommen.json @@ -1,7 +1,7 @@ { "name": "Benommen", "type": "effect", - "img": "icons/tools/instruments/hypnosis-mesmerism-eye.webp", + "img": "icons/magic/control/hypnosis-mesmerism-eye.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/blutend.json b/packs/items/kampfzustaende/blutend.json index 9cca085..ff6bc25 100644 --- a/packs/items/kampfzustaende/blutend.json +++ b/packs/items/kampfzustaende/blutend.json @@ -1,7 +1,7 @@ { "name": "Blutend", "type": "effect", - "img": "icons/tools/instruments/blood-drip-droplet-red.webp", + "img": "icons/skills/wounds/blood-drip-droplet-red.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/eingeschuechtert.json b/packs/items/kampfzustaende/eingeschuechtert.json index 71b8420..7cbc784 100644 --- a/packs/items/kampfzustaende/eingeschuechtert.json +++ b/packs/items/kampfzustaende/eingeschuechtert.json @@ -1,7 +1,7 @@ { "name": "Eingeschüchtert", "type": "effect", - "img": "icons/tools/instruments/fear-fright-white.webp", + "img": "icons/magic/control/fear-fright-white.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/ermutigt.json b/packs/items/kampfzustaende/ermutigt.json index 32d79bd..681f7c2 100644 --- a/packs/items/kampfzustaende/ermutigt.json +++ b/packs/items/kampfzustaende/ermutigt.json @@ -1,7 +1,7 @@ { "name": "Ermutigt", "type": "effect", - "img": "icons/tools/instruments/strike-fist-stone-light.webp", + "img": "icons/magic/earth/strike-fist-stone-light.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/erschoepft.json b/packs/items/kampfzustaende/erschoepft.json index 5e99afc..ddd8059 100644 --- a/packs/items/kampfzustaende/erschoepft.json +++ b/packs/items/kampfzustaende/erschoepft.json @@ -1,7 +1,7 @@ { "name": "Erschöpft", "type": "effect", - "img": "icons/tools/instruments/injury-body-pain-gray.webp", + "img": "icons/skills/wounds/injury-body-pain-gray.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/erzuernt.json b/packs/items/kampfzustaende/erzuernt.json index 6f65726..d2fd190 100644 --- a/packs/items/kampfzustaende/erzuernt.json +++ b/packs/items/kampfzustaende/erzuernt.json @@ -1,7 +1,7 @@ { "name": "Erzürnt", "type": "effect", - "img": "icons/tools/instruments/fear-fright-monster-grin-red-orange.webp", + "img": "icons/magic/control/fear-fright-monster-grin-red-orange.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/lahm.json b/packs/items/kampfzustaende/lahm.json index 96373dc..5139343 100644 --- a/packs/items/kampfzustaende/lahm.json +++ b/packs/items/kampfzustaende/lahm.json @@ -1,7 +1,7 @@ { "name": "Lahm", "type": "effect", - "img": "icons/tools/instruments/feet-spurred-boots-brown.webp", + "img": "icons/skills/movement/feet-spurred-boots-brown.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/taumelnd.json b/packs/items/kampfzustaende/taumelnd.json index 461ede3..051cdd7 100644 --- a/packs/items/kampfzustaende/taumelnd.json +++ b/packs/items/kampfzustaende/taumelnd.json @@ -1,7 +1,7 @@ { "name": "Taumelnd", "type": "effect", - "img": "icons/tools/instruments/silhouette-fall-slip-prone.webp", + "img": "icons/magic/control/silhouette-fall-slip-prone.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/ueberrascht.json b/packs/items/kampfzustaende/ueberrascht.json index 9bc441c..25d4e3c 100644 --- a/packs/items/kampfzustaende/ueberrascht.json +++ b/packs/items/kampfzustaende/ueberrascht.json @@ -1,7 +1,7 @@ { "name": "Überrascht", "type": "effect", - "img": "icons/tools/instruments/silhouette-hold-change-green.webp", + "img": "icons/magic/control/silhouette-hold-change-green.webp", "system": { "description": "", "equippable": false, diff --git a/packs/items/kampfzustaende/verwirrt.json b/packs/items/kampfzustaende/verwirrt.json index 5183538..204284a 100644 --- a/packs/items/kampfzustaende/verwirrt.json +++ b/packs/items/kampfzustaende/verwirrt.json @@ -1,7 +1,7 @@ { - "name": "Lahm", + "name": "Verwirrt", "type": "effect", - "img": "icons/tools/instruments/silhouette-grow-shrink-blue.webp", + "img": "icons/magic/control/silhouette-grow-shrink-blue.webp", "system": { "description": "", "equippable": false, diff --git a/source/module/actors/M5ModAggregate.ts b/source/module/actors/M5ModAggregate.ts index c84fa37..0e2fbe8 100644 --- a/source/module/actors/M5ModAggregate.ts +++ b/source/module/actors/M5ModAggregate.ts @@ -130,22 +130,22 @@ export default class M5ModAggregate { mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.SUBTRACT); if (mods.length !== 0) { ret.mods = ret.mods.concat(mods.map(this.pairAsSource)); - const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a - b, 0); - ret.value = Math.max(0, ret.value + bonus); + const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0); + ret.value = Math.max(0, ret.value - bonus); } mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.MULTIPLY); if (mods.length !== 0) { ret.mods = ret.mods.concat(mods.map(this.pairAsSource)); - const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a * b, 0); - ret.value = Math.max(0, ret.value + bonus); + const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0); + ret.value = Math.max(0, ret.value * bonus); } mods = arr.filter((pair) => pair.mod.operation === M5ModOperation.DIVISION); if (mods.length !== 0) { ret.mods = ret.mods.concat(mods.map(this.pairAsSource)); - const bonus = mods.map((p) => p.mod.value).reduce((a, b) => Math.floor(a / b), 0); - ret.value = Math.max(0, ret.value + bonus); + const bonus = mods.map((p) => p.mod.value).reduce((a, b) => a + b, 0); + ret.value = Math.max(0, Math.floor(ret.value / bonus)); } } diff --git a/templates/sheets/partial/mod.hbs b/templates/sheets/partial/mod.hbs index f56d85a..d4a2bfe 100644 --- a/templates/sheets/partial/mod.hbs +++ b/templates/sheets/partial/mod.hbs @@ -40,6 +40,9 @@ + + + {{/select}}