From f91c64f91f6c03f416d05dbdd1330399f3ea281f Mon Sep 17 00:00:00 2001 From: Michael Stein Date: Tue, 18 Apr 2023 23:54:58 +0200 Subject: [PATCH] Upgrade templates: PP, AP as string. --- source/module/items/M5Item.ts | 13 ++++ source/system.json | 1 - source/template.json | 105 ++++++++++++++++---------------- templates/sheets/item/spell.hbs | 2 +- 4 files changed, 67 insertions(+), 54 deletions(-) diff --git a/source/module/items/M5Item.ts b/source/module/items/M5Item.ts index 509b054..d6a6d42 100644 --- a/source/module/items/M5Item.ts +++ b/source/module/items/M5Item.ts @@ -236,4 +236,17 @@ export class M5Item extends Item { return (this as any).getEmbeddedDocument("Item", itemId) } + override migrateSystemData(): any { + const item = (this as any) + const data = item.system + + if (item.type === "spell") { + if (typeof data.ap !== "string") { + data.ap = Number.isFinite(data.ap) ? "" + data.ap : "" + } + } + + return super.migrateSystemData() + } + } diff --git a/source/system.json b/source/system.json index fe6c1d6..30f764e 100644 --- a/source/system.json +++ b/source/system.json @@ -7,7 +7,6 @@ "minimum": "10", "verified": "10" }, - "templateVersion": 3, "authors": [ { "name": "Michael Stein" } ], diff --git a/source/template.json b/source/template.json index 1351519..7ab35d3 100644 --- a/source/template.json +++ b/source/template.json @@ -54,57 +54,57 @@ "skills": { "skills": { "general": { - "akrobatik": { "fw": 6, "attribute": "gw", "initial": 8 }, - "alchimie": { "fw": 0, "attribute": "in", "initial": 8 }, - "anfuehren": { "fw": 6, "attribute": "pa", "initial": 8 }, - "athletik": { "fw": 0, "attribute": "st", "initial": 8 }, - "balancieren": { "fw": 6, "attribute": "gw", "initial": 8 }, - "beidhaendigerKampf": { "fw": 0, "attribute": "gs", "initial": 8 }, - "beredsamkeit": { "fw": 3, "attribute": "pa", "initial": 8 }, - "betaeuben": { "fw": 6, "attribute": "gs", "initial": 8 }, - "bootfahren": { "fw": 3, "attribute": "gs", "initial": 8 }, - "ersteHilfe": { "fw": 0, "attribute": "gs", "initial": 8 }, - "etikette": { "fw": 0, "attribute": "in", "initial": 8 }, - "fallenEntdecken": { "fw": 0, "attribute": "in", "initial": 8 }, - "fallenmechanik": { "fw": 0, "attribute": "gs", "initial": 8 }, - "faelschen": { "fw": 0, "attribute": "gs", "initial": 8 }, - "fechten": { "fw": 0, "attribute": "gs", "initial": 8 }, - "gassenwissen": { "fw": 0, "attribute": "in", "initial": 8 }, - "gaukeln": { "fw": 0, "attribute": "gs", "initial": 8 }, - "gelaendelauf": { "fw": 6, "attribute": "gw", "initial": 8 }, - "geraetekunde": { "fw": 0, "attribute": "in", "initial": 8 }, - "geschaeftssinn": { "fw": 0, "attribute": "in", "initial": 8 }, - "gluecksspiel": { "fw": 0, "attribute": "gs", "initial": 8 }, - "heilkunde": { "fw": 0, "attribute": "in", "initial": 8 }, - "kampfInVollruestung": { "fw": 0, "attribute": "st", "initial": 8 }, - "klettern": { "fw": 6, "attribute": "st", "initial": 8 }, - "landeskunde": { "fw": 6, "attribute": "in", "initial": 8 }, - "laufen": { "fw": 0, "attribute": "ko", "initial": 8 }, - "lesenVonZauberschrift": { "fw": 0, "attribute": "in", "initial": 8 }, - "meditieren": { "fw": 0, "attribute": "wk", "initial": 8 }, - "menschenkenntnis": { "fw": 3, "attribute": "in", "initial": 8 }, - "meucheln": { "fw": 0, "attribute": "gs", "initial": 8 }, - "musizieren": { "fw": 0, "attribute": "gs", "initial": 8 }, - "naturkunde": { "fw": 0, "attribute": "in", "initial": 8 }, - "pflanzenkunde": { "fw": 0, "attribute": "in", "initial": 8 }, - "reiten": { "fw": 6, "attribute": "gw", "initial": 8 }, - "reiterkampf": { "fw": 0, "attribute": "gw", "initial": 8 }, - "scharfschiessen": { "fw": 0, "attribute": "gs", "initial": 8 }, - "schleichen": { "fw": 3, "attribute": "gw", "initial": 8 }, - "schloesserOeffnen": { "fw": 0, "attribute": "gs", "initial": 8 }, - "schwimmen": { "fw": 3, "attribute": "gw", "initial": 8 }, - "seilkunst": { "fw": 3, "attribute": "gs", "initial": 8 }, - "spurensuche": { "fw": 0, "attribute": "in", "initial": 8 }, - "stehlen": { "fw": 3, "attribute": "gs", "initial": 8 }, - "tarnen": { "fw": 3, "attribute": "gw", "initial": 8 }, - "tauchen": { "fw": 6, "attribute": "ko", "initial": 8 }, - "tierkunde": { "fw": 0, "attribute": "in", "initial": 8 }, - "ueberleben": { "fw": 6, "attribute": "in", "initial": 8 }, - "verfuehren": { "fw": 3, "attribute": "pa", "initial": 8 }, - "verhoeren": { "fw": 3, "attribute": "pa", "initial": 8 }, - "verstellen": { "fw": 3, "attribute": "pa", "initial": 8 }, - "wagenlenken": { "fw": 3, "attribute": "gs", "initial": 8 }, - "zauberkunde": { "fw": 0, "attribute": "in", "initial": 8 } + "akrobatik": { "fw": 6, "attribute": "gw", "initial": 8, "pp": 0 }, + "alchimie": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "anfuehren": { "fw": 6, "attribute": "pa", "initial": 8, "pp": 0 }, + "athletik": { "fw": 0, "attribute": "st", "initial": 8, "pp": 0 }, + "balancieren": { "fw": 6, "attribute": "gw", "initial": 8, "pp": 0 }, + "beidhaendigerKampf": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "beredsamkeit": { "fw": 3, "attribute": "pa", "initial": 8, "pp": 0 }, + "betaeuben": { "fw": 6, "attribute": "gs", "initial": 8, "pp": 0 }, + "bootfahren": { "fw": 3, "attribute": "gs", "initial": 8, "pp": 0 }, + "ersteHilfe": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "etikette": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "fallenEntdecken": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "fallenmechanik": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "faelschen": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "fechten": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "gassenwissen": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "gaukeln": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "gelaendelauf": { "fw": 6, "attribute": "gw", "initial": 8, "pp": 0 }, + "geraetekunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "geschaeftssinn": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "gluecksspiel": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "heilkunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "kampfInVollruestung": { "fw": 0, "attribute": "st", "initial": 8, "pp": 0 }, + "klettern": { "fw": 6, "attribute": "st", "initial": 8, "pp": 0 }, + "landeskunde": { "fw": 6, "attribute": "in", "initial": 8, "pp": 0 }, + "laufen": { "fw": 0, "attribute": "ko", "initial": 8, "pp": 0 }, + "lesenVonZauberschrift": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "meditieren": { "fw": 0, "attribute": "wk", "initial": 8, "pp": 0 }, + "menschenkenntnis": { "fw": 3, "attribute": "in", "initial": 8, "pp": 0 }, + "meucheln": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "musizieren": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "naturkunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "pflanzenkunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "reiten": { "fw": 6, "attribute": "gw", "initial": 8, "pp": 0 }, + "reiterkampf": { "fw": 0, "attribute": "gw", "initial": 8, "pp": 0 }, + "scharfschiessen": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "schleichen": { "fw": 3, "attribute": "gw", "initial": 8, "pp": 0 }, + "schloesserOeffnen": { "fw": 0, "attribute": "gs", "initial": 8, "pp": 0 }, + "schwimmen": { "fw": 3, "attribute": "gw", "initial": 8, "pp": 0 }, + "seilkunst": { "fw": 3, "attribute": "gs", "initial": 8, "pp": 0 }, + "spurensuche": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "stehlen": { "fw": 3, "attribute": "gs", "initial": 8, "pp": 0 }, + "tarnen": { "fw": 3, "attribute": "gw", "initial": 8, "pp": 0 }, + "tauchen": { "fw": 6, "attribute": "ko", "initial": 8, "pp": 0 }, + "tierkunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 }, + "ueberleben": { "fw": 6, "attribute": "in", "initial": 8, "pp": 0 }, + "verfuehren": { "fw": 3, "attribute": "pa", "initial": 8, "pp": 0 }, + "verhoeren": { "fw": 3, "attribute": "pa", "initial": 8, "pp": 0 }, + "verstellen": { "fw": 3, "attribute": "pa", "initial": 8, "pp": 0 }, + "wagenlenken": { "fw": 3, "attribute": "gs", "initial": 8, "pp": 0 }, + "zauberkunde": { "fw": 0, "attribute": "in", "initial": 8, "pp": 0 } } } } @@ -220,6 +220,7 @@ }, "output": "" }, + "pp": 0, "calc": {} }, "item": { @@ -285,7 +286,7 @@ "bonus": 0, "type": "", "process": "", - "ap": 0, + "ap": "", "castDuration": "", "range": "", "effectTarget": "", diff --git a/templates/sheets/item/spell.hbs b/templates/sheets/item/spell.hbs index 89865a9..f0013c3 100644 --- a/templates/sheets/item/spell.hbs +++ b/templates/sheets/item/spell.hbs @@ -10,7 +10,7 @@ {{localize "midgard5.bonus"}} {{localize "midgard5.actor-ap"}} - + {{localize "midgard5.spell-castDuration"}}