From 22572ca98c454d9c9e5cfd73db68a6f2357e4270 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 24 Jun 2023 23:39:58 +0200 Subject: [PATCH 1/3] Support des armes non mortelles --- module/item.js | 2 +- module/rdd-combat.js | 1 - module/rdd-roll.js | 7 +++---- module/rdd-utility.js | 13 +++++++------ template.json | 4 +++- templates/dialog-roll-competence.html | 2 +- templates/enum-mortalite.html | 3 +++ templates/item-arme-sheet.html | 8 ++++++++ templates/item-competencecreature-sheet.html | 8 ++++++++ 9 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 templates/enum-mortalite.html diff --git a/module/item.js b/module/item.js index 48dd6576..3bda723e 100644 --- a/module/item.js +++ b/module/item.js @@ -675,7 +675,7 @@ export class RdDItem extends Item { _armeChatData() { return [ `Compétence: ${this.system.competence}`, - `Dommages: ${this.system.dommages}`, + `Dommages: ${this.system.dommages} ${this.system.mortalite=='non-mortel'? '(Non mortel)':''}`, `Force minimum: ${this.system.force}`, `Resistance: ${this.system.resistance}`, ...this._inventaireTemplateChatData() diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 8eec5bb5..84826d67 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -789,7 +789,6 @@ export class RdDCombat { let rollData = { passeArme: randomID(16), mortalite: arme?.system.mortalite, - coupsNonMortels: false, competence: competence.clone(), surprise: this.attacker.getSurprise(true), surpriseDefenseur: this.defender.getSurprise(true), diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 225f03fc..4331713a 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -187,7 +187,7 @@ export class RdDRoll extends Dialog { console.log("RdDRollSelectDialog - Cout reve", ptreve); this.updateRollResult(html); }); - this.html.find("[name='coupsNonMortels']").change((event) => { + this.html.find("[name='mortalite']").change((event) => { this.rollData.dmg.mortalite = event.currentTarget.checked ? "non-mortel" : "mortel"; this.updateRollResult(html); }); @@ -295,8 +295,7 @@ export class RdDRoll extends Dialog { rollData.dmg = rollData.attackerRoll?.dmg ?? RdDBonus.dmg(rollData, this.actor.getBonusDegat()) rollData.caracValue = parseInt(rollData.selectedCarac.value) - rollData.mortalite = rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite ?? 'mortel'; - rollData.coupsNonMortels = (rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite) == 'non-mortel'; + rollData.mortalite = rollData.attackerRoll?.dmg.mortalite ?? rollData.dmg.mortalite ?? rollData.mortalite ?? 'mortel'; rollData.use.appelAuMoral = this.actor.isPersonnage() && RdDCarac.isActionPhysique(rollData.selectedCarac); let dmgText = Misc.toSignedString(rollData.dmg.total); @@ -319,7 +318,7 @@ export class RdDRoll extends Dialog { // Mise à jour valeurs this.html.find(".dialog-roll-title").text(this._getTitle(rollData)); - this.html.find("[name='coupsNonMortels']").prop('checked', rollData.mortalite == 'non-mortel'); + this.html.find("[name='mortalite']").prop('checked', rollData.mortalite == 'non-mortel'); this.html.find(".dmg-arme-actor").text(dmgText); this.html.find("div.placeholder-ajustements").empty().append(adjustements); this.html.find("div.placeholder-resolution").empty().append(resolutionTable) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 4bfa7e7b..703e3c87 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -180,24 +180,25 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/item-queue-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/header-item.html', // partial enums - 'systems/foundryvtt-reve-de-dragon/templates/enum-caracteristiques.html', - 'systems/foundryvtt-reve-de-dragon/templates/enum-base-competence.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-base-competence.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-caracteristiques.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-categories.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-potion.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-queue.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-competence.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-draconic.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-heures.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-initpremierround.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-mortalite.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-niveau-ethylisme.html', - 'systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html', - 'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-queue.html', - 'systems/foundryvtt-reve-de-dragon/templates/enum-draconic.html', - 'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-type.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-periode.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-effet.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-tmr-type.html', // Partials 'systems/foundryvtt-reve-de-dragon/templates/tirage/liste-resultats-recherche.hbs', 'systems/foundryvtt-reve-de-dragon/templates/time/horloge.hbs', diff --git a/template.json b/template.json index 470190bf..9b0feb1c 100644 --- a/template.json +++ b/template.json @@ -594,7 +594,8 @@ "iscombat": false, "isnaturelle": true, "ispossession": false, - "dommages": 0 + "dommages": 0, + "mortalite": "mortel" }, "empoignade": { "templates": ["description"], @@ -671,6 +672,7 @@ "resistance": 0, "categorie_parade": "", "dommages": "0", + "mortalite": "mortel", "penetration": 0, "force": "0", "competence": "", diff --git a/templates/dialog-roll-competence.html b/templates/dialog-roll-competence.html index 800d4bfc..ee2a475b 100644 --- a/templates/dialog-roll-competence.html +++ b/templates/dialog-roll-competence.html @@ -54,7 +54,7 @@ {{else}} - + {{/if}} diff --git a/templates/enum-mortalite.html b/templates/enum-mortalite.html new file mode 100644 index 00000000..66bbbf31 --- /dev/null +++ b/templates/enum-mortalite.html @@ -0,0 +1,3 @@ + + + diff --git a/templates/item-arme-sheet.html b/templates/item-arme-sheet.html index 2964af13..fa911035 100644 --- a/templates/item-arme-sheet.html +++ b/templates/item-arme-sheet.html @@ -37,6 +37,14 @@ +
+ + +
diff --git a/templates/item-competencecreature-sheet.html b/templates/item-competencecreature-sheet.html index 94c67834..e68571fa 100644 --- a/templates/item-competencecreature-sheet.html +++ b/templates/item-competencecreature-sheet.html @@ -27,6 +27,14 @@
+
+ + +
{{/if}} {{#if isparade}}
-- 2.35.3 From 34b5df637f1427ed71b66d821242503222245cf7 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 24 Jun 2023 23:50:05 +0200 Subject: [PATCH 2/3] Notifier le joueur qu'il peut passer sa nuit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lorsque le MJ configure la nuit des personnages, une notification est envoyée aux joueurs pour leur dire de gérer leur nuit. --- module/actor.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/actor.js b/module/actor.js index 3ce87a7e..f09ae594 100644 --- a/module/actor.js +++ b/module/actor.js @@ -387,6 +387,14 @@ export class RdDActor extends RdDBaseActor { await this.distribuerStress('stress', consigne.stress.valeur, consigne.stress.motif); } await this.update({ 'system.sommeil': consigne.sommeil }) + const player = this.findPlayer(); + if (player) { + ChatUtility.notifyUser(player.id, 'info', `Vous pouvez gérer la nuit de ${this.name}`); + } + } + + findPlayer() { + return game.users.players.find(player => player.active && player.character?.id == this.id); } async onTimeChanging(oldTimestamp, newTimestamp) { -- 2.35.3 From 5d4a18aac587893f59e16ed91c96dd35dbe1626b Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 24 Jun 2023 23:59:25 +0200 Subject: [PATCH 3/3] Version 11.0.11 --- changelog.md | 4 ++++ system.json | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index f79ce302..61e61b41 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # v11.0 +## v11.0.11 - Les bleus de Khrachtchoum le Problémeux +- si le gardien configure le sommeil, les joueurs sont notifiés que chateau dormant vient de passer +- possibilité de créer des armes et des compétences de créatures non-mortelles. + ## v11.0.10 - Les Songes de Khrachtchoum le Problémeux - on peut de nouveau se déplacer dans les TMRs d'un clic sur la case à atteindre - Lire un livre depuis l'inventaire permet de nouveau de faire un jet de la tâche diff --git a/system.json b/system.json index e17b8473..b27f4862 100644 --- a/system.json +++ b/system.json @@ -1,8 +1,8 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", - "version": "11.0.10", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.0.10.zip", + "version": "11.0.11", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.0.11.zip", "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json", "changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md", "compatibility": { -- 2.35.3