From f5deb4e81fad27cef21c13bb3d9dce7679e08d76 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 22 Jan 2021 23:18:19 +0100 Subject: [PATCH 1/5] Fix /rdd significative --- module/rdd-commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/rdd-commands.js b/module/rdd-commands.js index 6f1eac94..fccca115 100644 --- a/module/rdd-commands.js +++ b/module/rdd-commands.js @@ -215,7 +215,7 @@ export class RdDCommands { caracValue: carac, finalLevel: diff, showDice: true, - diviseur: significative ? 2 : 1, + diviseurSignificative: significative ? 2 : 1, show: { title: "Table de résolution" } }; await RdDResolutionTable.rollData(rollData); From d032d9e5107940a5745758d4a9c0ec966a150a34 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 22 Jan 2021 23:19:17 +0100 Subject: [PATCH 2/5] Plus d'attaque avec l'esquive --- module/actor-sheet.js | 15 +++++---------- templates/actor-sheet.html | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 06db623b..79880544 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -90,16 +90,11 @@ export class RdDActorSheet extends ActorSheet { data.data.combat = duplicate(RdDUtility.checkNull(data.itemsByType['arme'])); data.data.combat = RdDUtility._finalizeArmeList(data.data.combat, data.itemsByType.competence, data.data.carac); - if (data.competenceByCategory && data.competenceByCategory.melee) { - //Specific case for Esquive and Corps à Corps - for (const melee of data.competenceByCategory.melee) { - if (melee.name == "Esquive") - data.data.combat.push({ name: "Esquive", data: { niveau: melee.data.niveau, description: "", force: 6, initiative: "", competence: "Esquive", dommages: 0 } }); - if (melee.name == "Corps à corps") { - let cc_init = RdDUtility.calculInitiative(melee.data.niveau, data.data.carac['melee'].value); - data.data.combat.push(RdDItemArme.mainsNues({ niveau: melee.data.niveau, initiative: cc_init })); - } - } + data.esquive = { name: "Esquive", niveau: data.competenceByCategory?.melee.find(it => it.name == 'Esquive')?.data.niveau ?? -6}; + let corpsACorps = data.competenceByCategory?.melee.find(it => it.name == 'Corps à corps'); + if (corpsACorps) { + let cc_init = RdDUtility.calculInitiative(corpsACorps.data.niveau, data.data.carac['melee'].value); + data.data.combat.push(RdDItemArme.mainsNues({ niveau: corpsACorps.data.niveau, initiative: cc_init })); } this.armesList = duplicate(data.data.combat); diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index f3c9bcc3..5597990d 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -529,14 +529,21 @@ {{#each data.combat as |arme key|}}
  • - {{arme.name}} - {{arme.data.initiative}} + {{arme.name}} + {{arme.data.initiative}} {{arme.data.competence}} - {{numberFormat arme.data.niveau decimals=0 sign=true}} - {{numberFormat arme.data.dommages decimals=0 sign=true}} + {{numberFormat arme.data.niveau decimals=0 sign=true}} + {{numberFormat arme.data.dommages decimals=0 sign=true}}
  • {{/each}} - +
  • + {{esquive.name}} + + + {{numberFormat esquive.niveau decimals=0 sign=true}} + +
  • + {{!-- Compteurs/Blessures Tab --}} From c8ba2f6da936cb68cc77fd4651261e7f6a842c0d Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 23 Jan 2021 00:29:03 +0100 Subject: [PATCH 3/5] Fix /tmrr --- module/rdd-commands.js | 13 ++++++++----- module/tmr-utility.js | 15 +++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/module/rdd-commands.js b/module/rdd-commands.js index fccca115..1523cb26 100644 --- a/module/rdd-commands.js +++ b/module/rdd-commands.js @@ -31,8 +31,11 @@ export class RdDCommands { rddCommands.registerCommand({ path: ["/tmra"], func: (content, msg, params) => TMRUtility.getTMRAleatoire(), descr: "Tire une case aléatoire des Terres médianes" }); rddCommands.registerCommand({ - path: ["/tmrr"], func: (content, msg, params) => rddCommands.getRencontreTMR(msg, params), - descr: "Exemple: /tmrr forêt 47
    Détermine quelle est la rencontre dans une case 'forêt' pour un jet de dé de 47" + path: ["/tmrr"], func: (content, msg, params) => rddCommands.getRencontreTMR(params), + descr: ` + Exemple: /tmrr foret lance un d100 et détermine la rencontre correspondante en 'forêt' + Exemple: /tmrr forêt 47 détermine la rencontre en 'forêt' pour un jet de dé de 47 + ` }); rddCommands.registerCommand({ @@ -182,8 +185,8 @@ export class RdDCommands { } /* -------------------------------------------- */ - getRencontreTMR(params) { - if (params.length == 2) { + async getRencontreTMR(params) { + if (params.length == 1 || params.length ==2) { return TMRUtility.getRencontre(params[0], params[1]) } else { @@ -226,7 +229,7 @@ export class RdDCommands { async rollDeDraconique(msg) { let ddr = new DeDraconique().evaluate(); ddr.showDice = true; - await RdDDice.show(ddr); + await RdDDice.showDiceSoNice(ddr); RdDCommands._chatAnswer(msg, `Lancer d'un Dé draconique: ${ddr.total}`); } diff --git a/module/tmr-utility.js b/module/tmr-utility.js index 22778d15..29f9a6fd 100644 --- a/module/tmr-utility.js +++ b/module/tmr-utility.js @@ -400,26 +400,25 @@ export class TMRUtility { /* -------------------------------------------- */ /** * Retourne une recontre en fonction de la case et du tirage - * @param {*} caseName + * @param {*} terrain * @param {*} roll */ - static async getRencontre( caseName, roll ) { - if ( !caseName) { + static async getRencontre( terrain, roll ) { + if ( !terrain) { ChatMessage.create({ content: "Un nom de case doit être indiqué (ie /tmrr desert ou /tmrr cite)" }); return false; } - if (roll == undefined) { - roll = new Roll("1d100").evaluate().total; - } + + roll = roll ?? new Roll("1d100").evaluate().total; roll = Math.max(1, Math.min(roll, 100)); - let rencontre = await this.rencontreTMRTypeCase(caseName, roll); + let rencontre = await this.rencontreTMRTypeCase(terrain, roll); if (rencontre) { let force = await this.evaluerForceRencontre(rencontre); ChatMessage.create({ user: game.user._id, whisper: [game.user._id], - content: "Rencontre en " + caseName + "(jet : " + roll + "%)
    Vous rencontrez un " + rencontre.name + " d'une force de " + force + " Points de Rêve"}); + content: `Rencontre en ${terrain} (jet : ${roll}%)
    Vous rencontrez un ${rencontre.name} de ${force} Points de Rêve`}); } return false; } From 67b45bf9f911cff0684d213f239a7a794a52ad7b Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sat, 23 Jan 2021 17:50:57 +0100 Subject: [PATCH 4/5] Correction combat --- module/actor.js | 6 +++--- system.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/actor.js b/module/actor.js index 8bd31bbb..6f679940 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2330,7 +2330,7 @@ export class RdDActor extends Actor { } } - count = encaissement.critique; + count = encaissement.critiques; while (count > 0) { let critique = blessures.critiques.liste[0]; if (!critique.active) { @@ -2338,8 +2338,8 @@ export class RdDActor extends Actor { count--; } else { // TODO: status effect dead - ChatMessage.create({ content: `${this.name} vient de succomber à une seconde blessure critique ! Que les Dragons gardent son Archétype en paix !` }); - encaissement.critique -= count; + ChatMessage.create({ content: `${this.name} vient de succomber à une seconde blessure critique ! Que les Dragons gardent son Archétype en paix !` }); + encaissement.critiques -= count; break; } } diff --git a/system.json b/system.json index 45f0f806..56881e3e 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.2.35", + "version": "1.2.36", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.8", From 41e63cd7e085f1951784592234e21399aef8df59 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sat, 23 Jan 2021 18:04:49 +0100 Subject: [PATCH 5/5] Gere recul pour creature --- module/rdd-combat.js | 14 +++++++++++--- system.json | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index fff177b3..95827deb 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -794,9 +794,17 @@ export class RdDCombat { if (this._isAttaqueCauseRecul(attackerRoll)) { let impactRecul = this._computeImpactRecul(attackerRoll); - const agilite = this.defender.isEntiteCauchemar() - ? this.defender.data.data.carac.reve.value - : this.defender.data.data.carac.agilite.value; + const agilite = 10; + if ( this.defender.data.data.carac.agilite ) { + agilite = this.defender.data.data.carac.agilite.value; + } else if ( this.defender.data.data.carac.force) { + agilite = this.defender.data.data.carac.force.value; + } else if ( this.defender.isEntiteCauchemar()) { + agilite = this.defender.data.data.carac.reve.value; + } else + ui.notifications.warn("Recul impossible pour cette créature/entité"); + return; + } let rollRecul = await RdDResolutionTable.rollData({ caracValue: 10, finalLevel: impactRecul, showDice: false }); diff --git a/system.json b/system.json index 56881e3e..8c2d166c 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.2.36", + "version": "1.2.37", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.8",