#171 - Gestion potion de soins (WIP)

This commit is contained in:
2021-04-04 18:37:16 +02:00
parent e4f432c781
commit a5561b7b88
9 changed files with 99 additions and 18 deletions

View File

@ -39,7 +39,7 @@ export class RdDCalendrier extends Application {
async initCalendrier() {
// Calendrier
this.calendrier = duplicate(game.settings.get("foundryvtt-reve-de-dragon", "calendrier"));
console.log("CALENDRIER", this.calendrier);
//console.log("CALENDRIER", this.calendrier);
if (this.calendrier == undefined || this.calendrier.moisRdD == undefined) {
this.calendrier.heureRdD = 0; // Index dans heuresList
this.calendrier.minutesRelative = 0;
@ -88,6 +88,14 @@ export class RdDCalendrier extends Application {
return day + " " + heuresList[month];
}
/* -------------------------------------------- */
getNumericDateFromIndex(index = undefined) {
if (!index) index = this.getCurrentDayIndex();
let month = Math.floor(index / 28)
return { month: heuresList[month],
day: (index - (month * 28)) + 1 }
}
/* -------------------------------------------- */
getCurrentHeure() {
return heuresList[this.calendrier.heureRdD];
@ -98,6 +106,10 @@ export class RdDCalendrier extends Application {
return (this.calendrier.moisRdD * 28) + this.calendrier.jour;
}
/* -------------------------------------------- */
getIndexFromDate(jour, mois) {
return (heuresDef[mois].heure * 28) + (jour-1);
}
/* -------------------------------------------- */
getJoursSuivants(num) {
let jours = [];