forked from public/foundryvtt-reve-de-dragon
Amélioration des entités
- l'attaquant ne sait plus que c'est une entité de cauchemar (surprise!) - l'encaissement indique une blessure dans le tchat... même si ce n'est que de l'endurance - les blurettes suivent les règles des entités de cauchemar (p322)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ENTITE_BLURETTE, ENTITE_INCARNE, renderTemplate } from "./constants.js";
|
||||
import { ENTITE_NONINCARNE, RDD_CONFIG, renderTemplate } from "./constants.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
|
||||
/**
|
||||
@@ -16,34 +16,29 @@ export class RdDEncaisser extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, actor) {
|
||||
let dialogConf = {
|
||||
if (actor.isEntiteNonIncarnee([ENTITE_NONINCARNE])) {
|
||||
throw `${actor.name} est une entité non incarnée et ne peut pas subnir de dommages`
|
||||
}
|
||||
|
||||
const dialogConf = {
|
||||
title: "Jet d'Encaissement",
|
||||
content: html,
|
||||
}
|
||||
|
||||
if (!actor.isEntite()) {
|
||||
dialogConf.default = "mortel";
|
||||
dialogConf.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])) {
|
||||
dialogConf.default = "entiteincarnee"
|
||||
dialogConf.buttons = {
|
||||
"entiteincarnee": { label: "Entité incarnée", callback: html => this.performEncaisser("entiteincarnee") }
|
||||
default: RDD_CONFIG.encaissement.mortel,
|
||||
buttons: {
|
||||
[RDD_CONFIG.encaissement.mortel]: { label: "Mortel", callback: html => this.performEncaisser(RDD_CONFIG.encaissement.mortel) },
|
||||
}
|
||||
}
|
||||
|
||||
let dialogOptions = {
|
||||
classes: ["rdd-roll-dialog"],
|
||||
width: 320,
|
||||
height: 'fit-content'
|
||||
if (!actor.isEntite()) {
|
||||
dialogConf.buttons[RDD_CONFIG.encaissement.nonmortel] = { label: "Non-mortel", callback: html => this.performEncaisser(RDD_CONFIG.encaissement.nonmortel) }
|
||||
dialogConf.buttons["sonne"] = { label: "Sonné", callback: html => this.actor.setSonne() }
|
||||
}
|
||||
|
||||
// Select proper roll dialog template and stuff
|
||||
super(dialogConf, dialogOptions);
|
||||
super(dialogConf, {
|
||||
classes: ["rdd-roll-dialog"],
|
||||
width: 320,
|
||||
height: 'fit-content'
|
||||
});
|
||||
|
||||
this.actor = actor;
|
||||
this.modifier = 0;
|
||||
|
||||
Reference in New Issue
Block a user