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 += "*";
|
label += "*";
|
||||||
}
|
}
|
||||||
if (item.system.valuable) {
|
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) {
|
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) {
|
if (!!item.system.containerId) {
|
||||||
|
|
@ -461,20 +461,22 @@ export class M5Character extends Actor {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!skip?.encumbrance) {
|
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 (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 }]);
|
this.createEffect("Belastung", [{ id: "movement", operation: M5ModOperation.DIVISION, type: M5ModType.STAT, value: 2 }]);
|
||||||
} else {
|
} else if (item.length === 1) {
|
||||||
item.update({
|
item[0].update({
|
||||||
data: {
|
data: {
|
||||||
equipped: true,
|
equipped: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
} else if (item.length === 2) {
|
||||||
|
item[1]?.delete();
|
||||||
}
|
}
|
||||||
} else if (ret.stats.encumbrance <= ret.stats.heavyLoad) {
|
} else if (ret.stats.encumbrance <= ret.stats.heavyLoad) {
|
||||||
if (!!item) {
|
if (!!item) {
|
||||||
item.update({
|
item[0].update({
|
||||||
data: {
|
data: {
|
||||||
equipped: false,
|
equipped: false,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue