Nouvelle fenêtre de jets de dés

This commit is contained in:
2025-09-05 01:09:32 +02:00
parent 652c435833
commit 1ff32697f4
134 changed files with 4025 additions and 400 deletions

View File

@@ -0,0 +1,31 @@
import { ROLLDIALOG_SECTION, RollPart } from "./roll-part.mjs"
const PART_TRICHER = "tricher"
export class RollPartTricher extends RollPart {
get code() { return PART_TRICHER }
get section() { return ROLLDIALOG_SECTION.CONDITIONS }
visible(rollData) { return game.user.isGM }
prepareContext(rollData) {
const current = this.getCurrent(rollData)
if (current.resultat == undefined) {
current.resultat = -1
}
}
getAjustements(rollData) {
rollData.current.resultat = this.getCurrent(rollData).resultat
return []
}
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).resultat = parseInt(e.currentTarget.value)
})
}
}