forked from public/foundryvtt-reve-de-dragon
Corrections sur les ajustements
- le malus de sur-encombrement est correctement calculé (dans la zone d'état) - par défaut, le sur-encombrement est appliqué - le sur-encombrement est affiché sur les actions physiques - l'encombrement s'applique à agilité/dérobée, avec natation/acrobatie (par défaut) - le moral est géré dans le noeud 'use' du rollData - le moral est associé aux actions physiques
This commit is contained in:
@ -38,28 +38,27 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _setDefaultOptions(actor, rollData) {
|
||||
const actorData = actor.system
|
||||
let defaultRollData = {
|
||||
alias: actor.name,
|
||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||
difficultesLibres: CONFIG.RDD.difficultesLibres,
|
||||
etat: actor.getEtatGeneral(),
|
||||
moral: actor.getMoralTotal(), /* La valeur du moral pour les jets de volonté */
|
||||
carac: actorData.carac,
|
||||
carac: actor.system.carac,
|
||||
finalLevel: 0,
|
||||
diffConditions: 0,
|
||||
diffLibre: rollData.competence?.system.default_diffLibre ?? 0,
|
||||
malusArmureValue: actor.getMalusArmure(),
|
||||
surencMalusValue: actor.computeMalusSurEncombrement(),
|
||||
useMoral: false, /* Est-ce que le joueur demande d'utiliser le moral ? Utile si le joueur change plusieurs fois de carac associée. */
|
||||
perteMoralEchec: false, /* Pour l'affichage dans le chat */
|
||||
use: {
|
||||
moral: false, /* Est-ce que le joueur demande d'utiliser le moral ? Utile si le joueur change plusieurs fois de carac associée. */
|
||||
libre: true,
|
||||
conditions: true,
|
||||
surenc: false,
|
||||
encTotal: false
|
||||
surenc: actor.isSurenc(),
|
||||
encTotal: true
|
||||
},
|
||||
isMalusEncombrementTotal: rollData.competence ? RdDItemCompetence.isMalusEncombrementTotal(rollData.competence) : 0,
|
||||
isMalusEncombrementTotal: RdDItemCompetence.isMalusEncombrementTotal(rollData.competence),
|
||||
malusArmureValue: actor.getMalusArmure(),
|
||||
surencMalusValue: actor.computeMalusSurEncombrement(),
|
||||
encTotal: actor.getEncTotal(),
|
||||
ajustementAstrologique: actor.ajustementAstrologique(),
|
||||
surprise: actor.getSurprise(false),
|
||||
@ -68,8 +67,8 @@ export class RdDRoll extends Dialog {
|
||||
forceDiceResult: -1
|
||||
}
|
||||
// Mini patch :Ajout du rêve actuel
|
||||
if ( actorData.type == "personnage") {
|
||||
defaultRollData.carac["reve-actuel"] = actorData.reve.reve
|
||||
if ( actor.system.type == "personnage") {
|
||||
defaultRollData.carac["reve-actuel"] = actor.system.reve.reve
|
||||
}
|
||||
|
||||
mergeObject(rollData, defaultRollData, { recursive: true, overwrite: false });
|
||||
@ -260,10 +259,10 @@ export class RdDRoll extends Dialog {
|
||||
this.updateRollResult();
|
||||
});
|
||||
html.find('.appel-moral').click((event) => { /* l'appel au moral, qui donne un bonus de +1 */
|
||||
this.rollData.useMoral = !this.rollData.useMoral;
|
||||
this.rollData.use.moral = !this.rollData.use.moral;
|
||||
const appelMoral = html.find('.icon-appel-moral')[0];
|
||||
const tooltip = html.find('.tooltipAppelAuMoralText')[0];
|
||||
if (this.rollData.useMoral) {
|
||||
if (this.rollData.use.moral) {
|
||||
if (this.rollData.moral > 0) {
|
||||
tooltip.innerHTML = "Appel au moral";
|
||||
appelMoral.src = "/systems/foundryvtt-reve-de-dragon/icons/moral-heureux.svg";
|
||||
@ -334,8 +333,9 @@ export class RdDRoll extends Dialog {
|
||||
RollDataAjustements.calcul(rollData, this.actor);
|
||||
rollData.finalLevel = this._computeFinalLevel(rollData);
|
||||
|
||||
HtmlUtility._showControlWhen($(".use-encTotal"), rollData.ajustements.encTotal.visible);
|
||||
HtmlUtility._showControlWhen($(".use-surenc"), rollData.ajustements.surenc.visible);
|
||||
HtmlUtility._showControlWhen($(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerivee(rollData.selectedCarac));
|
||||
HtmlUtility._showControlWhen($(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac));
|
||||
HtmlUtility._showControlWhen($(".utilisation-moral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility._showControlWhen($(".diffMoral"), rollData.ajustements.moralTotal.used);
|
||||
HtmlUtility._showControlWhen($(".divAppelAuMoral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility._showControlWhen($("#etat-general"), !RdDCarac.isIgnoreEtatGeneral(rollData));
|
||||
|
Reference in New Issue
Block a user