Utiliser les fenêtres de jets pour les jets

This commit is contained in:
2025-01-11 19:29:29 +01:00
parent 551438f514
commit 1b75decb18
4 changed files with 23 additions and 7 deletions

View File

@ -32,12 +32,26 @@ class TextRollCaracCompetence {
const path = RdDCarac.caracDetails(caracCode)?.path
const actors = TextRollCaracCompetence.getSelectedActors(actor)
actors.filter(it => foundry.utils.getProperty(it, path) != undefined)
.forEach(it => it.doRollCaracCompetence(caracCode, competence, diff))
.forEach(it => TextRollCaracCompetence.doRoll(it, caracCode, competence, diff))
}
}
static async doRoll(actor, caracCode, competence, diff) {
if (competence) {
if (actor.type == ACTOR_TYPES.personnage) {
actor.rollCaracCompetence(caracCode, competence, diff)
}
else {
actor.doRollCaracCompetence(caracCode, competence, diff)
}
}
else {
actor.rollCarac(caracCode, { diff })
}
}
static getSelectedActors(actor) {
const selected = canvas.tokens.controlled.map(it => it.actor).filter(it => it)
if (selected.length > 0){
if (selected.length > 0) {
return selected
}
actor = actor ?? RdDUtility.getSelectedActor()