From 08e767afcb85ef8cede54e9abfc7a2cad7b5b6eb Mon Sep 17 00:00:00 2001 From: oskaloq Date: Sun, 31 Mar 2024 18:51:01 +0200 Subject: [PATCH 01/10] =?UTF-8?q?Drag=20and=20Drop=20f=C3=BCr=20Container?= =?UTF-8?q?=20#98=20(#99)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Items können jetzt per Drag and Drop in Container verschoben werden. Werden sie nicht in einen Container gedroppt, landen sie wieder in der allgemeinen Item Übersicht. Co-authored-by: Ender Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/99 Reviewed-by: Byroks --- source/module/sheets/M5CharacterSheet.ts | 14 +++++++++++++- templates/sheets/character/gear.hbs | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/source/module/sheets/M5CharacterSheet.ts b/source/module/sheets/M5CharacterSheet.ts index 01b8b5b..c61c7bb 100644 --- a/source/module/sheets/M5CharacterSheet.ts +++ b/source/module/sheets/M5CharacterSheet.ts @@ -526,7 +526,11 @@ export default class M5CharacterSheet extends ActorSheet { let data = null; try { data = JSON.parse(event.dataTransfer.getData("text/plain")); - data.data.system.containerId = ""; //Clean containerId + console.log("Data", data.data); + let target = event.target.closest("[data-container-id]") as HTMLElement; + let containerId = target ? target.dataset.containerId : ""; + console.log("Container ID", containerId); + data.data.system.containerId = containerId; //Update containerId if (data.type !== "Transfer") return false; } catch (err) { return false; @@ -535,6 +539,14 @@ export default class M5CharacterSheet extends ActorSheet { if (!data.data) return false; if (data.actorId === this.actor.id) { + let itemId=data.data._id; + const context = this.actor as any; + const item = context.items.get(itemId); + item.update({ + data: { + containerId: data.data.system.containerId, + }, + }); return this._onSortItem(event, data.data); } diff --git a/templates/sheets/character/gear.hbs b/templates/sheets/character/gear.hbs index 79efc09..c36ef5f 100644 --- a/templates/sheets/character/gear.hbs +++ b/templates/sheets/character/gear.hbs @@ -63,7 +63,7 @@

{{localize "midgard5.itemsInContainers"}}

{{#each data.calc.gear.containers as |container containerId|}} -
+
{{container.label}}
From c5e5ba199bb180503a44d83c2bbc2dabe0d4b8ed Mon Sep 17 00:00:00 2001 From: oskaloq Date: Mon, 1 Apr 2024 19:30:19 +0200 Subject: [PATCH 02/10] changed manifest for easier update (#97) Co-authored-by: Ender Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/97 Reviewed-by: Byroks --- gulpfile.ts | 6 +++--- source/system.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gulpfile.ts b/gulpfile.ts index 73b2ee5..682b2c9 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -473,8 +473,8 @@ const updateManifest = (cb: any) => { const result = `${repoURL}/releases/download`; manifest.file.url = repoURL; - manifest.file.manifest = `${result}/v${manifest.file.version}/${manifest.name}`; - manifest.file.download = `${result}/v${manifest.file.version}/${manifest.file.name}-v${manifest.file.version}.zip`; + manifest.file.manifest = `${result}/latest/${manifest.name}?token=2455375115b92bc8d87c93df7159eec232456f2d`; + manifest.file.download = `${result}/v${manifest.file.version}/${manifest.file.name}-v${manifest.file.version}.zip?token=2455375115b92bc8d87c93df7159eec232456f2d`; const prettyProjectJson = stringify(manifest.file, { maxLength: 35, @@ -504,7 +504,7 @@ const gitTaskBuild = (cb: gulp.TaskFunctionCallback) => { if (!manifest) return cb(Error("could not load manifest.")); return gulp - .src(`${manifest.file.name}-v${manifest.file.version}.zip`) + .src(`${manifest.file.name}.zip`) .pipe(git.checkout(`v${manifest.file.version}`, { args: "-b" })) .pipe(git.add({ args: "--no-all -f" })) .pipe(git.commit(`v${manifest.file.version}`, { args: "-a", disableAppendPaths: true })); diff --git a/source/system.json b/source/system.json index c4d5528..d0d4bd7 100644 --- a/source/system.json +++ b/source/system.json @@ -28,8 +28,8 @@ "primaryTokenAttribute": "lp", "secondaryTokenAttribute": "ap", "url": "https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5", - "manifest": "https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/releases/download/v2.6.0/system.json", - "download": "https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/releases/download/v2.6.0/midgard5-v2.6.0.zip", + "manifest": "https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/releases/download/latest/system.json?token=2455375115b92bc8d87c93df7159eec232456f2d", + "download": "https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/releases/download/latest/midgard5.zip?token=2455375115b92bc8d87c93df7159eec232456f2d", "initiative": "@c.calc.attributes.gw.value", "license": "LICENSE.txt" } \ No newline at end of file From 5a1e11d0d7979f5ccd35fec31fa01aefda1e84e1 Mon Sep 17 00:00:00 2001 From: Byroks Date: Sat, 27 Apr 2024 18:45:20 +0200 Subject: [PATCH 03/10] Sneak update, AP Cost not working correctly --- source/module/items/M5Item.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/module/items/M5Item.ts b/source/module/items/M5Item.ts index 24b7c3f..786d868 100644 --- a/source/module/items/M5Item.ts +++ b/source/module/items/M5Item.ts @@ -343,7 +343,13 @@ export class M5Item extends Item { if (item.type === "spell" || item.type === "kampfkunst") { if (this.actor["system"].ap.value >= item.system.ap) { - this.actor["system"].ap.value -= item.system.ap; + this.actor["update"]({ + data: { + ap: { + value: this.actor["system"].ap.value - item.system.ap, + }, + }, + }); } } From 37d6ba12e784ada275be7bd398737295d0e4a162 Mon Sep 17 00:00:00 2001 From: LeFrique Date: Wed, 1 May 2024 19:10:47 +0200 Subject: [PATCH 04/10] tragkraft-containerwert-abw-kidoprep (#103) + Added ABW to items + Added warning for over-capacity + Added Valuecalculation for containers + Updated KiDo-template Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/103 Reviewed-by: Byroks Co-authored-by: LeFrique Co-committed-by: LeFrique --- lang/de.json | 18 +++++++++++++----- source/module/actors/M5Character.ts | 5 +++++ source/template.json | 10 +++++++--- templates/chat/roll-m5.hbs | 10 ++++------ templates/sheets/character/gear.hbs | 8 ++++---- templates/sheets/item/armor.hbs | 8 +++++++- templates/sheets/item/container.hbs | 6 ++++++ templates/sheets/item/defensiveWeapon.hbs | 8 +++++++- templates/sheets/item/item.hbs | 20 ++++++++++++-------- templates/sheets/item/kampfkunst.hbs | 18 +++++++++++++++++- templates/sheets/item/weapon.hbs | 8 +++++++- 11 files changed, 89 insertions(+), 30 deletions(-) diff --git a/lang/de.json b/lang/de.json index c6cc2eb..a12db20 100644 --- a/lang/de.json +++ b/lang/de.json @@ -61,6 +61,8 @@ "item-ismagic": "Ist Magisch", "item-wealth": "Vermögenswert", "item-weight": "Gewicht", + "item-abw": "ABW", + "item-abw-long": "Ausbrennwahrscheinlichkeit", "actor-lp": "Lebenspunkte", "actor-lp-short": "LP", @@ -133,7 +135,7 @@ "heavy-load": "Schwere Last", "thrust-load": "Schublast", "load-max": "Höchstlast", - "load-capacity": "Tragkraft", + "capacity": "Tragkraft", "exp-overall": "Erfahrungsschatz", "exp-available": "Erfahrungspunkte", @@ -356,12 +358,13 @@ "spell-agens": "Agens", "spell-reagens": "Reagens", "spell-material": "Zaubermaterial", + "spell-rank": "Stufe", "kampfkunst-type": "Form", "kampfkunst-variante": "Variante", "kampfkunst-variante-short": "Var", "kampfkunst-ep": "Erfahrungspunkte", - "kampfkunst-rank": "Stufe", + "kampfkunst-rank": "Stufe der Technik", "kampfkunst-weapon": "Waffengruppe", "kampfkunst-enemy": "Einschränkungen durch Art der Gegner", @@ -385,6 +388,10 @@ "kido-variante": "KiDo Variante", "kido-color": "Kampfstilfarbe", "kido-style": "Art der Technik", + "kido-rank": "Stufe der Technik", + "kido-grade": "Ausbildungsgrad", + "kido-enemy": "Einschränkungen durch Art der Gegner", + "kido-weapon": "Waffengruppe", "kido-type-angriff": "Kido Angriff", "kido-type-verteidigung": "Kido Verteidigung", @@ -399,6 +406,7 @@ "kido-variante-blockieren": "Blockieren", "kido-variante-bewegen": "Bewegen", "kido-variante-kontrollieren": "Kontrollieren", + "kido-variante-finte": "Finte", "mod-operation-add100": "Addieren (max 100)", "mod-operation-roll": "Wurf Modifikation", @@ -444,9 +452,9 @@ "reroll": "Neuwürfeln", "options": { - "modifier": "Modifikator", - "difficulty": "Schwellenwert", - "rollMode": "Würfel Modus" + "modifier": "Wurfmodifikator", + "difficulty": "Erfolg", + "rollMode": "Würfelmodus" } } } diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index 3f83d15..5f42cdc 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -280,6 +280,7 @@ export class M5Character extends Actor { if (!!item.system.containerId) { ret.gear.containers[item.system.containerId].weight += parseFloat((item.system.weight * item.system.quantity).toPrecision(4)); + ret.gear.containers[item.system.containerId].value += parseFloat(this.calculateValue(item.system.value * item.system.quantity, item.system.currency).toPrecision(3)); if (ret.gear.containers[item.system.containerId].equipped) { ret.stats.encumbrance += item.system.weight * item.system.quantity; } @@ -302,6 +303,7 @@ export class M5Character extends Actor { label: label, icon: icon, magic: item.system.magic, + abw: item.system.abw || 0, calc: item.system.calc, equipped: item.system?.equipped, valuable: item.system?.valuable, @@ -352,6 +354,7 @@ export class M5Character extends Actor { icon: item.img, skillId: item.system.skillId, magic: item.system.magic, + abw: item.system.abw || 0, valuable: item.system?.valuable, hoarded: item.system?.hoarded, value: item.system.value || 0, @@ -395,6 +398,7 @@ export class M5Character extends Actor { icon: item.img, skillId: item.system.skillId, magic: item.system.magic, + abw: item.system.abw || 0, valuable: item.system?.valuable, hoarded: item.system?.hoarded, value: item.system.value || 0, @@ -438,6 +442,7 @@ export class M5Character extends Actor { label: label, icon: item.img, magic: item.system.magic, + abw: item.system.abw || 0, valuable: item.system?.valuable, hoarded: item.system?.hoarded, value: item.system.value || 0, diff --git a/source/template.json b/source/template.json index ba41359..cd2fc5d 100644 --- a/source/template.json +++ b/source/template.json @@ -224,7 +224,8 @@ "weight": 0, "capacity": 0, "containerId": "", - "magic": false + "magic": false, + "abw": 0 }, "durationSelection": { "durationSelection": { @@ -314,7 +315,8 @@ "ausweichen": "midgard5.kido-variante-ausweichen", "blockieren": "midgard5.kido-variante-blockieren", "bewegen": "midgard5.kido-variante-bewegen", - "kontrollieren": "midgard5.kido-variante-kontrollieren" + "kontrollieren": "midgard5.kido-variante-kontrollieren", + "finte": "midgard5.kido-variante-finte" } } }, @@ -438,6 +440,7 @@ "agens": "", "reagens": "", "material": "", + "rank": 0, "rolls": { "formulas": { "0": { @@ -459,10 +462,11 @@ "ap": "", "weapon": "", "ep": "", - "rank": "", + "rank": 0, "enemy": "", "color": "", "style": "", + "grade": "", "rolls": { "formulas": { "0": { diff --git a/templates/chat/roll-m5.hbs b/templates/chat/roll-m5.hbs index 9e516fd..ccbbb64 100644 --- a/templates/chat/roll-m5.hbs +++ b/templates/chat/roll-m5.hbs @@ -94,31 +94,29 @@ - + - + - {{#if (eq i.type "angriff")}} - + - + - {{/if}} {{/unless}} {{/if}} diff --git a/templates/sheets/character/gear.hbs b/templates/sheets/character/gear.hbs index c36ef5f..faf4de1 100644 --- a/templates/sheets/character/gear.hbs +++ b/templates/sheets/character/gear.hbs @@ -251,13 +251,13 @@ {{/unless}} + + + - - + + @@ -73,12 +83,6 @@ {{/if}} -
{{i.ep}}
{{localize "midgard5.kampfkunst-color"}}{{localize "midgard5.kido-color"}} {{i.color}}
{{localize "midgard5.kampfkunst-style"}}{{localize "midgard5.kido-style"}} {{i.style}}
{{localize "midgard5.kido-type"}} {{localize (m5concat "midgard5.kido-type-" i.type)}}
{{localize "midgard5.kido-variante"}} {{localize (m5concat "midgard5.kido-variante-" i.variante)}}
{{localize "midgard5.kampfkunst-enemy"}}{{localize "midgard5.kido-enemy"}} {{i.enemy}}
{{localize "midgard5.kampfkunst-weapon"}}{{localize "midgard5.kido-weapon"}} {{i.weapon}}
- {{#unless (or (eq item.weight "") (eq item.equipped?))}} - {{item.weight}} kg + {{#unless (or (eq item.weight 0) (eq item.equipped?))}} + {{item.weight}}kg {{/unless}} - {{#unless (eq item.capacity "")}} - {{item.capacity}} kg + {{#unless (eq item.capacity 0)}} + {{item.capacity}}kg {{/unless}} diff --git a/templates/sheets/item/armor.hbs b/templates/sheets/item/armor.hbs index 6826f32..40bf142 100644 --- a/templates/sheets/item/armor.hbs +++ b/templates/sheets/item/armor.hbs @@ -51,9 +51,15 @@
{{localize "midgard5.item-weight"}} - +
+
+ {{localize "midgard5.item-abw"}} + +
+
diff --git a/templates/sheets/item/container.hbs b/templates/sheets/item/container.hbs index 13c1a87..78c1458 100644 --- a/templates/sheets/item/container.hbs +++ b/templates/sheets/item/container.hbs @@ -18,6 +18,12 @@ +
+ {{localize "midgard5.item-abw"}} + +
+
diff --git a/templates/sheets/item/defensiveWeapon.hbs b/templates/sheets/item/defensiveWeapon.hbs index 26ad39d..9de5a35 100644 --- a/templates/sheets/item/defensiveWeapon.hbs +++ b/templates/sheets/item/defensiveWeapon.hbs @@ -55,9 +55,15 @@
{{localize "midgard5.item-weight"}} - +
+
+ {{localize "midgard5.item-abw"}} + +
+
diff --git a/templates/sheets/item/item.hbs b/templates/sheets/item/item.hbs index 1509b7d..e64b2db 100644 --- a/templates/sheets/item/item.hbs +++ b/templates/sheets/item/item.hbs @@ -37,8 +37,6 @@
{{localize "midgard5.item-value"}} @@ -53,6 +51,18 @@
+
+ {{localize "midgard5.item-weight"}} + +
+
+
+ {{localize "midgard5.item-abw"}} + +
+
-
- {{localize "midgard5.item-weight"}} - -
-
diff --git a/templates/sheets/item/kampfkunst.hbs b/templates/sheets/item/kampfkunst.hbs index 962dd93..d50e049 100644 --- a/templates/sheets/item/kampfkunst.hbs +++ b/templates/sheets/item/kampfkunst.hbs @@ -25,8 +25,10 @@ {{localize "midgard5.kampfkunst-ep"}} + {{#unless item.system.isKido}} {{localize "midgard5.kampfkunst-rank"}} - + + {{/unless}} {{localize "midgard5.kampfkunst-weapon"}} @@ -83,6 +85,20 @@ {{/unless}} {{/unless}} + {{#if item.system.isKido}} + + {{localize "midgard5.kido-color"}} + + {{localize "midgard5.kido-style"}} + + + + {{localize "midgard5.kido-grade"}} + + {{localize "midgard5.kido-rank"}} + + + {{/if}} {{localize "midgard5.skill"}} diff --git a/templates/sheets/item/weapon.hbs b/templates/sheets/item/weapon.hbs index b1c2f79..dcda116 100644 --- a/templates/sheets/item/weapon.hbs +++ b/templates/sheets/item/weapon.hbs @@ -60,9 +60,15 @@
{{localize "midgard5.item-weight"}} - +
+ +
+ {{localize "midgard5.item-abw"}} + +
+ From 3ecd2c6c1edba9ff7a9d8cd65328792af6580b22 Mon Sep 17 00:00:00 2001 From: oskaloq Date: Tue, 14 May 2024 11:38:20 +0200 Subject: [PATCH 05/10] Vereinfachter-NPC/Kreaturen-Bogen (#107) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ich habe mal den ersten Entwurf eines NPC Bogens fertiggestellt. Ist jetzt ein eigener Actor Type geworden und nicht nur ein alternativer Char Bogen: Einfach beim Erstellen eines neuen Actors NPC wählen. Co-authored-by: Ender Co-authored-by: LeFrique Co-authored-by: Byroks Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/107 Reviewed-by: Le-Frique --- lang/de.json | 1 + source/PreloadTemplates.ts | 5 + source/module/M5Base.ts | 1 + source/module/items/M5Item.ts | 24 +-- source/module/rolls/M5Roll.ts | 20 +- source/module/sheets/M5CharacterSheet.ts | 50 +++-- source/settings.ts | 9 + source/style/npc-sheet.less | 23 +++ source/template.json | 22 ++- templates/sheets/character/gear.hbs | 10 +- templates/sheets/character/main.hbs | 24 +-- templates/sheets/character/spells.hbs | 2 + templates/sheets/npc/attribute.hbs | 4 + templates/sheets/npc/combat.hbs | 233 +++++++++++++++++++++++ templates/sheets/npc/description.hbs | 18 ++ templates/sheets/npc/main.hbs | 127 ++++++++++++ templates/sheets/npc/properties.hbs | 117 ++++++++++++ 17 files changed, 636 insertions(+), 54 deletions(-) create mode 100644 source/style/npc-sheet.less create mode 100644 templates/sheets/npc/attribute.hbs create mode 100644 templates/sheets/npc/combat.hbs create mode 100644 templates/sheets/npc/description.hbs create mode 100644 templates/sheets/npc/main.hbs create mode 100644 templates/sheets/npc/properties.hbs diff --git a/lang/de.json b/lang/de.json index a12db20..21443eb 100644 --- a/lang/de.json +++ b/lang/de.json @@ -283,6 +283,7 @@ "rangedWeapon": "Schusswaffe", "assignItemToCharacter": "Füge Gegenstand einem Charakter hinzu, um hier etwas auswählen zu können", "showAll": "Alle anzeigen", + "showUnlearned": "Ungelernte Fertigkeiten", "wealthAndWeight": "Vermögen und Lasten", "itemsInContainers": "Gegenstände in Aufbewahrung", "allItems": "Alle Gegenstände", diff --git a/source/PreloadTemplates.ts b/source/PreloadTemplates.ts index b2f2d19..a126db5 100644 --- a/source/PreloadTemplates.ts +++ b/source/PreloadTemplates.ts @@ -15,6 +15,11 @@ const preloadTemplates = async (): Promise[]> = "sheets/character/spells.hbs", "sheets/character/combat.hbs", "sheets/character/effects.hbs", + "sheets/npc/main.hbs", + "sheets/npc/combat.hbs", + "sheets/npc/properties.hbs", + "sheets/npc/description.hbs", + "sheets/npc/attribute.hbs", "sheets/partial/mod.hbs", "sheets/item/rolls.hbs", "chat/roll-m5.hbs", diff --git a/source/module/M5Base.ts b/source/module/M5Base.ts index e890123..fdc1b26 100644 --- a/source/module/M5Base.ts +++ b/source/module/M5Base.ts @@ -162,6 +162,7 @@ export interface M5AttributeCalculated extends M5ModResult { export interface M5CharacterCalculatedData { level: number; + movement: number; attributes: { st: M5AttributeCalculated; gs: M5AttributeCalculated; diff --git a/source/module/items/M5Item.ts b/source/module/items/M5Item.ts index 786d868..183e70d 100644 --- a/source/module/items/M5Item.ts +++ b/source/module/items/M5Item.ts @@ -314,7 +314,7 @@ export class M5Item extends Item { return ret; } - async roll() { + async roll(toggleAutomatedRoll = false) { const item = this as any; // Initialize chat data. @@ -341,20 +341,20 @@ export class M5Item extends Item { } }); - if (item.type === "spell" || item.type === "kampfkunst") { - if (this.actor["system"].ap.value >= item.system.ap) { - this.actor["update"]({ - data: { - ap: { - value: this.actor["system"].ap.value - item.system.ap, + const roll = new M5Roll(rollData, this.actor, item.name, item.id); + if (await roll.toMessage(toggleAutomatedRoll)) { + if (item.type === "spell" || item.type === "kampfkunst") { + if (this.actor["system"].ap.value >= item.system.ap) { + this.actor["update"]({ + data: { + ap: { + value: this.actor["system"].ap.value - item.system.ap, + }, }, - }, - }); + }); + } } } - - const roll = new M5Roll(rollData, this.actor, item.name, item.id); - return roll.toMessage(); } else { ChatMessage.create({ speaker: speaker, diff --git a/source/module/rolls/M5Roll.ts b/source/module/rolls/M5Roll.ts index 81f49fb..d47b4f4 100644 --- a/source/module/rolls/M5Roll.ts +++ b/source/module/rolls/M5Roll.ts @@ -142,18 +142,26 @@ export class M5Roll { return renderTemplate(M5Roll.TEMPLATE_PATH, this.data); } - async toMessage() { - let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") }); - if (checkOptions["cancelled"]) { - return; + async toMessage(toggleAutomatedRoll = false) { + let automatedRoll = (game as Game).settings.get("midgard5", "automatedRoll"); + automatedRoll = toggleAutomatedRoll ? !automatedRoll : automatedRoll; + const rMode = (game as Game).settings.get("core", "rollMode"); + + if (!automatedRoll) { + let checkOptions = await this.popUp({ isPW: this.data.rolls[0].label === (game as Game).i18n.localize("midgard5.pw") }); + if (checkOptions["cancelled"]) { + return; + } else { + const rMode = checkOptions["rollMode"]; + this.data.b = checkOptions; + } } else { - this.data.b = checkOptions; + this.data.b = { difficulty: 20, modifier: 0 }; } if (!this._evaluated) await this.evaluate(); const faces = this.pool.dice.map((x) => x.faces); - const rMode = checkOptions["rollMode"] || (game as Game).settings.get("core", "rollMode"); const chatData = { type: CONST.CHAT_MESSAGE_TYPES.ROLL, content: await this.render(), diff --git a/source/module/sheets/M5CharacterSheet.ts b/source/module/sheets/M5CharacterSheet.ts index c61c7bb..6160ad0 100644 --- a/source/module/sheets/M5CharacterSheet.ts +++ b/source/module/sheets/M5CharacterSheet.ts @@ -7,7 +7,6 @@ import { M5Roll } from "../rolls/M5Roll"; export default class M5CharacterSheet extends ActorSheet { static get defaultOptions() { return mergeObject(super.defaultOptions, { - template: "systems/midgard5/templates/sheets/character/main.hbs", width: 1000, height: 800, classes: ["midgard5", "sheet", "character"], @@ -21,7 +20,15 @@ export default class M5CharacterSheet extends ActorSheet { }); } - // get template() { + get template() { + //console.log("M5CharacterSheet", this.actor.data.type) + if (this.actor.type === "npc") { + return "systems/midgard5/templates/sheets/npc/main.hbs"; + } + else { + return "systems/midgard5/templates/sheets/character/main.hbs"; + } + } // return "systems/midgard5/templates/character_sheet/main.hbs" // }Options extends ActorSheet.Options = ActorSheet.Options, Data extends object = ActorSheet.Data @@ -78,7 +85,8 @@ export default class M5CharacterSheet extends ActorSheet { let attributeValue = target ? parseInt(target.dataset.value) : null; let attributeStr = target ? target.dataset.attribute : null; const roll = M5Roll.fromAttributeValue(this.actor, attributeStr, attributeValue); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".edit-item").on("click", async (event) => { @@ -138,7 +146,8 @@ export default class M5CharacterSheet extends ActorSheet { }); } - await item.roll(); + let toggleAutomatedRoll = (event.shiftKey) + await item.roll(toggleAutomatedRoll); this.render(); }); @@ -158,7 +167,8 @@ export default class M5CharacterSheet extends ActorSheet { const actor = this.actor as any; const item = actor.items.get(skillId) as M5Item; - await item.roll(); + let toggleAutomatedRoll = (event.shiftKey) + await item.roll(toggleAutomatedRoll); }); html.find(".roll-general-button").on("click", async (event) => { @@ -169,7 +179,8 @@ export default class M5CharacterSheet extends ActorSheet { const unlearnedSkill = data.skills.general[skillName] as M5SkillUnlearned; const roll = M5Roll.fromUnlearnedSkill(this.actor, unlearnedSkill, skillName); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".learn-button").on("click", async (event) => { @@ -267,48 +278,57 @@ export default class M5CharacterSheet extends ActorSheet { const context = this.actor as any; const item = context.items.get(itemId) as M5Item; - await item.roll(); + let toggleAutomatedRoll = (event.shiftKey) + await item.roll(toggleAutomatedRoll); this.render(); }); html.find(".roll-brawl-button").on("click", async (event) => { const roll = M5Roll.brawl(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".roll-cleanSpell-button").on("click", async (event) => { const roll = M5Roll.cleanSpell(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".roll-deprivationCold-button").on("click", async (event) => { const roll = M5Roll.deprivationCold(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".roll-deprivationHeat-button").on("click", async (event) => { const roll = M5Roll.deprivationHeat(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".roll-deprivationFood-button").on("click", async (event) => { const roll = M5Roll.deprivationFood(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".roll-defense-button").on("click", async (event) => { const roll = M5Roll.defense(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".roll-resistanceMind-button").on("click", async (event) => { const roll = M5Roll.resistanceMind(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".roll-resistanceBody-button").on("click", async (event) => { const roll = M5Roll.resistanceBody(this.actor); - await roll.toMessage(); + let toggleAutomatedRoll = (event.shiftKey) + await roll.toMessage(toggleAutomatedRoll); }); html.find(".change-equipped").on("click", async (event) => { diff --git a/source/settings.ts b/source/settings.ts index d9ba705..8705f00 100644 --- a/source/settings.ts +++ b/source/settings.ts @@ -13,4 +13,13 @@ export const loadSettings = async function () { default: true, type: Boolean, }); + (game as Game).settings.register("midgard5", "automatedRoll", { + name: "Automatische Würfelwürfe", + hint: "Falls aktiv, wird bei Würfelwürfen kein Dialog gezeigt. Das Verhalten kann mit gleichzeitig gedrückter Shift Taste umgekehrt werden.", + scope: "world", + config: true, + default: false, + type: Boolean, + }); + }; diff --git a/source/style/npc-sheet.less b/source/style/npc-sheet.less new file mode 100644 index 0000000..408202f --- /dev/null +++ b/source/style/npc-sheet.less @@ -0,0 +1,23 @@ +// main: midgard5.less +@borderGroove: 2px groove #eeede0; +@attributeBorderColor: rgba(0, 0, 0, 0.5); + +.midgard5 { + .sheet-npc { + .attribute-header { + align-items: center; + text-align: center; + font-weight: bold; + border: 0px solid transparent; + } + .attribute-value { + align-items: center; + text-align: center; + border: 0px solid transparent; + } + .fixed-value { + width: 3rem; + text-align: center; + } + } +} \ No newline at end of file diff --git a/source/template.json b/source/template.json index cd2fc5d..b337148 100644 --- a/source/template.json +++ b/source/template.json @@ -1,15 +1,18 @@ { "Actor": { - "types": ["character"], + "types": [ + "character", + "npc" + ], "templates": { "characterDescription": { "info": { "description": "", "background": "", "class": {}, + "npc-class": "", "race": "", "magicUsing": false, - "showAllItems": false, "gender": "", "weight": "", "height": "", @@ -19,9 +22,12 @@ "occupation": "", "origin": "", "faith": "", + "level": 1, "gold": 0, "silver": 0, - "copper": 0 + "copper": 0, + "showAllItems": false, + "showUnlearned": false } }, "characterBars": { @@ -44,6 +50,8 @@ "gp": 0 }, "attributes": { + "level": 1, + "movement": 24, "attributes": { "st": { "value": 50, "bonus": 0 }, "gs": { "value": 50, "bonus": 0 }, @@ -53,7 +61,8 @@ "zt": { "value": 50, "bonus": 0 }, "au": { "value": 50, "bonus": 0 }, "pa": { "value": 50, "bonus": 0 }, - "wk": { "value": 50, "bonus": 0 } + "wk": { "value": 50, "bonus": 0 }, + "git": { "value": 50, "bonus": 0 } } }, "skills": { @@ -156,6 +165,10 @@ "character": { "templates": ["characterBars", "attributes", "characterDescription", "characterHeader", "skills", "gear"], "calc": {} + }, + "npc": { + "templates": ["characterBars", "attributes", "characterDescription", "skills", "gear"], + "calc": {} } }, "Item": { @@ -376,6 +389,7 @@ "hoarded": false, "skillId": "", "damageBase": "1d6", + "ew": 5, "rolls": { "formulas": { "0": { diff --git a/templates/sheets/character/gear.hbs b/templates/sheets/character/gear.hbs index faf4de1..ec53822 100644 --- a/templates/sheets/character/gear.hbs +++ b/templates/sheets/character/gear.hbs @@ -234,7 +234,7 @@ {{localize "midgard5.capacity"}} - + @@ -289,7 +289,7 @@ {{localize "midgard5.item-weight"}} - + @@ -345,7 +345,7 @@ {{localize "midgard5.item-value"}} {{localize "midgard5.item-weight"}} - + @@ -392,7 +392,7 @@ {{localize "midgard5.item-value"}} {{localize "midgard5.item-weight"}} - + @@ -438,7 +438,7 @@ {{localize "midgard5.item-value"}} {{localize "midgard5.item-weight"}} - + diff --git a/templates/sheets/character/main.hbs b/templates/sheets/character/main.hbs index d5cef81..27af546 100644 --- a/templates/sheets/character/main.hbs +++ b/templates/sheets/character/main.hbs @@ -49,18 +49,6 @@ - - - - - - - - - - - - @@ -73,6 +61,18 @@ + + + + + + + + + + + +
{{localize "midgard5.actor-st"}}{{localize "midgard5.actor-gs"}}{{localize "midgard5.actor-gw"}}{{localize "midgard5.actor-ko"}}{{localize "midgard5.actor-in"}}{{localize "midgard5.actor-zt"}}{{localize "midgard5.actor-au"}}{{localize "midgard5.actor-pa"}}{{localize "midgard5.actor-wk"}}{{localize "midgard5.actor-git"}}
{{data.calc.attributes.st.value}} {{data.calc.attributes.gs.value}}{{data.calc.attributes.wk.value}} {{data.calc.stats.poisonResistance.value}}
{{localize "midgard5.actor-st"}}{{localize "midgard5.actor-gs"}}{{localize "midgard5.actor-gw"}}{{localize "midgard5.actor-ko"}}{{localize "midgard5.actor-in"}}{{localize "midgard5.actor-zt"}}{{localize "midgard5.actor-au"}}{{localize "midgard5.actor-pa"}}{{localize "midgard5.actor-wk"}}{{localize "midgard5.actor-git"}}
diff --git a/templates/sheets/character/spells.hbs b/templates/sheets/character/spells.hbs index 6884d0a..fc21a24 100644 --- a/templates/sheets/character/spells.hbs +++ b/templates/sheets/character/spells.hbs @@ -77,6 +77,7 @@
+ {{#if (eq data.types.actor)}}
{{localize "midgard5.pp"}} {{localize "midgard5.spells"}}
@@ -103,4 +104,5 @@
+ {{/if}}
diff --git a/templates/sheets/npc/attribute.hbs b/templates/sheets/npc/attribute.hbs new file mode 100644 index 0000000..6d6f4e6 --- /dev/null +++ b/templates/sheets/npc/attribute.hbs @@ -0,0 +1,4 @@ +
+
{{localize (m5concat "midgard5.actor-" attributeId "-long")}}
+
+
\ No newline at end of file diff --git a/templates/sheets/npc/combat.hbs b/templates/sheets/npc/combat.hbs new file mode 100644 index 0000000..91164f5 --- /dev/null +++ b/templates/sheets/npc/combat.hbs @@ -0,0 +1,233 @@ + +
+ +
+
+
{{localize "midgard5.calculated-values"}}
+ + + + + + + + + + + + + + +
{{localize "midgard5.movementRange"}}{{data.calc.stats.movement.value}}
{{localize "midgard5.initiative"}} + {{#if (isSkillInList (localizeMidgard "anfuehren") data.calc.skills.general)}} + {{skillEwInList (localizeMidgard "anfuehren") data.calc.skills.general}} + {{else}} + {{skillEw actor._id data.skills.general.anfuehren}} + {{/if}} + {{localize "midgard5.actionrank"}}{{data.calc.attributes.gw.value}}
+
+
+ +
+
+
{{localize "midgard5.actionrank"}}
+ + + +
+
+ +
+
+
{{localize "TYPES.Item.effect"}}
+ + + + + + + + + {{#each data.calc.gear.effects as |item itemId|}} + + + + {{!--{{#unless (eq item.label "Belastung")}}--}} + + {{!--{{/unless}}--}} + + {{/each}} + +
{{localize "TYPES.Item.effect"}} + +
+ {{item.label}} + {{#if item.equipped}} + {{localize "midgard5.active"}} + {{#unless (or (eq item.duration.unit "") (eq item.duration.unit "limitless"))}} + {{item.duration.time}} {{localize (concat "midgard5.time-" item.duration.unit)}} + {{/unless}} + {{/if}} +
+
+
+ + +
+
+
{{localize "midgard5.attack"}}
+ + + + + + + + + + + + {{#each data.calc.gear.weapons as |item itemId|}} + + + + + + + + + {{/each}} + +
{{localize "TYPES.Item.weapon"}}{{localize "midgard5.ew"}}{{localize "midgard5.damage"}} +
{{item.label}}{{#if item.special}}(*){{/if}}{{item.calc.ew}}{{item.damageBase}}
+ + + + + + + + + + + + {{#each data.calc.skills.combat as |skill skillId|}} + + + + + + + + {{/each}} + +
{{localize "midgard5.weapon-skill"}}{{localize "midgard5.ew"}}
{{skill.label}}{{skill.calc.ew}}
+
+
+ +
+
+
{{localize "midgard5.defense"}}
+ + + + + + + + + + + + + + + + + + +
{{localize "midgard5.defense"}}{{add data.calc.stats.defense.value data.calc.stats.defenseBonus.value}}
{{localize "midgard5.resistanceMind"}}{{data.calc.stats.resistanceMind.value}}
{{localize "midgard5.resistanceBody"}}{{data.calc.stats.resistanceBody.value}}
+ + + + + + + + + + + + {{#each data.calc.gear.defensiveWeapons as |item itemId|}} + + + + + + + + {{/each}} + +
{{localize "TYPES.Item.defensiveWeapon"}}{{localize "midgard5.ew"}}
{{item.label}}{{item.calc.ew}}
+ + + + + + + + + + + + {{#each data.calc.gear.armor as |item itemId|}} + + + + + + + {{/each}} + +
{{localize "TYPES.Item.armor"}}{{localize "midgard5.actor-lp-short"}}
{{item.label}}{{lpProtection}}
+
+
+ + {{#if actor.system.info.magicUsing }} +
+
+
{{localize "TYPES.Item.spell"}}
+ + + + + + + +
{{localize "midgard5.spellCasting"}}{{data.calc.stats.spellCasting.value}}
+ + + + + + + + + + + + {{#each data.calc.spells as |item itemId|}} + + + + + + + + {{/each}} + +
{{localize "TYPES.Item.spell"}}{{localize "midgard5.ew"}}
{{item.label}}{{#if item.special}}(*){{/if}}{{item.calc.ew}}
+
+
+ {{/if}} +
diff --git a/templates/sheets/npc/description.hbs b/templates/sheets/npc/description.hbs new file mode 100644 index 0000000..d1b9e9f --- /dev/null +++ b/templates/sheets/npc/description.hbs @@ -0,0 +1,18 @@ +
+
+
+
{{localize "midgard5.description"}}
+
+
{{editor data.info.description target="data.info.description" button=true owner=owner editable=editable}}
+
+
+ +
+
+
{{localize "midgard5.background"}}
+
+
{{editor data.info.background target="data.info.background" button=true owner=owner editable=editable}}
+
+
+ +
\ No newline at end of file diff --git a/templates/sheets/npc/main.hbs b/templates/sheets/npc/main.hbs new file mode 100644 index 0000000..610f929 --- /dev/null +++ b/templates/sheets/npc/main.hbs @@ -0,0 +1,127 @@ +
+
+ + +
+ Midgard +
+ + +
+ + + + + + + + + + +
{{localize "midgard5.actor-name"}}
{{localize "midgard5.class"}}{{localize "midgard5.level"}}{{data.calc.level}}
+ + + + + + + + + + + +
{{localize "midgard5.race"}}{{localize "midgard5.occupation"}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
{{data.attributes.st.value}}{{data.attributes.gs.value}}{{data.attributes.gw.value}}{{data.attributes.ko.value}}{{data.attributes.in.value}}{{data.attributes.zt.value}}{{data.attributes.au.value}}{{data.attributes.pa.value}}{{data.attributes.wk.value}}{{data.attributes.git.value}}
{{localize "midgard5.actor-st"}}{{localize "midgard5.actor-gs"}}{{localize "midgard5.actor-gw"}}{{localize "midgard5.actor-ko"}}{{localize "midgard5.actor-in"}}{{localize "midgard5.actor-zt"}}{{localize "midgard5.actor-au"}}{{localize "midgard5.actor-pa"}}{{localize "midgard5.actor-wk"}}{{localize "midgard5.actor-git"}}
+
+ + +
+ +
+ + +
+ + + + + + + + + +
{{localize "midgard5.actor-lp-short"}} +
+ + {{#times data.lp.max}} + {{#if (lt this ../data.lp.value)}} +
+ {{else}} +
+ {{/if}} + {{/times}} +
{{data.lp.max}}
+
+
{{localize "midgard5.actor-ap-short"}} +
+ + {{#times data.ap.max}} + {{#if (lt this ../data.ap.value)}} +
+ {{else}} +
+ {{/if}} + {{/times}} +
{{data.ap.max}}
+
+
+
+
+ + {{!-- Character Sheet Navigation --}} + + +
+ +
+ {{> "systems/midgard5/templates/sheets/npc/combat.hbs"}} +
+
+ {{> "systems/midgard5/templates/sheets/npc/properties.hbs"}} +
+
+ {{> "systems/midgard5/templates/sheets/npc/description.hbs"}} +
+ +
+
\ No newline at end of file diff --git a/templates/sheets/npc/properties.hbs b/templates/sheets/npc/properties.hbs new file mode 100644 index 0000000..08439b4 --- /dev/null +++ b/templates/sheets/npc/properties.hbs @@ -0,0 +1,117 @@ +
+
+
{{localize "midgard5.attributes"}}
+
+
+ {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="st" attribute=data.attributes.st}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="gs" attribute=data.attributes.gs}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="gw" attribute=data.attributes.gw}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="ko" attribute=data.attributes.ko}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="in" attribute=data.attributes.in}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="zt" attribute=data.attributes.zt}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="au" attribute=data.attributes.au}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="pa" attribute=data.attributes.pa}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="wk" attribute=data.attributes.wk}} + {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="git" attribute=data.attributes.git}} +
+
{{localize "midgard5.movementRange"}}
+
+
+
+
{{localize "midgard5.exp-overall"}}
+
+
+
+
{{localize "midgard5.actor-lp-short"}} {{localize "midgard5.maximum"}}
+
+
+
+
{{localize "midgard5.actor-ap-short"}} {{localize "midgard5.maximum"}}
+
+
+
+
{{localize "midgard5.magicUsing"}}
+
+
+
+
+
+
+ +
+
{{localize "midgard5.skills"}}
+ + + + + + + + + + + + + {{#each data.calc.skills.general as |skill skillId|}} + + + + + + + {{/each}} + {{#unless (not data.info.showUnlearned)}} + {{#each data.skills.general as |skill key|}} + {{#unless (isSkillInList (localizeMidgard key) ../actor.system.calc.skills.general) }} + + + + + + + {{/unless}} + {{/each}} + {{/unless}} + +
{{localize "midgard5.skills"}}{{localize "midgard5.ew"}}
{{skill.label}}
{{localizeMidgard key}}
+
+
+
+
+
{{localize "midgard5.gear"}}
+ + + + + + + + + + + + {{#each data.calc.gear.items as |item itemId|}} + + + + + + + + {{/each}} + +
{{localize "TYPES.Item.item"}}{{localize "midgard5.item-quantity"}}{{localize "midgard5.item-value"}} +
+ {{item.label}} + + + {{item.quantity}} + + + {{#unless (or (eq item.value 0) (eq item.currency ""))}} + {{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}} + {{/unless}} +
+
+
+
\ No newline at end of file From 918b32fda0430072763c9c2a8095f34c696658eb Mon Sep 17 00:00:00 2001 From: Byroks Date: Wed, 22 May 2024 08:15:47 +0200 Subject: [PATCH 06/10] =?UTF-8?q?Attribute=20Mods=20ver=C3=A4ndern=20Boni?= =?UTF-8?q?=20nicht=20(#111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: + Mods für die Attribute (wie zb. bei dem Zauber Stärke) haben davon abgeleitete Werte (Wie Schadensbonus) nicht verändert Changes: + Mods werden vor den abgeleiteten Werten ausgewertet Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/111 Reviewed-by: Le-Frique --- source/module/actors/M5Character.ts | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index 5f42cdc..e745fcb 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -172,6 +172,26 @@ export class M5Character extends Actor { ret.attributes.pa.bonus = M5Character.attributeBonus(data.attributes.pa); ret.attributes.wk.bonus = M5Character.attributeBonus(data.attributes.wk); + if (!skip?.mods) { + const aggregate = new M5ModAggregate(data, ret); + + context.items + ?.filter( + (item) => + (item.type === "item" || item.type === "skill" || item.type === "effect" || item.type === "armor" || item.type === "container" || item.type === "class") && item.system.equipped + ) + .forEach((item) => { + const mods = item.system.mods; + //console.log("Actor item mods", mods) + Object.keys(mods).forEach((modIndex) => { + const mod = mods[modIndex] as M5ItemMod; + aggregate.push(mod, item.name); + }); + }); + + ret.skillMods = aggregate.calculate(); + } + ret.stats.lp = this.modResult(data.lp); ret.stats.ap = this.modResult(data.ap); ret.stats.lpProtection = this.modResult(0); @@ -201,26 +221,6 @@ export class M5Character extends Actor { ret.stats.thrustLoad = M5Character.thrustLoadValue(data.attributes.st); ret.stats.encumbrance = 0; - if (!skip?.mods) { - const aggregate = new M5ModAggregate(data, ret); - - context.items - ?.filter( - (item) => - (item.type === "item" || item.type === "skill" || item.type === "effect" || item.type === "armor" || item.type === "container" || item.type === "class") && item.system.equipped - ) - .forEach((item) => { - const mods = item.system.mods; - //console.log("Actor item mods", mods) - Object.keys(mods).forEach((modIndex) => { - const mod = mods[modIndex] as M5ItemMod; - aggregate.push(mod, item.name); - }); - }); - - ret.skillMods = aggregate.calculate(); - } - if (!skip?.containers) { context.items ?.filter((item) => item.type === "container") From 1852f2bf08016e642fce894f1c69c5218ea6c06f Mon Sep 17 00:00:00 2001 From: Byroks Date: Sun, 26 May 2024 09:56:02 +0200 Subject: [PATCH 07/10] Sneak Fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: + EP Input vergrößert + Verstecke Ungelernte Fähigkeiten auf Spieler Bogen wie bei NPC Bogen + Fix Mods (again) + nutze richtige movement wert bei NPC Bogen --- source/module/actors/M5Character.ts | 22 ++++++++++++---------- templates/sheets/character/base_values.hbs | 2 +- templates/sheets/character/skills.hbs | 4 ++++ templates/sheets/npc/properties.hbs | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index e745fcb..9f1f863 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -152,6 +152,7 @@ export class M5Character extends Actor { ret.level = M5Character.levelFromExp(data.info.race === "Zwerg" ? Math.min(data.calc.stats?.hoard * 2 || 0, data.es) : data.es); + //Set all values that are not dependent on another Value ret.attributes.st.value = M5Character.attributeMinMax(data.attributes.st); // TODO item effects ret.attributes.gs.value = M5Character.attributeMinMax(data.attributes.gs); ret.attributes.gw.value = M5Character.attributeMinMax(data.attributes.gw); @@ -172,6 +173,17 @@ export class M5Character extends Actor { ret.attributes.pa.bonus = M5Character.attributeBonus(data.attributes.pa); ret.attributes.wk.bonus = M5Character.attributeBonus(data.attributes.wk); + ret.stats.lp = this.modResult(data.lp); + ret.stats.ap = this.modResult(data.ap); + ret.stats.lpProtection = this.modResult(0); + ret.stats.apProtection = this.modResult(0); + ret.stats.movement = this.modResult(data.movement); + ret.stats.hoardMin = M5Character.levelThreshold.at(ret.level - 1) / 2; + ret.stats.hoardNext = M5Character.levelThreshold.at(ret.level) / 2; + ret.stats.wealth = parseFloat((data.info.gold + data.info.silver / 10 + data.info.copper / 100).toPrecision(3)); + ret.stats.hoard = 0; + ret.stats.encumbrance = 0; + if (!skip?.mods) { const aggregate = new M5ModAggregate(data, ret); @@ -192,15 +204,10 @@ export class M5Character extends Actor { ret.skillMods = aggregate.calculate(); } - ret.stats.lp = this.modResult(data.lp); - ret.stats.ap = this.modResult(data.ap); - ret.stats.lpProtection = this.modResult(0); - ret.stats.apProtection = this.modResult(0); ret.stats.defense = this.modResult(M5Character.defenseFromLevel(ret.level)); 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.defenseBonus = this.modResult(ret.attributes.gw.bonus); - ret.stats.movement = this.modResult(data.movement); ret.stats.resistanceMind = this.modResult(ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.in.bonus : this.raceBonus(data.info.race))); ret.stats.resistanceBody = this.modResult(ret.stats.defense.value + (data.info.race === "Mensch" ? ret.attributes.ko.bonus : this.raceBonus(data.info.race))); ret.stats.spellCasting = this.modResult((data.info.magicUsing ? M5Character.spellCastingFromLevel(ret.level) : 3) + ret.attributes.zt.bonus); @@ -211,15 +218,10 @@ export class M5Character extends Actor { ret.stats.deprivationCold = this.modResult(Math.floor(ret.attributes.ko.value / 2)); ret.stats.deprivationHeat = this.modResult(Math.floor(ret.attributes.ko.value / 2)); ret.stats.deprivationFood = this.modResult(Math.floor(40 + ret.attributes.ko.value / 2)); - ret.stats.hoardMin = M5Character.levelThreshold.at(ret.level - 1) / 2; - ret.stats.hoardNext = M5Character.levelThreshold.at(ret.level) / 2; - ret.stats.wealth = parseFloat((data.info.gold + data.info.silver / 10 + data.info.copper / 100).toPrecision(3)); - ret.stats.hoard = 0; ret.stats.load = M5Character.loadValue(data.attributes.st); ret.stats.heavyLoad = M5Character.heavyLoadValue(data.attributes.st); ret.stats.loadMax = M5Character.maxLoadValue(data.attributes.st); ret.stats.thrustLoad = M5Character.thrustLoadValue(data.attributes.st); - ret.stats.encumbrance = 0; if (!skip?.containers) { context.items diff --git a/templates/sheets/character/base_values.hbs b/templates/sheets/character/base_values.hbs index 20b25b7..e4ecbc7 100644 --- a/templates/sheets/character/base_values.hbs +++ b/templates/sheets/character/base_values.hbs @@ -35,7 +35,7 @@ {{localize "midgard5.grace"}} {{localize "midgard5.exp-overall"}} - + {{localize "midgard5.destiny"}} diff --git a/templates/sheets/character/skills.hbs b/templates/sheets/character/skills.hbs index cbebdde..2fa832d 100644 --- a/templates/sheets/character/skills.hbs +++ b/templates/sheets/character/skills.hbs @@ -142,6 +142,8 @@
{{localize "midgard5.unlearned-skills"}}
+ + @@ -154,6 +156,7 @@ + {{#unless (not data.info.showUnlearned)}} {{#each data.skills.general as |skill key|}} {{#unless (isSkillInList (localizeMidgard key) ../actor.system.calc.skills.general) }} @@ -166,6 +169,7 @@ {{/unless}} {{/each}} + {{/unless}}
diff --git a/templates/sheets/npc/properties.hbs b/templates/sheets/npc/properties.hbs index 08439b4..a7f11e3 100644 --- a/templates/sheets/npc/properties.hbs +++ b/templates/sheets/npc/properties.hbs @@ -15,7 +15,7 @@ {{> "systems/midgard5/templates/sheets/npc/attribute.hbs" attributeId="git" attribute=data.attributes.git}}
{{localize "midgard5.movementRange"}}
-
+
{{localize "midgard5.exp-overall"}}
From 38f1c90c09596d4deafce02ce2f27c37cd29ca67 Mon Sep 17 00:00:00 2001 From: Byroks Date: Mon, 27 May 2024 10:03:54 +0200 Subject: [PATCH 08/10] Fix Bonus bei Wurf anzeige (#114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: + Situations Boni wird nicht mehr auf den Würfel gerechnet sondern seperat angezeigt wie andere Boni Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/114 Reviewed-by: Le-Frique --- lang/de.json | 2 +- source/module/rolls/M5Roll.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lang/de.json b/lang/de.json index 21443eb..4a7f4af 100644 --- a/lang/de.json +++ b/lang/de.json @@ -1,6 +1,6 @@ { "TYPES.Actor.character": "Charakter", - "ACTOR.TypeNpc": "Kreatur / Nichtspielerfigur", + "TYPES.Actor.npc": "Kreatur / Nichtspielerfigur", "ACTOR.TypeVehicle": "Transportmittel / Pferd etc.", "TYPES.Item.item": "Gegenstand", diff --git a/source/module/rolls/M5Roll.ts b/source/module/rolls/M5Roll.ts index d47b4f4..c66c1fc 100644 --- a/source/module/rolls/M5Roll.ts +++ b/source/module/rolls/M5Roll.ts @@ -11,7 +11,12 @@ export class M5Roll { public _total: number = 0; public pool: PoolTerm = null; - constructor(public data: M5RollData, public actor: any, public label: string, public id?: string) { + constructor( + public data: M5RollData, + public actor: any, + public label: string, + public id?: string + ) { //super(null) //this.data = rollData } @@ -26,7 +31,7 @@ export class M5Roll { .map((rollName, index) => { indexMap.set(index, rollName); const formula = this.data.rolls[rollName]; - formula.formula = index === 0 && this.id !== "-1" ? formula.formula.replace(/(\d*d\d*)/, `{$1 + ${this.data.b.modifier}}`) : formula.formula; + formula.formula = index === 0 && this.id !== "-1" ? formula.formula + `+ ${this.data.b.modifier}` : formula.formula; const roll = new Roll(formula.formula, this.data); return roll; }); From 32bf1ba74735075d31819f9f11d590f91216e77d Mon Sep 17 00:00:00 2001 From: Byroks Date: Mon, 27 May 2024 10:04:26 +0200 Subject: [PATCH 09/10] Fix PP anzeige von Zaubern (#115) Changes: + PP werden wieder angezeigt + Es werden nur PP Angezeigt von Zauberschulen wo die lernkosten ungleich 0 sind Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/115 --- source/module/rolls/M5Roll.ts | 5 +++++ templates/sheets/character/spells.hbs | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/source/module/rolls/M5Roll.ts b/source/module/rolls/M5Roll.ts index c66c1fc..5e296a9 100644 --- a/source/module/rolls/M5Roll.ts +++ b/source/module/rolls/M5Roll.ts @@ -95,6 +95,7 @@ export class M5Roll { this.data.res.label = this.label; if ((game as Game).settings.get("midgard5", "automatedPP") && this.data.iType !== null) { if ((this.data.i.type === "language" || this.data.i.type === "general") && this.data.rolls[0].dice[0] >= 16) { + ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`); this.actor.items.get(this.id).update({ system: { pp: this.data.i.pp + 1, @@ -102,6 +103,7 @@ export class M5Roll { }); } else if (this.data.rolls[0].dice[0] === 20) { if (this.data.i.type === "combat") { + ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`); // Rolling through skill this.actor.items.get(this.id).update({ system: { @@ -109,6 +111,7 @@ export class M5Roll { }, }); } else if (this.data.iType === "weapon") { + ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`); // Rolling through Weapon Item const skill = this.actor.items.get(this.data.i.skillId); skill.update({ @@ -117,6 +120,7 @@ export class M5Roll { }, }); } else if (this.data.iType === "defensiveWeapon") { + ui.notifications.notify(`Praxispunkt eingetragen für ${this.actor.items.get(this.id).name}`); // Rolling through defensiveWeapon Item const skill = this.actor.items.get(this.data.i.skillId); skill.update({ @@ -125,6 +129,7 @@ export class M5Roll { }, }); } else if (this.data.iType === "spell") { + ui.notifications.notify(`Praxispunkt eingetragen für ${this.data.i.process}`); // Rolling through Spell Item const klasse = this.actor.items.find((x) => x.type === "class" && x.system.equipped); klasse.update({ diff --git a/templates/sheets/character/spells.hbs b/templates/sheets/character/spells.hbs index fc21a24..063ee45 100644 --- a/templates/sheets/character/spells.hbs +++ b/templates/sheets/character/spells.hbs @@ -77,7 +77,6 @@
- {{#if (eq data.types.actor)}}
{{localize "midgard5.pp"}} {{localize "midgard5.spells"}}
@@ -88,6 +87,7 @@
{{#each data.lernKostenZauber as |group name|}} + {{#unless (eq group.kosten 0)}} @@ -96,6 +96,7 @@ + {{/unless}} {{/each}}
@@ -104,5 +105,4 @@
- {{/if}} From c5ce058f44df5a315448872d1401412ce7e70462 Mon Sep 17 00:00:00 2001 From: Byroks Date: Mon, 27 May 2024 10:12:23 +0200 Subject: [PATCH 10/10] V2.7.0 --- package.json | 4 ++-- source/system.json | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b3dc8bc..3b9273f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foundry-system-midgard5", - "version": "2.6.0", + "version": "2.7.0", "description": "", "main": "index.js", "scripts": { @@ -58,4 +58,4 @@ "dependencies": { "handlebars-helpers": "^0.10.0" } -} \ No newline at end of file +} diff --git a/source/system.json b/source/system.json index d0d4bd7..38e8a11 100644 --- a/source/system.json +++ b/source/system.json @@ -3,17 +3,13 @@ "name": "midgard5", "title": "Midgard 5. Edition", "description": "The German RPG Midgard 5. Edition", - "version": "2.6.0", + "version": "2.7.0", "compatibility": { "minimum": "10", "verified": "11", "maximum": "11" }, - "authors": [ - {"name": "Byroks"}, - {"name": "Le-Frique"}, - {"name": "Oskaloq"} - ], + "authors": [{ "name": "Byroks" }, { "name": "Le-Frique" }, { "name": "Oskaloq" }], "scripts": ["bundle.js"], "styles": ["bundle.css"], "languages": [ @@ -32,4 +28,4 @@ "download": "https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/releases/download/latest/midgard5.zip?token=2455375115b92bc8d87c93df7159eec232456f2d", "initiative": "@c.calc.attributes.gw.value", "license": "LICENSE.txt" -} \ No newline at end of file +}