+ Lasten gem. KOD. S. 59
This commit is contained in:
2024-01-07 20:05:51 +01:00
parent b8e873537c
commit 71b04063e7
4 changed files with 103 additions and 2 deletions
+61 -1
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) {