diff --git a/CHANGELOG.md b/CHANGELOG.md index bc0fbdd..12888c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # Changelog ## 1.3.0 - Foundry 0.8.x compatibility -- Updated the System to the new version of Foundry VTT (a lot of things broke) +- Updated the System to the new version of Foundry VTT (a lot of things broke). - RnK button is now black in chat if no actions left in roll. - -## 1.2.2 - Before the Change -- Added some custom technique's types by request: Link & Specificity +- NPC can now have strengths/weaknesses with all rings. +- Added an optional "Specificity" technique type to serve as a catch-all (by request). +- Fix rnkMessage not passing on actor object for NPCs (thanks to Bragma). - Added Mantis Clan compendium entries - Fixed the "Crescent Moon Style" technique rank from 4 to 2 diff --git a/system/lang/en-en.json b/system/lang/en-en.json index 3d97ff6..7b37f32 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -16,7 +16,7 @@ }, "CustomTechniques": { "Title": "Use custom techniques", - "Hint": "Add 'Link' and 'Specificity' techniques types." + "Hint": "Add 'Specificity' technique type to serve as a catch-all." } }, "ACTOR": { diff --git a/system/lang/es-es.json b/system/lang/es-es.json index 51e6f71..a701fc5 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -16,7 +16,7 @@ }, "CustomTechniques": { "Title": "Use custom techniques", - "Hint": "Add 'Link' and 'Specificity' techniques types." + "Hint": "Add 'Specificity' technique type to serve as a catch-all." } }, "ACTOR": { diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index 09e8b46..38ef052 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -16,7 +16,7 @@ }, "CustomTechniques": { "Title": "Utiliser les techniques personnalisées", - "Hint": "Ajoute les types de technique 'Lien' et 'Particularités'." + "Hint": "Ajoute un type de technique 'Particularités' pour servir de fourre-tout." } }, "ACTOR": { @@ -175,7 +175,6 @@ "ninjutsu": "Ninjutsu", "school_ability": "Capacité d'école", "mastery_ability": "Capacité de maîtrise", - "link": "Liens", "specificity": "Particularités" }, "peculiarities": { diff --git a/system/scripts/actors/base-sheet.js b/system/scripts/actors/base-sheet.js index 88ab43a..45c44a7 100644 --- a/system/scripts/actors/base-sheet.js +++ b/system/scripts/actors/base-sheet.js @@ -349,7 +349,13 @@ export class BaseSheetL5r5e extends ActorSheet { case "technique": { // If technique, select the current type const techType = $(event.currentTarget).data("tech-type"); - if ([...CONFIG.l5r5e.techniques, ...CONFIG.l5r5e.techniques_school].includes(techType)) { + if ( + [ + ...CONFIG.l5r5e.techniques, + ...CONFIG.l5r5e.techniques_school, + ...CONFIG.l5r5e.techniques_custom, + ].includes(techType) + ) { item.data.data.technique_type = techType; item.data.img = `${CONFIG.l5r5e.paths.assets}icons/techs/${techType}.svg`; } diff --git a/system/scripts/actors/twenty-questions.js b/system/scripts/actors/twenty-questions.js index 7caae30..c43ec7e 100644 --- a/system/scripts/actors/twenty-questions.js +++ b/system/scripts/actors/twenty-questions.js @@ -82,8 +82,7 @@ export class TwentyQuestions { shuji: false, maho: false, ninjutsu: false, - link: false, - specificity: false, + specificity: true, }, techniques: [], school_ability: [], diff --git a/system/scripts/config.js b/system/scripts/config.js index cfd9158..0f84f0a 100644 --- a/system/scripts/config.js +++ b/system/scripts/config.js @@ -8,7 +8,7 @@ L5R5E.paths = { L5R5E.money = [50, 10]; L5R5E.stances = ["earth", "air", "water", "fire", "void"]; L5R5E.techniques = ["kata", "kiho", "inversion", "invocation", "ritual", "shuji", "maho", "ninjutsu"]; -L5R5E.techniques_custom = ["link", "specificity"]; +L5R5E.techniques_custom = ["specificity"]; L5R5E.techniques_school = ["school_ability", "mastery_ability"]; L5R5E.xp = { diff --git a/system/scripts/helpers.js b/system/scripts/helpers.js index 2c10362..12a43eb 100644 --- a/system/scripts/helpers.js +++ b/system/scripts/helpers.js @@ -45,10 +45,7 @@ export class HelpersL5r5e { * Get Techniques for List / Select */ static getTechniquesList() { - return [ - ...CONFIG.l5r5e.techniques, - ...(game.settings.get("l5r5e", "techniques-customs") ? CONFIG.l5r5e.techniques_custom : []), - ].map((e) => ({ + return CONFIG.l5r5e.techniques.map((e) => ({ id: e, label: game.i18n.localize(`l5r5e.techniques.${e}`), })); diff --git a/system/scripts/items/technique-sheet.js b/system/scripts/items/technique-sheet.js index 3ab1a48..99f705d 100644 --- a/system/scripts/items/technique-sheet.js +++ b/system/scripts/items/technique-sheet.js @@ -19,8 +19,11 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e { async getData() { const sheetData = await super.getData(); - // Add "school ability" and "mastery ability" - CONFIG.l5r5e.techniques_school.forEach((e) => { + // Add "school ability", "mastery ability" and customs if active + [ + ...CONFIG.l5r5e.techniques_school, + ...(game.settings.get("l5r5e", "techniques-customs") ? CONFIG.l5r5e.techniques_custom : []), + ].forEach((e) => { sheetData.data.techniquesList.push({ id: e, label: game.i18n.localize(`l5r5e.techniques.${e}`), diff --git a/system/scripts/migration.js b/system/scripts/migration.js index 867e763..da8dc50 100644 --- a/system/scripts/migration.js +++ b/system/scripts/migration.js @@ -183,6 +183,8 @@ export class MigrationL5r5e { const updateData = {}; const actorData = actor.data; + console.log(actorData); // TODO TMP data.data ? à vérifier + // ***** Start of 1.1.0 ***** // Add "Prepared" in actor if (actorData.prepared === undefined) { @@ -202,6 +204,16 @@ export class MigrationL5r5e { } // ***** End of 1.1.0 ***** + // ***** Start of 1.3.0 ***** + // NPC have now more thant a Strength and a Weakness + if (actor.type === "npc" && actorData.rings_affinities) { + updateData["data.rings_affinities." + actorData.rings_affinities.strength.ring] = + actorData.rings_affinities.strength.value; + updateData["data.rings_affinities." + actorData.rings_affinities.weakness.ring] = + actorData.rings_affinities.weakness.value; + } + // ***** End of 1.3.0 ***** + return updateData; } diff --git a/system/template.json b/system/template.json index 17c9ed2..221dfff 100644 --- a/system/template.json +++ b/system/template.json @@ -103,8 +103,7 @@ "shuji": false, "maho": false, "ninjutsu": false, - "link": false, - "specificity": false + "specificity": true } } }, @@ -124,14 +123,11 @@ "social": 0 }, "rings_affinities": { - "strength": { - "ring": "fire", - "value": 2 - }, - "weakness": { - "ring": "water", - "value": -2 - } + "earth": 0, + "air": 0, + "water": 0, + "fire": 0, + "void": 0 }, "skills": { "artisan": 0, diff --git a/system/templates/actors/npc/social.html b/system/templates/actors/npc/social.html index cf00292..6c97315 100644 --- a/system/templates/actors/npc/social.html +++ b/system/templates/actors/npc/social.html @@ -18,24 +18,11 @@