v1.5 #3

Merged
VincentVk merged 12 commits from public/foundryvtt-reve-de-dragon:v1.5 into v1.5 2022-07-02 01:32:57 +02:00
2 changed files with 17 additions and 4 deletions
Showing only changes of commit 59ece09357 - Show all commits

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 = {