Possession pour non haut-rêvant

This commit is contained in:
Vincent Vandemeulebrouck 2022-06-25 18:59:20 +02:00
parent 5868bf16e0
commit 59ece09357
2 changed files with 17 additions and 4 deletions

View File

@ -2568,7 +2568,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
conjurerPossession(possession) { conjurerPossession(possession) {
let draconic = this.getBestDraconic() let draconic = this.getBestDraconic();
RdDPossession.managePossession(this, draconic, possession) RdDPossession.managePossession(this, draconic, possession)
} }

View File

@ -139,18 +139,18 @@ export class RdDPossession {
return; return;
} }
const defender = target.actor const defender = target.actor;
if ( !possession) { if ( !possession) {
possession = this.searchPossessionFromEntite( attacker, defender) possession = this.searchPossessionFromEntite( attacker, defender)
if ( !possession) { if ( !possession) {
possession = await this.createPossession(attacker, defender) possession = await this.createPossession(attacker, defender)
} }
} }
possession = duplicate(possession) possession = duplicate(possession);
this.updateEtatPossession(possession) this.updateEtatPossession(possession)
let rollData = { let rollData = {
competence: competence, competence: competence.data.data.niveau >=0 ? competence : RdDPossession.competenceNonHautRevant(),
possession: possession, possession: possession,
possede: defender.name, possede: defender.name,
possesseur: attacker.name, possesseur: attacker.name,
@ -177,6 +177,19 @@ export class RdDPossession {
dialog.render(true) dialog.render(true)
} }
static competenceNonHautRevant() {
return {
img: 'systems/foundryvtt-reve-de-dragon/icons/competence_vigilance.webp',
name: 'non Haut-rêvant',
data: {
data: {
niveau: 0,
defaut_carac: "reve",
}
}
};
}
/* -------------------------------------------- */ /* -------------------------------------------- */
static async createPossession( attacker, defender ) { static async createPossession( attacker, defender ) {
let possessionData = { let possessionData = {