diff --git a/system/lang/en-en.json b/system/lang/en-en.json index ebeddae..1637a4a 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -255,6 +255,12 @@ "rank": "Rank Total Xp: ", "curriculum": "in curriculum" }, + "npc": { + "types": { + "adversary": "Adversary", + "minion": "Minion" + } + }, "twenty_questions": { "title": "Twenty questions", "bt_abrev": "20Q", diff --git a/system/lang/es-es.json b/system/lang/es-es.json index 037ddda..2bfd91a 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -255,6 +255,12 @@ "rank": "Rank Total Xp: ", "curriculum": "in curriculum" }, + "npc": { + "types": { + "adversary": "Adversary", + "minion": "Minion" + } + }, "twenty_questions": { "title": "Twenty questions", "bt_abrev": "20Q", diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index 948ee1a..7b1c0d6 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -255,6 +255,12 @@ "rank": "Xp Total du rang : ", "curriculum": "Inclus dans le cursus" }, + "npc": { + "types": { + "adversary": "Antagoniste", + "minion": "Sous-fifre" + } + }, "twenty_questions": { "title": "Vingt questions", "bt_abrev": "20Q", diff --git a/system/scripts/actors/npc-sheet.js b/system/scripts/actors/npc-sheet.js index 2d4518b..b3496dd 100644 --- a/system/scripts/actors/npc-sheet.js +++ b/system/scripts/actors/npc-sheet.js @@ -4,7 +4,10 @@ import { BaseSheetL5r5e } from "./base-sheet.js"; * NPC Sheet */ export class NpcSheetL5r5e extends BaseSheetL5r5e { - static types = ["minion", "adversary"]; + /** + * Sub Types + */ + static types = ["adversary", "minion"]; static get defaultOptions() { return mergeObject(super.defaultOptions, { @@ -20,7 +23,10 @@ export class NpcSheetL5r5e extends BaseSheetL5r5e { getData() { const sheetData = super.getData(); - sheetData.data.types = NpcSheetL5r5e.types; + sheetData.data.types = NpcSheetL5r5e.types.map((e) => ({ + id: e, + label: game.i18n.localize("l5r5e.npc.types." + e), + })); return sheetData; } diff --git a/system/scripts/actors/twenty-questions.js b/system/scripts/actors/twenty-questions.js index 928de6b..bfee3d3 100644 --- a/system/scripts/actors/twenty-questions.js +++ b/system/scripts/actors/twenty-questions.js @@ -308,7 +308,7 @@ export class TwentyQuestions { const exceed = {}; TwentyQuestions[listName].forEach((formName) => { const id = getProperty(this.data, formName); - if (id === "none") { + if (!id || id === "none") { return; } if (!store[id]) { diff --git a/system/scripts/helpers.js b/system/scripts/helpers.js index 249b84a..e788497 100644 --- a/system/scripts/helpers.js +++ b/system/scripts/helpers.js @@ -8,13 +8,11 @@ export class HelpersL5r5e { * Get Rings/Element for List / Select */ static getRingsList(actor = null) { - return CONFIG.l5r5e.stances.map((e) => { - return { - id: e, - label: game.i18n.localize(`l5r5e.rings.${e}`), - value: actor?.data?.data?.rings?.[e] || 0, - }; - }); + return CONFIG.l5r5e.stances.map((e) => ({ + id: e, + label: game.i18n.localize(`l5r5e.rings.${e}`), + value: actor?.data?.data?.rings?.[e] || 0, + })); } /** @@ -22,13 +20,11 @@ export class HelpersL5r5e { */ static getSkillsList(useGroup = false) { if (!useGroup) { - return Array.from(L5R5E.skills).map(([id, cat]) => { - return { - id: id, - cat: cat, - label: game.i18n.localize(`l5r5e.skills.${cat}.${id}`), - }; - }); + return Array.from(L5R5E.skills).map(([id, cat]) => ({ + id: id, + cat: cat, + label: game.i18n.localize(`l5r5e.skills.${cat}.${id}`), + })); } const skills = {}; @@ -49,12 +45,10 @@ export class HelpersL5r5e { * Get Techniques for List / Select */ static getTechniquesList() { - return CONFIG.l5r5e.techniques.map((e) => { - return { - id: e, - label: game.i18n.localize(`l5r5e.techniques.${e}`), - }; - }); + return CONFIG.l5r5e.techniques.map((e) => ({ + id: e, + label: game.i18n.localize(`l5r5e.techniques.${e}`), + })); } /** diff --git a/system/templates/actors/npc/identity.html b/system/templates/actors/npc/identity.html index 3a816cd..e59d300 100644 --- a/system/templates/actors/npc/identity.html +++ b/system/templates/actors/npc/identity.html @@ -3,9 +3,9 @@