Astrologie: garder toutes les lectures d'un acteur

This commit is contained in:
2024-05-12 22:40:06 +02:00
parent 611b57c149
commit 19dd3b540c
7 changed files with 74 additions and 75 deletions

View File

@ -2365,26 +2365,25 @@ export class RdDActor extends RdDBaseActorSang {
/* -------------------------------------------- */
async resetNombresAstraux() {
async deleteNombresAstraux() {
const deletions = this.itemTypes['nombreastral'].map(it => it._id);
await this.deleteEmbeddedDocuments("Item", deletions);
}
/* -------------------------------------------- */
async ajouteNombreAstral(callData) {
const indexDate = Number.parseInt(callData.date);
async ajouteNombreAstral(date, nbAstral, isValid) {
const indexDate = Number.parseInt(date);
// Ajout du nombre astral
const item = {
name: "Nombre Astral", type: "nombreastral", system:
{
value: callData.nbAstral,
istrue: callData.isvalid,
value: nbAstral,
istrue: isValid,
jourindex: indexDate,
jourlabel: RdDTimestamp.formatIndexDate(indexDate)
}
};
await this.createEmbeddedDocuments("Item", [item]);
game.system.rdd.calendrier.notifyChangeNombresAstraux();
}
async supprimerAnciensNombresAstraux() {