Add workaround for double Belastun effekt
This commit is contained in:
parent
9e17887167
commit
50e2e534a0
|
|
@ -288,10 +288,10 @@ export class M5Character extends Actor {
|
|||
label += "*";
|
||||
}
|
||||
if (item.system.valuable) {
|
||||
ret.stats.wealth += parseFloat((this.calculateValue(item.system.value * item.system.quantity, item.system.currency)).toPrecision(3));
|
||||
ret.stats.wealth += parseFloat(this.calculateValue(item.system.value * item.system.quantity, item.system.currency).toPrecision(3));
|
||||
}
|
||||
if (item.system.hoarded) {
|
||||
ret.stats.hoard += parseFloat((this.calculateValue(item.system.value * item.system.quantity, item.system.currency)).toPrecision(3));
|
||||
ret.stats.hoard += parseFloat(this.calculateValue(item.system.value * item.system.quantity, item.system.currency).toPrecision(3));
|
||||
}
|
||||
|
||||
if (!!item.system.containerId) {
|
||||
|
|
@ -461,20 +461,22 @@ export class M5Character extends Actor {
|
|||
});
|
||||
|
||||
if (!skip?.encumbrance) {
|
||||
const item = context.items.find((x) => x.name === "Belastung");
|
||||
const item = context.items.filter((x) => x.name === "Belastung");
|
||||
if (ret.stats.encumbrance > ret.stats.heavyLoad) {
|
||||
if (!item) {
|
||||
if (item.length === 0) {
|
||||
this.createEffect("Belastung", [{ id: "movement", operation: M5ModOperation.DIVISION, type: M5ModType.STAT, value: 2 }]);
|
||||
} else {
|
||||
item.update({
|
||||
} else if (item.length === 1) {
|
||||
item[0].update({
|
||||
data: {
|
||||
equipped: true,
|
||||
},
|
||||
});
|
||||
} else if (item.length === 2) {
|
||||
item[1]?.delete();
|
||||
}
|
||||
} else if (ret.stats.encumbrance <= ret.stats.heavyLoad) {
|
||||
if (!!item) {
|
||||
item.update({
|
||||
item[0].update({
|
||||
data: {
|
||||
equipped: false,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue