forked from public/foundryvtt-reve-de-dragon
Utiliser les fenêtres de jets pour les jets
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user