Gestion des armes dans hotbar
This commit is contained in:
parent
724c556b9e
commit
76a02d60ca
@ -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);
|
||||
}
|
||||
|
@ -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": {
|
||||
|
Loading…
Reference in New Issue
Block a user