diff --git a/module/actor.js b/module/actor.js index 124782d6..5135f6e2 100644 --- a/module/actor.js +++ b/module/actor.js @@ -2494,7 +2494,7 @@ export class RdDActor extends Actor { } console.log("rollCompetence !!!", rollData); - const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html' }, { + const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { name: 'jet-competence', label: 'Jet ' + Grammar.apostrophe('de', name), callbacks: [ @@ -2556,7 +2556,7 @@ export class RdDActor extends Actor { console.log("rollTache !!!", rollData); - const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html' }, { + const dialog = await RdDRoll.create(this, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { name: 'jet-competence', label: 'Jet de Tâche ' + tacheData.name, callbacks: [ @@ -2574,6 +2574,7 @@ export class RdDActor extends Actor { rollData.appliquerFatigue = ReglesOptionelles.isUsing("appliquer-fatigue"); rollData.tache = duplicate(rollData.tache); rollData.tache.data.points_de_tache_courant += rollData.rolled.ptTache; + rollData.tache.data.tentatives++; if (rollData.rolled.isETotal) { rollData.tache.data.difficulte--; } @@ -3622,10 +3623,7 @@ export class RdDActor extends Actor { return; } if (!Misc.isElectedUser()) { - RdDActor.remoteActorCall({ - actorId: achat.vendeurId ?? achat.acheteurId, - method: 'achatVente', args: [achat] - }); + RdDActor.remoteActorCall({actorId: achat.vendeurId ?? achat.acheteurId, method: 'achatVente', args: [achat]}); return; } @@ -3683,6 +3681,7 @@ export class RdDActor extends Actor { const chatAchatItem = duplicate(vente); chatAchatItem.quantiteTotal = achat.quantiteTotal; ChatMessage.create({ + user: achat.userId, speaker: {alias: (acheteur ?? vendeur).name} , whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name), content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', chatAchatItem) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index fb02808c..c0c361cf 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -747,7 +747,7 @@ export class RdDCombat { const dialog = await RdDRoll.create(this.attacker, rollData, { - html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html', + html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html', options: { height: 540 } }, { name: 'jet-attaque', @@ -1000,7 +1000,7 @@ export class RdDCombat { const dialog = await RdDRoll.create(this.defender, rollData, { - html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html', + html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html', options: { height: 540 } }, { name: 'jet-parade', @@ -1088,7 +1088,7 @@ export class RdDCombat { let rollData = this._prepareEsquive(attackerRoll, esquive); const dialog = await RdDRoll.create(this.defender, rollData, - { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html' }, { + { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html' }, { name: 'jet-esquive', label: 'Esquiver', callbacks: [ diff --git a/module/rdd-main.js b/module/rdd-main.js index 60bc9f45..110090d3 100644 --- a/module/rdd-main.js +++ b/module/rdd-main.js @@ -148,7 +148,7 @@ Hooks.once("init", async function () { game.socket.on("system.foundryvtt-reve-de-dragon", sockmsg => { console.log(">>>>> MSG RECV", sockmsg); - RdDUtility.onSocketMesssage(sockmsg); + RdDUtility.onSocketMessage(sockmsg); RdDCombat.onSocketMessage(sockmsg); ChatUtility.onSocketMessage(sockmsg); RdDActor.onSocketMessage(sockmsg); diff --git a/module/rdd-resolution-table.js b/module/rdd-resolution-table.js index 269043bb..52d0bd6a 100644 --- a/module/rdd-resolution-table.js +++ b/module/rdd-resolution-table.js @@ -7,40 +7,14 @@ import { ReglesOptionelles } from "./regles-optionelles.js"; * difficultés au delà de -10 */ const levelDown = [ - { level: -11, score: 1, sign: 0, part: 0, epart: 2, etotal: 90 }, - { level: -12, score: 1, sign: 0, part: 0, epart: 2, etotal: 70 }, - { level: -13, score: 1, sign: 0, part: 0, epart: 2, etotal: 50 }, - { level: -14, score: 1, sign: 0, part: 0, epart: 2, etotal: 30 }, - { level: -15, score: 1, sign: 0, part: 0, epart: 2, etotal: 10 }, - { level: -16, score: 1, sign: 0, part: 0, epart: 0, etotal: 2 } -]; -const levelImpossible = { score: 0, sign: 0, part: 0, epart: 0, etotal: 1 }; -/** - * Table des résultats spéciaux - inutilisée, conservée si on veut afficher la table - */ -const specialResults = [ - { part: 0, epart: 0, etotal: 0, min: 0, max: 0 }, - { part: 1, epart: 81, etotal: 92, min: 1, max: 5 }, - { part: 2, epart: 82, etotal: 92, min: 6, max: 10 }, - { part: 3, epart: 83, etotal: 93, min: 11, max: 15 }, - { part: 4, epart: 84, etotal: 93, min: 16, max: 20 }, - { part: 5, epart: 85, etotal: 94, min: 21, max: 25 }, - { part: 6, epart: 86, etotal: 94, min: 26, max: 30 }, - { part: 7, epart: 87, etotal: 95, min: 31, max: 35 }, - { part: 8, epart: 88, etotal: 95, min: 36, max: 40 }, - { part: 9, epart: 89, etotal: 96, min: 41, max: 45 }, - { part: 10, epart: 90, etotal: 96, min: 46, max: 50 }, - { part: 11, epart: 91, etotal: 97, min: 51, max: 55 }, - { part: 12, epart: 92, etotal: 97, min: 56, max: 60 }, - { part: 13, epart: 93, etotal: 98, min: 61, max: 65 }, - { part: 14, epart: 94, etotal: 98, min: 65, max: 70 }, - { part: 15, epart: 95, etotal: 99, min: 71, max: 75 }, - { part: 16, epart: 96, etotal: 99, min: 76, max: 80 }, - { part: 17, epart: 97, etotal: 100, min: 81, max: 85 }, - { part: 18, epart: 98, etotal: 100, min: 86, max: 90 }, - { part: 19, epart: 99, etotal: 100, min: 81, max: 95 }, - { part: 20, epart: 100, etotal: 100, min: 96, max: 100 } + { level: -11, score: 1, norm: 1, sign: 0, part: 0, epart: 2, etotal: 90 }, + { level: -12, score: 1, norm: 1, sign: 0, part: 0, epart: 2, etotal: 70 }, + { level: -13, score: 1, norm: 1, sign: 0, part: 0, epart: 2, etotal: 50 }, + { level: -14, score: 1, norm: 1, sign: 0, part: 0, epart: 2, etotal: 30 }, + { level: -15, score: 1, norm: 1, sign: 0, part: 0, epart: 2, etotal: 10 }, + { level: -16, score: 1, norm: 1, sign: 0, part: 0, epart: 0, etotal: 2 } ]; +const levelImpossible = { score: 0, norm:0, sign: 0, part: 0, epart: 0, etotal: 1 }; const reussites = [ { code: "etotal", isPart: false, isSign: false, isSuccess: false, isEchec: true, isEPart: true, isETotal: true, ptTache: -4, ptQualite: -6, quality: "Echec total", condition: (target, roll) => roll >= target.etotal && roll <= 100 }, @@ -110,7 +84,7 @@ export class RdDResolutionTable { /* -------------------------------------------- */ static async roll(caracValue, finalLevel, rollData = {}){ let chances = this.computeChances(caracValue, finalLevel); - this._updateChancesWithBonus(chances, rollData.bonus); + this._updateChancesWithBonus(chances, rollData.bonus, finalLevel); this._updateChancesFactor(chances, rollData.diviseurSignificative); chances.showDice = rollData.showDice; chances.rollMode = rollData.rollMode; @@ -147,8 +121,8 @@ export class RdDResolutionTable { } /* -------------------------------------------- */ - static _updateChancesWithBonus(chances, bonus) { - if (bonus) { + static _updateChancesWithBonus(chances, bonus, finalLevel) { + if (bonus && finalLevel>-11) { let newScore = Number(chances.score) + bonus; mergeObject(chances, this._computeCell(null, newScore), { overwrite: true }); } diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 89ec1f16..4322b752 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -164,7 +164,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/casetmr-specific-list.html', // Dialogs 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-resolution.html', - 'systems/foundryvtt-reve-de-dragon/templates/dialog-competence.html', + 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html', 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-carac.html', 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html', 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', @@ -177,10 +177,12 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/partial-description-sort.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-ajustements.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html', + 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html', + 'systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html', 'systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html', // Calendrier @@ -622,7 +624,7 @@ export class RdDUtility { } /* -------------------------------------------- */ - static onSocketMesssage(sockmsg) { + static onSocketMessage(sockmsg) { switch (sockmsg.msg) { case "msg_gm_chat_message": return ChatUtility.handleGMChatMessage(sockmsg.data); diff --git a/templates/chat-resultat-tache.html b/templates/chat-resultat-tache.html index e6f2c81b..248d89f9 100644 --- a/templates/chat-resultat-tache.html +++ b/templates/chat-resultat-tache.html @@ -6,8 +6,11 @@ {{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
- Après {{tache.data.periodicite}} {{alias}} a obtenu {{rolled.ptTache}} point{{~#if (gt rolled.ptTache 1)}}s{{/if}} de tâche, - son avancement est de {{tache.data.points_de_tache_courant}} sur {{tache.data.points_de_tache}} point{{~#if (gt tache.data.points_de_tache_courant 1)}}s{{/if}} de tâche. + {{alias}} a obtenu {{rolled.ptTache}} point{{~#unless (eq rolled.ptTache 1)}}s{{/unless}} de tâche, + son avancement est de + {{tache.data.points_de_tache_courant}} sur {{tache.data.points_de_tache}} + point{{~#unless (eq tache.data.points_de_tache_courant 1)}}s{{/unless}} de tâche + ({{~#unless (eq tache.data.tentatives 1)}}{{tache.data.tentatives}} tentatives{{else}}première tentative{{/unless~}}). {{#if (and tache.data.fatigue appliquerFatigue)}}
Il s'est fatigué de {{tache.data.fatigue}} case{{~#if (gt tache.data.fatigue 1)}}s{{/if}}.{{/if}} {{#if rolled.isETotal}}
Son échec total augmente de 1 la difficulté de la tâche!{{/if~}} {{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}} diff --git a/templates/chat-vente-item.html b/templates/chat-vente-item.html index 4341b07a..ce9f87f1 100644 --- a/templates/chat-vente-item.html +++ b/templates/chat-vente-item.html @@ -22,15 +22,16 @@ {{prixLot}} Sols
{{/if}}

- + {{#if (or (gt quantiteNbLots 0) quantiteIllimite)}} - - {{#if (eq prixLot 0)}}Prendre{{else}}Acheter{{/if}} + + {{#if (eq prixLot 0)}}Prendre{{else}}Acheter{{/if}} + {{/if}}
diff --git a/templates/dialog-roll-alchimie.html b/templates/dialog-roll-alchimie.html index d6001a79..5e6f8133 100644 --- a/templates/dialog-roll-alchimie.html +++ b/templates/dialog-roll-alchimie.html @@ -10,10 +10,7 @@
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} {{#if alchimie.sansCristal}}
@@ -21,6 +18,7 @@
{{/if}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-roll-carac.html b/templates/dialog-roll-carac.html index 8d510bba..89c454ab 100644 --- a/templates/dialog-roll-carac.html +++ b/templates/dialog-roll-carac.html @@ -10,6 +10,7 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-roll-chant.html b/templates/dialog-roll-chant.html index df2482cb..8f72f568 100644 --- a/templates/dialog-roll-chant.html +++ b/templates/dialog-roll-chant.html @@ -11,11 +11,9 @@ {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-competence.html b/templates/dialog-roll-competence.html similarity index 88% rename from templates/dialog-competence.html rename to templates/dialog-roll-competence.html index f298cf8a..86d26d22 100644 --- a/templates/dialog-competence.html +++ b/templates/dialog-roll-competence.html @@ -60,25 +60,16 @@ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-surenc.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-enctotal.html"}} - - {{#if isGM}} -
- -
- {{/if}} -
{{#if attackerRoll}} -
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{else}} - {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}} {{/if}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-roll-danse.html b/templates/dialog-roll-danse.html index d9507232..65d3376e 100644 --- a/templates/dialog-roll-danse.html +++ b/templates/dialog-roll-danse.html @@ -11,12 +11,11 @@ {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}} +
diff --git a/templates/dialog-roll-jeu.html b/templates/dialog-roll-jeu.html index 1318700d..049a1512 100644 --- a/templates/dialog-roll-jeu.html +++ b/templates/dialog-roll-jeu.html @@ -14,6 +14,7 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffLibre.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-roll-maitrise-tmr.html b/templates/dialog-roll-maitrise-tmr.html index feef2c21..7408b24d 100644 --- a/templates/dialog-roll-maitrise-tmr.html +++ b/templates/dialog-roll-maitrise-tmr.html @@ -9,11 +9,9 @@
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}}
diff --git a/templates/dialog-roll-meditation.html b/templates/dialog-roll-meditation.html index 918e0315..718ae819 100644 --- a/templates/dialog-roll-meditation.html +++ b/templates/dialog-roll-meditation.html @@ -36,6 +36,7 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}}
diff --git a/templates/dialog-roll-musique.html b/templates/dialog-roll-musique.html index 6455e3d1..b93161f1 100644 --- a/templates/dialog-roll-musique.html +++ b/templates/dialog-roll-musique.html @@ -11,11 +11,9 @@ {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-roll-oeuvre.html b/templates/dialog-roll-oeuvre.html index 45d23f49..1a0c26db 100644 --- a/templates/dialog-roll-oeuvre.html +++ b/templates/dialog-roll-oeuvre.html @@ -12,11 +12,9 @@ {{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-roll-recettecuisine.html b/templates/dialog-roll-recettecuisine.html index ab977783..394ff935 100644 --- a/templates/dialog-roll-recettecuisine.html +++ b/templates/dialog-roll-recettecuisine.html @@ -25,11 +25,9 @@
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-moral.html"}}
diff --git a/templates/dialog-roll-reve-de-dragon.html b/templates/dialog-roll-reve-de-dragon.html index 4f7857a3..5e93afda 100644 --- a/templates/dialog-roll-reve-de-dragon.html +++ b/templates/dialog-roll-reve-de-dragon.html @@ -9,11 +9,9 @@
-
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}}
diff --git a/templates/dialog-roll-signedraconique.html b/templates/dialog-roll-signedraconique.html index b9de46d9..c790fe6b 100644 --- a/templates/dialog-roll-signedraconique.html +++ b/templates/dialog-roll-signedraconique.html @@ -31,11 +31,9 @@ {{/select}} -
- - -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}}
diff --git a/templates/dialog-roll-sort.html b/templates/dialog-roll-sort.html index e5e75302..920b4bf7 100644 --- a/templates/dialog-roll-sort.html +++ b/templates/dialog-roll-sort.html @@ -48,7 +48,7 @@
- +
+
diff --git a/templates/partial-roll-diffFixe.html b/templates/partial-roll-diffFixe.html new file mode 100644 index 00000000..25edb580 --- /dev/null +++ b/templates/partial-roll-diffFixe.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/templates/partial-roll-diffLibre.html b/templates/partial-roll-diffLibre.html index 544a7bb5..a20fb4b3 100644 --- a/templates/partial-roll-diffLibre.html +++ b/templates/partial-roll-diffLibre.html @@ -1,5 +1,5 @@
- + +
+{{/if}}