From 3a0186a15fd37037d48a40ba9d9af4a1fa959e28 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 4 Jun 2021 20:29:03 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20boissons=20exotiques&de=20mauvais=20go?= =?UTF-8?q?=C3=BBt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit La qualité et l'exotisme sont maintenant appliqués aux boissons --- module/actor.js | 2 +- module/rdd-utility.js | 1 + templates/dialog-item-consommer.html | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/module/actor.js b/module/actor.js index f6b367fd..60a1467a 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1940,7 +1940,7 @@ export class RdDActor extends Actor { const itemData = Misc.data(item); const exotisme = Math.min(itemData.data.exotisme, itemData.data.qualite, 0); if (exotisme < 0) { - const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `surmonte l'exotisme de ${itemData.name}` }); + const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${itemData.name}` }); if (rolled.isEchec) { if (!choix.seForcer) { return false; diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 88cd4ddd..98d21036 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -222,6 +222,7 @@ export class RdDUtility { Handlebars.registerHelper('caseTmr-label', coord => TMRUtility.getTMRLabel(coord)); Handlebars.registerHelper('caseTmr-type', coord => TMRUtility.getTMRType(coord)); Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord)); + Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1))); Handlebars.registerHelper('sortCompetence', competences => competences.sort((a, b) => { if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) { diff --git a/templates/dialog-item-consommer.html b/templates/dialog-item-consommer.html index 6fe38683..81ed53fe 100644 --- a/templates/dialog-item-consommer.html +++ b/templates/dialog-item-consommer.html @@ -24,9 +24,9 @@ {{/if}} {{/if}} - {{#if (lt item.data.exotisme 0)}} + {{#if (or (lt item.data.qualite 0) (lt item.data.exotisme 0))}}

- Pour surmonter l'exotisme, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat item.data.exotisme decimals=0 sign=true}}. + Pour surmonter {{#if (lt item.data.qualite 0)}}le mauvais goût{{else}}l'exotisme{{/if}}, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat (min item.data.exotisme item.data.qualite) decimals=0 sign=true}}.