Remove Lasteneffekte

Changes:
 + Aktive Effekte wurden entfernt
 + Überschrittene Lasten werden Rot eingefärbt
This commit is contained in:
2024-03-04 11:04:44 +01:00
parent b83c57b5c8
commit b51f99d64f
2 changed files with 56 additions and 59 deletions
+50 -53
View File
@@ -461,58 +461,55 @@ export class M5Character extends Actor {
};
});
if (!skip?.encumbrance) {
const item = context.items.filter((x) => x.name === "Belastung");
if (ret.stats.encumbrance > ret.stats.heavyLoad) {
if (item.length === 0) {
this.createEffect("Belastung", [{ id: "movement", operation: M5ModOperation.DIVISION, type: M5ModType.STAT, value: 2 }]);
} 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.length === 1) {
item[0].update({
data: {
equipped: false,
},
});
}
}
}
// if (!skip?.encumbrance) {
// const item = context.items.filter((x) => x.name === "Belastung");
// if (ret.stats.encumbrance > ret.stats.heavyLoad) {
// if (item.length === 0) {
// this.createEffect("Belastung", [{ id: "movement", operation: M5ModOperation.DIVISION, type: M5ModType.STAT, value: 2 }]);
// } 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.length === 1) {
// item[0]?.update({
// data: {
// equipped: false,
// },
// });
// }
// }
// }
if (!skip?.encumbrance) {
const item = context.items.filter((x) => x.name === "Höchstlast");
if (ret.stats.encumbrance > ret.stats.loadMax) {
if (item.length === 0) {
let messageContent = `Höchstlast wurde überschritten: 1 AP Schaden durch Belastung alle 10 Minuten abziehen!`;
let chatData = {
speaker: ChatMessage.getSpeaker({ actor: Actor.name }),
content: messageContent,
};
ChatMessage.create(chatData, {});
ui.notifications.warn(messageContent);
this.createEffect("Höchstlast", [{ id: "ap", operation: M5ModOperation.SUBTRACT, type: M5ModType.STAT, value: 1 }]);
} else if (item.length === 2) {
item[1]?.delete();
} else if (item.length === 1) {
item[0].update({
data: {
equipped: true,
},
});
}
} else if (ret.stats.encumbrance < ret.stats.loadMax) {
if (item.length === 1) {
item[0]?.delete();
}
}
}
// if (!skip?.encumbrance) {
// const item = context.items.filter((x) => x.name === "Höchstlast");
// if (ret.stats.encumbrance > ret.stats.loadMax) {
// if (item.length === 0) {
// this.createEffect("Höchstlast", [{ id: "ap", operation: M5ModOperation.SUBTRACT, type: M5ModType.STAT, value: 1 }]);
// } 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.loadMax) {
// if (item.length === 1) {
// item[0]?.update({
// data: {
// equipped: false,
// },
// });
// }
// }
// }
}
if (!skip?.effects) {
@@ -551,11 +548,11 @@ 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") {