Revert "Merge branch 'develop' into lasten"

This reverts commit 365f06575e, reversing
changes made to 60c7a97ffe.
This commit is contained in:
2024-02-05 18:07:27 +01:00
parent 365f06575e
commit a7d79d921b
10 changed files with 69 additions and 334 deletions
+15 -55
View File
@@ -240,51 +240,6 @@ export class M5Character extends Actor {
ret.skillMods = aggregate.calculate();
}
if (!skip?.items) {
context.items
?.filter((item) => item.type === "item")
.forEach((item) => {
item.prepareDerivedData();
let label = item.name;
if (item.system.magic) {
label += "*";
}
if (item.system.valuable) {
ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
}
if (item.system.hoarded) {
ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
}
let icon = item.img;
let rollable = false;
for (let key in item.system.rolls.formulas) {
rollable = item.system.rolls.formulas[key]?.enabled;
if (rollable) {
break;
}
}
ret.gear.items[item.id] = {
label: label,
icon: icon,
magic: item.system.magic,
calc: item.system.calc,
equipped: item.system?.equipped,
valuable: item.system?.valuable,
hoarded: item.system?.hoarded,
weight: item.system.weight || 0,
containerId: item.system.containerId || "",
value: item.system.value || 0,
currency: item.system.currency || "",
quantity: item.system.quantity || 0,
rollExist: rollable,
};
});
}
if (!skip?.containers) {
context.items
?.filter((item) => item.type === "container")
@@ -393,10 +348,10 @@ export class M5Character extends Actor {
")";
}
if (item.system.valuable) {
ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
ret.stats.wealth += this.calculateValue(item.system.value, item.system.currency);
}
if (item.system.hoarded) {
ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
ret.stats.hoard += item.system.value || 0;
}
if (!!item.system.containerId) {
ret.gear.containers[item.system.containerId].weight += item.system.weight;
@@ -414,7 +369,6 @@ export class M5Character extends Actor {
valuable: item.system?.valuable,
hoarded: item.system?.hoarded,
value: item.system.value || 0,
currency: item.system.currency || "",
calc: item.system.calc,
special: item.system.special,
damageBase: item.system.damageBase,
@@ -433,12 +387,20 @@ export class M5Character extends Actor {
label += "*(" + (item.system.stats.defenseBonus < 0 ? "" : "+") + item.system.stats.defenseBonus + ")";
}
if (item.system.valuable) {
ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
ret.stats.wealth += this.calculateValue(item.system.value, item.system.currency);
}
if (item.system.hoarded) {
ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
ret.stats.hoard += item.system.value || 0;
}
if (!!item.system.containerId) {
ret.gear.containers[item.system.containerId].weight += item.system.weight;
if (ret.gear.containers[item.system.containerId].equipped) {
ret.stats.encumbrance += item.system.weight;
}
} else if (item.system.equipped) {
ret.stats.encumbrance += item.system.weight || 0;
}
ret.gear.defensiveWeapons[item.id] = {
label: label,
skillId: item.system.skillId,
@@ -446,7 +408,6 @@ export class M5Character extends Actor {
valuable: item.system?.valuable,
hoarded: item.system?.hoarded,
value: item.system.value || 0,
currency: item.system.currency || "",
defenseBonus: item.system.stats.defenseBonus,
calc: item.system.calc,
equipped: item.system?.equipped,
@@ -464,10 +425,10 @@ export class M5Character extends Actor {
label += "*";
}
if (item.system.valuable) {
ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
ret.stats.wealth += this.calculateValue(item.system.value, item.system.currency);
}
if (item.system.hoarded) {
ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency);
ret.stats.hoard += item.system.value || 0;
}
if (!!item.system.containerId) {
ret.gear.containers[item.system.containerId].weight += item.system.weight;
@@ -486,7 +447,6 @@ export class M5Character extends Actor {
valuable: item.system?.valuable,
hoarded: item.system?.hoarded,
value: item.system.value || 0,
currency: item.system.currency || "",
lpProtection: item.system.lpProtection,
calc: item.system.calc,
equipped: item.system?.equipped,