Intégration astrologie

Intégration du thème astral dans les fenêtres d'astrologie
This commit is contained in:
2023-03-08 02:02:40 +01:00
parent 42ed5da2d4
commit 77cf72a752
20 changed files with 461 additions and 566 deletions

View File

@ -4,7 +4,6 @@ import { RdDRollDialogEthylisme } from "./rdd-roll-ethylisme.js";
import { RdDRoll } from "./rdd-roll.js";
import { RdDTMRDialog } from "./rdd-tmr-dialog.js";
import { Misc } from "./misc.js";
import { RdDAstrologieJoueur } from "./rdd-astrologie-joueur.js";
import { RdDResolutionTable } from "./rdd-resolution-table.js";
import { RdDDice } from "./rdd-dice.js";
import { RdDRollTables } from "./rdd-rolltables.js";
@ -36,6 +35,7 @@ import { DialogRepos } from "./sommeil/dialog-repos.js";
import { RdDBaseActor } from "./actor/base-actor.js";
import { RdDTimestamp } from "./rdd-timestamp.js";
import { RdDItemTache } from "./item-tache.js";
import { APP_ASTROLOGIE_REFRESH, AppAstrologie } from "./sommeil/app-astrologie.js";
const POSSESSION_SANS_DRACONIC = {
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
@ -2916,7 +2916,7 @@ export class RdDActor extends RdDBaseActor {
}
/* -------------------------------------------- */
async resetNombreAstral() {
async resetNombresAstraux() {
let toDelete = this.listItems('nombreastral');
const deletions = toDelete.map(it => it._id);
await this.deleteEmbeddedDocuments("Item", deletions);
@ -2936,24 +2936,23 @@ export class RdDActor extends RdDBaseActor {
}
};
await this.createEmbeddedDocuments("Item", [item]);
// Affichage Dialog
this.astrologieNombresAstraux();
game.system.rdd.calendrier.notifyChangeNombresAstraux();
}
async supprimerAnciensNombresAstraux() {
const toDelete = this.listItems('nombreastral')
.filter(it => game.system.rdd.calendrier.isAfterIndexDate(it.system.jourindex))
.map(it => it._id);
await this.deleteEmbeddedDocuments("Item", toDelete);
const calendrier = game.system.rdd.calendrier;
if (calendrier) {
const toDelete = this.listItems('nombreastral')
.filter(it => calendrier.isAfterIndexDate(it.system.jourindex))
.map(it => it._id);
await this.deleteEmbeddedDocuments("Item", toDelete);
}
}
/* -------------------------------------------- */
async astrologieNombresAstraux() {
// Suppression des anciens nombres astraux
await this.supprimerAnciensNombresAstraux();
// Afficher l'interface spéciale
await RdDAstrologieJoueur.create(this);
await AppAstrologie.create(this);
}
/* -------------------------------------------- */