Fix enc for equipments/weapons
All checks were successful
Release Creation / build (release) Successful in 1m34s

This commit is contained in:
2025-07-13 19:30:28 +02:00
parent 8197e3c369
commit d2cbe71731
17 changed files with 71 additions and 38 deletions

View File

@@ -636,6 +636,28 @@ export default class FTLNomadUtils {
}
}
static async fixWeaponsEnc() {
// Iterate over all items of type "weapon" from compendium
const weapons = game.items.filter(i => i.type === "weapon");
for (const weapon of weapons) {
// If the weapon's encumbrance is less than 1, set it to 1
if (weapon.system.enc < 1) {
await weapon.update({ "system.enc": 1 });
}
}
}
static async fixEquipmentEnc() {
// Iterate over all items of type "equipment" from compendium
const equipments = game.items.filter(i => i.type === "equipment");
for (const equipment of equipments) {
// If the equipment's encumbrance is less than 1, set it to
if (equipment.system.enc < 1) {
await equipment.update({ "system.enc": 1 });
}
}
}
static async importMeleeWeapons() {
// Create a melee weapons folder if it doesn't exist
const meleeWeaponsFolder = game.folders.getName("Melee Weapons") || await Folder.create({