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

@@ -1,5 +1,6 @@
import { DIFF, DIFFS, ROLL_TYPE_MEDITATION, ROLL_TYPE_OEUVRE, ROLL_TYPE_SORT, ROLL_TYPE_TACHE } from "./roll-constants.mjs";
import { ROLLDIALOG_SECTION, RollPart } from "./roll-part.mjs";
import { Misc } from "../misc.js";
export const PART_DIFF = "diff"
@@ -41,8 +42,8 @@ export class RollPartDiff extends RollPart {
{
type: diffType.key,
label: diffType?.label ?? '',
value: current.value ?? 0,
disabled: !diffType.libre,
value: Misc.inRange(current.value ?? 0, -10, diffType.max),
min: -10,
max: diffType.max
},
@@ -67,11 +68,12 @@ export class RollPartDiff extends RollPart {
async _onRender(rollDialog, context, options) {
const input = rollDialog.element.querySelector(`roll-section[name="${this.code}"] input[name="${this.code}"]`)
input?.addEventListener("change", e => {
this.getCurrent(rollDialog.rollData).value = parseInt(e.currentTarget.value)
rollDialog.render()
})
input?.addEventListener("input", e => this.onInputChange(e, rollDialog))
}
onInputChange(event, rollDialog) {
this.getCurrent(rollDialog.rollData).value = parseInt(event.currentTarget.value)
rollDialog.render()
}
}