forked from public/foundryvtt-reve-de-dragon
Utiliser perception/reve pour les créatures
Ces caractéristiques remplacent toutes les autres
This commit is contained in:
@ -24,18 +24,16 @@ class TextRollCaracCompetence {
|
||||
}
|
||||
|
||||
static async onRollText(event, actor) {
|
||||
const caracCode = event.currentTarget.attributes['data-carac-code']?.value
|
||||
const caracCode = event.currentTarget.attributes['data-carac-code']?.value
|
||||
if (caracCode) {
|
||||
const competence = event.currentTarget.attributes['data-competence']?.value
|
||||
const diff = event.currentTarget.attributes['data-diff']?.value
|
||||
|
||||
const path = RdDCarac.caracDetails(caracCode)?.path
|
||||
const actors = TextRollCaracCompetence.getSelectedActors(actor)
|
||||
actors.filter(it => foundry.utils.getProperty(it, path) != undefined)
|
||||
.forEach(it => TextRollCaracCompetence.doRoll(it, caracCode, competence, diff))
|
||||
actors.forEach(it => TextRollCaracCompetence.doRoll(it, caracCode, competence, diff))
|
||||
}
|
||||
}
|
||||
static async doRoll(actor, caracCode, competence, diff) {
|
||||
caracCode = actor.mapCarac(caracCode)
|
||||
if (competence) {
|
||||
if (actor.type == ACTOR_TYPES.personnage) {
|
||||
actor.rollCaracCompetence(caracCode, competence, diff)
|
||||
|
Reference in New Issue
Block a user