Dialog chateau-dormant

Pour permettre de pré-remplir les infos de chateau dormant
This commit is contained in:
2023-02-07 18:06:45 +01:00
parent 07d0d92f57
commit c70b6c9d5f
17 changed files with 467 additions and 167 deletions

View File

@ -2,7 +2,8 @@
import { DialogChronologie } from "./dialog-chronologie.js";
import { DialogCreateSigneDraconique } from "./dialog-create-signedraconique.js";
import { DialogStress } from "./dialog-stress.js";
import { DialogChateauDormant } from "./sommeil/dialog-chateau-dormant.js";
import { DialogStress } from "./sommeil/dialog-stress.js";
import { RdDItemCompetence } from "./item-competence.js";
import { Misc } from "./misc.js";
import { RdDCarac } from "./rdd-carac.js";
@ -13,7 +14,6 @@ import { RdDResolutionTable } from "./rdd-resolution-table.js";
import { RdDRollResolutionTable } from "./rdd-roll-resolution-table.js";
import { RdDRollTables } from "./rdd-rolltables.js";
import { RdDUtility } from "./rdd-utility.js";
import { CompendiumTableHelpers } from "./settings/system-compendiums.js";
import { FenetreRechercheTirage } from "./tirage/fenetre-recherche-tirage.js";
import { TMRUtility } from "./tmr-utility.js";
@ -77,6 +77,7 @@ export class RdDCommands {
this.registerCommand({ path: ["/tirer", "rencontre"], func: (content, msg, params) => this.getRencontreTMR(params), descr: `Détermine une rencontre dans les TMR (synonyme de "/tmrr")` });
this.registerCommand({ path: ["/tirage"], func: (content, msg, params) => this.tirage(), descr: "Ouvre la fenêtre de recherche et tirage" });
this.registerCommand({ path: ["/sommeil"], func: (content, msg, params) => this.sommeil(msg, params), descr: "Prépare le passage de journée pour chateau dormant" });
this.registerCommand({ path: ["/meteo"], func: (content, msg, params) => this.getMeteo(msg, params), descr: "Propose une météo marine" });
this.registerCommand({ path: ["/nom"], func: (content, msg, params) => RdDNameGen.getName(msg, params), descr: "Génère un nom aléatoire" });
@ -462,13 +463,14 @@ export class RdDCommands {
let name = params[params.length - 1];
if (name == undefined) {
for (let actor of game.actors) {
actor.distribuerStress('stress', stress, motif);
// TODO: ne plus stresser les entités de cauchemar!
await actor.distribuerStress('stress', stress, motif);
}
} else {
//console.log(stressValue, nomJoueur);
let actor = Misc.findActor(name, game.actors.filter(it => it.hasPlayerOwner)) ?? Misc.findPlayer(name)?.character
if (actor) {
actor.distribuerStress('stress', stress, motif);
await actor.distribuerStress('stress', stress, motif);
}
else {
ui.notifications.warn(`Pas de personnage ou de joueur correspondant à ${name}!`);
@ -485,5 +487,8 @@ export class RdDCommands {
async tirage() {
FenetreRechercheTirage.create();
}
async sommeil() {
DialogChateauDormant.create();
}
}