Possibilité d'accorder un personnage
Le drag&drop d'un acteur depuis la liste des acteurs sur la fiche d'une entité incarnée permet d'accorder le personnage
This commit is contained in:
@ -67,7 +67,7 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
if (this.isNonIncarnee()) {
|
||||
return
|
||||
}
|
||||
await RdDEncaisser.encaisser(this)
|
||||
await RdDEncaisser.encaisser(this)
|
||||
}
|
||||
|
||||
isEffectAllowed(effectId) {
|
||||
@ -91,20 +91,16 @@ export class RdDEntite extends RdDBaseActorReve {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setEntiteReveAccordee(attacker) {
|
||||
async setEntiteReveAccordee(actor) {
|
||||
if (this.isEntite([ENTITE_INCARNE])) {
|
||||
let resonnance = foundry.utils.duplicate(this.system.sante.resonnance);
|
||||
if (resonnance.actors.find(it => it == attacker.id)) {
|
||||
if (this.system.sante.resonnance.actors.find(it => it == actor.id)) {
|
||||
// déjà accordé
|
||||
return;
|
||||
return
|
||||
}
|
||||
resonnance.actors.push(attacker.id);
|
||||
await this.update({ "system.sante.resonnance": resonnance });
|
||||
await this.update({ "system.sante.resonnance.actors": [...this.system.sante.resonnance.actors, actor.id] })
|
||||
}
|
||||
else {
|
||||
super.setEntiteReveAccordee(attacker)
|
||||
super.setEntiteReveAccordee(actor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user