From 78ca5b9ee1a1f5c39d6b9317914a7d71e877d6eb Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 13 Jan 2021 16:31:22 +0100 Subject: [PATCH 1/7] Fix proportions logo --- styles/simple.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/styles/simple.css b/styles/simple.css index 06cfc90d..6eb17d5c 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1341,7 +1341,7 @@ display: inline-flex; } #logo { - content : url("img/logo.png"); - width: 100px; - height: 48px; + content : url(img/logo.png); + width: 80px; + height: 68px; } \ No newline at end of file From 87412968d02c0bb76130665d94145e9981d36488 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 13 Jan 2021 16:32:25 +0100 Subject: [PATCH 2/7] Bloquage des status-effects "obligatoires" --- module/status-effects.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/module/status-effects.js b/module/status-effects.js index cf420867..b8e6f572 100644 --- a/module/status-effects.js +++ b/module/status-effects.js @@ -1,17 +1,17 @@ +const demiReveStatusEffect = { id: 'demi-reve', rdd: true, label: 'Demi-rêve', icon: 'systems/foundryvtt-reve-de-dragon/icons/heures/hd12.svg' }; const rddStatusEffects = [ { id: 'sonne', rdd: true, label: 'Sonné', icon: 'icons/svg/stoned.svg' }, + demiReveStatusEffect ]; -const demiReveStatusEffect = { id: 'demi-reve', rdd: true, label: 'Demi-rêve', icon: 'systems/foundryvtt-reve-de-dragon/icons/heures/hd12.svg' }; -const rddPrivateStatusEffects = [demiReveStatusEffect,]; -const statusDemiSurpriseCombat = new Set(['sonne', 'demi-reve', 'prone', 'restrain']); const statusDemiSurprise = new Set(['sonne', 'prone', 'restrain']); const statusSurpriseTotale = new Set(['unconscious', 'blind']); export class StatusEffects { static init() { - StatusEffects.setCoreStatusId(rddPrivateStatusEffects); + StatusEffects.setCoreStatusId([demiReveStatusEffect]); StatusEffects.setCoreStatusId(rddStatusEffects); + StatusEffects.setMandatoryRdd(); const defaultUseStatusEffect = CONFIG.statusEffects.map(it => it.id).join(); game.settings.register("foundryvtt-reve-de-dragon", "use-status-effects", { name: "use-status-effects", @@ -41,8 +41,7 @@ export class StatusEffects { if (statusSurpriseTotale.has(id)) { return 2; } - const status = (isCombat ? statusDemiSurpriseCombat : statusDemiSurprise); - return status.has(id) ? 1 : 0; + return statusDemiSurprise.has(id) || (isCombat && id == demiReveStatusEffect.id) ? 1 : 0; } static statusId(effectData) { @@ -55,6 +54,10 @@ export class StatusEffects { it["flags.core.statusId"] = it.id; }); } + static setMandatoryRdd() { + CONFIG.statusEffects.filter(it => statusDemiSurprise.has(it.id) || statusSurpriseTotale.has(it.id)) + .forEach(it => it.rdd = true); + } static _getUseStatusEffects() { const setting = game.settings.get("foundryvtt-reve-de-dragon", "use-status-effects"); @@ -89,7 +92,7 @@ class StatusEffectsSettings extends FormApplication { mergeObject(options, { id: "status-effects-settings", template: "systems/foundryvtt-reve-de-dragon/templates/status-effects-settings.html", - height: "auto", + height: "800", width: 350, minimizable: false, closeOnSubmit: true, From 55ee2ebad532da50f667f605f767ea1ce0f9e6d2 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 13 Jan 2021 16:34:24 +0100 Subject: [PATCH 3/7] Suppression doublon getEtatGeneral MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit compteurs toujours présent sur les acteurs => simplifications des accès --- module/actor.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/module/actor.js b/module/actor.js index f931bb56..06c8442b 100644 --- a/module/actor.js +++ b/module/actor.js @@ -201,8 +201,9 @@ export class RdDActor extends Actor { getProtectionNaturelle() { return Misc.toInt(this.data.data.attributs.protection.value); } + /* -------------------------------------------- */ getEtatGeneral() { - return this.data.data.compteurs.etat.value; + return this.data.data.compteurs.etat?.value ?? 0; } getMalusArmure() { return this.data.data.attributs?.malusarmure?.value ?? 0; @@ -211,7 +212,7 @@ export class RdDActor extends Actor { return Math.floor(this.encTotal ?? 0); } getSurenc() { - return this.data.data.compteurs?.surenc?.value ?? 0; + return this.data.data.compteurs.surenc?.value ?? 0; } /* -------------------------------------------- */ loadCompendiumNames() { @@ -869,11 +870,6 @@ export class RdDActor extends Actor { return resume; } - /* -------------------------------------------- */ - getEtatGeneral() { - return this.data.data.compteurs?.etat?.value ?? 0; - } - /* -------------------------------------------- */ computeEtatGeneral() { let data = this.data.data; @@ -889,7 +885,7 @@ export class RdDActor extends Actor { state += RdDUtility.currentFatigueMalus(data.sante.fatigue.value, data.sante.endurance.max); } // Ajout de l'éthylisme - state += Math.min(0, (data.compteurs?.ethylisme?.value ?? 0)); + state += Math.min(0, (data.compteurs.ethylisme?.value ?? 0)); data.compteurs.etat.value = state; if (data.compteurs && data.compteurs.surenc) { From d1a8c13b843977a07d32985f954f0138d0b15750 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 13 Jan 2021 17:30:44 +0100 Subject: [PATCH 4/7] =?UTF-8?q?Fix:=20etat=20g=C3=A9n=C3=A9ral=20sur=20Hau?= =?UTF-8?q?t=20r=C3=AAve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/rdd-carac.js | 4 ++-- module/rdd-roll.js | 2 +- module/rolldata-ajustements.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/rdd-carac.js b/module/rdd-carac.js index 921bbb6e..ae9cdf26 100644 --- a/module/rdd-carac.js +++ b/module/rdd-carac.js @@ -13,10 +13,10 @@ export class RdDCarac { return selectedCarac?.label?.toLowerCase()?.match(/r(e|ê)ve(( |-)actuel)?/); } - static isIgnoreEtatGeneral(selectedCarac) { + static isIgnoreEtatGeneral(selectedCarac, competence) { return !selectedCarac || RdDCarac.isChance(selectedCarac) || - RdDCarac.isReve(selectedCarac); + (RdDCarac.isReve(selectedCarac) && !competence); } /** diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 6b998e44..de2f3b05 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -210,7 +210,7 @@ export class RdDRoll extends Dialog { rollData.finalLevel = this._computeFinalLevel(rollData); HtmlUtility._showControlWhen($(".diffMoral"), rollData.ajustements.moralTotal.used); - HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac)); + HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac, rollData.competence)); HtmlUtility._showControlWhen($("#ajust-astrologique"), RdDResolutionTable.isAjustementAstrologique(rollData)); // Sort management diff --git a/module/rolldata-ajustements.js b/module/rolldata-ajustements.js index 5eff690d..1929f7ef 100644 --- a/module/rolldata-ajustements.js +++ b/module/rolldata-ajustements.js @@ -49,7 +49,7 @@ export const referenceAjustements = { getValue: (rollData, actor) => RdDBonus.find(rollData.surpriseDefenseur).attaque, }, etat: { - isUsed: (rollData, actor) => !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac), + isUsed: (rollData, actor) => !RdDCarac.isIgnoreEtatGeneral(rollData.selectedCarac, rollData.competence), getLabel: (rollData, actor) => 'Etat général', getValue: (rollData, actor) => actor.getEtatGeneral() }, From 36788b28d276628a7a5f168c57cc4a479931329e Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 13 Jan 2021 17:32:25 +0100 Subject: [PATCH 5/7] =?UTF-8?q?Fix:=20pas=20de=20surprise=20pour=20demi-r?= =?UTF-8?q?=C3=AAve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Un point d'exclamation inesthétique apparaîssait --- templates/actor-sheet.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 439a78c8..9fc22a73 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -76,11 +76,11 @@ {{data.compteurs.surenc.label}}: {{data.compteurs.surenc.value}}
+ {{#if data.surprise}}{{data.surprise}}! {{/if}} {{#if actor.effects}} - {{data.surprise}}! {{#each actor.effects as |effect key|}} - {{effect.label}} + {{effect.label}} {{/each}} {{#if data.isGM}} From 576be59d333927b92fdb5bedbba0c91dec303a42 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 13 Jan 2021 18:00:22 +0100 Subject: [PATCH 6/7] Remove hook (undeclared) --- module/actor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/module/actor.js b/module/actor.js index 06c8442b..a1d42ac5 100644 --- a/module/actor.js +++ b/module/actor.js @@ -31,7 +31,6 @@ export class RdDActor extends Actor { static init() { Hooks.on("deleteActiveEffect", (actor, effect, options) => actor.onDeleteActiveEffect(effect, options)); Hooks.on("createActiveEffect", (actor, effect, options) => actor.onCreateActiveEffect(effect, options)); - Hooks.on("updateToken", (scene, token, data, options) => { RdDActor.onUpdateToken(scene, token, data, options) }); } /* -------------------------------------------- */ From 9659c4a5bc6004d35e62f4a7dc26abcce5c84347 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 13 Jan 2021 18:01:39 +0100 Subject: [PATCH 7/7] Affichage des effets Suppression icone 'sonne' en doublon --- templates/actor-creature-sheet.html | 18 ++++++++++++++++-- templates/actor-sheet.html | 1 - 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html index e98568dd..12e5a346 100644 --- a/templates/actor-creature-sheet.html +++ b/templates/actor-creature-sheet.html @@ -17,7 +17,22 @@
{{data.blessures.resume}}
-
+
+ {{#if data.surprise}}{{data.surprise}}! {{/if}} + {{#if actor.effects}} + {{#each actor.effects as |effect key|}} + + {{effect.label}} + + {{/each}} + {{#if data.isGM}} + (enlever tout) + {{/if}} + {{else}} + Aucun effet actif + {{/if}} +
+ @@ -83,7 +98,6 @@ Sonné : -
  • Etat Général : diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 9fc22a73..01db205f 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -42,7 +42,6 @@