Support des blurettes

On peut définir Blurette comme type d'entité.
Pas de jet poour s'accorder aux blurettes.
This commit is contained in:
Vincent Vandemeulebrouck
2022-07-22 21:38:15 +02:00
parent 3958b1bdc2
commit 9e63706de6
5 changed files with 47 additions and 31 deletions

View File

@ -1,3 +1,5 @@
import { ENTITE_BLURETTE, ENTITE_INCARNE, ENTITE_NONINCARNE } from "./constants";
/**
* Extend the base Dialog entity by defining a custom window to perform roll.
* @extends {Dialog}
@ -7,15 +9,19 @@ export class RdDEncaisser extends Dialog {
/* -------------------------------------------- */
constructor(html, actor) {
// Common conf
const buttonsCreatures = {
"mortel": { label: "Mortel", callback: html => this.performEncaisser("mortel") },
"non-mortel": { label: "Non-mortel", callback: html => this.performEncaisser("non-mortel") },
"sonne": { label: "Sonné", callback: html => this.actor.setSonne() },
};
const buttonsEntitesCauchemar = {
"cauchemar": { label: "cauchemar", callback: html => this.performEncaisser("cauchemar") }
};
const buttons = actor.isEntiteCauchemar() ? buttonsEntitesCauchemar : buttonsCreatures;
let buttons = {};
if (!actor.isEntite()){
buttons = {
"mortel": { label: "Mortel", callback: html => this.performEncaisser("mortel") },
"non-mortel": { label: "Non-mortel", callback: html => this.performEncaisser("non-mortel") },
"sonne": { label: "Sonné", callback: html => this.actor.setSonne() },
};
}
else if (actor.isEntite([ENTITE_BLURETTE, ENTITE_INCARNE])){
buttons = {
"cauchemar": { label: "cauchemar", callback: html => this.performEncaisser("cauchemar") }
}
}
let dialogConf = {
title: "Jet d'Encaissement",