Upgrade templates: PP, AP as string.

This commit is contained in:
Michael Stein 2023-04-18 23:54:58 +02:00
parent 5de5e043ae
commit f91c64f91f
4 changed files with 67 additions and 54 deletions

View File

@ -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()
}
}

View File

@ -7,7 +7,6 @@
"minimum": "10",
"verified": "10"
},
"templateVersion": 3,
"authors": [
{ "name": "Michael Stein" }
],

View File

@ -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": "",

View File

@ -10,7 +10,7 @@
<td>{{localize "midgard5.bonus"}}</td>
<td><input name="data.bonus" type="text" value="{{data.bonus}}" data-dtype="Number" /></td>
<td>{{localize "midgard5.actor-ap"}}</td>
<td><input name="data.ap" type="text" value="{{data.ap}}" data-dtype="Number" /></td>
<td><input name="data.ap" type="text" value="{{data.ap}}" data-dtype="String" /></td>
</tr>
<tr>
<td>{{localize "midgard5.spell-castDuration"}}</td>