#6 Lasten und Gewichte #52

Merged
Byroks merged 16 commits from lasten into develop 2024-02-24 11:23:39 +01:00
4 changed files with 103 additions and 2 deletions
Showing only changes of commit 71b04063e7 - Show all commits

View File

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

View File

@ -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: {

View File

@ -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<typeof foundry.documents.BaseActor>[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) {

View File

@ -165,6 +165,31 @@
</tbody>
</table>
</div>
{{/each}}
{{/each}}
<div class="flexpart">
<div class="flexpart-header"><img src="icons/tools/hand/scale-balances-merchant-brown.webp" class="flexpart-icon">Lasten in Kilogramm</div>
<table>
<thead class="theader">
<tr>
<th class="title" style="text-align: center">{{localize "midgard5.load"}}</th>
<th class="title" style="text-align: center">{{localize "midgard5.heavy-load"}}</th>
<th class="title" style="text-align: center">{{localize "midgard5.load-max"}}</th>
<th class="title" style="text-align: center">{{localize "midgard5.thrust-load"}}</th>
<th class="title" style="text-align: center">{{localize "midgard5.encumbrance"}}</th>
</tr>
</thead>
<tfoot>
<tr height = 10px></tr>
<tr>
<td class="fixed-value"><input type="number" name="data.info.load" value="{{data.calc.stats.load}}"></td>
<td class="fixed-value"><input type="number" name="data.info.heavyLoad" value="{{data.calc.stats.heavyLoad}}"></td>
<td class="fixed-value"><input type="number" name="data.info.loadMax" value="{{data.calc.stats.loadMax}}"></td>
<td class="fixed-value"><input type="number" name="data.info.thrustLoad" value="{{data.calc.stats.thrustLoad}}"></td>
<td class="fixed-value"><input type="number" name="data.info.encumbrance" value="{{data.calc.stats.encumbrance}}"></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>