Working on Skills and some fixes

- Added Skills to character sheet
- Added migration to old skills
- Added icon on skills
- Added actor.isNpc
- Money out of system
This commit is contained in:
Vlyan
2023-01-08 15:12:22 +01:00
parent 1ec9e65ca5
commit 710afd9804
22 changed files with 302 additions and 145 deletions

View File

@@ -745,7 +745,7 @@ export class HelpersL5r5e {
* @return {Promise<{RollTableDraw}>} The drawn results
*/
static async drawManyFromPack(pack, tableName, retrieve = 5, opt = { rollMode: "selfroll" }) {
const comp = await game.packs.get(pack);
const comp = game.packs.get(pack);
if (!comp) {
console.log(`L5R5E | Pack not found[${pack}]`);
return;
@@ -760,6 +760,23 @@ export class HelpersL5r5e {
return await table.drawMany(retrieve, opt);
}
/**
* Load all compendium data from his id
*
* @param {String} compendium
* @param {Function} filter
* @returns {Promise<Item[]>}
*/
static async loadCompendium(compendium, filter = item => true) {
const pack = game.packs.get(compendium);
if (!pack) {
console.log(`L5R5E | Pack not found[${compendium}]`);
return;
}
const data = (await pack.getDocuments()) ?? [];
return data.filter(filter);
}
/**
* Return the string simplified for comparaison
* @param {string} str