Simplifications en cherchant bug rêve actuel
Parfois, le rêve actuel est ajouté dans les caractéristiques des feuilles de personnage. Simplifications pour essayer d'isoler le souci.
This commit is contained in:
@@ -16,6 +16,7 @@ import { RdDDice } from "./rdd-dice.js";
|
||||
import { RdDRencontre } from "./item/rencontre.js";
|
||||
import { ITEM_TYPES } from "./constants.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { CARACS } from "./rdd-carac.js";
|
||||
|
||||
const TMR_DISPLAY_SIZE = {
|
||||
code: 'tmr-display-size',
|
||||
@@ -125,7 +126,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
HtmlUtility.showControlWhen(this.html.find(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(this._getCoordActor()));
|
||||
|
||||
this.html.find('form.tmr-dialog *').click(event => {
|
||||
if (this.subdialog?.rendered){
|
||||
if (this.subdialog?.rendered) {
|
||||
this.subdialog?.bringToFront()
|
||||
}
|
||||
})
|
||||
@@ -685,12 +686,12 @@ export class RdDTMRDialog extends Dialog {
|
||||
tmr: tmr,
|
||||
canClose: false,
|
||||
diffLibre: -7,
|
||||
forceCarac: { 'reve-actuel': { label: "Rêve Actuel", value: this.actor.getReveActuel() } },
|
||||
forceCarac: this.actor.getCaracReveActuel(),
|
||||
maitrise: { verbe: 'maîtriser', action: 'Maîtriser le fleuve' }
|
||||
}
|
||||
rollData.double = EffetsDraconiques.isDoubleResistanceFleuve(this.actor) ? true : undefined,
|
||||
rollData.competence.system.defaut_carac = 'reve-actuel';
|
||||
await this._rollMaitriseCaseHumide(rollData);
|
||||
rollData.double = EffetsDraconiques.isDoubleResistanceFleuve(this.actor) ? true : undefined
|
||||
rollData.competence.system.defaut_carac = CARACS.REVE_ACTUEL
|
||||
await this._rollMaitriseCaseHumide(rollData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,30 +811,30 @@ export class RdDTMRDialog extends Dialog {
|
||||
tmr: tmr,
|
||||
canClose: options.canClose ?? false,
|
||||
diffLibre: options.difficulte ?? -7,
|
||||
forceCarac: { 'reve-actuel': { label: "Rêve Actuel", value: this.actor.getReveActuel() } },
|
||||
forceCarac: this.actor.getCaracReveActuel(),
|
||||
maitrise: { verbe: 'conquérir', action: options.action }
|
||||
};
|
||||
rollData.competence.system.defaut_carac = 'reve-actuel';
|
||||
}
|
||||
rollData.competence.system.defaut_carac = CARACS.REVE_ACTUEL
|
||||
|
||||
await this._maitriserTMR(rollData, r => this._onResultatConquerir(r, options));
|
||||
await this._maitriserTMR(rollData, r => this._onResultatConquerir(r, options))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onResultatConquerir(rollData, options) {
|
||||
if (rollData.rolled.isETotal) {
|
||||
rollData.souffle = await this.actor.ajouterSouffle({ chat: false });
|
||||
rollData.souffle = await this.actor.ajouterSouffle({ chat: false })
|
||||
}
|
||||
rollData.poesie = await Poetique.getExtrait();
|
||||
rollData.poesie = await Poetique.getExtrait()
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getOwners(this.actor),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.hbs`, rollData)
|
||||
});
|
||||
})
|
||||
if (rollData.rolled.isEchec) {
|
||||
options.onConqueteEchec(rollData, options.effetDraconique);
|
||||
options.onConqueteEchec(rollData, options.effetDraconique)
|
||||
}
|
||||
else {
|
||||
await options.onConqueteReussie(rollData, options.effetDraconique);
|
||||
this.updateTokens();
|
||||
await options.onConqueteReussie(rollData, options.effetDraconique)
|
||||
this.updateTokens()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -967,7 +968,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
const targetOddq = this.pixiTMR.computeEventOddq(event)
|
||||
const targetCoord = TMRUtility.oddqToCoordTMR(targetOddq)
|
||||
|
||||
if (targetCoord == COORD_TMR_INCONNU){
|
||||
if (targetCoord == COORD_TMR_INCONNU) {
|
||||
ui.notifications.error("Vous ne pouvez pas vous déplacer ici");
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user