RollV2, tchat et appel chance

gestion des appels à la chance pour tout jet V2

correction de soucis forçage du jet

continuation des messages de défense
This commit is contained in:
2025-09-27 23:48:17 +02:00
parent a7e14736e4
commit faca73b0a1
23 changed files with 240 additions and 153 deletions

View File

@@ -46,7 +46,7 @@ import { PAS_DE_DRACONIC, POSSESSION_SANS_DRACONIC } from "./item/base-items.js"
import { RdDRollResult } from "./rdd-roll-result.js";
import { RdDInitiative } from "./initiative.mjs";
import RollDialog from "./roll/roll-dialog.mjs";
import { OptionsAvancees, ROLL_DIALOG_V2 } from "./settings/options-avancees.js";
import { OptionsAvancees, ROLL_DIALOG_V2, ROLL_DIALOG_V2_TEST } from "./settings/options-avancees.js";
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
@@ -3049,7 +3049,7 @@ export class RdDActor extends RdDBaseActorSang {
/* -------------------------------------------- */
async _rollArtV2(oeuvreId, callbackAction = async (rd) => await this._resultArtV2(rd)) {
async _rollArtV2(oeuvreId) {
const oeuvre = this.items.get(oeuvreId)
const rollData = {
title: `Interpretation de ${oeuvre.name} par ${this.name}`,
@@ -3066,23 +3066,12 @@ export class RdDActor extends RdDBaseActorSang {
}
await RollDialog.create(rollData, {
onRollDone: (dialog) => {
this._onCloseRollDialog()
dialog.close()
},
customChatMessage: true,
callbacks: [callbackAction]
if (!OptionsAvancees.isUsing(ROLL_DIALOG_V2_TEST))
dialog.close()
}
})
}
// TODO: move vers ChatRollResult
async _resultArtV2(artData) {
const niveau = artData.oeuvre.system.niveau ?? 0
const baseQualite = (artData.rolled.isSuccess ? niveau : artData.competence.system.niveau)
artData.qualiteFinale = Math.min(baseQualite, niveau) + artData.rolled.ptQualite
//this.$onRollCompetence(artData)
await RdDRollResult.displayRollData(artData, this.name, `chat-resultat-${artData.art}.hbs`)
}
/* -------------------------------------------- */
async rollOeuvre(id) {
if (OptionsAvancees.isUsing(ROLL_DIALOG_V2)) {