Jets de compétence avec carac imposée

Fonctionne maintenant correctement

Pour les créatures/entitées: on fait au mieux, mais ça ne correspond
pas forcément bien, car les carac/compétences ne correspondent
pas toujours
This commit is contained in:
2025-01-13 21:44:02 +01:00
parent de9d3bbb48
commit c733644f3a
6 changed files with 37 additions and 36 deletions

View File

@ -8,6 +8,7 @@ import { RdDCarac } from "./rdd-carac.js";
import { RdDResolutionTable } from "./rdd-resolution-table.js";
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
import { Grammar } from "./grammar.js";
import { ACTOR_TYPES } from "./item.js";
/**
* Extend the base Dialog entity to select roll parameters
@ -62,7 +63,7 @@ export class RdDRoll extends Dialog {
forceDiceResult: -1
}
// Mini patch :Ajout du rêve actuel
if (actor.system.type == "personnage") {
if (actor.type == ACTOR_TYPES.personnage) {
defaultRollData.carac["reve-actuel"] = actor.system.reve.reve
}
@ -131,11 +132,12 @@ export class RdDRoll extends Dialog {
console.log('RdDRoll.activateListeners', this.rollData);
// Update html, according to rollData
if (this.rollData.competence) {
const defaut_carac = this.rollData.competence.system.defaut_carac
if (!this.rollData.selectedCarac && this.rollData.competence) {
// Set the default carac from the competence item
this.rollData.selectedCarac = this.rollData.carac[defaut_carac];
this.html.find("[name='carac']").val(defaut_carac);
this.rollData.selectedCarac = this.rollData.carac[this.actor.mapCarac(this.rollData.competence.system.defaut_carac)]
}
if (this.rollData.selectedCarac) {
this.html.find("[name='carac']").val(RdDCarac.caracDetails(this.rollData.selectedCarac.label).code)
}
if (this.rollData.selectedSort) {
this.setSelectedSort(this.rollData.selectedSort);