diff --git a/lang/de.json b/lang/de.json index efc50fd..ea40665 100644 --- a/lang/de.json +++ b/lang/de.json @@ -107,6 +107,12 @@ "midgard5.no-container": "Ohne", + "midgard5.encumbrance": "Getragene Last", + "midgard5.load": "Normallast", + "midgard5.heavy-load": "Schwere Last", + "midgard5.thrust-load": "Schublast", + "midgard5.load-max": "Höchstlast", + "midgard5.exp-overall": "Erfahrungsschatz", "midgard5.exp-available": "Erfahrungspunkte", "midgard5.grace": "Göttliche Gnade", diff --git a/source/module/M5Base.ts b/source/module/M5Base.ts index 1ab5161..b3deb2f 100644 --- a/source/module/M5Base.ts +++ b/source/module/M5Base.ts @@ -90,6 +90,11 @@ export enum M5Stats { HOARD_NEXT = "hoardNext", HOARD_MIN = "hoardMin", WEALTH = "wealth", + LOAD = "load", + HEAVY_LOAD = "heavyLoad", + LOAD_MAX = "loadMax", + THRUST_LOAD = "thrustLoad", + ENCUMBRANCE = "encumbrance", } export enum M5ModType { @@ -181,6 +186,11 @@ export interface M5CharacterCalculatedData { hoardNext: number; hoardMin: number; wealth: number; + load: number; + heavyLoad: number; + loadMax: number; + thrustLoad: number; + encumbrance: number; }; skillMods: {}; skills: { diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index be1be10..6259882 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -1,6 +1,8 @@ +import { data } from "jquery"; import { M5Item } from "../items/M5Item"; -import { M5Attribute, M5CharacterCalculatedData, M5ItemMod, M5ModOperation, M5ModResult, M5RollData, M5Skill, M5SkillCalculated, M5SkillLearned } from "../M5Base"; +import { M5Attribute, M5Attributes, M5CharacterCalculatedData, M5ItemMod, M5ModOperation, M5ModResult, M5RollData, M5Skill, M5SkillCalculated, M5SkillLearned, M5Stats } from "../M5Base"; import M5ModAggregate from "./M5ModAggregate"; +import { info } from "console"; export class M5Character extends Actor { // constructor( // data: ConstructorParameters[0], @@ -23,6 +25,54 @@ export class M5Character extends Actor { return -2; } + static loadValue(attribute: M5Attribute) { + const value = this.attributeMinMax(attribute); + if (value > 99) return 35; + if (value > 95) return 30; + if (value > 80) return 25; + if (value > 60) return 20; + if (value > 30) return 15; + if (value > 10) return 10; + if (value > 0) return 5; + return 0; + } + + static heavyLoadValue(attribute: M5Attribute) { + const value = this.attributeMinMax(attribute); + if (value > 99) return 50; + if (value > 95) return 45; + if (value > 80) return 40; + if (value > 60) return 35; + if (value > 30) return 30; + if (value > 10) return 25; + if (value > 0) return 20; + return 0; + } + + static maxLoadValue(attribute: M5Attribute) { + const value = this.attributeMinMax(attribute); + if (value > 99) return 90; + if (value > 95) return 80; + if (value > 80) return 75; + if (value > 60) return 70; + if (value > 30) return 60; + if (value > 10) return 50; + if (value > 0) return 40; + return 0; + } + + static thrustLoadValue(attribute: M5Attribute) { + const value = this.attributeMinMax(attribute); + if (value > 99) return 200; + if (value > 95) return 170; + if (value > 80) return 150; + if (value > 60) return 140; + if (value > 30) return 120; + if (value > 10) return 70; + if (value > 0) return 50; + return 0; + } + derivedData( skip: { mods?: boolean; @@ -72,6 +122,11 @@ export class M5Character extends Actor { drinking: { value: 0, mods: [] }, drinkingFW: 0, hoard: 0, + encumbrance: 0, + load: 0, + heavyLoad: 0, + thrustLoad: 0, + loadMax: 0, }, skillMods: {}, skills: { @@ -149,6 +204,11 @@ export class M5Character extends Actor { ret.stats.hoardNext = M5Character.levelThreshold.at (ret.level)/2; ret.stats.wealth = data.info.gold + data.info.silver/10 + data.info.copper/100; 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?.mods) { diff --git a/templates/sheets/character/gear.hbs b/templates/sheets/character/gear.hbs index e50a55e..a7d2ae7 100644 --- a/templates/sheets/character/gear.hbs +++ b/templates/sheets/character/gear.hbs @@ -165,6 +165,31 @@ - {{/each}} + {{/each}} + +
+
Lasten in Kilogramm
+ + + + + + + + + + + + + + + + + + + + +
{{localize "midgard5.load"}}{{localize "midgard5.heavy-load"}}{{localize "midgard5.load-max"}}{{localize "midgard5.thrust-load"}}{{localize "midgard5.encumbrance"}}
+
\ No newline at end of file