diff --git a/module/actor.js b/module/actor.js index 99b61dd3..1259a94e 100644 --- a/module/actor.js +++ b/module/actor.js @@ -3070,6 +3070,18 @@ export class RdDActor extends RdDBaseActor { this.currentTMR.render(true); } + /* -------------------------------------------- */ + getArmeCompetence(arme) { + let comp = arme.system.competence + if (!comp || comp.name == "") { + comp = arme.system.lancer + } + if ( !comp || comp.name == "") { + comp = arme.system.tir + } + return comp + } + /* -------------------------------------------- */ rollArme(arme) { if (!Targets.hasTargets()) { @@ -3081,19 +3093,20 @@ export class RdDActor extends RdDBaseActor { title: 'Ne pas utiliser les automatisation de combat', buttonLabel: "Pas d'automatisation", onAction: async () => { - this.rollCompetence(arme.system.competence, { tryTarget: false }) + this.rollCompetence(this.getArmeCompetence(arme), { tryTarget: false }) } }); return; } + Targets.selectOneToken(target => { if (Targets.isTargetEntite(target)) { ui.notifications.warn(`Vous ne pouvez pas attaquer une entité non incarnée avec votre ${arme.name}!!!!`); return; } - - const competence = this.getCompetence(arme.system.competence) + const competence = this.getCompetence(this.getArmeCompetence(arme)) + console.log("RollArme", competence, arme) if (competence.isCompetencePossession()) { return RdDPossession.onAttaquePossession(target, this, competence); } diff --git a/system.json b/system.json index d47a2ce3..0a615b86 100644 --- a/system.json +++ b/system.json @@ -1,8 +1,8 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", - "version": "11.0.17", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.0.17.zip", + "version": "11.0.18", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.0.18.zip", "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json", "changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md", "compatibility": {