Intégration astrologie
Intégration du thème astral dans les fenêtres d'astrologie
This commit is contained in:
parent
42ed5da2d4
commit
77cf72a752
@ -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);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -26,10 +26,13 @@ export class RdDBaseActor extends Actor {
|
||||
case "msg_remote_actor_call":
|
||||
return RdDBaseActor.onRemoteActorCall(sockmsg.data, sockmsg.userId);
|
||||
case "msg_reset_nombre_astral":
|
||||
console.log("RESET ASTRAL", game.user.character);
|
||||
game.user.character.resetNombreAstral();
|
||||
game.user.character.resetNombresAstraux();
|
||||
game.system.rdd.calendrier.notifyChangeNombresAstraux();
|
||||
return;
|
||||
}
|
||||
case "msg_refresh_nombre_astral":
|
||||
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static remoteActorCall(callData, userId = undefined) {
|
||||
|
@ -1,54 +0,0 @@
|
||||
import { ThemeAstral } from "./sommeil/theme-astral.js";
|
||||
|
||||
/**
|
||||
* Extend the base Dialog entity by defining a custom window to perform roll.
|
||||
* @extends {Dialog}
|
||||
*/
|
||||
export class RdDAstrologieEditeur extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, calendrier, calendrierData) {
|
||||
let dialogConf = {
|
||||
title: "Editeur d'Astrologie",
|
||||
content: html,
|
||||
default: "fermer",
|
||||
buttons: {
|
||||
fermer: { label: "Fermer", callback: html => { } }
|
||||
}
|
||||
};
|
||||
let dialogOptions = {
|
||||
classes: ["rdd-roll-dialog"],
|
||||
width: 600,
|
||||
height: 'fit-content',
|
||||
'max-height': 800,
|
||||
'z-index': 99999
|
||||
}
|
||||
super(dialogConf, dialogOptions)
|
||||
|
||||
this.calendrier = calendrier;
|
||||
this.updateData(calendrierData);
|
||||
}
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
this.html.find('[name="theme-astral"]').click(event => ThemeAstral.create());
|
||||
this.html.find('[name="reset-nombres-astraux"]').click(event => this.resetNombreAstraux());
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async resetNombreAstraux() {
|
||||
game.system.rdd.calendrier.resetNombreAstral();
|
||||
await game.system.rdd.calendrier.rebuildListeNombreAstral();
|
||||
|
||||
game.system.rdd.calendrier.showAstrologieEditor();
|
||||
this.close()
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
updateData(calendrierData) {
|
||||
this.calendrierData = duplicate(calendrierData);
|
||||
}
|
||||
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
import { RdDItemCompetence } from "./item-competence.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
import { ThemeAstral } from "./sommeil/theme-astral.js";
|
||||
|
||||
|
||||
/**
|
||||
* Extend the base Dialog entity by defining a custom window to perform roll.
|
||||
* @extends {Dialog}
|
||||
*/
|
||||
export class RdDAstrologieJoueur extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async create(actor) {
|
||||
|
||||
let dialogData = {
|
||||
nombres: this.organizeNombres(actor),
|
||||
dates: game.system.rdd.calendrier.getJoursSuivants(10),
|
||||
etat: actor.getEtatGeneral(),
|
||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||
astrologie: RdDItemCompetence.findCompetence(actor.items, 'Astrologie')
|
||||
}
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', dialogData);
|
||||
|
||||
const options = { classes: ["rdd-roll-dialog"], width: 600, height: 'fit-content', 'z-index': 99999 };
|
||||
const dialog = new RdDAstrologieJoueur(html, actor, dialogData, options);
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, actor, dialogData, dialogOptions) {
|
||||
const dialogConf = {
|
||||
title: "Nombres Astraux",
|
||||
content: html,
|
||||
default: "saveButton",
|
||||
buttons: {
|
||||
saveButton: { label: "Fermer", callback: html => {} }
|
||||
},
|
||||
};
|
||||
super(dialogConf, dialogOptions);
|
||||
|
||||
this.actor = actor;
|
||||
this.dataNombreAstral = duplicate(dialogData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
|
||||
this.html.find("[name='diffConditions']").val(0);
|
||||
|
||||
this.html.find('[name="jet-astrologie"]').click(event => {
|
||||
this.requestJetAstrologie();
|
||||
});
|
||||
this.html.find('[name="theme-astral"]').click(event => {
|
||||
ThemeAstral.create();
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static organizeNombres(actor) {
|
||||
let itemNombres = actor.listItems('nombreastral');
|
||||
let itemFiltered = {};
|
||||
for (let item of itemNombres) {
|
||||
if (itemFiltered[item.system.jourindex]) {
|
||||
itemFiltered[item.system.jourindex].listValues.push(item.system.value);
|
||||
} else {
|
||||
itemFiltered[item.system.jourindex] = {
|
||||
listValues: [item.system.value],
|
||||
jourlabel: item.system.jourlabel
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemFiltered;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
requestJetAstrologie() {
|
||||
let socketData = {
|
||||
id: this.actor.id,
|
||||
carac_vue: this.actor.system.carac['vue'].value,
|
||||
etat: this.dataNombreAstral.etat,
|
||||
astrologie: this.dataNombreAstral.astrologie,
|
||||
conditions: this.html.find('[name="diffConditions"]').val(),
|
||||
date: this.html.find('[name="joursAstrologie"]').val(),
|
||||
userId: game.user.id
|
||||
}
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
game.system.rdd.calendrier.requestNombreAstral(socketData);
|
||||
} else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_request_nombre_astral",
|
||||
data: socketData
|
||||
});
|
||||
}
|
||||
this.close();
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +1,14 @@
|
||||
import { RdDCalendrierEditeur } from "./rdd-calendrier-editeur.js";
|
||||
import { RdDAstrologieEditeur } from "./rdd-astrologie-editeur.js";
|
||||
import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
import { RdDDice } from "./rdd-dice.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { HIDE_DICE, SHOW_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
import { DialogChronologie } from "./dialog-chronologie.js";
|
||||
import { RdDTimestamp, WORLD_TIMESTAMP_SETTING } from "./rdd-timestamp.js";
|
||||
import { MAX_NOMBRE_ASTRAL, RdDTimestamp, WORLD_TIMESTAMP_SETTING } from "./rdd-timestamp.js";
|
||||
import { DialogChateauDormant } from "./sommeil/dialog-chateau-dormant.js";
|
||||
import { ReglesOptionelles } from "./settings/regles-optionelles.js";
|
||||
|
||||
const RDD_JOUR_PAR_MOIS = 28;
|
||||
const RDD_HEURES_PAR_JOUR = 12;
|
||||
const MAX_NOMBRE_ASTRAL = 12;
|
||||
const JOURS_DU_MOIS = Array(RDD_JOUR_PAR_MOIS).fill().map((item, index) => 1 + index);
|
||||
import { APP_ASTROLOGIE_REFRESH, AppAstrologie } from "./sommeil/app-astrologie.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDCalendrier extends Application {
|
||||
@ -43,10 +38,10 @@ export class RdDCalendrier extends Application {
|
||||
|
||||
if (Misc.isUniqueConnectedGM()) { // Uniquement si GM
|
||||
RdDTimestamp.setWorldTime(this.timestamp);
|
||||
this.listeNombreAstral = this.getListeNombreAstral();
|
||||
this.rebuildListeNombreAstral(HIDE_DICE); // Ensure always up-to-date
|
||||
this.nombresAstraux = this.getNombresAstraux();
|
||||
this.rebuildNombresAstraux(HIDE_DICE); // Ensure always up-to-date
|
||||
}
|
||||
console.log('RdDCalendrier.constructor()', this.timestamp, this.timestamp.toCalendrier(), this.calendrierPos, this.listeNombreAstral);
|
||||
console.log('RdDCalendrier.constructor()', this.timestamp, this.timestamp.toCalendrier(), this.calendrierPos, this.nombresAstraux);
|
||||
Hooks.on('updateSetting', async (setting, update, options, id) => this.onUpdateSetting(setting, update, options, id));
|
||||
}
|
||||
|
||||
@ -150,7 +145,7 @@ export class RdDCalendrier extends Application {
|
||||
});
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getListeNombreAstral() {
|
||||
getNombresAstraux() {
|
||||
return game.settings.get(SYSTEM_RDD, "liste-nombre-astral") ?? [];
|
||||
}
|
||||
|
||||
@ -212,8 +207,8 @@ export class RdDCalendrier extends Application {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
resetNombreAstral() {
|
||||
this.listeNombreAstral = [];
|
||||
resetNombresAstraux() {
|
||||
this.nombresAstraux = [];
|
||||
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", []);
|
||||
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
@ -233,30 +228,39 @@ export class RdDCalendrier extends Application {
|
||||
if (indexDate == undefined) {
|
||||
indexDate = this.timestamp.indexDate;
|
||||
}
|
||||
const listNombreAstral = this.getListeNombreAstral();
|
||||
let astralData = listNombreAstral.find((nombreAstral, i) => nombreAstral.index == indexDate);
|
||||
this.nombresAstraux = this.getNombresAstraux();
|
||||
let astralData = this.nombresAstraux.find((nombreAstral, i) => nombreAstral.index == indexDate);
|
||||
return astralData?.nombreAstral ?? 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rebuildListeNombreAstral(showDice = HIDE_DICE) {
|
||||
async rebuildNombresAstraux(showDice = HIDE_DICE) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
let newList = [];
|
||||
for (let i = 0; i < MAX_NOMBRE_ASTRAL; i++) {
|
||||
let dayIndex = this.timestamp.indexDate + i;
|
||||
let na = this.listeNombreAstral.find(n => n.index == dayIndex);
|
||||
let na = this.nombresAstraux.find(n => n.index == dayIndex);
|
||||
if (na) {
|
||||
newList[i] = na;
|
||||
} else {
|
||||
newList[i] = await this.ajouterNombreAstral(dayIndex, showDice);
|
||||
}
|
||||
}
|
||||
this.listeNombreAstral = newList;
|
||||
this.nombresAstraux = newList;
|
||||
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", newList);
|
||||
game.actors.forEach(actor => actor.deleteEmbeddedDocuments("Item", actor.listItems('nombreastral').map(it => it.id)));
|
||||
game.actors.filter(it => it.isPersonnage()).forEach(actor => actor.supprimerAnciensNombresAstraux());
|
||||
this.notifyChangeNombresAstraux();
|
||||
}
|
||||
}
|
||||
|
||||
notifyChangeNombresAstraux() {
|
||||
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_refresh_nombre_astral",
|
||||
data: {}
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setNewTimestamp(newTimestamp) {
|
||||
const oldTimestamp = this.timestamp;
|
||||
@ -266,7 +270,7 @@ export class RdDCalendrier extends Application {
|
||||
await DialogChateauDormant.create();
|
||||
}
|
||||
this.timestamp = newTimestamp;
|
||||
await this.rebuildListeNombreAstral();
|
||||
await this.rebuildNombresAstraux();
|
||||
this.updateDisplay();
|
||||
}
|
||||
|
||||
@ -362,16 +366,16 @@ export class RdDCalendrier extends Application {
|
||||
}
|
||||
|
||||
addNbAstralIncorect(actorId, date, nbAstral) {
|
||||
let astralData = this.listeNombreAstral.find((nombreAstral, i) => nombreAstral.index == date);
|
||||
let astralData = this.nombresAstraux.find((nombreAstral, i) => nombreAstral.index == date);
|
||||
astralData.valeursFausses.push({ actorId: actorId, nombreAstral: nbAstral });
|
||||
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", this.listeNombreAstral);
|
||||
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", this.nombresAstraux);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getAjustementAstrologique(heureNaissance, name = undefined) {
|
||||
let defHeure = RdDTimestamp.findHeure(heureNaissance);
|
||||
if (defHeure) {
|
||||
return RdDCalendrier.ajustementAstrologiqueHeure(defHeure.heure, this.getNombreAstral(), this.timestamp.heure);
|
||||
return RdDTimestamp.ajustementAstrologiqueHeure(defHeure.heure, this.getNombreAstral(), this.timestamp.heure);
|
||||
}
|
||||
else if (name) {
|
||||
ui.notifications.warn(name + " n'a pas d'heure de naissance, ou elle est incorrecte : " + heureNaissance);
|
||||
@ -382,20 +386,6 @@ export class RdDCalendrier extends Application {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ajustementAstrologiqueHeure(hn, nbAstral, heure) {
|
||||
switch (RdDCalendrier.ecartHeureChance(hn, nbAstral, heure)) {
|
||||
case 0: return 4;
|
||||
case 4: case 8: return 2;
|
||||
case 6: return -4;
|
||||
case 3: case 9: return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ecartHeureChance(heureNaissance, nombreAstral, heure) {
|
||||
return ((heureNaissance + nombreAstral - heure) % RDD_HEURES_PAR_JOUR + RDD_HEURES_PAR_JOUR) % RDD_HEURES_PAR_JOUR;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getData() {
|
||||
let formData = super.getData();
|
||||
@ -469,41 +459,8 @@ export class RdDCalendrier extends Application {
|
||||
this.editeur.render(true);
|
||||
}
|
||||
|
||||
static buildJoursMois() { return JOURS_DU_MOIS; }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async showAstrologieEditor() {
|
||||
const calendrierData = duplicate(this.fillCalendrierData());
|
||||
this.listeNombreAstral = this.listeNombreAstral || [];
|
||||
|
||||
calendrierData.astrologieData = this.listeNombreAstral.map(astro => {
|
||||
const timestamp = new RdDTimestamp({ indexDate: astro.index });
|
||||
astro.date = { mois: timestamp.mois, jour: timestamp.jour + 1 }
|
||||
for (let vf of astro.valeursFausses) {
|
||||
let actor = game.actors.get(vf.actorId);
|
||||
vf.actorName = (actor) ? actor.name : "Inconnu";
|
||||
}
|
||||
return astro;
|
||||
});
|
||||
|
||||
const nbAstral = this.getNombreAstral()
|
||||
calendrierData.heures = Array.from(Array(RDD_HEURES_PAR_JOUR).keys());
|
||||
calendrierData.ajustementsActeur = game.actors.filter(it => it.isPersonnage() && it.hasPlayerOwner).map(actor => {
|
||||
return {
|
||||
actor,
|
||||
ajustements: calendrierData.heures.map(heure => {
|
||||
const hn = RdDTimestamp.findHeure(actor.getHeureNaissance())?.heure;
|
||||
return {
|
||||
heure,
|
||||
ajustement: RdDCalendrier.ajustementAstrologiqueHeure(hn, nbAstral, heure)
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/calendar-astrologie-template.html', calendrierData);
|
||||
let astrologieEditeur = new RdDAstrologieEditeur(html, this, calendrierData)
|
||||
astrologieEditeur.updateData(calendrierData);
|
||||
astrologieEditeur.render(true);
|
||||
await AppAstrologie.create();
|
||||
}
|
||||
}
|
@ -55,7 +55,7 @@ import { RdDFauneItemSheet } from "./item/sheet-faune.js";
|
||||
import { RdDConteneurItemSheet } from "./item/sheet-conteneur.js";
|
||||
import { RdDSigneDraconiqueItemSheet } from "./item/sheet-signedraconique.js";
|
||||
import { RdDItemInventaireSheet } from "./item/sheet-base-inventaire.js";
|
||||
import { ThemeAstral } from "./sommeil/theme-astral.js";
|
||||
import { AppAstrologie } from "./sommeil/app-astrologie.js";
|
||||
|
||||
/**
|
||||
* RdD system
|
||||
@ -97,7 +97,7 @@ export class SystemReveDeDragon {
|
||||
/* -------------------------------------------- */
|
||||
async onInit() {
|
||||
game.system.rdd = this;
|
||||
this.ThemeAstral = ThemeAstral;
|
||||
this.AppAstrologie = AppAstrologie;
|
||||
|
||||
|
||||
console.log(`Initializing Reve de Dragon System`);
|
||||
|
@ -5,10 +5,11 @@ import { RdDDice } from "./rdd-dice.js";
|
||||
|
||||
export const WORLD_TIMESTAMP_SETTING = "calendrier";
|
||||
|
||||
const RDD_MOIS_PAR_AN = 12;
|
||||
const RDD_JOURS_PAR_MOIS = 28;
|
||||
const RDD_JOURS_PAR_AN = 336; //RDD_JOURS_PAR_MOIS * RDD_MOIS_PAR_AN;
|
||||
const RDD_HEURES_PAR_JOUR = 12;
|
||||
const RDD_MOIS_PAR_AN = 12;
|
||||
export const RDD_JOURS_PAR_MOIS = 28;
|
||||
export const RDD_HEURES_PAR_JOUR = 12;
|
||||
export const MAX_NOMBRE_ASTRAL = 12;
|
||||
const RDD_MINUTES_PAR_HEURES = 120;
|
||||
const RDD_MINUTES_PAR_JOUR = 1440; //RDD_HEURES_PAR_JOUR * RDD_MINUTES_PAR_HEURES;
|
||||
const ROUNDS_PAR_MINUTE = 10;
|
||||
@ -46,16 +47,9 @@ const FORMULES_PERIODE = [
|
||||
{ code: 'jour', label: "Jours", calcul: async (t, nombre) => t.addJours(nombre) },
|
||||
]
|
||||
|
||||
|
||||
export class RdDTimestamp {
|
||||
|
||||
static hh(heure) {
|
||||
return heure < 9 ? `0${heure + 1}` : `${heure + 1}`;
|
||||
}
|
||||
|
||||
static iconeHeure(heure) {
|
||||
return `systems/foundryvtt-reve-de-dragon/icons/heures/hd${RdDTimestamp.hh(heure)}.svg`;
|
||||
}
|
||||
|
||||
static init() {
|
||||
game.settings.register(SYSTEM_RDD, WORLD_TIMESTAMP_SETTING, {
|
||||
name: WORLD_TIMESTAMP_SETTING,
|
||||
@ -73,10 +67,35 @@ export class RdDTimestamp {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static hh(heure) {
|
||||
return heure < 9 ? `0${heure + 1}` : `${heure + 1}`;
|
||||
}
|
||||
|
||||
static iconeHeure(heure) {
|
||||
return `systems/foundryvtt-reve-de-dragon/icons/heures/hd${RdDTimestamp.hh(heure)}.svg`;
|
||||
}
|
||||
|
||||
static definitions() {
|
||||
return DEFINITION_HEURES
|
||||
}
|
||||
|
||||
static formulesDuree() {
|
||||
return FORMULES_DUREE
|
||||
}
|
||||
|
||||
static formulesPeriode() {
|
||||
return FORMULES_PERIODE
|
||||
}
|
||||
|
||||
static heures() {
|
||||
return Misc.intArray(0, RDD_HEURES_PAR_JOUR)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param signe
|
||||
* @param signe
|
||||
* @returns L'entrée de DEFINITION_HEURES correspondant au signe
|
||||
*/
|
||||
*/
|
||||
static definition(signe) {
|
||||
if (signe == undefined) {
|
||||
signe = 0;
|
||||
@ -91,23 +110,26 @@ export class RdDTimestamp {
|
||||
return definition
|
||||
}
|
||||
|
||||
static definitions() {
|
||||
return DEFINITION_HEURES
|
||||
}
|
||||
static formulesDuree() {
|
||||
return FORMULES_DUREE
|
||||
}
|
||||
|
||||
static formulesPeriode() {
|
||||
return FORMULES_PERIODE
|
||||
}
|
||||
|
||||
static imgSigneHeure(heure) {
|
||||
return RdDTimestamp.imgSigne(RdDTimestamp.definition(heure));
|
||||
}
|
||||
|
||||
static imgSigne(signe) {
|
||||
return signe == undefined ? '' : `<img class="img-signe-heure" src="${signe.webp}" alt="${signe.label}"/>`
|
||||
return signe == undefined ? '' : `<img class="img-signe-heure" src="${signe.webp}" alt="${signe.label}" title="${signe.label}"/>`
|
||||
}
|
||||
|
||||
static ajustementAstrologiqueHeure(hn, nbAstral, heure) {
|
||||
let ecart = (hn + nbAstral - heure) % RDD_HEURES_PAR_JOUR;
|
||||
if (ecart < 0) {
|
||||
ecart = (ecart + RDD_HEURES_PAR_JOUR) % RDD_HEURES_PAR_JOUR;
|
||||
}
|
||||
switch (ecart) {
|
||||
case 0: return 4;
|
||||
case 4: case 8: return 2;
|
||||
case 6: return -4;
|
||||
case 3: case 9: return -2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static handleTimestampEditor(html, path, consumeTimestamp = async (path, timestamp) => { }) {
|
||||
|
@ -234,8 +234,10 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-meditation.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-tmr.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-alchimie.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/sommeil-actor-moral.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-gardien.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-joueur.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-theme.hbs',
|
||||
// Calendrier
|
||||
'systems/foundryvtt-reve-de-dragon/templates/calendar-template.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/calendar-editor-template.html',
|
||||
|
207
module/sommeil/app-astrologie.js
Normal file
207
module/sommeil/app-astrologie.js
Normal file
@ -0,0 +1,207 @@
|
||||
import { SYSTEM_RDD } from "../constants.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDTimestamp } from "../rdd-timestamp.js";
|
||||
|
||||
export const APP_ASTROLOGIE_REFRESH = `${SYSTEM_RDD}-refresh-astrologie`
|
||||
|
||||
export class AppAstrologie extends Application {
|
||||
static async create(actor = undefined, options = {}) {
|
||||
if (actor == undefined && !game.user.isGM) {
|
||||
actor = game.user.character
|
||||
}
|
||||
if (!actor && !game.user.isGM) {
|
||||
console.error("AppAstrologie uniquement accessible pour le MJ, ou depuis un personnage pour un joueur")
|
||||
}
|
||||
new AppAstrologie(actor, options).render(true);
|
||||
}
|
||||
|
||||
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/sommeil/app-astrologie.hbs",
|
||||
title: "Astrologie",
|
||||
width: 'fit-content',
|
||||
height: 'fit-content',
|
||||
popOut: true,
|
||||
resizable: false
|
||||
});
|
||||
}
|
||||
|
||||
constructor(actor, options = {}) {
|
||||
super(options);
|
||||
this.actor = actor;
|
||||
this.hookReference = Hooks.on(APP_ASTROLOGIE_REFRESH, () => this.refreshAstrologie());
|
||||
}
|
||||
|
||||
getData(options) {
|
||||
this.appData = super.getData(options)
|
||||
const calendrier = game.system.rdd.calendrier;
|
||||
mergeObject(this.appData, {
|
||||
isGM: game.user.isGM,
|
||||
isActor: this.actor != undefined,
|
||||
calendrier: calendrier.getTimestamp().toCalendrier(),
|
||||
dates: calendrier.getJoursSuivants(10),
|
||||
heures: RdDTimestamp.definitions(),
|
||||
actorAstrologie: this.getActorAstrologie(),
|
||||
gmAstrologie: this.getGMAstrologie(calendrier),
|
||||
theme: {
|
||||
signeAstral: RdDTimestamp.definition(0),
|
||||
signeNaissance: RdDTimestamp.definition(0)
|
||||
}
|
||||
})
|
||||
return this.appData;
|
||||
}
|
||||
|
||||
getActorAstrologie() {
|
||||
if (this.actor) {
|
||||
return {
|
||||
actor: this.actor,
|
||||
nombres: this._organizeNombresAstraux(this.actor.listItems('nombreastral')),
|
||||
ajustements: CONFIG.RDD.difficultesLibres,
|
||||
etat: this.actor.getEtatGeneral(),
|
||||
astrologie: this.actor.getCompetence('Astrologie')
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
_organizeNombresAstraux(nombresAstraux) {
|
||||
let organized = {};
|
||||
nombresAstraux.forEach(na => {
|
||||
if (!organized[na.system.jourindex]) {
|
||||
organized[na.system.jourindex] = {
|
||||
listValues: [],
|
||||
jourlabel: na.system.jourlabel
|
||||
}
|
||||
}
|
||||
organized[na.system.jourindex].listValues.push(na.system.value);
|
||||
})
|
||||
return organized;
|
||||
}
|
||||
|
||||
getGMAstrologie(calendrier) {
|
||||
if (game.user.isGM) {
|
||||
const nbAstral = calendrier.getNombreAstral()
|
||||
const heures = RdDTimestamp.heures();
|
||||
return {
|
||||
ajustementsActors: game.actors.filter(it => it.isPersonnage() && it.hasPlayerOwner)
|
||||
.map(actor => this.getAjustementActor(actor, nbAstral, heures)),
|
||||
nombresAstraux: calendrier.getNombresAstraux().map(na => this.getDetailNombreAstral(na))
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
getAjustementActor(actor, nbAstral, heures) {
|
||||
const hn = RdDTimestamp.findHeure(actor.getHeureNaissance())?.heure ?? 0;
|
||||
return {
|
||||
actor,
|
||||
ajustements: heures.map(heure => {
|
||||
return { heure, ajustement: RdDTimestamp.ajustementAstrologiqueHeure(hn, nbAstral, heure) };
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
getDetailNombreAstral(nombreAstral) {
|
||||
const detail = duplicate(nombreAstral);
|
||||
const timestamp = new RdDTimestamp({ indexDate: nombreAstral.index });
|
||||
detail.date = { mois: timestamp.mois, jour: timestamp.jour + 1 };
|
||||
detail.valeursFausses.forEach(fausse => fausse.actorName = game.actors.get(fausse.actorId).name ?? "Inconnu");
|
||||
return detail;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
this.html.find('select[name="signe-astral"]').change(event => {
|
||||
this.selectNombreAstral(this.html.find('select[name="signe-astral"]').val());
|
||||
})
|
||||
this.html.find('select[name="signe-naissance"]').change(event => {
|
||||
this.selectHeureNaissance(this.html.find('select[name="signe-naissance"]').val());
|
||||
})
|
||||
this.html.find('td.nombre-astral').click(event => {
|
||||
this.selectNombreAstral(Number.parseInt(event.currentTarget.attributes['data-nombre-astral'].value) - 1);
|
||||
})
|
||||
this.html.find('tr.heure-naissance').click(event => {
|
||||
this.selectHeureNaissance(event.currentTarget.attributes['data-heure-naissance'].value);
|
||||
})
|
||||
this.html.find('[name="jet-astrologie"]').click(event => this.requestJetAstrologie());
|
||||
this.html.find('[name="rebuild-nombres-astraux"]').click(event => this.rebuildNombresAstraux());
|
||||
|
||||
this.onCalculThemeAstral();
|
||||
}
|
||||
|
||||
selectHeureNaissance(heureNaissance) {
|
||||
this.appData.theme.signeNaissance = RdDTimestamp.definition(heureNaissance);
|
||||
this.onCalculThemeAstral();
|
||||
}
|
||||
|
||||
selectNombreAstral(nombreAstral) {
|
||||
this.appData.theme.signeAstral = RdDTimestamp.definition(nombreAstral);
|
||||
this.onCalculThemeAstral();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rebuildNombresAstraux() {
|
||||
game.system.rdd.calendrier.resetNombresAstraux();
|
||||
|
||||
await game.system.rdd.calendrier.rebuildNombresAstraux();
|
||||
}
|
||||
|
||||
onCalculThemeAstral() {
|
||||
const chiffreAstral = this.appData.theme.signeAstral.heure + 1;
|
||||
const heureNaissance = this.appData.theme.signeNaissance.heure + 1;
|
||||
RdDTimestamp.definitions().forEach(dh => {
|
||||
const ajustement = RdDTimestamp.ajustementAstrologiqueHeure(heureNaissance, chiffreAstral, dh.heure + 1);
|
||||
const txtAjustement = ajustement == 0 ? '' : Misc.toSignedString(ajustement);
|
||||
this.html.find(`div.astro-ajustement.ajustement-${dh.hh}`).text(txtAjustement)
|
||||
});
|
||||
|
||||
this.html.find(`select[name="signe-astral"]`).val(this.appData.theme.signeAstral.key)
|
||||
this.html.find(`select[name="signe-naissance"]`).val(this.appData.theme.signeNaissance.key)
|
||||
|
||||
const angle = ((chiffreAstral + heureNaissance) * 30) % 360;
|
||||
const rotation = `rotate(${angle}deg)`;
|
||||
this.html.find(`div.astro-roue div.astro-disque img`).css({
|
||||
'transform': rotation,
|
||||
'-ms-transform': rotation,
|
||||
'-moz-transform': rotation,
|
||||
'-webkit-transform': rotation,
|
||||
'-o-transform': rotation
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
requestJetAstrologie() {
|
||||
if (!this.appData?.isActor) {
|
||||
return
|
||||
}
|
||||
let socketData = {
|
||||
id: this.appData.actorAstrologie.actor.id,
|
||||
carac_vue: this.actor.system.carac['vue'].value,
|
||||
etat: this.actor.getEtatGeneral(),
|
||||
astrologie: this.actor.getCompetence('Astrologie'),
|
||||
conditions: this.html.find('[name="diffConditions"]').val(),
|
||||
date: this.html.find('[name="joursAstrologie"]').val(),
|
||||
userId: game.user.id
|
||||
}
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
game.system.rdd.calendrier.requestNombreAstral(socketData);
|
||||
} else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_request_nombre_astral",
|
||||
data: socketData
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
refreshAstrologie() {
|
||||
this.render(true)
|
||||
}
|
||||
async close(options) {
|
||||
Hooks.off(APP_ASTROLOGIE_REFRESH, this.hookReference);
|
||||
this.hookReference = undefined
|
||||
await super.close(options)
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDCalendrier } from "../rdd-calendrier.js";
|
||||
import { RdDTimestamp } from "../rdd-timestamp.js";
|
||||
|
||||
export class ThemeAstral extends Application {
|
||||
static get defaultOptions() {
|
||||
return mergeObject(super.defaultOptions, {
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/sommeil/theme-astral.hbs",
|
||||
title: "Thème astral",
|
||||
width: 'fit-content',
|
||||
height: 'fit-content',
|
||||
popOut: true,
|
||||
resizable: false
|
||||
});
|
||||
}
|
||||
|
||||
static async create() {
|
||||
new ThemeAstral().render(true);
|
||||
}
|
||||
constructor() {
|
||||
super({});
|
||||
}
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
this.html.find('select[name="signe-astral"]').change(event => {
|
||||
this.onCalculThemeAstral();
|
||||
})
|
||||
this.html.find('select[name="signe-naissance"]').change(event => {
|
||||
this.onCalculThemeAstral();
|
||||
})
|
||||
this.onCalculThemeAstral();
|
||||
}
|
||||
|
||||
onCalculThemeAstral() {
|
||||
const signeAstral = RdDTimestamp.definition(this.html.find('select[name="signe-astral"]').val())
|
||||
const chiffreAstral = signeAstral.heure + 1;
|
||||
const signeNaissance = RdDTimestamp.definition(this.html.find('select[name="signe-naissance"]').val())
|
||||
const heureNaissance = signeNaissance.heure + 1;
|
||||
const heureChance = (chiffreAstral + heureNaissance) % 12 + 1
|
||||
RdDTimestamp.definitions().forEach(dh => {
|
||||
const ajustement = RdDCalendrier.ajustementAstrologiqueHeure(heureNaissance, chiffreAstral, dh.heure + 1);
|
||||
const txtAjustement = ajustement == 0 ? '' : Misc.toSignedString(ajustement);
|
||||
this.html.find(`div.astro-ajustement.ajustement-${dh.hh}`).text(txtAjustement)
|
||||
});
|
||||
|
||||
const angle = (heureChance * 30 + 330) % 360;
|
||||
const rotation = `rotate(${angle}deg)`;
|
||||
this.html.find(`div.astro-roue div.astro-disque img`).css({
|
||||
'transform': rotation,
|
||||
'-ms-transform': rotation,
|
||||
'-moz-transform': rotation,
|
||||
'-webkit-transform': rotation,
|
||||
'-o-transform': rotation
|
||||
});
|
||||
}
|
||||
}
|
@ -8,6 +8,6 @@
|
||||
{"name":"Encaissement","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/svg/bones.svg","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.encaisser();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671234017623,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"WD6T8AdRbX2Ylxqe"}
|
||||
{"name":"Jet quelconque","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/sundries/gaming/dice-runed-tan.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.roll();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233500655,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"bnJnbKDHpbqY8Pr9"}
|
||||
{"name":"Recherche et tirage","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/tools/scribal/magnifying-glass.webp","command":"game.system.rdd.commands.tirage()","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.ZFWPNdQBjQs9z0YW"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.5.4","coreVersion":"10.291","createdTime":1673472449426,"modifiedTime":1673655461651,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"iVZnxOxhCMpkvYh3"}
|
||||
{"name":"Thème astral","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/magic/nature/symbol-moon-stars-white.webp","command":"game.system.rdd.ThemeAstral.create();","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.oA0HPFeFK6YMspAX"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.19","coreVersion":"10.291","createdTime":1678127868791,"modifiedTime":1678150559112,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"koqhiDJSGP4gQ4vf"}
|
||||
{"name":"Thème astral","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/magic/nature/symbol-moon-stars-white.webp","command":"game.system.rdd.AppAstrologie.create()","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.oA0HPFeFK6YMspAX"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.19","coreVersion":"10.291","createdTime":1678127868791,"modifiedTime":1678237392810,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"koqhiDJSGP4gQ4vf"}
|
||||
{"name":"Jet d'éthylisme","type":"script","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"icons/consumables/drinks/alcohol-beer-stein-wooden-metal-brown.webp","command":"const selected = game.system.rdd.RdDUtility.getSelectedActor();\nif (selected) {\n selected.jetEthylisme();\n}\nelse {\n ui.notifications.info('Pas de personnage sélectionné');\n}","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.XHNbjnGKXaCiCadq"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1671220038331,"modifiedTime":1671233646086,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"mvub1dRHNFmWjRr7"}
|
||||
{"name":"Tirer le tarot","type":"chat","scope":"global","author":"Hp9ImM4o9YRTSdfu","img":"systems/foundryvtt-reve-de-dragon/icons/tarots/dos-tarot.webp","command":"/tirer tarot","ownership":{"default":0,"Hp9ImM4o9YRTSdfu":3},"flags":{"core":{"sourceId":"Macro.HBZSKR9OHCQbLcTC"}},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.3.15","coreVersion":"10.291","createdTime":1669469547231,"modifiedTime":1671237401618,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"},"folder":null,"sort":0,"_id":"vTfJTFYYiRu8X5LM"}
|
||||
|
@ -870,12 +870,16 @@ form.rdddialogchrono input[type=datetime-local] {
|
||||
color: var(--color-text-dark-primary);
|
||||
border-radius: 3px;
|
||||
}
|
||||
div.theme-astral{
|
||||
width: 14rem;
|
||||
margin: 0.4rem;
|
||||
}
|
||||
form.dialog-astro {
|
||||
width: 17rem;
|
||||
}
|
||||
form.dialog-astro div.astro-roue {
|
||||
div.astro-roue {
|
||||
position: relative;
|
||||
left: 2rem;
|
||||
left: calc(50% - 6.5rem);
|
||||
width: 13rem;
|
||||
height: 13rem;
|
||||
}
|
||||
|
@ -1,56 +0,0 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<div class="header-fields">
|
||||
<h1 class="charname">Horoscope</h1>
|
||||
</div>
|
||||
</header>
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
<th>Date</th>
|
||||
{{#each astrologieData as |nombreData key|}}
|
||||
<td class='table-nombres-astraux-td'>{{nombreData.date.jour}}{{timestamp-imgSigneHeure nombreData.date.mois}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
<th>Nombre astral</th>
|
||||
{{#each astrologieData as |nombreData key|}}
|
||||
<td class='table-nombres-astraux-td'>
|
||||
<ol>
|
||||
<b>{{nombreData.nombreAstral}}</b>
|
||||
{{#each nombreData.valeursFausses as |fausseVal key|}}
|
||||
<li>{{fausseVal.actorName}} - {{fausseVal.nombreAstral}}</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>+4</strong></td>
|
||||
<td><strong>+2</strong></td>
|
||||
<td><strong>-2</strong></td>
|
||||
<td><strong>-4</strong></td>
|
||||
</tr>
|
||||
{{#each heuresParActeur as |heuresDef name|}}
|
||||
<tr>
|
||||
<td><strong>{{name}}</strong>:</td>
|
||||
{{#each heuresDef as |ajustement|}}
|
||||
<td>
|
||||
{{#each ajustement.heures as |heure|}}
|
||||
{{timestamp-imgSigneHeure heure}}
|
||||
{{/each}}
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
@ -1,68 +0,0 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<div class="header-fields">
|
||||
<h1 class="charname">Horoscope</h1>
|
||||
</div>
|
||||
<div class="header-fields">
|
||||
<a class="chat-card-button" name="theme-astral">Thème astral</a>
|
||||
<a class="chat-card-button" name="reset-nombres-astraux">Réinitialiser les nombres astraux</a>
|
||||
</div>
|
||||
</header>
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
{{#each astrologieData as |nombreData key|}}
|
||||
<th>{{nombreData.date.jour}}{{timestamp-imgSigneHeure nombreData.date.mois}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nombre astral</th>
|
||||
{{#each astrologieData as |nombreData key|}}
|
||||
<td>
|
||||
<ol>
|
||||
<b>{{nombreData.nombreAstral}}</b>
|
||||
{{#each nombreData.valeursFausses as |fausseVal key|}}
|
||||
<li>{{fausseVal.actorName}} - {{fausseVal.nombreAstral}}</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr>
|
||||
<th></th>
|
||||
{{#each heures as |heure|}}
|
||||
<th>
|
||||
{{timestamp-imgSigneHeure heure}}
|
||||
</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{#each ajustementsActeur as |ajustementActeur|}}
|
||||
<tr>
|
||||
<td>
|
||||
<img class="img-signe-heure" src="{{actor.img}}" title="{{actor.name}}" />
|
||||
{{actor.name}} {{timestamp-imgSigneHeure actor.system.heure}}
|
||||
</td>
|
||||
{{#each ajustementActeur.ajustements as |ajustement|}}
|
||||
<td>{{#if (ne ajustement.ajustement 0)}}
|
||||
<strong>
|
||||
{{numberFormat ajustement.ajustement decimals=0 sign=true}}
|
||||
</strong>
|
||||
{{else}}
|
||||
<div class="dimmed">
|
||||
{{timestamp-imgSigneHeure ajustement.heure}}
|
||||
</div>
|
||||
{{/if}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
@ -1,61 +0,0 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<div class="header-fields">
|
||||
<h1 class="charname">Astrologie</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<div>
|
||||
<label>Conditions</label>
|
||||
<select name="diffConditions" data-dtype="Number">
|
||||
{{#select diffConditions}}
|
||||
{{#each ajustementsConditions as |key|}}
|
||||
<option value={{key}}>{{numberFormat key decimals=0 sign=true}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label> Jours</label>
|
||||
<select name="joursAstrologie" data-dtype="Number">
|
||||
{{#select joursSuivants}}
|
||||
{{#each dates as |date key|}}
|
||||
<option value={{date.index}}>{{date.label}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label>
|
||||
Etat Général: {{etat}}
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<a class="chat-card-button" name="jet-astrologie">Lire les étoiles</a>
|
||||
<a class="chat-card-button" name="theme-astral">Thème astral</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="astralList">Nombres Astraux</label>
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
{{#each nombres as |nombreData key|}}
|
||||
<td class='table-nombres-astraux-td'>{{nombreData.jourlabel}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
{{#each nombres as |nombreData key|}}
|
||||
<td class='table-nombres-astraux-td'>
|
||||
<ol>
|
||||
{{#each nombreData.listValues as |nombreAstral key|}}
|
||||
<li>{{nombreAstral}}</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
</form>
|
18
templates/sommeil/app-astrologie.hbs
Normal file
18
templates/sommeil/app-astrologie.hbs
Normal file
@ -0,0 +1,18 @@
|
||||
<form class="app-calendar-astrologie" autocomplete="off">
|
||||
<div class="flexrow">
|
||||
<div class="flex-grow">
|
||||
<div class="header-fields">
|
||||
<h1 class="charname">Astrologie {{#if isActor}}: {{actorAstrologie.actor.name}}{{/if}}</h1>
|
||||
</div>
|
||||
{{log 'astrologie' this}}
|
||||
{{#if isActor}}
|
||||
{{> 'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-joueur.hbs'}}
|
||||
{{else}}
|
||||
{{> 'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-gardien.hbs'}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div>
|
||||
{{> 'systems/foundryvtt-reve-de-dragon/templates/sommeil/astrologie-theme.hbs'}}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
57
templates/sommeil/astrologie-gardien.hbs
Normal file
57
templates/sommeil/astrologie-gardien.hbs
Normal file
@ -0,0 +1,57 @@
|
||||
<div>
|
||||
<a class="chat-card-button" name="rebuild-nombres-astraux">Réinitialiser les nombres astraux</a>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
{{#each gmAstrologie.nombresAstraux as |nba|}}
|
||||
<th>{{nba.date.jour}}{{timestamp-imgSigneHeure nba.date.mois}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nombre astral</th>
|
||||
{{#each gmAstrologie.nombresAstraux as |nba|}}
|
||||
<td class="nombre-astral" data-nombre-astral="{{nba.nombreAstral}}">
|
||||
<ol>
|
||||
<b>{{nba.nombreAstral}}</b>
|
||||
{{#each nba.valeursFausses as |fausse|}}
|
||||
<li>{{fausse.actorName}} - {{fausse.nombreAstral}}</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr>
|
||||
<th></th>
|
||||
{{#each heures as |heure|}}
|
||||
<td>
|
||||
{{timestamp-imgSigneHeure heure.heure}}
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{#each gmAstrologie.ajustementsActors as |ajustementActeur|}}
|
||||
<tr class="heure-naissance" data-heure-naissance="{{actor.system.heure}}">
|
||||
<td>
|
||||
<img class="img-signe-heure" src="{{actor.img}}" title="{{actor.name}}" />
|
||||
{{actor.name}} {{timestamp-imgSigneHeure actor.system.heure}}
|
||||
</td>
|
||||
{{#each ajustementActeur.ajustements as |ajustement|}}
|
||||
<td>{{#if (ne ajustement.ajustement 0)}}
|
||||
<strong>
|
||||
{{numberFormat ajustement.ajustement decimals=0 sign=true}}
|
||||
</strong>
|
||||
{{else}}
|
||||
<div class="dimmed">
|
||||
{{timestamp-imgSigneHeure ajustement.heure}}
|
||||
</div>
|
||||
{{/if}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
</div>
|
43
templates/sommeil/astrologie-joueur.hbs
Normal file
43
templates/sommeil/astrologie-joueur.hbs
Normal file
@ -0,0 +1,43 @@
|
||||
<div>
|
||||
<label>Conditions</label>
|
||||
<select name="diffConditions" data-dtype="Number">
|
||||
{{#select '0'}}
|
||||
{{#each actorAstrologie.ajustements as |ajustement|}}
|
||||
<option value={{ajustement}}>{{ajustement}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label> Jours</label>
|
||||
<select name="joursAstrologie" data-dtype="Number">
|
||||
{{#select ''}}
|
||||
{{#each dates as |date|}}
|
||||
<option value={{date.index}}>{{date.label}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label>
|
||||
Etat Général: {{actorAstrologie.etat}}
|
||||
</label>
|
||||
<a class="chat-card-button" name="jet-astrologie">Lire les étoiles</a>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="astralList">Nombres Astraux</label>
|
||||
<table class='table-nombres-astraux'>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
{{#each actorAstrologie.nombres as |nombre|}}
|
||||
<th class='table-nombres-astraux-td'>{{nombre.jourlabel}}</th>
|
||||
{{/each}}
|
||||
</tr>
|
||||
<tr class='table-nombres-astraux-td'>
|
||||
{{#each actorAstrologie.nombres as |nombre|}}
|
||||
<td class='table-nombres-astraux-td'>
|
||||
<ol>
|
||||
{{#each nombre.listValues as |value|}}
|
||||
<li>{{value}}</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
32
templates/sommeil/astrologie-theme.hbs
Normal file
32
templates/sommeil/astrologie-theme.hbs
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="theme-astral">
|
||||
<div class="flexcol">
|
||||
<label for="signe-astral">Nombre Astral</label>
|
||||
<select name="signe-astral" class="calendar-signe-heure" data-dtype="String">
|
||||
{{#select "vaisseau"}}
|
||||
{{#each heures as |heure|}}
|
||||
<option value="{{heure.key}}">{{numberFormat heure.hh}} - {{heure.label}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label for="signe-naissance">Heure de Naissance</label>
|
||||
<select name="signe-naissance" class="calendar-signe-heure" data-dtype="String">
|
||||
{{#select "vaisseau"}}
|
||||
{{#each heures as |heure|}}
|
||||
<option value="{{heure.key}}">{{numberFormat heure.hh}} - {{heure.label}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<hr>
|
||||
<div><label>Heures de chance et malchance</label></div>
|
||||
<div class="astro-roue">
|
||||
<div class="astro-cercle1"></div>
|
||||
<div class="astro-disque">
|
||||
<img src="systems/foundryvtt-reve-de-dragon/styles/img/ui/astro-disque.svg" alt="">
|
||||
</div>
|
||||
{{#each heures as |heure|}}
|
||||
<div class="astro-heure heure-{{heure.hh}}"><img class="astro-heure-img" src="{{heure.webp}}" title="{{heure.label}}"></div>
|
||||
<div class="astro-ajustement ajustement-{{heure.hh}}"></div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
@ -1,52 +0,0 @@
|
||||
<form class="dialog-astro">
|
||||
<div class="form-group">
|
||||
<label for="signe-astral">Chiffre Astral</label>
|
||||
<select name="signe-astral" class="calendar-signe-heure" data-dtype="String">
|
||||
{{#select "vaisseau"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signe-naissance">Heure</label>
|
||||
<select name="signe-naissance" class="calendar-signe-heure" data-dtype="String">
|
||||
{{#select "vaisseau"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<hr>
|
||||
<div><label>Heures de chance et malchance</label></div>
|
||||
<div class="astro-roue">
|
||||
<div class="astro-cercle1"></div>
|
||||
<div class="astro-disque">
|
||||
<img src="systems/foundryvtt-reve-de-dragon/styles/img/ui/astro-disque.svg" alt="">
|
||||
</div>
|
||||
<div class="astro-heure heure-01"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd01.webp" alt=""></div>
|
||||
<div class="astro-heure heure-02"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd02.webp" alt=""></div>
|
||||
<div class="astro-heure heure-03"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd03.webp" alt=""></div>
|
||||
<div class="astro-heure heure-04"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd04.webp" alt=""></div>
|
||||
<div class="astro-heure heure-05"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd05.webp" alt=""></div>
|
||||
<div class="astro-heure heure-06"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd06.webp" alt=""></div>
|
||||
<div class="astro-heure heure-07"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd07.webp" alt=""></div>
|
||||
<div class="astro-heure heure-08"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd08.webp" alt=""></div>
|
||||
<div class="astro-heure heure-09"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd09.webp" alt=""></div>
|
||||
<div class="astro-heure heure-10"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd10.webp" alt=""></div>
|
||||
<div class="astro-heure heure-11"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd11.webp" alt=""></div>
|
||||
<div class="astro-heure heure-12"><img class="astro-heure-img" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd12.webp" alt=""></div>
|
||||
|
||||
<div class="astro-ajustement ajustement-01"></div>
|
||||
<div class="astro-ajustement ajustement-02"></div>
|
||||
<div class="astro-ajustement ajustement-03">-2</div>
|
||||
<div class="astro-ajustement ajustement-04">+2</div>
|
||||
<div class="astro-ajustement ajustement-05"></div>
|
||||
<div class="astro-ajustement ajustement-06">-4</div>
|
||||
<div class="astro-ajustement ajustement-07"></div>
|
||||
<div class="astro-ajustement ajustement-08">+2</div>
|
||||
<div class="astro-ajustement ajustement-09">-2</div>
|
||||
<div class="astro-ajustement ajustement-10"></div>
|
||||
<div class="astro-ajustement ajustement-11"></div>
|
||||
<div class="astro-ajustement ajustement-12">+4</div>
|
||||
|
||||
</div>
|
||||
</form>
|
Loading…
Reference in New Issue
Block a user