Fix some stuff

This commit is contained in:
2024-03-24 19:45:51 +01:00
parent c9c2fb801d
commit ddbe48f937
9 changed files with 72 additions and 117 deletions
+11 -67
View File
@@ -114,9 +114,9 @@ export class M5Character extends Actor {
brawlFw: 0,
poisonResistance: { value: 0, mods: [] },
enduranceBonus: 0,
deprivationCold: 0,
deprivationHeat: 0,
deprivationFood: 0,
deprivationCold: { value: 0, mods: [] },
deprivationHeat: { value: 0, mods: [] },
deprivationFood: { value: 0, mods: [] },
hoard: 0,
encumbrance: 0,
load: 0,
@@ -188,9 +188,9 @@ export class M5Character extends Actor {
ret.stats.brawlFw = ret.stats.brawl.value + ret.stats.attackBonus.value + (data.info.race === "Zwerg" ? 1 : 0);
ret.stats.poisonResistance = this.modResult(30 + Math.floor(ret.attributes.ko.value / 2));
ret.stats.enduranceBonus = Math.floor(ret.attributes.ko.value / 10) + Math.floor(ret.attributes.st.value / 20);
ret.stats.deprivationCold = (Math.floor(ret.attributes.ko.value / 2));
ret.stats.deprivationHeat = (Math.floor(ret.attributes.ko.value / 2));
ret.stats.deprivationFood = (Math.floor(40 + (ret.attributes.ko.value / 2)));
ret.stats.deprivationCold = this.modResult(Math.floor(ret.attributes.ko.value / 2));
ret.stats.deprivationHeat = this.modResult(Math.floor(ret.attributes.ko.value / 2));
ret.stats.deprivationFood = this.modResult(Math.floor(40 + ret.attributes.ko.value / 2));
ret.stats.hoardMin = M5Character.levelThreshold.at(ret.level - 1) / 2;
ret.stats.hoardNext = M5Character.levelThreshold.at(ret.level) / 2;
ret.stats.wealth = parseFloat((data.info.gold + data.info.silver / 10 + data.info.copper / 100).toPrecision(3));
@@ -205,7 +205,10 @@ export class M5Character extends Actor {
const aggregate = new M5ModAggregate(data, ret);
context.items
?.filter((item) => (item.type === "item" || item.type === "effect" || item.type === "armor" || item.type === "container" || item.type === "class") && item.system.equipped)
?.filter(
(item) =>
(item.type === "item" || item.type === "skill" || item.type === "effect" || item.type === "armor" || item.type === "container" || item.type === "class") && item.system.equipped
)
.forEach((item) => {
const mods = item.system.mods;
//console.log("Actor item mods", mods)
@@ -446,41 +449,7 @@ export class M5Character extends Actor {
containerId: item.system.containerId || "",
};
});
//if (!skip?.encumbrance) {
//const item = context.items.filter((x) => x.name === "Belastung");
//if (item.length === 0) {
// this.createEffect("Belastung", [
// { id: "movement", operation: M5ModOperation.DIVISION, type: M5ModType.STAT, value: 2 },
// { id: "attackBonus", operation: M5ModOperation.SUBTRACT, type: M5ModType.STAT, value: 4 },
// { id: "defenseBonus", operation: M5ModOperation.SUBTRACT, type: M5ModType.STAT, value: 4 }
// ]);
//} else if (item.length === 2) {
// item[1]?.delete();
//}
//
//if (item.length === 1) {
// item[0]?.update({
// img: "icons/containers/bags/sack-simple-leather-orange.webp" });
// }
//
//if (ret.stats.encumbrance <= ret.stats.heavyLoad) {
// item[0]?.update({
// data: {
// equipped: false,
// }
// });
// }
//
//if (ret.stats.encumbrance > ret.stats.heavyLoad) {
// item[0].update({
// data: {
// equipped: true,
// },
// });
// }
//}
}
}
if (!skip?.class) {
context.items
@@ -539,31 +508,6 @@ export class M5Character extends Actor {
pp: item.system.pp,
calc: item.system.calc,
} as M5SkillCalculated;
// Adjust attribute Aussehen based on Athletik skill
if (item.name === "Athletik") {
ret.attributes.au.value += Math.floor(item.system.fw / 3);
}
// Adjust stat Bewegungsweite based on Laufen skill
if (item.name === "Laufen") {
ret.stats.movement.value += Math.floor(item.system.fw / 3);
}
// Adjust stat Kälte based on Überleben (Gebirge) skill
if (item.name === "Überleben (Gebirge)") {
ret.stats.deprivationCold += Math.floor(item.system.fw * 5);
}
// Adjust stat Kälte based on Überleben (Steppe) skill
if (item.name === "Überleben (Steppe)") {
ret.stats.deprivationHeat += Math.floor(item.system.fw * 5);
}
// Adjust stat Durst & Hunger based on Robustheit skill
if (item.name === "Robustheit") {
ret.stats.deprivationFood += 10;
}
});
}
+3 -3
View File
@@ -41,9 +41,9 @@ export default class M5ModAggregate {
this.push({ type: M5ModType.STAT, id: M5Stats.AP, operation: M5ModOperation.SET, value: calc.stats.ap.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.PROTECTION_LP, operation: M5ModOperation.SET, value: calc.stats.lpProtection.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.PROTECTION_AP, operation: M5ModOperation.SET, value: calc.stats.apProtection.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_COLD, operation: M5ModOperation.SET, value: calc.stats.deprivationCold }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_HEAT, operation: M5ModOperation.SET, value: calc.stats.deprivationHeat }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_FOOD, operation: M5ModOperation.SET, value: calc.stats.deprivationFood }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_COLD, operation: M5ModOperation.SET, value: calc.stats.deprivationCold.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_HEAT, operation: M5ModOperation.SET, value: calc.stats.deprivationHeat.value }, characterString);
this.push({ type: M5ModType.STAT, id: M5Stats.DEPRIVATION_FOOD, operation: M5ModOperation.SET, value: calc.stats.deprivationFood.value }, characterString);
}
push(mod: M5ItemMod, source: string) {