Compare commits
42 Commits
foundryvtt
...
foundryvtt
Author | SHA1 | Date | |
---|---|---|---|
88e00c59bc | |||
d314dc39a0 | |||
30bb803da2 | |||
dd79e16ea5 | |||
83e2d56fd4 | |||
afc23dfa7b | |||
3e189cbe5f | |||
d0475e8677 | |||
a3694c1673 | |||
9e6d5856b1 | |||
acc880b53f | |||
2598ae3489 | |||
4f5fb63751 | |||
d739a7993a | |||
41335cd433 | |||
e470d76ea0 | |||
ffccc819f1 | |||
45bfc69b39 | |||
79e9358072 | |||
5cab418e62 | |||
7809f7c21a | |||
1bac204071 | |||
3bf5beb67b | |||
ac1da6e979 | |||
67735197bc | |||
f81dc9a5f5 | |||
a563233d6b | |||
0c11013694 | |||
77cf72a752 | |||
42ed5da2d4 | |||
5fd3a43b2a | |||
1bb710ce83 | |||
80579032ea | |||
a810e20eca | |||
c6f0aaeba0 | |||
3c3be7409d | |||
f97345e407 | |||
4cc50fc190 | |||
26967fe1cd | |||
b23dcaace5 | |||
045ee76013 | |||
7fed3844b5 |
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
.vscode/settings.json
|
||||
.idea
|
||||
.history
|
||||
todo.md
|
||||
/.vscode
|
||||
/ignored/
|
||||
|
BIN
icons/sante/blessure-mort.webp
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
icons/sante/blessure-soins.webp
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
icons/sante/blessure.webp
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
icons/sante/eraflure.webp
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
icons/sante/mort.webp
Normal file
After Width: | Height: | Size: 7.6 KiB |
65
lang/fr.json
@ -7,47 +7,48 @@
|
||||
"TypeVehicule": "Véhicule"
|
||||
},
|
||||
"ITEM": {
|
||||
"TypeObjet": "Objet",
|
||||
"TypeGemme": "Gemme",
|
||||
"TypeCompetence": "Compétence",
|
||||
"TypeCompetencecreature": "Compétence de créature",
|
||||
"TypeMaladie": "Maladie",
|
||||
"TypePoison": "Poison",
|
||||
"TypeNombreastral": "Nombre astral",
|
||||
"TypeTarot": "Carte de tarot",
|
||||
"TypeCasetmr": "TMR spéciale",
|
||||
"TypeRencontre": "Rencontre TMR",
|
||||
"TypeMunition": "Munition",
|
||||
"TypeMonnaie": "Monnaie",
|
||||
"TypeHerbe": "Herbe",
|
||||
"TypePlante": "Plante",
|
||||
"TypeIngredient": "Ingrédient",
|
||||
"TypeFaune": "Faune",
|
||||
"TypeLivre": "Livre",
|
||||
"TypePotion": "Potion",
|
||||
"TypeArme": "Arme",
|
||||
"TypeArmure": "Armure",
|
||||
"TypeConteneur": "Conteneur",
|
||||
"TypeNourritureboisson": "Nourriture & boisson",
|
||||
"TypeService": "Service",
|
||||
"TypeBlessure": "Blessure",
|
||||
"TypeCasetmr": "TMR spéciale",
|
||||
"TypeChant": "Chant",
|
||||
"TypeCompetence": "Compétence",
|
||||
"TypeCompetencecreature": "Compétence de créature",
|
||||
"TypeConteneur": "Conteneur",
|
||||
"TypeDanse": "Danse",
|
||||
"TypeMusique": "Musique",
|
||||
"TypeOeuvre": "Oeuvre",
|
||||
"TypeTache": "Tâche",
|
||||
"TypeExtraitpoetique": "Extrait poetique",
|
||||
"TypeFaune": "Faune",
|
||||
"TypeGemme": "Gemme",
|
||||
"TypeHerbe": "Herbe",
|
||||
"TypeIngredient": "Ingrédient",
|
||||
"TypeJeu": "Jeu",
|
||||
"TypeLivre": "Livre",
|
||||
"TypeMaladie": "Maladie",
|
||||
"TypeMeditation": "Méditation",
|
||||
"TypeMonnaie": "Monnaie",
|
||||
"TypeMunition": "Munition",
|
||||
"TypeMusique": "Musique",
|
||||
"TypeNombreastral": "Nombre astral",
|
||||
"TypeNourritureboisson": "Nourriture & boisson",
|
||||
"TypeObjet": "Objet",
|
||||
"TypeOeuvre": "Oeuvre",
|
||||
"TypeOmbre": "Ombre de Thanatos",
|
||||
"TypePlante": "Plante",
|
||||
"TypePoison": "Poison",
|
||||
"TypePossession": "Possession",
|
||||
"TypePotion": "Potion",
|
||||
"TypeQueue": "Queue de Dragon",
|
||||
"TypeRecettealchimique": "Recette alchimique",
|
||||
"TypeRecettecuisine": "Recette de cuisine",
|
||||
"TypeSort": "Sort",
|
||||
"TypeMeditation": "Méditation",
|
||||
"TypeRencontre": "Rencontre TMR",
|
||||
"TypeService": "Service",
|
||||
"TypeSignedraconique": "Signe draconique",
|
||||
"TypeQueue": "Queue de Dragon",
|
||||
"TypeOmbre": "Ombre de Thanatos",
|
||||
"TypeSouffle": "Souffle de Dragon",
|
||||
"TypeTete": "Tête de Dragon",
|
||||
"TypePossession": "Possession",
|
||||
"TypeSort": "Sort",
|
||||
"TypeSortreserve": "Sort en réserve",
|
||||
"TypeExtraitpoetique": "Extrait poetique"
|
||||
"TypeSouffle": "Souffle de Dragon",
|
||||
"TypeTache": "Tâche",
|
||||
"TypeTarot": "Carte de tarot",
|
||||
"TypeTete": "Tête de Dragon"
|
||||
},
|
||||
"EFFECT": {
|
||||
"StatusStunned": "Sonné",
|
||||
|
@ -13,6 +13,7 @@ import { STATUSES } from "./settings/status-effects.js";
|
||||
import { MAINS_DIRECTRICES } from "./actor.js";
|
||||
import { RdDBaseActorSheet } from "./actor/base-actor-sheet.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDItemBlessure } from "./item/blessure.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
@ -151,42 +152,31 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.html.find('.creer-tache').click(async event => {
|
||||
this.createEmptyTache();
|
||||
});
|
||||
this.html.find('.creer-tache-blessure-legere').click(async event => {
|
||||
this.actor.createTacheBlessure('legere');
|
||||
});
|
||||
this.html.find('.creer-tache-blessure-grave').click(async event => {
|
||||
this.actor.createTacheBlessure('grave');
|
||||
});
|
||||
this.html.find('.creer-tache-blessure-critique').click(async event => {
|
||||
this.actor.createTacheBlessure('critique');
|
||||
});
|
||||
this.html.find('.creer-tache-blessure-legere').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 2));
|
||||
this.html.find('.creer-tache-blessure-grave').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 4));
|
||||
this.html.find('.creer-tache-blessure-critique').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 6));
|
||||
this.html.find('.creer-blessure-legere').click(async event => RdDItemBlessure.createBlessure(this.actor, 2));
|
||||
this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4));
|
||||
this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6));
|
||||
this.html.find('.creer-une-oeuvre').click(async event => {
|
||||
this.selectTypeOeuvreToCreate();
|
||||
});
|
||||
|
||||
// Blessure control
|
||||
this.html.find('.blessure-control').click(async event => {
|
||||
const tr = this.html.find(event.currentTarget).parents(".item");
|
||||
let btype = tr.data("blessure-type");
|
||||
let index = tr.data('blessure-index');
|
||||
let active = this.html.find(event.currentTarget).data('blessure-active');
|
||||
//console.log(btype, index, active);
|
||||
await this.actor.manageBlessureFromSheet(btype, index, active);
|
||||
this.html.find('.blessure-premierssoins-done').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
||||
});
|
||||
|
||||
// Blessure data
|
||||
this.html.find('.blessure-soins').change(async event => {
|
||||
const tr = this.html.find(event.currentTarget).parents(".item");
|
||||
let btype = tr.data('blessure-type');
|
||||
let index = tr.data('blessure-index');
|
||||
let psoins = tr.find('.blessure-premiers_soins').val();
|
||||
let pcomplets = tr.find('.blessure-soins_complets').val();
|
||||
let jours = tr.find('.blessure-jours').val();
|
||||
let loc = tr.find('.blessure-localisation').val();
|
||||
let psdone = tr.find('.blessure-psdone:checked').val();
|
||||
let scdone = tr.find('.blessure-scdone:checked').val();
|
||||
console.log(btype, index, psoins, pcomplets, jours, loc, psdone, scdone);
|
||||
await this.actor.setDataBlessureFromSheet(btype, index, psoins, pcomplets, jours, loc, psdone, scdone);
|
||||
this.html.find('.blessure-soinscomplets-done').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||
});
|
||||
this.html.find('.blessure-premierssoins-bonus').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ premierssoins: { bonus: Number(event.currentTarget.value) } })
|
||||
});
|
||||
this.html.find('.blessure-soinscomplets-bonus').change(async event => {
|
||||
const blessure = this.getBlessure(event);
|
||||
await blessure?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
||||
});
|
||||
|
||||
// Equip Inventory Item
|
||||
@ -426,6 +416,12 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
});
|
||||
}
|
||||
|
||||
getBlessure(event) {
|
||||
const itemId = this.html.find(event.currentTarget).parents(".item-blessure").data('item-id');
|
||||
const blessure = this.actor.getItem(itemId, 'blessure');
|
||||
return blessure;
|
||||
}
|
||||
|
||||
isCompetenceAffichable(competence) {
|
||||
return !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(competence);
|
||||
}
|
||||
|
770
module/actor.js
@ -78,6 +78,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static filterItemsPerTypeForSheet(formData, itemTypes) {
|
||||
formData.blessures = Misc.arrayOrEmpty(itemTypes['blessure']);
|
||||
formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']);
|
||||
formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']);
|
||||
formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']);
|
||||
@ -123,21 +124,27 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
.map(t => Misc.arrayOrEmpty(itemTypes[t]))
|
||||
.reduce((a, b) => a.concat(b), [])
|
||||
.sort(Misc.ascending(it => it.name));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */ /** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
|
||||
this.html.find('.conteneur-name a').click(async event => {
|
||||
RdDUtility.toggleAfficheContenu(this.getItemId(event));
|
||||
this.render(true);
|
||||
});
|
||||
this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true))
|
||||
this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat());
|
||||
this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat());
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */ /** @override */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.html = html;
|
||||
|
||||
this.html.find('.conteneur-name a').click(async event => {
|
||||
RdDUtility.toggleAfficheContenu(this.getItemId(event));
|
||||
this.render(true);
|
||||
});
|
||||
this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true))
|
||||
this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat());
|
||||
this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat());
|
||||
this.html.find('.recherche')
|
||||
.each((index, field) => {
|
||||
this._rechercheSelectArea(field);
|
||||
})
|
||||
.keyup(async event => this._rechercherKeyup(event))
|
||||
.change(async event => this._rechercherKeyup(event));
|
||||
this.html.find('.recherche').prop( "disabled", false );
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
@ -160,12 +167,6 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
this.html.find('.monnaie-moins').click(async event => {
|
||||
this.actor.monnaieIncDec(this.getItemId(event), -1);
|
||||
});
|
||||
this.html.find('.recherche')
|
||||
.each((index, field) => {
|
||||
this._rechercheSelectArea(field);
|
||||
})
|
||||
.keyup(async event => this._rechercherKeyup(event))
|
||||
.change(async event => this._rechercherKeyup(event));
|
||||
}
|
||||
|
||||
_rechercherKeyup(event) {
|
||||
|
@ -5,6 +5,7 @@ import { Misc } from "../misc.js";
|
||||
import { RdDAudio } from "../rdd-audio.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
||||
import { APP_ASTROLOGIE_REFRESH } from "../sommeil/app-astrologie.js";
|
||||
|
||||
export class RdDBaseActor extends Actor {
|
||||
|
||||
@ -20,16 +21,18 @@ export class RdDBaseActor extends Actor {
|
||||
Hooks.on("updateActor", (actor, change, options, actorId) => actor.onUpdateActor(change, options, actorId));
|
||||
}
|
||||
|
||||
|
||||
static onSocketMessage(sockmsg) {
|
||||
switch (sockmsg.msg) {
|
||||
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,18 +0,0 @@
|
||||
const BASE_TACHE_SOIN_BLESSURE = { type: "tache", img: 'systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp', system: { carac: "dexterite", competence: "Chirurgie", periodicite: "1 round", fatigue: 0, } }
|
||||
const TACHES_SOIN_BLESSURE = {
|
||||
'critique': { name: 'Blessure critique', system: { difficulte: -6, points_de_tache: 6 } },
|
||||
'grave': { name: 'Blessure grave', system: { difficulte: -4, points_de_tache: 4 } },
|
||||
'legere': { name: 'Blessure légère', system: { difficulte: -2, points_de_tache: 2 } },
|
||||
}
|
||||
|
||||
export class RdDItemTache extends Item {
|
||||
|
||||
static prepareTacheSoin(gravite) {
|
||||
const blessure = TACHES_SOIN_BLESSURE[gravite]
|
||||
if (blessure) {
|
||||
return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), blessure)
|
||||
}
|
||||
ui.notifications.warn(`Pas de tâche de soins pour une blessure ${gravite}`)
|
||||
return undefined;
|
||||
}
|
||||
}
|
@ -31,9 +31,9 @@ const typesInventaire = {
|
||||
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"]
|
||||
const typesObjetsDraconiques = ["queue", "ombre", "souffle", "tete", "signedraconique", "sortreserve", "rencontre"]
|
||||
const typesObjetsConnaissance = ["meditation", "recettealchimique", "sort"]
|
||||
const typesObjetsEffet = ["possession", "poison", "maladie"]
|
||||
const typesObjetsEffet = ["possession", "poison", "maladie", "blessure"]
|
||||
const typesObjetsCompetence = ["competence", "competencecreature"]
|
||||
const typesObjetsTemporels = ["poison", "maladie", "queue", "ombre", "souffle", "signedraconique", "rencontre"]
|
||||
const typesObjetsTemporels = ["blessure", "poison", "maladie", "queue", "ombre", "souffle", "signedraconique", "rencontre"]
|
||||
const typesEnvironnement = typesInventaireMateriel;
|
||||
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
|
||||
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
|
||||
@ -176,6 +176,7 @@ export class RdDItem extends Item {
|
||||
isBoisson() { return this.isNourritureBoisson() && this.system.boisson; }
|
||||
isAlcool() { return this.isNourritureBoisson() && this.system.boisson && this.system.alcoolise; }
|
||||
isHerbeAPotion() { return this.type == 'herbe' && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos'); }
|
||||
isBlessure() { return this.type == 'blessure' }
|
||||
|
||||
isPresentDansMilieux(milieux) {
|
||||
return this.getEnvironnements(milieux).length > 0
|
||||
|
177
module/item/blessure.js
Normal file
@ -0,0 +1,177 @@
|
||||
import { RdDItem } from "../item.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDTimestamp } from "../rdd-timestamp.js";
|
||||
|
||||
const BASE_TACHE_SOIN_BLESSURE = {
|
||||
type: "tache",
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp',
|
||||
system: { carac: "dexterite", competence: "Chirurgie", periodicite: "1 round", fatigue: 0, }
|
||||
}
|
||||
const TACHES_SOIN_BLESSURE = {
|
||||
6: { name: 'Blessure critique', system: { difficulte: -6, points_de_tache: 6 } },
|
||||
4: { name: 'Blessure grave', system: { difficulte: -4, points_de_tache: 4 } },
|
||||
2: { name: 'Blessure légère', system: { difficulte: -2, points_de_tache: 2 } },
|
||||
}
|
||||
|
||||
const definitionsBlessures = [
|
||||
{ type: "contusion", gravite: 0, labelGravite: 'Contusion/éraflure', max: 100, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/eraflure.webp" },
|
||||
{ type: "legere", gravite: 2, labelGravite: 'Légère', max: 5, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
|
||||
{ type: "grave", gravite: 4, labelGravite: 'Grave', max: 2, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
|
||||
{ type: "critique", gravite: 6, labelGravite: 'Critique', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
|
||||
{ type: "mort", gravite: 8, labelGravite: 'Mort', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/mort.webp" }
|
||||
]
|
||||
|
||||
export class RdDItemBlessure extends RdDItem {
|
||||
|
||||
static get defaultIcon() {
|
||||
return "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp";
|
||||
}
|
||||
|
||||
prepareDerivedData() {
|
||||
super.prepareDerivedData();
|
||||
this.system.labelGravite = this.getLabelGravite()
|
||||
}
|
||||
|
||||
static prepareTacheSoin(gravite) {
|
||||
const tache = TACHES_SOIN_BLESSURE[gravite]
|
||||
if (!tache) {
|
||||
ui.notifications.warn(`Pas de tâche de soins pour une blessure ${gravite}`)
|
||||
return undefined;
|
||||
}
|
||||
return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), tache)
|
||||
}
|
||||
static async createBlessure(actor, gravite, localisation = '') {
|
||||
const definition = RdDItemBlessure.getDefinition(gravite)
|
||||
const blessure = {
|
||||
name: definition.labelGravite,
|
||||
type: 'blessure',
|
||||
img: definition.icon,
|
||||
system: {
|
||||
gravite: gravite,
|
||||
difficulte: - gravite,
|
||||
localisation: localisation
|
||||
}
|
||||
}
|
||||
|
||||
const blessures = await actor.createEmbeddedDocuments('Item', [blessure])
|
||||
return blessures[0]
|
||||
}
|
||||
|
||||
static async createTacheSoinBlessure(actor, gravite) {
|
||||
const tache = RdDItemBlessure.prepareTacheSoin(gravite)
|
||||
if (tache) {
|
||||
const taches = await actor.createEmbeddedDocuments('Item', [tache], { renderSheet: false });
|
||||
return taches[0];
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
async updateTacheSoinBlessure(tache) {
|
||||
if (tache) {
|
||||
await tache.update({
|
||||
system: {
|
||||
itemId: this.id,
|
||||
difficulte: Math.min(this.system.difficulte, tache.system.difficulte),
|
||||
points_de_tache_courant: Math.max(0, this.system.premierssoins.tache)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async setSoinsBlessure(systemUpdate = {}) {
|
||||
systemUpdate = mergeObject(systemUpdate, this.system, { overwrite: false }),
|
||||
systemUpdate.soinscomplets.done = systemUpdate.premierssoins.done && systemUpdate.soinscomplets.done
|
||||
await this.update({
|
||||
img: this.getImgSoins(systemUpdate.gravite, systemUpdate.soinscomplets.done),
|
||||
system: systemUpdate
|
||||
});
|
||||
}
|
||||
|
||||
async recuperationBlessure({ actor, timestamp, message, isMaladeEmpoisonne, blessures }) {
|
||||
if (this.parent != actor || actor == undefined) {
|
||||
return;
|
||||
}
|
||||
if (new RdDTimestamp(this.system.fin).isAfterIndexDate(timestamp)) {
|
||||
// attente periode
|
||||
return
|
||||
}
|
||||
if (this.system.gravite > 0) {
|
||||
const update = { premierssoins: { bonus: 0 }, soinscomplets: { bonus: 0 } }
|
||||
const gravite = this.system.gravite;
|
||||
const graviteMoindre = gravite - 2;
|
||||
const moindres = blessures.filter(it => it.system.gravite == graviteMoindre, 'blessures').length
|
||||
const labelGravite = RdDItemBlessure.getLabelGravite(gravite);
|
||||
|
||||
let rolled = await actor.jetRecuperationConstitution(Misc.toInt(this.system.soinscomplets.bonus) + actor.system.sante.bonusPotion, message);
|
||||
|
||||
if (rolled.isETotal) {
|
||||
message.content += ` -- une blessure ${labelGravite} s'infecte (temps de guérison augmenté de ${definition.facteur} jours, perte de vie)`;
|
||||
mergeObject(update, { fin: { indexDate: timestamp.addJours(gravite).indexDate } });
|
||||
await actor.santeIncDec("vie", -1);
|
||||
}
|
||||
else {
|
||||
if (!isMaladeEmpoisonne && rolled.isSuccess && this.peutRetrograder(graviteMoindre, moindres)) {
|
||||
message.content += ` -- une blessure ${labelGravite} cicatrise`;
|
||||
mergeObject(update, { gravite: graviteMoindre, fin: { indexDate: timestamp.addJours(graviteMoindre).indexDate } });
|
||||
}
|
||||
else {
|
||||
message.content += ` -- une blessure ${labelGravite} reste stable`;
|
||||
}
|
||||
}
|
||||
await this.update(update);
|
||||
}
|
||||
}
|
||||
|
||||
peutRetrograder(graviteMoindre, moindres) {
|
||||
return moindres < RdDItemBlessure.getDefinition(graviteMoindre).max
|
||||
}
|
||||
|
||||
async calculerFinPeriodeTemporel(debut) {
|
||||
return await debut.nouveauJour().addJours(this.system.gravite);
|
||||
}
|
||||
|
||||
async onFinPeriode(oldTimestamp, newTimestamp) {
|
||||
if (this.system.gravite <= 0) {
|
||||
await super.onFinPeriode(oldTimestamp, newTimestamp)
|
||||
}
|
||||
}
|
||||
|
||||
getImgSoins(gravite, soins) {
|
||||
let img = 'blessure'
|
||||
if (gravite > 6) {
|
||||
img = 'mort'
|
||||
}
|
||||
if (gravite <= 0) {
|
||||
img = 'eraflure'
|
||||
}
|
||||
return `systems/foundryvtt-reve-de-dragon/icons/sante/${soins ? 'blessure-soins' : img}.webp`
|
||||
}
|
||||
|
||||
getLabelGravite() {
|
||||
return RdDItemBlessure.getDefinition(this.system.gravite).labelGravite
|
||||
}
|
||||
|
||||
static getDefinition(gravite) {
|
||||
return definitionsBlessures.sort(Misc.ascending(it => it.gravite))
|
||||
.find(it => it.gravite >= gravite);
|
||||
}
|
||||
static maxBlessures(gravite) {
|
||||
return RdDItemBlessure.getDefinition(gravite).max
|
||||
}
|
||||
|
||||
isContusion() {
|
||||
return this.system.gravite <= 0
|
||||
}
|
||||
isLegere() {
|
||||
return this.system.gravite > 0 && this.system.gravite <= 2
|
||||
}
|
||||
isGrave() {
|
||||
return this.system.gravite > 2 && this.system.gravite <= 4
|
||||
}
|
||||
isCritique() {
|
||||
return this.system.gravite > 4 && this.system.gravite <= 6
|
||||
}
|
||||
isMort() {
|
||||
return this.system.gravite > 6
|
||||
}
|
||||
}
|
29
module/item/sheet-blessure.js
Normal file
@ -0,0 +1,29 @@
|
||||
import { RdDItemSheet } from "../item-sheet.js";
|
||||
|
||||
export class RdDBlessureItemSheet extends RdDItemSheet {
|
||||
|
||||
static get ITEM_TYPE() { return "blessure" };
|
||||
|
||||
async getData() {
|
||||
const formData = await super.getData();
|
||||
formData.disabled = formData.options.isGM || formData.options.isOwned ? '' : 'disabled';
|
||||
return formData;
|
||||
}
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
if (!this.options.editable) return;
|
||||
|
||||
this.html.find('[name="premierssoins-done"]').change(async event => {
|
||||
await this.item.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
||||
});
|
||||
this.html.find('[name="soinscomplets-done"]').change(async event => {
|
||||
await this.item.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||
});
|
||||
this.html.find('[name="system-gravite"]').change(async event => {
|
||||
const gravite = Number(event.currentTarget.value)
|
||||
await this.item.setSoinsBlessure({ gravite: gravite, difficulte: - gravite })
|
||||
});
|
||||
}
|
||||
}
|
@ -416,6 +416,49 @@ class _10_5_0_UpdatePeriodicite extends Migration {
|
||||
}
|
||||
}
|
||||
|
||||
class _10_7_0_MigrationBlessures extends Migration {
|
||||
get code() { return "migration-blessures"; }
|
||||
get version() { return "10.7.0"; }
|
||||
|
||||
async migrate() {
|
||||
const timestamp = game.system.rdd.calendrier.getTimestamp()
|
||||
await Promise.all(game.actors.filter(it => it.isPersonnage() || it.isCreature())
|
||||
.map(async (actor) => {
|
||||
const legeres = actor.system.blessures?.legeres.liste.filter(it => it.active).map(it => this.creerBlessure(2, 'légère', it, timestamp)) ?? [];
|
||||
const graves = actor.system.blessures?.graves.liste.filter(it => it.active).map(it => this.creerBlessure(4, 'grave', it, timestamp)) ?? [];
|
||||
const critiques = actor.system.blessures?.critiques.liste.filter(it => it.active).map(it => this.creerBlessure(6, 'critique', it, timestamp));
|
||||
const blessures = legeres.concat(graves).concat(critiques);
|
||||
if (blessures.length > 0) {
|
||||
await actor.createEmbeddedDocuments("Item", blessures);
|
||||
}
|
||||
await actor.update({
|
||||
'system.blessures.legeres.liste': [],
|
||||
'system.blessures.graves.liste': [],
|
||||
'system.blessures.critiques.liste': []
|
||||
})
|
||||
}));
|
||||
}
|
||||
creerBlessure(gravite, graviteTexte, blessure, timestamp) {
|
||||
const dateBlessure = timestamp.addJours(-blessure.jours);
|
||||
const datePremiereRecup = dateBlessure.addJours(gravite);
|
||||
return {
|
||||
name: `Blessure ${graviteTexte}`,
|
||||
type: 'blessure',
|
||||
img: `systems/foundryvtt-reve-de-dragon/icons/sante/blessure${blessure.psdone ? '-soins' : ''}.webp`,
|
||||
system: {
|
||||
gravite: gravite,
|
||||
difficulte: -gravite,
|
||||
debut: { indexDate: dateBlessure.indexDate, indexMinute: 0 },
|
||||
fin: { indexDate: datePremiereRecup.indexDate, indexMinute: 0 },
|
||||
premierssoins: { done: blessure.psdone, bonus: blessure.premiers_soins },
|
||||
soinscomplets: { done: blessure.scdone, bonus: blessure.soins_complets },
|
||||
localisation: blessure.localisation,
|
||||
jours: blessure.jours
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class Migrations {
|
||||
static getMigrations() {
|
||||
return [
|
||||
@ -431,6 +474,7 @@ export class Migrations {
|
||||
new _10_3_17_Monnaies(),
|
||||
new _10_4_6_ServicesEnCommerces(),
|
||||
new _10_5_0_UpdatePeriodicite(),
|
||||
new _10_7_0_MigrationBlessures(),
|
||||
];
|
||||
}
|
||||
|
||||
@ -447,7 +491,7 @@ export class Migrations {
|
||||
migrate() {
|
||||
const currentVersion = game.settings.get(SYSTEM_RDD, "systemMigrationVersion");
|
||||
if (isNewerVersion(game.system.version, currentVersion)) {
|
||||
//if (true) { /* comment previous and uncomment here to test before upgrade */
|
||||
//if (true) { /* comment previous and uncomment here to test before upgrade */
|
||||
const migrations = Migrations.getMigrations().filter(m => isNewerVersion(m.version, currentVersion));
|
||||
if (migrations.length > 0) {
|
||||
migrations.sort((a, b) => this.compareVersions(a, b));
|
||||
|
@ -119,6 +119,17 @@ export class Misc {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns an array of incremental integers (including from / excluding to).
|
||||
* if max<min, the array is decrementing integers
|
||||
*/
|
||||
static intArray(from, to) {
|
||||
if (from > to) {
|
||||
return Array.from(Array(from - to).keys()).map(i => from - i)
|
||||
}
|
||||
return Array.from(Array(to - from).keys()).map(i => from + i)
|
||||
}
|
||||
|
||||
static distinct(array) {
|
||||
return [...new Set(array)];
|
||||
}
|
||||
|
@ -1,49 +0,0 @@
|
||||
|
||||
/**
|
||||
* 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 myButtons = {
|
||||
resetButton: { label: "Re-tirer les nombres astraux", callback: html => this.resetNombreAstraux() },
|
||||
saveButton: { label: "Fermer", callback: html => {} }
|
||||
};
|
||||
|
||||
// Common conf
|
||||
let dialogConf = { content: html, title: "Editeur d'Astrologie", buttons: myButtons, default: "saveButton" };
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async resetNombreAstraux() {
|
||||
game.system.rdd.calendrier.resetNombreAstral();
|
||||
await game.system.rdd.calendrier.rebuildListeNombreAstral();
|
||||
|
||||
game.system.rdd.calendrier.showAstrologieEditor();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
updateData(calendrierData) {
|
||||
this.calendrierData = duplicate(calendrierData);
|
||||
}
|
||||
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
import { RdDItemCompetence } from "./item-competence.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { SYSTEM_SOCKET_ID } from "./constants.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();
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
@ -28,7 +28,7 @@ export class RdDBonus {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static dmg(rollData, dmgActor, isCauchemar = false) {
|
||||
static dmg(rollData, dmgActor, isEntiteIncarnee = false) {
|
||||
let dmg = { total: 0 };
|
||||
if (rollData.arme && rollData.arme.name.toLowerCase() == "esquive") {
|
||||
// Specific case management
|
||||
@ -41,7 +41,7 @@ export class RdDBonus {
|
||||
dmg.dmgSurprise = RdDBonus.dmgBonus(rollData.ajustements?.attaqueDefenseurSurpris.used);
|
||||
dmg.dmgActor = rollData.selectedCarac ? RdDBonus._dmgPerso(dmgActor, rollData.selectedCarac.label, dmg.dmgArme) : 0;
|
||||
dmg.total = dmg.dmgSurprise + dmg.dmgTactique + dmg.dmgArme + dmg.dmgActor + dmg.dmgParticuliere;
|
||||
dmg.mortalite = RdDBonus._calculMortalite(rollData, isCauchemar)
|
||||
dmg.mortalite = RdDBonus._calculMortalite(rollData, isEntiteIncarnee)
|
||||
}
|
||||
return dmg;
|
||||
}
|
||||
@ -62,11 +62,8 @@ export class RdDBonus {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _calculMortalite(rollData, isCauchemar) {
|
||||
if (isCauchemar) {
|
||||
return "cauchemar";
|
||||
}
|
||||
return isCauchemar ? "cauchemar"
|
||||
static _calculMortalite(rollData, isEntiteIncarnee) {
|
||||
return isEntiteIncarnee ? "entiteincarnee"
|
||||
: rollData.dmg?.mortalite
|
||||
?? rollData.arme?.system.mortalite
|
||||
?? "mortel";
|
||||
|
@ -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,17 +38,26 @@ 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));
|
||||
}
|
||||
|
||||
display() {
|
||||
let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
||||
renderTemplate(templatePath, {}).then(html => {
|
||||
this.render(true);
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
async onUpdateSetting(setting, update, options, id) {
|
||||
if (setting.key == SYSTEM_RDD + '.' + WORLD_TIMESTAMP_SETTING) {
|
||||
this.timestamp = RdDTimestamp.getWorldTime();
|
||||
this.updateDisplay();
|
||||
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,7 +154,7 @@ export class RdDCalendrier extends Application {
|
||||
});
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getListeNombreAstral() {
|
||||
getNombresAstraux() {
|
||||
return game.settings.get(SYSTEM_RDD, "liste-nombre-astral") ?? [];
|
||||
}
|
||||
|
||||
@ -190,12 +194,8 @@ export class RdDCalendrier extends Application {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getJoursSuivants(count) {
|
||||
let jours = [];
|
||||
let indexDate = this.timestamp.indexDate;
|
||||
for (let i = 0; i < count; i++, indexDate++) {
|
||||
jours[i] = { label: RdDTimestamp.formatIndexDate(indexDate), index: indexDate };
|
||||
}
|
||||
return jours;
|
||||
return Misc.intArray(this.timestamp.indexDate, this.timestamp.indexDate + count)
|
||||
.map(i => { return { label: RdDTimestamp.formatIndexDate(i), index: i } })
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -216,8 +216,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, {
|
||||
@ -237,29 +237,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.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;
|
||||
@ -269,7 +279,7 @@ export class RdDCalendrier extends Application {
|
||||
await DialogChateauDormant.create();
|
||||
}
|
||||
this.timestamp = newTimestamp;
|
||||
await this.rebuildListeNombreAstral();
|
||||
await this.rebuildNombresAstraux();
|
||||
this.updateDisplay();
|
||||
}
|
||||
|
||||
@ -285,6 +295,7 @@ export class RdDCalendrier extends Application {
|
||||
this.positionnerHeure(Number(calendarSet.value));
|
||||
}
|
||||
this.updateDisplay();
|
||||
Hooks.callAll(APP_ASTROLOGIE_REFRESH);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -301,7 +312,7 @@ export class RdDCalendrier extends Application {
|
||||
async positionnerHeure(heure) {
|
||||
const indexDate = this.timestamp.indexDate;
|
||||
const addDay = this.timestamp.heure < heure ? 0 : 1;
|
||||
const newTimestamp = new RdDTimestamp({ indexDate: indexDate + addDay}).addHeures(heure);
|
||||
const newTimestamp = new RdDTimestamp({ indexDate: indexDate + addDay }).addHeures(heure);
|
||||
await this.setNewTimestamp(newTimestamp)
|
||||
}
|
||||
|
||||
@ -365,20 +376,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);
|
||||
}
|
||||
|
||||
static ecartHeureChance(heureNaissance, nombreAstral, heure) {
|
||||
return (heureNaissance + nombreAstral - heure) % RDD_HEURES_PAR_JOUR;
|
||||
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);
|
||||
@ -389,16 +396,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;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getData() {
|
||||
let formData = super.getData();
|
||||
@ -472,41 +469,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();
|
||||
}
|
||||
}
|
@ -39,35 +39,31 @@ export class RdDCombatManager extends Combat {
|
||||
|
||||
static init() {
|
||||
/* -------------------------------------------- */
|
||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
||||
RdDCombatManager.pushInitiativeOptions(html, options);
|
||||
});
|
||||
Hooks.on("preDeleteCombat", (combat, html, id) => {
|
||||
combat.onPreDeleteCombat()
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
cleanItemUse() {
|
||||
for (let turn of this.turns) {
|
||||
turn.actor.resetItemUse()
|
||||
}
|
||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => { RdDCombatManager.pushInitiativeOptions(html, options); });
|
||||
Hooks.on("updateCombat", (combat, change, options, userId) => { RdDCombat.onUpdateCombat(combat, change, options, userId) });
|
||||
Hooks.on("preDeleteCombat", (combat, html, id) => { combat.onPreDeleteCombat() });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async nextRound() {
|
||||
this.cleanItemUse();
|
||||
await this.finDeRound();
|
||||
return await super.nextRound();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onPreDeleteCombat() {
|
||||
await this.finDeRound({ terminer: true });
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
await this.finDeRound({ terminer: true });
|
||||
ChatUtility.removeChatMessageContaining(`<div data-combatid="${this.id}" data-combatmessage="actor-turn-summary">`)
|
||||
game.messages.filter(m => ChatUtility.getMessageData(m, 'attacker-roll') != undefined && ChatUtility.getMessageData(m, 'defender-roll') != undefined)
|
||||
.forEach(it => it.delete());
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async finDeRound(options = { terminer: false }) {
|
||||
this.turns.forEach(turn => turn.actor.resetItemUse());
|
||||
|
||||
for (let combatant of this.combatants) {
|
||||
if (combatant.actor) {
|
||||
await combatant.actor.finDeRound(options);
|
||||
@ -144,9 +140,8 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculInitiative(niveau, caracValue, bonusEcaille = 0) {
|
||||
let base = niveau + Math.floor(caracValue / 2);
|
||||
base += bonusEcaille;
|
||||
static calculInitiative(niveau, caracValue, bonus = 0) {
|
||||
let base = niveau + Math.floor(caracValue / 2) + bonus;
|
||||
return "1d6" + (base >= 0 ? "+" : "") + base;
|
||||
}
|
||||
|
||||
@ -420,18 +415,11 @@ export class RdDCombatManager extends Combat {
|
||||
/* -------------------------------------------- */
|
||||
export class RdDCombat {
|
||||
|
||||
static init() {
|
||||
Hooks.on("updateCombat", (combat, change, options, userId) => { RdDCombat.onUpdateCombat(combat, change, options, userId) });
|
||||
Hooks.on("preDeleteCombat", (combat, options, userId) => { RdDCombat.onPreDeleteCombat(combat, options, userId); });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static onSocketMessage(sockmsg) {
|
||||
switch (sockmsg.msg) {
|
||||
case "msg_encaisser":
|
||||
return RdDCombat.onMsgEncaisser(sockmsg.data);
|
||||
case "msg_defense":
|
||||
return RdDCombat.onMsgDefense(sockmsg.data);
|
||||
case "msg_encaisser": return RdDCombat.onMsgEncaisser(sockmsg.data);
|
||||
case "msg_defense": return RdDCombat.onMsgDefense(sockmsg.data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,16 +430,6 @@ export class RdDCombat {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static onPreDeleteCombat(combat, options, userId) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
combat.cleanItemUse();
|
||||
ChatUtility.removeChatMessageContaining(`<div data-combatid="${combat.id}" data-combatmessage="actor-turn-summary">`)
|
||||
game.messages.filter(m => ChatUtility.getMessageData(m, 'attacker-roll') != undefined && ChatUtility.getMessageData(m, 'defender-roll') != undefined)
|
||||
.forEach(it => it.delete());
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static combatNouveauTour(combat) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
@ -756,15 +734,6 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async attaque(competence, arme) {
|
||||
// const nonIncarnee = this.defender.isEntite([ENTITE_NONINCARNE])
|
||||
// const blurette = this.defender.isEntite([ENTITE_BLURETTE])
|
||||
// if (nonIncarnee || blurette) {
|
||||
// ChatMessage.create( {
|
||||
// content: `<strong>La cible est ${nonIncarnee ? 'non incarnée' : 'une blurette'}.
|
||||
// Il est impossible de l'atteindre.`,
|
||||
// whisper: ChatMessage.getWhisperRecipients("GM")})
|
||||
// }
|
||||
|
||||
if (!await this.attacker.accorder(this.defender, 'avant-attaque')) {
|
||||
return;
|
||||
}
|
||||
@ -970,9 +939,8 @@ export class RdDCombat {
|
||||
/* -------------------------------------------- */
|
||||
_filterArmesParade(defender, competence) {
|
||||
let items = defender.items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
|
||||
for (let item of items) {
|
||||
item.system.nbUsage = defender.getItemUse(item.id); // Ajout du # d'utilisation ce round
|
||||
}
|
||||
items.forEach(item => item.system.nbUsage = defender.getItemUse(item.id)); // Ajout du # d'utilisation ce round
|
||||
|
||||
switch (competence.system.categorie) {
|
||||
case 'tir':
|
||||
case 'lancer':
|
||||
@ -1327,13 +1295,8 @@ export class RdDCombat {
|
||||
blessuresStatus: actor.computeResumeBlessure(),
|
||||
SConst: actor.getSConst(),
|
||||
actorId: actor.id,
|
||||
isGrave: false,
|
||||
isCritique: false
|
||||
}
|
||||
if (actor.countBlessuresNonSoigneeByName("critiques") > 0) { // Pour éviter le cumul grave + critique
|
||||
formData.isCritique = true;
|
||||
} else if (actor.countBlessuresNonSoigneeByName("graves") > 0) {
|
||||
formData.isGrave = true;
|
||||
isGrave: actor.countBlessures(it => it.isGraves()) > 0,
|
||||
isCritique: actor.countBlessures(it => it.isCritique()) > 0
|
||||
}
|
||||
|
||||
ChatUtility.createChatWithRollMode(actor.name, {
|
||||
|
@ -332,7 +332,7 @@ export class RdDCommands {
|
||||
let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : { name: undefined };
|
||||
if (competence) {
|
||||
for (let actor of actors) {
|
||||
await actor.rollCaracCompetence(caracName, competence.name, diff);
|
||||
await actor.doRollCaracCompetence(caracName, competence.name, diff);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
@ -36,6 +36,7 @@ import { RdDActorVehiculeSheet } from "./actor-vehicule-sheet.js";
|
||||
import { RdDActorEntiteSheet } from "./actor-entite-sheet.js";
|
||||
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDItemBlessure } from "./item/blessure.js";
|
||||
import { RdDItemService } from "./item/service.js";
|
||||
import { RdDItemMaladie } from "./item/maladie.js";
|
||||
import { RdDItemPoison } from "./item/poison.js";
|
||||
@ -46,6 +47,7 @@ import { RdDItemSouffle } from "./item/souffle.js";
|
||||
import { RdDRencontre } from "./item/rencontre.js";
|
||||
|
||||
import { RdDItemSheet } from "./item-sheet.js";
|
||||
import { RdDBlessureItemSheet } from "./item/sheet-blessure.js";
|
||||
import { RdDServiceItemSheet } from "./item/sheet-service.js";
|
||||
import { RdDRencontreItemSheet } from "./item/sheet-rencontre.js";
|
||||
import { RdDHerbeItemSheet } from "./item/sheet-herbe.js";
|
||||
@ -55,6 +57,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 { AppAstrologie } from "./sommeil/app-astrologie.js";
|
||||
|
||||
/**
|
||||
* RdD system
|
||||
@ -73,21 +76,22 @@ export class SystemReveDeDragon {
|
||||
this.RdDUtility = RdDUtility;
|
||||
this.RdDHotbar = RdDHotbar;
|
||||
this.itemClasses = {
|
||||
service: RdDItemService,
|
||||
blessure: RdDItemBlessure,
|
||||
maladie: RdDItemMaladie,
|
||||
ombre: RdDItemOmbre,
|
||||
poison: RdDItemPoison,
|
||||
queue: RdDItemQueue,
|
||||
ombre: RdDItemOmbre,
|
||||
souffle: RdDItemSouffle,
|
||||
rencontre: RdDRencontre,
|
||||
service: RdDItemService,
|
||||
signedraconique: RdDItemSigneDraconique,
|
||||
rencontre: RdDRencontre
|
||||
souffle: RdDItemSouffle,
|
||||
}
|
||||
this.actorClasses = {
|
||||
commerce: RdDCommerce,
|
||||
creature: RdDActor,
|
||||
entite: RdDActor,
|
||||
personnage: RdDActor,
|
||||
vehicule: RdDActor,
|
||||
commerce: RdDCommerce,
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +100,8 @@ export class SystemReveDeDragon {
|
||||
/* -------------------------------------------- */
|
||||
async onInit() {
|
||||
game.system.rdd = this;
|
||||
this.AppAstrologie = AppAstrologie;
|
||||
|
||||
|
||||
console.log(`Initializing Reve de Dragon System`);
|
||||
|
||||
@ -154,6 +160,7 @@ export class SystemReveDeDragon {
|
||||
RdDItemSheet.register(RdDPlanteItemSheet);
|
||||
RdDItemSheet.register(RdDIngredientItemSheet);
|
||||
RdDItemSheet.register(RdDServiceItemSheet);
|
||||
RdDItemSheet.register(RdDBlessureItemSheet);
|
||||
|
||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||
types: [
|
||||
@ -180,7 +187,6 @@ export class SystemReveDeDragon {
|
||||
RdDUtility.init();
|
||||
RdDDice.init();
|
||||
RdDCommands.init();
|
||||
RdDCombat.init();
|
||||
RdDCombatManager.init();
|
||||
RdDTokenHud.init();
|
||||
RdDBaseActor.init();
|
||||
@ -274,8 +280,8 @@ export class SystemReveDeDragon {
|
||||
let sidebar = document.getElementById("sidebar");
|
||||
sidebar.style.width = "min-content";
|
||||
}
|
||||
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
game.system.rdd.calendrier = new RdDCalendrier();
|
||||
new Migrations().migrate();
|
||||
}
|
||||
|
||||
@ -284,13 +290,7 @@ export class SystemReveDeDragon {
|
||||
RdDDice.onReady();
|
||||
/* -------------------------------------------- */
|
||||
/* Affiche/Init le calendrier */
|
||||
let calendrier = new RdDCalendrier();
|
||||
let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
||||
let templateData = {};
|
||||
renderTemplate(templatePath, templateData).then(html => {
|
||||
calendrier.render(true);
|
||||
});
|
||||
game.system.rdd.calendrier = calendrier; // Reference;
|
||||
game.system.rdd.calendrier = new RdDCalendrier().display();
|
||||
|
||||
// Avertissement si joueur sans personnage
|
||||
if (!game.user.isGM && game.user.character == undefined) {
|
||||
|
@ -195,17 +195,6 @@ export class RdDResolutionTable {
|
||||
return Math.max(Math.floor(carac * (diff + 10) / 2), 1);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isAjustementAstrologique(rollData) {
|
||||
if (rollData.selectedCarac?.label.toLowerCase().includes('chance')) {
|
||||
return true;
|
||||
}
|
||||
if (rollData.selectedSort?.system.isrituel) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isEchec(rollData) {
|
||||
switch (rollData.surprise) {
|
||||
@ -294,12 +283,9 @@ export class RdDResolutionTable {
|
||||
carac: carac,
|
||||
difficulte: level,
|
||||
min: minLevel,
|
||||
rows: RdDResolutionTable.incrementalArray(minCarac, maxCarac),
|
||||
cols: RdDResolutionTable.incrementalArray(minLevel, maxLevel)
|
||||
rows: Misc.intArray(minCarac, maxCarac+1),
|
||||
cols: Misc.intArray(minLevel, maxLevel+1)
|
||||
});
|
||||
}
|
||||
static incrementalArray(min, max) {
|
||||
return Array.from(Array(max-min+1).keys()).map(i=>i+min)
|
||||
}
|
||||
|
||||
}
|
@ -30,9 +30,9 @@ export class RdDEncaisser extends Dialog {
|
||||
};
|
||||
}
|
||||
else if (actor.isEntite([ENTITE_BLURETTE, ENTITE_INCARNE])) {
|
||||
dialogConf.default = "cauchemar"
|
||||
dialogConf.default = "entiteincarnee"
|
||||
dialogConf.buttons = {
|
||||
"cauchemar": { label: "Cauchemar", callback: html => this.performEncaisser("cauchemar") }
|
||||
"entiteincarnee": { label: "Entité incarnée", callback: html => this.performEncaisser("entiteincarnee") }
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,6 @@ export class RdDEncaisser extends Dialog {
|
||||
total: Number(this.modifier),
|
||||
ajustement: Number(this.modifier),
|
||||
encaisserSpecial: this.encaisserSpecial,
|
||||
loc: { result: 0, label: "" },
|
||||
mortalite: mortalite
|
||||
}
|
||||
});
|
||||
|
@ -7,15 +7,16 @@ export class RdDSheetUtility {
|
||||
const userRightLevel = game.user.isGM
|
||||
? CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
||||
: document.getUserLevel(game.user);
|
||||
mergeObject(options, {
|
||||
let newOptions = {
|
||||
isGM: game.user.isGM,
|
||||
isOwned: document.parent,
|
||||
isOwned: document.parent ? true : false,
|
||||
editable: editable,
|
||||
cssClass: editable ? "editable" : "locked",
|
||||
isLimited: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.LIMITED,
|
||||
isObserver: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER,
|
||||
isOwner: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER
|
||||
});
|
||||
}
|
||||
mergeObject(options, newOptions);
|
||||
return options;
|
||||
}
|
||||
|
||||
|
@ -5,12 +5,13 @@ 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_MINUTES_PAR_HEURES = 120;
|
||||
const RDD_MINUTES_PAR_JOUR = 1440; //RDD_HEURES_PAR_JOUR * RDD_MINUTES_PAR_HEURES;
|
||||
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;
|
||||
export const RDD_MINUTES_PAR_HEURES = 120;
|
||||
export const RDD_MINUTES_PAR_JOUR = 1440; //RDD_HEURES_PAR_JOUR * RDD_MINUTES_PAR_HEURES;
|
||||
const ROUNDS_PAR_MINUTE = 10;
|
||||
|
||||
const DEFINITION_HEURES = [
|
||||
@ -46,11 +47,8 @@ const FORMULES_PERIODE = [
|
||||
{ code: 'jour', label: "Jours", calcul: async (t, nombre) => t.addJours(nombre) },
|
||||
]
|
||||
|
||||
export class RdDTimestamp {
|
||||
|
||||
static iconeHeure(heure) {
|
||||
return `systems/foundryvtt-reve-de-dragon/icons/heures/hd${heure < 9 ? '0' : ''}${heure + 1}.svg`;
|
||||
}
|
||||
export class RdDTimestamp {
|
||||
|
||||
static init() {
|
||||
game.settings.register(SYSTEM_RDD, WORLD_TIMESTAMP_SETTING, {
|
||||
@ -63,15 +61,41 @@ export class RdDTimestamp {
|
||||
|
||||
for (let i = 0; i < DEFINITION_HEURES.length; i++) {
|
||||
DEFINITION_HEURES[i].heure = i;
|
||||
DEFINITION_HEURES[i].hh = RdDTimestamp.hh(i);
|
||||
DEFINITION_HEURES[i].icon = RdDTimestamp.iconeHeure(i);
|
||||
DEFINITION_HEURES[i].webp = DEFINITION_HEURES[i].icon.replace(".svg", ".webp");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
@ -86,20 +110,26 @@ export class RdDTimestamp {
|
||||
return definition
|
||||
}
|
||||
|
||||
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) => { }) {
|
||||
@ -222,6 +252,8 @@ export class RdDTimestamp {
|
||||
get heure() { return Math.floor(this.indexMinute / RDD_MINUTES_PAR_HEURES) }
|
||||
get minute() { return this.indexMinute % RDD_MINUTES_PAR_HEURES }
|
||||
get round() { return ROUNDS_PAR_MINUTE * (this.indexMinute - Math.floor(this.indexMinute)) }
|
||||
get angleHeure() { return this.indexMinute / RDD_MINUTES_PAR_JOUR * 360 - 60 }
|
||||
get angleMinute() { return this.indexMinute / RDD_MINUTES_PAR_HEURES * 360 + 45}
|
||||
|
||||
formatDate() {
|
||||
const jour = this.jour + 1;
|
||||
|
@ -2,6 +2,7 @@
|
||||
import { HtmlUtility } from "./html-utility.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDCombatManager } from "./rdd-combat.js";
|
||||
import { Targets } from "./targets.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDTokenHud {
|
||||
@ -18,29 +19,39 @@ export class RdDTokenHud {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async addExtensionHud(app, html, tokenId) {
|
||||
static async addExtensionHud(app, html, tokenId, isCombat) {
|
||||
|
||||
let token = canvas.tokens.get(tokenId);
|
||||
let actor = token.actor;
|
||||
let combatant = game.combat.combatants.find(c => c.tokenId == tokenId);
|
||||
if (! (combatant?.actor) ) {
|
||||
app.hasExtension = true;
|
||||
// soins
|
||||
await RdDTokenHud.addExtensionHudSoins(html, actor);
|
||||
|
||||
if (isCombat) {
|
||||
let combatant = game.combat.combatants.find(c => c.tokenId == tokenId);
|
||||
if (!(combatant?.actor)) {
|
||||
ui.notifications.warn(`Le combatant ${token.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
||||
return;
|
||||
}
|
||||
let actions = RdDCombatManager.listActionsCombat(combatant);
|
||||
// initiative
|
||||
await RdDTokenHud.addExtensionHudInit(html, combatant, actions);
|
||||
// combat
|
||||
await RdDTokenHud.addExtensionHudCombat(html, combatant, actions);
|
||||
}
|
||||
app.hasExtension = true;
|
||||
|
||||
let actionsCombat = RdDCombatManager.listActionsCombat(combatant);
|
||||
|
||||
}
|
||||
|
||||
static async addExtensionHudInit(html, combatant, actions) {
|
||||
const hudData = {
|
||||
combatant: combatant,
|
||||
actions: actionsCombat,
|
||||
combatant, actions,
|
||||
commandes: [
|
||||
{ name: "Autre action", command: 'autre' },
|
||||
{ name: 'Initiative +1', command: 'inc', value: 0.01 },
|
||||
{ name: 'Initiative +1', command: 'inc', value: 0.01 },
|
||||
{ name: 'Initiative -1', command: 'dec', value: -0.01 }]
|
||||
};
|
||||
|
||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||
// initiative
|
||||
await RdDTokenHud._configureSubMenu(controlIconCombat,
|
||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
|
||||
hudData,
|
||||
@ -51,48 +62,70 @@ export class RdDTokenHud {
|
||||
RdDTokenHud._initiativeCommand(initCommand, combatantId);
|
||||
} else {
|
||||
let index = event.currentTarget.attributes['data-action-index'].value;
|
||||
let action = actionsCombat[index];
|
||||
let action = hudData.actions[index];
|
||||
RdDCombatManager.rollInitiativeAction(combatantId, action);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static async addExtensionHudCombat(html, combatant, actions) {
|
||||
const hudData = { combatant, actions, commandes: [] };
|
||||
const controlIconTarget = html.find('.control-icon[data-action=target]');
|
||||
// combat
|
||||
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html', hudData,
|
||||
(event) => {
|
||||
const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
|
||||
const action = actionsCombat[actionIndex];
|
||||
const action = hudData.actions[actionIndex];
|
||||
if (action.action == 'conjurer') {
|
||||
actor.conjurerPossession(actor.getPossession(action.system.possessionid));
|
||||
const possession = combatant.actor.getPossession(action.system.possessionid);
|
||||
combatant.actor.conjurerPossession(possession);
|
||||
}
|
||||
else {
|
||||
actor.rollArme(action);
|
||||
combatant.actor.rollArme(action);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static async addExtensionHudSoins(html, sourceActor) {
|
||||
const target = Targets.getTarget({ warn: false });
|
||||
if (target?.actor) {
|
||||
const hudSoins = { blessures: target.actor.blessuresASoigner() ?? [] };
|
||||
if (hudSoins.blessures.length > 0) {
|
||||
// soins
|
||||
const controlIconTarget = html.find('.control-icon[data-action=combat]');
|
||||
await RdDTokenHud._configureSubMenu(controlIconTarget,
|
||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-soins.hbs',
|
||||
hudSoins,
|
||||
(event) => {
|
||||
const blessureId = event.currentTarget.attributes['data-blessure-id']?.value;
|
||||
sourceActor.rollSoins(target.actor, blessureId)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static _initiativeCommand(initCommand, combatantId) {
|
||||
switch (initCommand) {
|
||||
case 'inc': return RdDCombatManager.incDecInit(combatantId, 0.01);
|
||||
case 'dec': return RdDCombatManager.incDecInit(combatantId, -0.01);
|
||||
case 'autre': return RdDCombatManager.rollInitiativeAction(combatantId,
|
||||
case 'autre': return RdDCombatManager.rollInitiativeAction(combatantId,
|
||||
{ name: "Autre action", action: 'autre', system: { initOnly: true, competence: "Autre action" } });
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async addTokenHudExtensions(app, html, tokenId) {
|
||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||
controlIconCombat.click(event => {
|
||||
if (event.currentTarget.className.includes('active')) {
|
||||
RdDTokenHud.removeExtensionHud(app, html, tokenId);
|
||||
} else {
|
||||
setTimeout(function () { RdDTokenHud.addExtensionHud(app, html, tokenId) }, 200);
|
||||
}
|
||||
});
|
||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||
if (controlIconCombat.length > 0) {
|
||||
controlIconCombat.click(event => {
|
||||
if (event.currentTarget.className.includes('active')) {
|
||||
RdDTokenHud.removeExtensionHud(app, html, tokenId);
|
||||
} else {
|
||||
setTimeout(() => RdDTokenHud.addExtensionHud(app, html, tokenId), 200);
|
||||
}
|
||||
});
|
||||
|
||||
if (controlIconCombat.length>0 && controlIconCombat[0].className.includes('active')) {
|
||||
RdDTokenHud.addExtensionHud(app, html, tokenId);
|
||||
const isCombat = controlIconCombat[0].className.includes('active');
|
||||
RdDTokenHud.addExtensionHud(app, html, tokenId, isCombat);
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,9 +133,9 @@ export class RdDTokenHud {
|
||||
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) {
|
||||
const hud = $(await renderTemplate(template, hudData));
|
||||
const list = hud.find('div.rdd-hud-list');
|
||||
|
||||
|
||||
RdDTokenHud._toggleHudListActive(hud, list);
|
||||
|
||||
|
||||
hud.find('img.rdd-hud-togglebutton').click(event => RdDTokenHud._toggleHudListActive(hud, list));
|
||||
list.find('.rdd-hud-menu').click(onMenuItem);
|
||||
|
||||
|
@ -19,9 +19,9 @@ import { RdDRaretes } from "./item/raretes.js";
|
||||
/* -------------------------------------------- */
|
||||
// This table starts at 0 -> niveau -10
|
||||
const carac_array = ["taille", "apparence", "constitution", "force", "agilite", "dexterite", "vue", "ouie", "odoratgout", "volonte", "intellect", "empathie", "reve", "chance", "melee", "tir", "lancer", "derobee"];
|
||||
const difficultesLibres = [0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10];
|
||||
const ajustementsConditions = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10];
|
||||
const ajustementsEncaissement = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, +13, +14, +15, +16, +17, +18, +19, +20, +21, +22, +23, +24, +25];
|
||||
const difficultesLibres = Misc.intArray(0, -11);
|
||||
const ajustementsConditions = Misc.intArray(-10, 11);
|
||||
const ajustementsEncaissement = Misc.intArray(-10, 26);
|
||||
|
||||
/* -------------------------------------------- */
|
||||
function _buildAllSegmentsFatigue(max) {
|
||||
@ -66,38 +66,31 @@ const fatigueMarche = {
|
||||
"tresdifficile": { "4": 4, "6": 6 }
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const definitionsBlessures = [
|
||||
{ type: "legere", facteur: 2 },
|
||||
{ type: "grave", facteur: 4 },
|
||||
{ type: "critique", facteur: 6 }
|
||||
]
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const nomEthylisme = ["Emeché", "Gris", "Pinté", "Pas frais", "Ivre", "Bu", "Complètement fait", "Ivre mort"];
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const definitionsEncaissement = {
|
||||
"mortel": [
|
||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 },
|
||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "2", eraflures: 0, legeres: 0, graves: 1, critiques: 0 },
|
||||
{ minimum: 20, maximum: undefined, endurance: "100", vie: "4 + @over20", eraflures: 0, legeres: 0, graves: 0, critiques: 1 },
|
||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1},
|
||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0},
|
||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 2},
|
||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "2", gravite: 4},
|
||||
{ minimum: 20, maximum: undefined, endurance: "100", vie: "4 + @over20", gravite: 6},
|
||||
],
|
||||
"non-mortel": [
|
||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 },
|
||||
{ minimum: 20, maximum: undefined, endurance: "100", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 },
|
||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1},
|
||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0 },
|
||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 0 },
|
||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", gravite: 2 },
|
||||
{ minimum: 20, maximum: undefined, endurance: "100", vie: "0", gravite: 2 },
|
||||
],
|
||||
"cauchemar": [
|
||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
||||
{ minimum: 20, maximum: undefined, endurance: "3d6 + @over20", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
||||
"entiteincarnee": [
|
||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1},
|
||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0},
|
||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 0 },
|
||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", gravite: 0 },
|
||||
{ minimum: 20, maximum: undefined, endurance: "3d6 + @over20", vie: "0", gravite: 0 },
|
||||
]
|
||||
};
|
||||
|
||||
@ -139,7 +132,7 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html',
|
||||
@ -234,8 +227,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',
|
||||
@ -274,7 +269,8 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('computeResolutionChances', (row, col) => RdDResolutionTable.computeChances(row, col));
|
||||
Handlebars.registerHelper('upperFirst', str => Misc.upperFirst(str ?? 'Null'));
|
||||
Handlebars.registerHelper('lowerFirst', str => Misc.lowerFirst(str ?? 'Null'));
|
||||
Handlebars.registerHelper('upper', str => str?.toUpperCase() ?? 'NULL');
|
||||
Handlebars.registerHelper('upper', str => str?.toUpperCase() ?? '');
|
||||
Handlebars.registerHelper('lowercase', str => str?.toLowerCase() ?? '');
|
||||
Handlebars.registerHelper('le', str => Grammar.articleDetermine(str));
|
||||
Handlebars.registerHelper('apostrophe', (article, str) => Grammar.apostrophe(article, str));
|
||||
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str));
|
||||
@ -470,10 +466,6 @@ export class RdDUtility {
|
||||
return ajustementsEncaissement;
|
||||
}
|
||||
|
||||
static getDefinitionsBlessures() {
|
||||
return definitionsBlessures;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getSegmentsFatigue(maxEnd) {
|
||||
maxEnd = Math.max(maxEnd, 1);
|
||||
@ -614,17 +606,10 @@ export class RdDUtility {
|
||||
encaissement.dmg.loc.label = encaissement.dmg.loc.label ?? 'Corps;';
|
||||
encaissement.roll = roll;
|
||||
encaissement.armure = armure;
|
||||
encaissement.penetration = rollData.arme?.system.penetration ?? 0;
|
||||
encaissement.total = jetTotal;
|
||||
encaissement.vie = await RdDUtility._evaluatePerte(encaissement.vie, over20);
|
||||
encaissement.endurance = await RdDUtility._evaluatePerte(encaissement.endurance, over20);
|
||||
encaissement.penetration = rollData.arme?.system.penetration ?? 0;
|
||||
encaissement.blessures = (
|
||||
encaissement.critiques > 0 ? "Critique" :
|
||||
encaissement.graves > 0 ? "Grave" :
|
||||
encaissement.legeres > 0 ? "Légère" :
|
||||
encaissement.eraflures > 0 ? "Contusions/Eraflures" :
|
||||
'Aucune'
|
||||
);
|
||||
return encaissement;
|
||||
}
|
||||
|
||||
|
216
module/sommeil/app-astrologie.js
Normal file
@ -0,0 +1,216 @@
|
||||
import { SYSTEM_RDD } from "../constants.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RDD_MINUTES_PAR_HEURES, RDD_MINUTES_PAR_JOUR, 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.heure-${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 angleAstrologie = ((chiffreAstral + heureNaissance) * 30) % 360 - 45;
|
||||
this.html.find(`div.astro-roue div.astro-disque img`).css(this.cssRotation(angleAstrologie));
|
||||
|
||||
const timestamp = game.system.rdd.calendrier.getTimestamp();
|
||||
|
||||
this.html.find(`div.astro-roue div.astro-horloge-heure img`).css(this.cssRotation(timestamp.angleHeure));
|
||||
this.html.find(`div.astro-roue div.astro-horloge-minute img`).css(this.cssRotation(timestamp.angleMinute));
|
||||
}
|
||||
|
||||
cssRotation(angleAstrologie) {
|
||||
const rotation = `rotate(${angleAstrologie}deg)`;
|
||||
return {
|
||||
'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,4 +1,3 @@
|
||||
import { EffetsDraconiques } from "../tmr/effets-draconiques.js";
|
||||
|
||||
export class DialogChateauDormant extends Dialog {
|
||||
|
||||
@ -76,28 +75,31 @@ export class DialogChateauDormant extends Dialog {
|
||||
|
||||
async onChateauDormant() {
|
||||
const motifStress = this.html.find("form input[name='motifStress']").val();
|
||||
const consignesChateauDormant = jQuery.map(this.html.find('li.set-sommeil-actor'), it => {
|
||||
const actorRow = this.html.find(it);
|
||||
const actorId = actorRow.data('actor-id');
|
||||
const actor = this.getActor(actorId);
|
||||
const insomnie = actorRow.find('input.sommeil-insomnie').is(':checked');
|
||||
return {
|
||||
actor,
|
||||
ignorer: actorRow.find('input.sommeil-ignorer').is(':checked'),
|
||||
stress: {
|
||||
motif: motifStress,
|
||||
valeur: Number.parseInt(actorRow.find('input.sommeil-stress').val()),
|
||||
},
|
||||
sommeil: {
|
||||
nouveaujour: true,
|
||||
date: this.dialogData.finChateauDormant,
|
||||
insomnie: insomnie,
|
||||
heures: insomnie ? 0 : Number.parseInt(actorRow.find('input.sommeil-heures').val()),
|
||||
moral: actor.moral,
|
||||
}
|
||||
}
|
||||
});
|
||||
consignesChateauDormant.forEach(async consigne => await consigne.actor.prepareChateauDormant(consigne))
|
||||
jQuery.map(
|
||||
this.html.find('li.set-sommeil-actor'),
|
||||
it => this.extractConsigneActor(this.html.find(it), motifStress)
|
||||
).forEach(async consigne => await consigne.actor.prepareChateauDormant(consigne))
|
||||
}
|
||||
|
||||
|
||||
extractConsigneActor(actorRow, motifStress) {
|
||||
const actorId = actorRow.data('actor-id');
|
||||
const actor = this.getActor(actorId);
|
||||
const insomnie = actorRow.find('input.sommeil-insomnie').is(':checked');
|
||||
return {
|
||||
actor,
|
||||
ignorer: actorRow.find('input.sommeil-ignorer').is(':checked'),
|
||||
stress: {
|
||||
motif: motifStress,
|
||||
valeur: Number.parseInt(actorRow.find('input.sommeil-stress').val()),
|
||||
},
|
||||
sommeil: {
|
||||
nouveaujour: true,
|
||||
date: this.dialogData.finChateauDormant,
|
||||
insomnie: insomnie,
|
||||
heures: insomnie ? 0 : Number.parseInt(actorRow.find('input.sommeil-heures').val()),
|
||||
moral: actor.system.sommeil.moral ?? 'neutre',
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -4,7 +4,10 @@ import { EffetsDraconiques } from "../tmr/effets-draconiques.js";
|
||||
export class DialogRepos extends Dialog {
|
||||
|
||||
static async create(actor) {
|
||||
if (!ReglesOptionelles.isUsing("chateau-dormant-gardien")) {
|
||||
if (!actor.isPersonnage()) {
|
||||
return
|
||||
}
|
||||
if (!ReglesOptionelles.isUsing("chateau-dormant-gardien") || !actor.hasPlayerOwner) {
|
||||
actor.system.sommeil = {
|
||||
"nouveaujour": true,
|
||||
"insomnie": EffetsDraconiques.isSujetInsomnie(actor),
|
||||
|
@ -39,18 +39,18 @@ export class Targets {
|
||||
}
|
||||
}
|
||||
|
||||
static getTarget() {
|
||||
static getTarget(options = { warn: true }) {
|
||||
const targets = Targets.listTargets();
|
||||
switch (targets.length) {
|
||||
case 1:
|
||||
return targets[0];
|
||||
case 0:
|
||||
ui.notifications.warn("Vous devez choisir une cible à attaquer!");
|
||||
if (options.warn) ui.notifications.warn("Vous devez choisir une cible à attaquer!");
|
||||
break;
|
||||
default:
|
||||
ui.notifications.warn("Vous devez choisir une cible (et <strong>une seule</strong>) à attaquer!");
|
||||
return;
|
||||
if (options.warn) ui.notifications.warn("Vous devez choisir une cible (et <strong>une seule</strong>) à attaquer!");
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
}
|
@ -8,5 +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.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"}
|
||||
|
22
styles/img/ui/astro-disque.svg
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="402.74" height="402.74" version="1.1" viewBox="0 0 106.56 106.56" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title/>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g transform="translate(-52.554 -94.887)" fill="none">
|
||||
<path d="m54.72 134.47 64.823 64.757" opacity=".8" stroke="#4a0" stroke-width=".53382"/>
|
||||
<path d="m143.17 111.06-88.517 23.669" opacity=".8" stroke="#4a0" stroke-width=".53382"/>
|
||||
<g stroke="#c83737" stroke-width=".52917">
|
||||
<path d="m54.72 134.47 102.23 27.392" opacity=".8"/>
|
||||
<path d="m119.53 97.053-64.809 37.418" opacity=".8"/>
|
||||
<path d="m92.137 199.28-37.418-64.809" opacity=".8"/>
|
||||
</g>
|
||||
<circle transform="rotate(15)" cx="140.58" cy="115.73" r="52.917" opacity=".5" stroke="#aa00d4" stroke-linecap="round" stroke-width=".7"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
20
styles/img/ui/rdd-aiguille-horloge.svg
Normal file
After Width: | Height: | Size: 7.6 KiB |
17
styles/img/ui/rdd-aiguille-minute.svg
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="675" height="675" version="1.1" viewBox="0 0 178.59 178.59" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
|
||||
<dc:title/>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<circle cx="89.297" cy="89.297" r="4.6257" style="fill:#214478"/>
|
||||
<g transform="matrix(.98563 -.98178 .98563 .98178 -87.392 88.66)">
|
||||
<rect x="88.635" y="7.9375" width="1.3229" height="82.021" style="fill:#214478"/>
|
||||
<path d="m88.635 72.76s-2.6458-1e-6 -2.6458-2.6458c-1e-6 -5.2917 1.2526-5.291 1.2149-13.168-0.01237-2.5872 1.4309-4.0295 1.4309-15.936 2e-6 -9.7014 0-29.104 0-29.104s-0.96823-1.3508-1.3297-2.5446c-0.65159-2.152 0.35906-1.9377 1.0888-4.0645 0.32001-0.93267 0.86732-5.2972 0.86732-5.2972s0.59836 4.3708 0.91836 5.3035c0.72973 2.1268 1.6581 1.9061 1.0065 4.0582-0.36144 1.1937-1.2284 2.5446-1.2284 2.5446v29.104c0 11.906 1.3229 13.229 1.2284 15.936-0.27485 7.8725 1.4174 7.8768 1.4174 13.168 1e-6 2.6458-2.6458 2.6458-2.6458 2.6458z" style="fill:#214478"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -77,6 +77,16 @@
|
||||
--gradient-violet: linear-gradient(150deg, rgba(100, 45, 124, 0.6), rgba(216, 157, 192, 0.3), rgba(177, 157, 216, 0.5), rgba(107, 62, 121, 0.3), rgba(100, 45, 124, 0.6));
|
||||
--gradient-purple-black: linear-gradient(150deg, rgba(0, 0, 0, 0.7), rgba(100, 45, 124, 0.4), rgba(82, 17, 131, 0.3),rgba(100, 45, 124, 0.4), rgba(0, 0, 0, 0.7));
|
||||
--gradient-silver-light: linear-gradient(30deg, rgba(61, 55, 93, 0.2), rgba(178, 179, 196, 0.1), rgba(59, 62, 63, 0.2), rgba(206, 204, 199, 0.1), rgba(61, 46, 49, 0.2));
|
||||
--gradient-daylight: conic-gradient(
|
||||
from 0deg,
|
||||
hsla(50, 50%, 80%, 0.7),
|
||||
hsla(50, 50%, 80%, 0.1) 25%,
|
||||
hsla(250, 50%, 20%, 0.1) 25%,
|
||||
hsla(250, 50%, 20%, 0.5) 50%,
|
||||
hsla(250, 50%, 20%, 0.1) 75%,
|
||||
hsla(50, 50%, 80%, 0.1) 75%,
|
||||
hsla(50, 50%, 80%, 0.7)
|
||||
);
|
||||
|
||||
--background-custom-button: linear-gradient(to bottom, rgba(33, 55, 74, 0.988) 5%, rgba(21, 40, 51, 0.671) 100%);
|
||||
--background-custom-button-hover: linear-gradient(to bottom, rgb(128, 0, 0) 5%, rgb(62, 1, 1) 100%);
|
||||
@ -176,7 +186,7 @@ i:is(.fas, .far) {
|
||||
}
|
||||
|
||||
.system-foundryvtt-reve-de-dragon .sheet-header :is(.header-compteurs,.header-etats,.profile-img, .profile-img-token){
|
||||
padding: 0 3%;
|
||||
padding: 0 0.4rem;
|
||||
}
|
||||
|
||||
.system-foundryvtt-reve-de-dragon .sheet-header :is(.profile-img, .profile-img-token) {
|
||||
@ -203,11 +213,13 @@ i:is(.fas, .far) {
|
||||
}
|
||||
|
||||
.system-foundryvtt-reve-de-dragon .sheet-header .header-compteurs {
|
||||
width: calc(60% - 110px - 1rem);
|
||||
text-align: right;
|
||||
max-width: fit-content;
|
||||
}
|
||||
|
||||
.system-foundryvtt-reve-de-dragon .sheet-header div.header-etats {
|
||||
width: calc(40% - 32px - 1rem);
|
||||
height: 48px;
|
||||
max-width: fit-content;
|
||||
flex: initial;
|
||||
@ -416,6 +428,7 @@ span.equipement-detail-buttons {
|
||||
justify-content: center;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.blessure-control {
|
||||
flex-grow: 1;
|
||||
flex-direction: row;
|
||||
@ -447,14 +460,17 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
||||
.blessure-inactive {
|
||||
color:rgba(150, 150, 150, 0.4);
|
||||
}
|
||||
.blessure-active-2,
|
||||
.blessure-active-legere {
|
||||
color:rgba(60, 60, 60, 0.9);
|
||||
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
||||
}
|
||||
.blessure-active-4,
|
||||
.blessure-active-grave {
|
||||
color: rgba(218, 126, 21, 0.9);
|
||||
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
||||
}
|
||||
.blessure-active-6,
|
||||
.blessure-active-critique {
|
||||
color: rgba(173, 36, 26, 0.9);
|
||||
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
||||
@ -860,12 +876,127 @@ 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;
|
||||
}
|
||||
div.astro-roue {
|
||||
position: relative;
|
||||
left: calc(50% - 6.5rem);
|
||||
width: 13rem;
|
||||
height: 13rem;
|
||||
}
|
||||
div.astro-roue div.astro-heure {
|
||||
position: absolute;
|
||||
width: 1.8rem;
|
||||
height: 1.8rem;
|
||||
}
|
||||
|
||||
div.astro-roue div.astro-cercle1 {
|
||||
position: absolute;
|
||||
background: var(--gradient-daylight);
|
||||
border: 0.2rem solid rgba(100, 45, 124, 0.6);
|
||||
border-radius: calc(6rem);
|
||||
top: calc(50% - 6rem);
|
||||
left: calc(50% - 6rem);
|
||||
width: calc(100% - 1rem);
|
||||
height: calc(100% - 1rem);
|
||||
}
|
||||
div.astro-roue div.astro-cercle2 {
|
||||
position: absolute;
|
||||
border: 0.1rem solid rgba(100, 45, 124, 0.4);
|
||||
border-radius: calc(6.1rem);
|
||||
top: calc(50% - 4.5rem);
|
||||
left: calc(50% - 4.5rem);
|
||||
width: calc(100% - 4rem);
|
||||
height: calc(100% - 4rem);
|
||||
}
|
||||
div.astro-roue div.astro-disque {
|
||||
position: absolute;
|
||||
border: none;
|
||||
top: calc(50% - 3.4rem);
|
||||
left: calc(50% - 3.4rem);
|
||||
width: calc(100% - 6.2rem);
|
||||
height: calc(100% - 6.2rem);
|
||||
}
|
||||
div.astro-roue div.astro-horloge-heure {
|
||||
position: absolute;
|
||||
border: none;
|
||||
top: calc(50% - 2.5rem);
|
||||
left: calc(50% - 2.5rem);
|
||||
width: calc(100% - 8rem);
|
||||
height: calc(100% - 8rem);
|
||||
}
|
||||
div.astro-roue div.astro-horloge-minute {
|
||||
position: absolute;
|
||||
border: none;
|
||||
top: calc(50% - 3.5rem);
|
||||
left: calc(50% - 3.5rem);
|
||||
width: calc(100% - 6rem);
|
||||
height: calc(100% - 6rem);
|
||||
}
|
||||
div.astro-roue div.astro-ajustement {
|
||||
position: absolute;
|
||||
width: 0.8rem;
|
||||
height: 0.8rem;
|
||||
color: hsl(120, 50%, 15%);
|
||||
font-size: 0.8rem;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border-radius: 0.4rem;
|
||||
background-color: hsla(300, 100%, 95%, 0.3);
|
||||
}
|
||||
div.astro-roue div.astro-disque img { border: none; }
|
||||
div.astro-roue div:is(.astro-horloge-heure, .astro-horloge-minute) img {
|
||||
border: none;
|
||||
text-shadow: #403f3e;
|
||||
}
|
||||
div.astro-roue div.astro-heure img.astro-heure-img {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
flex-grow: 0;
|
||||
padding: 0.1rem;
|
||||
border: 0;
|
||||
opacity: 0.9;
|
||||
border: none;
|
||||
}
|
||||
|
||||
div.astro-roue div.astro-heure.heure-01 { top: calc(50% - 1rem + sin(-180deg) * 5rem); left: calc(50% - 1rem + cos(-180deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-02 { top: calc(50% - 1rem + sin(-150deg) * 5rem); left: calc(50% - 1rem + cos(-150deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-03 { top: calc(50% - 1rem + sin(-120deg) * 5rem); left: calc(50% - 1rem + cos(-120deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-04 { top: calc(50% - 1rem + sin(-90deg) * 5rem); left: calc(50% - 1rem + cos(-90deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-05 { top: calc(50% - 1rem + sin(-60deg) * 5rem); left: calc(50% - 1rem + cos(-60deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-06 { top: calc(50% - 1rem + sin(-30deg) * 5rem); left: calc(50% - 1rem + cos(-30deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-07 { top: calc(50% - 1rem + sin(-0deg) * 5rem); left: calc(50% - 1rem + cos(-0deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-08 { top: calc(50% - 1rem + sin(30deg) * 5rem); left: calc(50% - 1rem + cos(30deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-09 { top: calc(50% - 1rem + sin(60deg) * 5rem); left: calc(50% - 1rem + cos(60deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-10 { top: calc(50% - 1rem + sin(90deg) * 5rem); left: calc(50% - 1rem + cos(90deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-11 { top: calc(50% - 1rem + sin(120deg) * 5rem); left: calc(50% - 1rem + cos(120deg) * 5rem); }
|
||||
div.astro-roue div.astro-heure.heure-12 { top: calc(50% - 1rem + sin(150deg) * 5rem); left: calc(50% - 1rem + cos(150deg) * 5rem); }
|
||||
|
||||
div.astro-roue div.astro-ajustement.heure-01 { top: calc(50% - 0.4rem + sin(180deg) * 3.9rem); left: calc(50% - 0.4rem + cos(180deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-02 { top: calc(50% - 0.4rem + sin(-150deg) * 3.9rem); left: calc(50% - 0.4rem + cos(-150deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-03 { top: calc(50% - 0.4rem + sin(-120deg) * 3.9rem); left: calc(50% - 0.4rem + cos(-120deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-04 { top: calc(50% - 0.4rem + sin(-90deg) * 3.9rem); left: calc(50% - 0.4rem + cos(-90deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-05 { top: calc(50% - 0.4rem + sin(-60deg) * 3.9rem); left: calc(50% - 0.4rem + cos(-60deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-06 { top: calc(50% - 0.4rem + sin(-30deg) * 3.9rem); left: calc(50% - 0.4rem + cos(-30deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-07 { top: calc(50% - 0.4rem + sin(0deg) * 3.9rem); left: calc(50% - 0.4rem + cos(0deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-08 { top: calc(50% - 0.4rem + sin(30deg) * 3.9rem); left: calc(50% - 0.4rem + cos(30deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-09 { top: calc(50% - 0.4rem + sin(60deg) * 3.9rem); left: calc(50% - 0.4rem + cos(60deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-10 { top: calc(50% - 0.4rem + sin(90deg) * 3.9rem); left: calc(50% - 0.4rem + cos(90deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-11 { top: calc(50% - 0.4rem + sin(120deg) * 3.9rem); left: calc(50% - 0.4rem + cos(120deg) * 3.9rem); }
|
||||
div.astro-roue div.astro-ajustement.heure-12 { top: calc(50% - 0.4rem + sin(150deg) * 3.9rem); left: calc(50% - 0.4rem + cos(150deg) * 3.9rem); }
|
||||
|
||||
.window-app .window-content, .window-app.sheet .window-content .sheet-body{
|
||||
background: rgb(245,245,240) url(img/bg_left.webp) no-repeat left top;
|
||||
}
|
||||
|
||||
section.sheet-body{padding: 0.25rem 0.5rem;}
|
||||
section.sheet-body {
|
||||
padding: 0.25rem 0.5rem;
|
||||
}
|
||||
|
||||
.sheet header.sheet-header :is(.profile-img, .profile-img-token) {
|
||||
object-fit: scale-down;
|
||||
@ -1261,27 +1392,36 @@ table.table-nombres-astraux tr:hover {
|
||||
}
|
||||
|
||||
/* ======================================== */
|
||||
.tokenhudext {
|
||||
.token-hud-ext {
|
||||
display: flex;
|
||||
flex: 0 !important;
|
||||
font-family: CaslonPro;
|
||||
font-weight: 600;
|
||||
}
|
||||
.tokenhudext.left {
|
||||
.token-hud-ext.left {
|
||||
justify-content: flex-start;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 2.75rem;
|
||||
right: 4rem;
|
||||
}
|
||||
.tokenhudext.right {
|
||||
.token-hud-ext.soins {
|
||||
justify-content: flex-start;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 13.2rem;
|
||||
left: -5rem;
|
||||
max-width: 8.5rem
|
||||
}
|
||||
|
||||
.token-hud-ext.right {
|
||||
justify-content: flex-start;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 2.75rem;
|
||||
left: 4rem;
|
||||
}
|
||||
.control-icon.tokenhudicon {
|
||||
.control-icon.token-hud-icon {
|
||||
width: fit-content;
|
||||
height: fit-content;
|
||||
min-width: 6rem;
|
||||
@ -1290,7 +1430,7 @@ table.table-nombres-astraux tr:hover {
|
||||
line-height: 1rem;
|
||||
margin: 0.2rem;
|
||||
}
|
||||
.control-icon.tokenhudicon.right {
|
||||
.control-icon.token-hud-icon.right {
|
||||
margin-left: 8px;
|
||||
}
|
||||
.rdd-hud-menu label {
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "10.6.17",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.6.17.zip",
|
||||
"version": "10.7.0",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.0.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
|
@ -179,23 +179,8 @@
|
||||
"value": 10,
|
||||
"label": "Endurance",
|
||||
"derivee": false
|
||||
}
|
||||
},
|
||||
"blessures": {
|
||||
"legeres": {
|
||||
"liste": [ { "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" } ]
|
||||
},
|
||||
"graves": {
|
||||
"liste": [ { "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" } ]
|
||||
},
|
||||
"critiques": {
|
||||
"liste": [ { "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" } ]
|
||||
}
|
||||
"bonusPotion": 0
|
||||
},
|
||||
"attributs": {
|
||||
"plusdom": {
|
||||
@ -380,23 +365,8 @@
|
||||
"value": 0,
|
||||
"label": "Fatigue",
|
||||
"derivee": true
|
||||
}
|
||||
},
|
||||
"blessures": {
|
||||
"legeres": {
|
||||
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
||||
},
|
||||
"graves": {
|
||||
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
||||
},
|
||||
"critiques": {
|
||||
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
||||
}
|
||||
"bonusPotion": 0
|
||||
},
|
||||
"attributs": {
|
||||
"sconst": {
|
||||
@ -567,7 +537,7 @@
|
||||
"monnaie", "nourritureboisson", "gemme",
|
||||
"service",
|
||||
"meditation", "rencontre", "queue", "ombre", "souffle", "tete", "casetmr", "signedraconique", "sort", "sortreserve",
|
||||
"nombreastral", "tache", "maladie", "poison", "possession",
|
||||
"nombreastral", "tache", "blessure", "maladie", "poison", "possession",
|
||||
"tarot", "extraitpoetique"
|
||||
],
|
||||
"templates": {
|
||||
@ -636,6 +606,22 @@
|
||||
"compteur": 0,
|
||||
"date": 0
|
||||
},
|
||||
"blessure": {
|
||||
"templates": ["temporel"],
|
||||
"gravite": 0,
|
||||
"difficulte": 0,
|
||||
"premierssoins": {
|
||||
"tache": 0,
|
||||
"done": false,
|
||||
"bonus": 0
|
||||
},
|
||||
"soinscomplets": {
|
||||
"done": false,
|
||||
"bonus": 0
|
||||
},
|
||||
"localisation": "",
|
||||
"jours": 0
|
||||
},
|
||||
"maladie": {
|
||||
"templates": ["description", "temporel"],
|
||||
"identifie": false,
|
||||
@ -833,7 +819,8 @@
|
||||
"points_de_tache_courant": 0,
|
||||
"nb_jet_echec": 0,
|
||||
"nb_jet_succes": 0,
|
||||
"cacher_points_de_tache": false
|
||||
"cacher_points_de_tache": false,
|
||||
"itemId": ""
|
||||
},
|
||||
"sort": {
|
||||
"templates": ["description"],
|
||||
|
38
templates/actor/blessure.hbs
Normal file
@ -0,0 +1,38 @@
|
||||
<li class="item item-blessure flexrow list-item blessure-active-{{lowercase system.labelGravite}}" data-item-id="{{id}}">
|
||||
<span class="blessure-control">
|
||||
<img class="sheet-competence-img" src="{{img}}" />
|
||||
<i class="fas fa-skull-crossbones"></i>
|
||||
{{system.labelGravite}}
|
||||
</span>
|
||||
{{#if (gt system.gravite 6)}}
|
||||
<span class="flexrow"></span>
|
||||
<span class="flexrow"></span>
|
||||
{{else}}
|
||||
<span class="flexrow">
|
||||
<input type="checkbox" class="blessure-premierssoins-done" name="blessure.{{id}}.premierssoins.done" {{#if system.premierssoins.done}}checked{{/if}}/>
|
||||
{{#if system.premierssoins.done}}
|
||||
<input type="text" class="blessure-premierssoins-bonus number-x2" name="blessure.{{id}}.premierssoins.bonus" data-dtype="number" value="{{system.premierssoins.bonus}}"/>
|
||||
{{else}}
|
||||
<label>{{system.premierssoins.tache}} / {{system.gravite}}</label>
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="flexrow">
|
||||
{{#if system.premierssoins.done}}
|
||||
<input type="checkbox" class="blessure-soinscomplets-done" name="blessure.{{id}}.system.soinscomplets.done" {{#if system.soinscomplets.done}}checked{{/if}}/>
|
||||
{{#if system.soinscomplets.done}}
|
||||
<input type="text" class="blessure-soinscomplets-bonus number-x2" name="blessure.{{id}}.system.soinscomplets.bonus" data-dtype="number" value="{{system.soinscomplets.bonus}}"/>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<label>Difficulté {{system.difficulte}}</label>
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
<span>
|
||||
{{system.localisation}}
|
||||
</span>
|
||||
<span class="item-controls">
|
||||
<a class="item-edit" title="Editer"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-montrer" title="Montrer"><i class="fas fa-comment"></i></a>
|
||||
</span>
|
||||
</li>
|
@ -1,27 +0,0 @@
|
||||
<li class="item flexrow list-item {{#if blessure.active}}blessure-active-{{gravite}}{{else}}blessure-inactive{{/if}}"
|
||||
data-blessure-type="{{gravite}}"
|
||||
data-attribute={{key}}
|
||||
data-blessure-index="{{key}}"
|
||||
data-blessure-active="{{blessure.active}}">
|
||||
<span class="blessure-control" title="Blessure {{title}}">
|
||||
<i class="fas fa-skull-crossbones" name="blessure-{{gravite}}-{{key}}-active"></i>
|
||||
{{title}}
|
||||
</span>
|
||||
{{#if blessure.active}}
|
||||
<span class="blessure-soins flexrow">
|
||||
<input class="blessure-psdone" name="blessure-{{gravite}}-{{key}}-psdone" type="checkbox" name="blessure.psdone" {{#if blessure.psdone}}checked{{/if}}/>
|
||||
<input class="blessure-premiers_soins" type="text" name="blessure-{{gravite}}-{{key}}-premiers_soins" data-dtype="number" value="{{blessure.premiers_soins}}"/>
|
||||
</span>
|
||||
<span class="blessure-soins flexrow">
|
||||
<input class="blessure-scdone" name="blessure-{{gravite}}-{{key}}-scdone" type="checkbox" name="blessure.scdone" {{#if blessure.scdone}}checked{{/if}}/>
|
||||
<input class="blessure-soins_complets" type="text" name="blessure-{{gravite}}-{{key}}-soins_complets" data-dtype="number" value="{{blessure.soins_complets}}"/>
|
||||
</span>
|
||||
<input class="blessure-jours" type="text" name="blessure-{{gravite}}-{{key}}-jours" name="jours" data-dtype="number" value="{{blessure.jours}}"/>
|
||||
<input class="blessure-localisation" type="text" name="blessure-{{gravite}}-{{key}}-localisation" data-dtype="String" value="{{blessure.loc}}"/>
|
||||
{{else}}
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
{{/if}}
|
||||
</li>
|
@ -1,18 +1,20 @@
|
||||
<h4>blessures</h4>
|
||||
<div>
|
||||
<a class="chat-card-button creer-blessure-legere"><i class="fas fa-plus-circle"></i> légère</a>
|
||||
<a class="chat-card-button creer-blessure-grave"><i class="fas fa-plus-circle"></i> grave</a>
|
||||
<a class="chat-card-button creer-blessure-critique"><i class="fas fa-plus-circle"></i> critique</a>
|
||||
</div>
|
||||
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow" >
|
||||
<span>Blessures</span>
|
||||
<span></span>
|
||||
<span>Premiers soins</span>
|
||||
<span>Soins complets</span>
|
||||
<span>Age (jours)</span>
|
||||
<span>Localisation</span>
|
||||
<span>Loc.</span>
|
||||
<span>Actions</span>
|
||||
</li>
|
||||
{{#each system.blessures.legeres.liste as |blessure key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html" blessure=blessure key=key gravite="legere" title="Légère"}}
|
||||
{{/each}}
|
||||
{{#each system.blessures.graves.liste as |blessure key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html" blessure=blessure key=key gravite="grave" title="Grave"}}
|
||||
{{/each}}
|
||||
{{#each system.blessures.critiques.liste as |blessure key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html" blessure=blessure key=key gravite="critique" title="Critique"}}
|
||||
{{#each blessures as |blessure|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs" blessure}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
<h4>Soins</h4>
|
||||
<a class="chat-card-button creer-tache-blessure-legere">Blessure légère</a>
|
||||
<a class="chat-card-button creer-tache-blessure-grave">Blessure grave</a>
|
||||
<a class="chat-card-button creer-tache-blessure-critique">Blessure critique</a>
|
||||
<div>
|
||||
<a class="chat-card-button creer-tache-blessure-legere"><i class="fas fa-first-aid"></i> légère</a>
|
||||
<a class="chat-card-button creer-tache-blessure-grave"><i class="fas fa-first-aid"></i> grave</a>
|
||||
<a class="chat-card-button creer-tache-blessure-critique"><i class="fas fa-first-aid"></i> critique</a>
|
||||
</div>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each taches as |tache id|}}
|
||||
{{#if (eq tache.system.competence 'Chirurgie')}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<span>
|
||||
<div>
|
||||
{{#if effects}}
|
||||
{{#each effects as |effect key|}}
|
||||
<span class="active-effect" data-effect="{{effect.flags.core.statusId}}">
|
||||
@ -9,4 +9,4 @@
|
||||
{{else}}
|
||||
Aucun effet actif
|
||||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<div class="flex-group-left header-etats">
|
||||
<div class="flexcol">
|
||||
<span>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</span>
|
||||
<span>Sur-encombrement: {{calc.surenc}}</span>
|
||||
<span>{{calc.resumeBlessures}}</span>
|
||||
<div>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</div>
|
||||
<div>Sur-encombrement: {{calc.surenc}}</div>
|
||||
<div>{{calc.resumeBlessures}}</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html"}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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,64 +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>
|
||||
<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}}
|
||||
</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,17 +1,18 @@
|
||||
{{#if isGM}}
|
||||
{{log this}}
|
||||
<span>
|
||||
{{#if (gt endurance 0)}}
|
||||
De plus, {{alias}} a perdu {{endurance}} points d'endurance
|
||||
{{#if (ne vie 0)}}et <span class="rdd-roll-echec">{{vie}} points de vie</span>{{/if}}
|
||||
{{/if}}
|
||||
{{#if (gt endurance 1)}}Jet d'endurance : {{jetEndurance}} / {{resteEndurance}} {{/if}}
|
||||
{{#if (and jetEndurance (gt endurance 1))}}Jet d'endurance : {{jetEndurance}} / {{resteEndurance}} {{/if}}
|
||||
</span>
|
||||
{{else}}
|
||||
<h4>{{alias}} encaisse à
|
||||
<span>
|
||||
{{numberFormat dmg.total decimals=0 sign=true}}
|
||||
{{#if (eq dmg.mortalite 'non-mortel')~}}(coups non mortels)
|
||||
{{~else if (eq dmg.mortalite 'cauchemar')}}(entité de cauchemar)
|
||||
{{~else if (eq dmg.mortalite 'entiteincarnee')}}(entité incarnée)
|
||||
{{~/if}}
|
||||
</span>
|
||||
</h4>
|
||||
@ -22,15 +23,16 @@
|
||||
{{~/unless}}, total: <span class="rdd-roll-echec">{{total}}</span>
|
||||
<br>
|
||||
{{alias}}
|
||||
{{#if (eq dmg.mortalite 'cauchemar')}}subit le coup
|
||||
{{else if eraflures}}subit une contusion
|
||||
{{else if legeres}}subit une blessure légère
|
||||
{{else if graves}}subit une blessure grave
|
||||
{{else if critiques}}subit une blessure critique
|
||||
{{#if (eq dmg.mortalite 'entiteincarnee')}}subit le coup
|
||||
{{else if mort}}vient de mourir
|
||||
{{else if blessure}}
|
||||
{{#if (gt blessure.system.gravite 0)}}subit une blessure {{blessure.system.labelGravite}}
|
||||
{{else}}subit une contusion
|
||||
{{~/if~}}
|
||||
{{else}}s'en sort sans une égratignure
|
||||
{{~/if~}}
|
||||
{{~#unless (eq dmg.mortalite 'cauchemar')}}
|
||||
|
||||
{{~#unless (eq dmg.mortalite 'entiteincarnee')}}
|
||||
{{#if dmg.loc.label}}
|
||||
{{#if (gt roll.total 0)}}({{dmg.loc.label}}){{/if}}
|
||||
{{/if}}
|
||||
@ -39,7 +41,7 @@
|
||||
{{~#if hasPlayerOwner}}, a perdu {{endurance}} points d'endurance
|
||||
{{#if (ne vie 0)}}, <span class="rdd-roll-echec">{{vie}} points de vie</span>{{/if}}
|
||||
{{/if}}
|
||||
{{#if (ne dmg.mortalite 'cauchemar')}}
|
||||
{{#if (ne dmg.mortalite 'entiteincarnee')}}
|
||||
{{#if (gt endurance 1)}}et
|
||||
{{#if sonne}}est <strong>sonné</strong><img class="chat-icon" src="icons/svg/stoned.svg" alt="charge" height="16" width="16" /> jusqu'à la fin du prochain round{{else}}n'est pas sonné{{/if}}!
|
||||
{{#if hasPlayerOwner}}Jet d'endurance : Jet d'endurance : {{jetEndurance}} / {{resteEndurance}}{{/if}}
|
||||
|
@ -1,52 +0,0 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<div class="header-fields">
|
||||
<h1 class="charname">Astrologie</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<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>
|
||||
<label> <a name="jet-astrologie">Faire un jet d'Astrologie</a></label>
|
||||
|
||||
{{!-- Sheet Body --}}
|
||||
<section class="sheet-body">
|
||||
<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>
|
@ -1,9 +1,9 @@
|
||||
<div class="control-icon rdd-combat ">
|
||||
<img class="rdd-hud-togglebutton" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd06.svg" width="36" height="36" title="Attaque"/>
|
||||
<div class="rdd-hud-list tokenhudext left">
|
||||
<div class="rdd-hud-list token-hud-ext left">
|
||||
{{#each actions as |action key|}}
|
||||
{{#unless action.system.initOnly}}
|
||||
<div class="control-icon tokenhudicon rdd-hud-menu rdd-attaque"
|
||||
<div class="control-icon token-hud-icon rdd-hud-menu rdd-attaque"
|
||||
data-combatant-id="{{../combatant.id}}"
|
||||
data-action-index="{{action.index}}"
|
||||
title="{{action.name}}">
|
||||
|
@ -1,8 +1,8 @@
|
||||
<div class="control-icon rdd-initiative ">
|
||||
<img class="rdd-hud-togglebutton" src="icons/svg/sword.svg" width="36" height="36" title="Initiative" />
|
||||
<div class="rdd-hud-list tokenhudext right">
|
||||
<div class="rdd-hud-list token-hud-ext right">
|
||||
{{#each actions as |action key|}}
|
||||
<div class="control-icon tokenhudicon rdd-hud-menu"
|
||||
<div class="control-icon token-hud-icon rdd-hud-menu"
|
||||
data-combatant-id="{{../combatant.id}}"
|
||||
data-action-index="{{action.index}}"
|
||||
title="{{action.name}}">
|
||||
@ -10,7 +10,7 @@
|
||||
</div>
|
||||
{{/each}}
|
||||
{{#each commandes as |commande key|}}
|
||||
<div class="control-icon tokenhudicon rdd-hud-menu"
|
||||
<div class="control-icon token-hud-icon rdd-hud-menu"
|
||||
data-command="{{commande.command}}"
|
||||
data-combatant-id="{{../combatant.id}}"
|
||||
data-action-index="{{commande.index}}"
|
||||
|
12
templates/hud-actor-soins.hbs
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="control-icon rdd-soins ">
|
||||
<img class="rdd-hud-togglebutton" src="icons/svg/regen.svg" width="36" height="36" title="Soins" />
|
||||
<div class="rdd-hud-list token-hud-ext soins">
|
||||
{{#each blessures as |blessure|}}
|
||||
<div class="control-icon token-hud-icon rdd-hud-menu"
|
||||
data-blessure-id="{{blessure.id}}"
|
||||
title="{{blessure.name}}">
|
||||
<label>Soigner: {{blessure.name}}</label>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
55
templates/item-blessure-sheet.html
Normal file
@ -0,0 +1,55 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}}
|
||||
<section class="sheet-body">
|
||||
<div class="form-group">
|
||||
<label for="system-gravite">Gravité</label>
|
||||
<select name="system-gravite" class="gravite" data-dtype="Number">
|
||||
{{#select system.gravite}}
|
||||
<option value="0">Contusion / Eraflure</option>
|
||||
<option value="2">Légère</option>
|
||||
<option value="4">Grave</option>
|
||||
<option value="6">Critique</option>
|
||||
<option value="8">Mort</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.localisation">Localisation</label>
|
||||
<input class="attribute-value" type="text" name="system.localisation" value="{{system.localisation}}" data-dtype="String"/>
|
||||
</div>
|
||||
{{#if (lt system.gravite 7)}}
|
||||
<div class="form-group">
|
||||
<label for="system.difficulte">Difficulté des soins</label>
|
||||
<input class="attribute-value number-x" type="text" name="system.difficulte" value="{{system.difficulte}}" data-dtype="Number"/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="premierssoins-done">Premiers soins
|
||||
<input class="attribute-value" type="checkbox" name="premierssoins-done" {{#if system.premierssoins.done}}checked{{/if}}/>
|
||||
</label>
|
||||
{{#if system.premierssoins.done}}
|
||||
<input class="attribute-value number-x" type="text" name="system.premierssoins.bonus" value="{{system.premierssoins.bonus}}" data-dtype="Number"/>
|
||||
{{else}}
|
||||
<label for="system.premierssoins.tache">Points de tâches</label>
|
||||
<input class="attribute-value number-x" type="text" name="system.premierssoins.tache" value="{{system.premierssoins.tache}}" data-dtype="Number"/>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
|
||||
{{#if system.premierssoins.done}}
|
||||
<div class="form-group">
|
||||
<label for="soinscomplets-done">Soins complets
|
||||
<input class="attribute-value" type="checkbox" name="soinscomplets-done" {{#if system.soinscomplets.done}}checked{{/if}}/>
|
||||
</label>
|
||||
{{#if system.soinscomplets.done}}
|
||||
<input class="attribute-value number-x" type="text" name="system.soinscomplets.bonus" value="{{system.soinscomplets.bonus}}" data-dtype="Number"/>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if options.isOwned}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/temporel.hbs" this labeldebut="Obtenue" labelfin="Prochain jet"}}
|
||||
{{/if}}
|
||||
</section>
|
||||
</form>
|
@ -18,7 +18,7 @@
|
||||
<section class="sheet-body">
|
||||
<div class="tab items flexcol" data-group="primary" data-tab="informations">
|
||||
<div class="form-group">
|
||||
<label>Fréquence</label>
|
||||
<label for="system.rarete">Fréquence</label>
|
||||
<select name="system.rarete" class="rarete" data-dtype="String">
|
||||
{{#select system.rarete}}
|
||||
<option value=""></option>
|
||||
@ -27,75 +27,69 @@
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Catégorie</label>
|
||||
<label for="system.categorie">Catégorie</label>
|
||||
<select name="system.categorie" class="categoriepotion" data-dtype="String">
|
||||
{{#select system.categorie}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-potion.html"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
{{#if isSoins}}
|
||||
<div class="form-group">
|
||||
<label>Herbe</label>
|
||||
<select name="system.herbe" class="herbe" data-dtype="String">
|
||||
{{selectOptions herbesSoins selected=system.herbe localize=false}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Nombre de brins</label>
|
||||
<input class="attribute-value" type="text" name="system.herbebrins" value="{{system.herbebrins}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Bonus</label>
|
||||
<input class="attribute-value" type="text" name="system.herbebonus" value="{{system.herbebonus}}" data-dtype="Number" />
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if isRepos}}
|
||||
<div class="form-group">
|
||||
<label>Herbe</label>
|
||||
<select name="system.herbe" class="herbe" data-dtype="String">
|
||||
{{selectOptions herbesRepos selected=system.herbe localize=false}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Nombre de brins</label>
|
||||
<input class="attribute-value" type="text" name="system.herbebrins" value="{{system.herbebrins}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Bonus</label>
|
||||
<input class="attribute-value" type="text" name="system.herbebonus" value="{{system.herbebonus}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Repos Alchimique ?</label>
|
||||
<input class="attribute-value" type="checkbox" name="system.reposalchimique" {{#if system.reposalchimique}}checked{{/if}}/>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if system.magique}}
|
||||
<div class="form-group">
|
||||
<label>Points de rêve</label>
|
||||
<input class="attribute-value" type="text" name="system.pr" value="{{system.pr}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="xp">Permanente ? </label>
|
||||
<input class="attribute-value" type="checkbox" name="system.prpermanent" {{#if system.prpermanent}}checked{{/if}}/>
|
||||
</div>
|
||||
{{#if isSoins}}
|
||||
<div class="form-group">
|
||||
<label for="xp">Points de guérison </label>
|
||||
<label for="xp">{{pointsGuerison}}</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="form-group">
|
||||
<label>Date de l'Enchantement : Jour/Mois (date actuelle : {{dateActuelle}})</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="number" name="enchantement.jour" class="date-enchantement" value="{{enchantement.jour}}" data-dtype="Number" min="1" max="28"/>
|
||||
<select name="enchantement.mois" class="date-enchantement" data-dtype="String">
|
||||
{{#select enchantement.mois}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
{{#if (or isSoins isRepos)}}
|
||||
<div class="form-group">
|
||||
<label for="system.herbe">Herbe</label>
|
||||
<select name="system.herbe" class="herbe" data-dtype="String">
|
||||
{{#if isSoins}}
|
||||
{{selectOptions herbesSoins selected=system.herbe localize=false}}
|
||||
{{/if}}
|
||||
{{#if isRepos}}
|
||||
{{selectOptions herbesRepos selected=system.herbe localize=false}}
|
||||
{{/if}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.herbebrins">Nombre de brins</label>
|
||||
<input class="attribute-value" type="text" name="system.herbebrins" value="{{system.herbebrins}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.herbebonus">Bonus</label>
|
||||
<input class="attribute-value" type="text" name="system.herbebonus" value="{{system.herbebonus}}" data-dtype="Number" />
|
||||
</div>
|
||||
{{#if isRepos}}
|
||||
<div class="form-group">
|
||||
<label for="system.reposalchimique">Repos Alchimique ?</label>
|
||||
<input class="attribute-value" type="checkbox" name="system.reposalchimique" {{#if system.reposalchimique}}checked{{/if}}/>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if system.magique}}
|
||||
<div class="form-group">
|
||||
<label for="system.pr">Points de rêve</label>
|
||||
<input class="attribute-value" type="text" name="system.pr" value="{{system.pr}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.prpermanent">Permanente ? </label>
|
||||
<input class="attribute-value" type="checkbox" name="system.prpermanent" {{#if system.prpermanent}}checked{{/if}}/>
|
||||
</div>
|
||||
{{#if (or isSoins isRepos)}}
|
||||
<div class="form-group">
|
||||
<label>Points de
|
||||
{{#if isSoins}}guérison{{/if}}
|
||||
{{#if isRepos}}repos{{/if}}
|
||||
</label>
|
||||
<label>{{system.puissance}}</label>
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="form-group">
|
||||
<label for="enchantement.jour">Date de l'Enchantement : Jour/Mois (date actuelle : {{dateActuelle}})</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="number" name="enchantement.jour" class="date-enchantement" value="{{enchantement.jour}}" data-dtype="Number" min="1" max="28"/>
|
||||
<select name="enchantement.mois" class="date-enchantement" data-dtype="String">
|
||||
{{#select enchantement.mois}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-heures.html"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/item/partial-inventaire.html"}}
|
||||
|
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
@ -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
@ -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>
|
39
templates/sommeil/astrologie-theme.hbs
Normal file
@ -0,0 +1,39 @@
|
||||
<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>
|
||||
{{#each heures as |heure|}}
|
||||
<div class="astro-ajustement heure-{{heure.hh}}"></div>
|
||||
<div class="astro-heure heure-{{heure.hh}}"><img class="astro-heure-img" src="{{heure.webp}}" title="{{heure.label}}"></div>
|
||||
{{/each}}
|
||||
<div class="astro-cercle2"></div>
|
||||
<div class="astro-disque">
|
||||
<img src="systems/foundryvtt-reve-de-dragon/styles/img/ui/astro-disque.svg" alt="">
|
||||
</div>
|
||||
<div class="astro-horloge-heure">
|
||||
<img src="systems/foundryvtt-reve-de-dragon/styles/img/ui/rdd-aiguille-horloge.svg" alt="">
|
||||
</div>
|
||||
<div class="astro-horloge-minute">
|
||||
<img src="systems/foundryvtt-reve-de-dragon/styles/img/ui/rdd-aiguille-minute.svg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|