diff --git a/system/lang/en-en.json b/system/lang/en-en.json index 582779b..4e1b67a 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -253,8 +253,8 @@ "composuretip": "(Earth + Water) x2", "focus": "Focus", "focustip": "Air + Fire", - "vigilante": "Vigilante", - "vigilantetip": "(Air + Water) /2", + "vigilance": "Vigilante", + "vigilancetip": "(Air + Water) /2", "voidpoints": "Void Points", "fatigue": "Fatigue", "strife": "Strife" @@ -371,6 +371,7 @@ "q18": "18. Who was your character named to honor ? (p. 95)", "d10r1": "D10 Result (1/2)", "d10r2": "D10 Result (2/2)", + "d10r2_choice": "2nd D10 Effect:", "q19": "19. What is your character’s personal name ? (p. 95)" }, "part7": { diff --git a/system/lang/es-es.json b/system/lang/es-es.json index a77c6ce..fffb65d 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -253,8 +253,8 @@ "composuretip": "(Tierra + Agua) x2", "focus": "Concentración", "focustip": "Aire + Fuego", - "vigilante": "Alerta", - "vigilantetip": "(Aire + Agua) /2", + "vigilance": "Alerta", + "vigilancetip": "(Aire + Agua) /2", "voidpoints": "P. Vacío", "fatigue": "Fatiga", "strife": "Conflicto" @@ -371,6 +371,7 @@ "q18": "18. Who was your character named to honor ? (p. 95)", "d10r1": "D10 Result (1/2)", "d10r2": "D10 Result (2/2)", + "d10r2_choice": "2nd D10 Effect:", "q19": "19. What is your character’s personal name ? (p. 95)" }, "part7": { diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index e6184d3..cc7ff3d 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -253,8 +253,8 @@ "composuretip": "(Terre + Eau) x2", "focus": "Attention", "focustip": "Air + Feu", - "vigilante": "Vigilance", - "vigilantetip": "(Air + Eau) /2", + "vigilance": "Vigilance", + "vigilancetip": "(Air + Eau) /2", "voidpoints": "Points de Vide", "fatigue": "Fatigue", "strife": "Conflit" @@ -371,6 +371,7 @@ "q18": "18. En l’honneur de qui votre personnage a-t-il été prénommé ? (p. 95)", "d10r1": "Résultat du 1er D10", "d10r2": "Résultat du 2eme D10", + "d10r2_choice": "Effet du 2ème D10:", "q19": "19. Quel est le prénom de votre personnage ? (p. 95)" }, "part7": { diff --git a/system/scripts/actor.js b/system/scripts/actor.js index 024281f..8e3037c 100644 --- a/system/scripts/actor.js +++ b/system/scripts/actor.js @@ -79,7 +79,7 @@ export class ActorL5r5e extends Actor { data.endurance = (Number(data.rings.earth) + Number(data.rings.fire)) * 2; data.composure = (Number(data.rings.earth) + Number(data.rings.water)) * 2; data.focus = Number(data.rings.air) + Number(data.rings.fire); - data.vigilante = Math.floor((Number(data.rings.air) + Number(data.rings.water)) / 2); + data.vigilance = Math.ceil((Number(data.rings.air) + Number(data.rings.water)) / 2); // Attributes bars data.void_points.max = data.rings.void; diff --git a/system/scripts/actors/twenty-questions-dialog.js b/system/scripts/actors/twenty-questions-dialog.js index 02466b1..b0d4368 100644 --- a/system/scripts/actors/twenty-questions-dialog.js +++ b/system/scripts/actors/twenty-questions-dialog.js @@ -193,13 +193,20 @@ export class TwentyQuestionsDialog extends FormApplication { console.warn("event stepKey is undefined"); return; } - try { // Get item const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); + if (item.entity !== "Item" || !item) { + console.warn("forbidden item for this drop zone", type, item.data.type); + return; + } + + // Specific step18_heritage, all item/tech allowed + if (stepKey === "step18.heritage_item") { + type = item.data.type; + } + if ( - item.entity !== "Item" || - !item || (type !== "item" && item.data.type !== type) || (type === "item" && !["item", "weapon", "armor"].includes(item.data.type)) ) { diff --git a/system/scripts/actors/twenty-questions.js b/system/scripts/actors/twenty-questions.js index 47c3bbc..d8f3fea 100644 --- a/system/scripts/actors/twenty-questions.js +++ b/system/scripts/actors/twenty-questions.js @@ -23,6 +23,7 @@ export class TwentyQuestions { "step8.skill", "step13.skill", "step17.skill", + "step18.skill", ]; /** @@ -40,6 +41,7 @@ export class TwentyQuestions { "step13.disadvantage", "step14.special_features", "step16.item", + "step18.heritage_item", ]; /** @@ -146,6 +148,7 @@ export class TwentyQuestions { heritage_name: "", heritage_1: null, heritage_2: null, + heritage_item: [], }, step19: { firstname: "", diff --git a/system/scripts/helpers.js b/system/scripts/helpers.js index de28247..2a02886 100644 --- a/system/scripts/helpers.js +++ b/system/scripts/helpers.js @@ -149,11 +149,21 @@ export class HelpersL5r5e { static convertSymbols(text, toSymbol) { CONFIG.l5r5e.symbols.forEach((cfg, tag) => { if (toSymbol) { - text = text.replace(tag, ``); + text = text.replace( + new RegExp(HelpersL5r5e.escapeRegExp(tag), "gi"), + `` + ); } else { text = text.replace(new RegExp(``, "gi"), tag); } }); return text; } + + /** + * Escape Regx characters + */ + static escapeRegExp(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + } } diff --git a/system/system.json b/system/system.json index e8add75..a42452b 100644 --- a/system/system.json +++ b/system/system.json @@ -141,11 +141,6 @@ "lang": "es", "name": "Spanish (Spain)", "path": "lang/es-es.json" - }, - { - "lang": "pt-br", - "name": "Português (Brasil)", - "path": "lang/pt-br.json" } ], "url": "https://gitlab.com/teaml5r/l5r5e", diff --git a/system/template.json b/system/template.json index 9f7f4b8..7b4dfc7 100644 --- a/system/template.json +++ b/system/template.json @@ -72,7 +72,7 @@ "endurance": 0, "composure": 0, "focus": 0, - "vigilante": 0, + "vigilance": 0, "void_points": { "max": 1, "value": 0 diff --git a/system/templates/actors/character/attributes.html b/system/templates/actors/character/attributes.html index 7abf42b..4cd303c 100644 --- a/system/templates/actors/character/attributes.html +++ b/system/templates/actors/character/attributes.html @@ -28,12 +28,12 @@
{{ localize 'l5r5e.attributes.focustip' }}
-{{ localize 'l5r5e.attributes.vigilantetip' }}
+{{ localize 'l5r5e.attributes.vigilancetip' }}
{{ localize 'l5r5e.attributes.focustip' }}
{{ localize 'l5r5e.attributes.vigilantetip' }}
+{{ localize 'l5r5e.attributes.vigilancetip' }}