Utilisation de constant pour le systeme
This commit is contained in:
parent
79a7ad8b8c
commit
31d1d352f2
@ -32,6 +32,7 @@ import { DialogFabriquerPotion } from "./dialog-fabriquer-potion.js";
|
|||||||
import { RollDataAjustements } from "./rolldata-ajustements.js";
|
import { RollDataAjustements } from "./rolldata-ajustements.js";
|
||||||
import { DialogItemAchat } from "./dialog-item-achat.js";
|
import { DialogItemAchat } from "./dialog-item-achat.js";
|
||||||
import { RdDItem } from "./item.js";
|
import { RdDItem } from "./item.js";
|
||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/**
|
/**
|
||||||
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
|
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
|
||||||
@ -766,13 +767,13 @@ export class RdDActor extends Actor {
|
|||||||
const sustNeeded = tplData.attributs.sust.value;
|
const sustNeeded = tplData.attributs.sust.value;
|
||||||
const sustConsomme = tplData.compteurs.sust.value;
|
const sustConsomme = tplData.compteurs.sust.value;
|
||||||
const eauConsomme = tplData.compteurs.eau.value;
|
const eauConsomme = tplData.compteurs.eau.value;
|
||||||
if (game.settings.get("foundryvtt-reve-de-dragon", "appliquer-famine-soif").includes('famine') && sustConsomme < sustNeeded) {
|
if (game.settings.get(SYSTEM_RDD, "appliquer-famine-soif").includes('famine') && sustConsomme < sustNeeded) {
|
||||||
const perte = sustConsomme < Math.min(0.5, sustNeeded) ? 3 : (sustConsomme <= (sustNeeded / 2) ? 2 : 1);
|
const perte = sustConsomme < Math.min(0.5, sustNeeded) ? 3 : (sustConsomme <= (sustNeeded / 2) ? 2 : 1);
|
||||||
message.content += `<br>Vous ne vous êtes sustenté que de ${sustConsomme} pour un appétit de ${sustNeeded}, vous avez faim!
|
message.content += `<br>Vous ne vous êtes sustenté que de ${sustConsomme} pour un appétit de ${sustNeeded}, vous avez faim!
|
||||||
La famine devrait vous faire ${perte} points d'endurance non récupérables, notez le cumul de côté et ajustez l'endurance`;
|
La famine devrait vous faire ${perte} points d'endurance non récupérables, notez le cumul de côté et ajustez l'endurance`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.settings.get("foundryvtt-reve-de-dragon", "appliquer-famine-soif").includes('soif') && eauConsomme < sustNeeded) {
|
if (game.settings.get(SYSTEM_RDD, "appliquer-famine-soif").includes('soif') && eauConsomme < sustNeeded) {
|
||||||
const perte = eauConsomme < Math.min(0.5, sustNeeded) ? 12 : (eauConsomme <= (sustNeeded / 2) ? 6 : 3);
|
const perte = eauConsomme < Math.min(0.5, sustNeeded) ? 12 : (eauConsomme <= (sustNeeded / 2) ? 6 : 3);
|
||||||
message.content += `<br>Vous n'avez bu que ${eauConsomme} doses de liquide pour une soif de ${sustNeeded}, vous avez soif!
|
message.content += `<br>Vous n'avez bu que ${eauConsomme} doses de liquide pour une soif de ${sustNeeded}, vous avez soif!
|
||||||
La soif devrait vous faire ${perte} points d'endurance non récupérables, notez le cumul de côté et ajustez l'endurance`;
|
La soif devrait vous faire ${perte} points d'endurance non récupérables, notez le cumul de côté et ajustez l'endurance`;
|
||||||
@ -3474,7 +3475,7 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async accorder(entite, when = 'avant-encaissement') {
|
async accorder(entite, when = 'avant-encaissement') {
|
||||||
if (when != game.settings.get("foundryvtt-reve-de-dragon", "accorder-entite-cauchemar")
|
if (when != game.settings.get(SYSTEM_RDD, "accorder-entite-cauchemar")
|
||||||
|| !entite.isEntiteCauchemar()
|
|| !entite.isEntiteCauchemar()
|
||||||
|| entite.isEntiteCauchemarAccordee(this)) {
|
|| entite.isEntiteCauchemarAccordee(this)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -7,6 +7,7 @@ import { RdDGemme } from "./rdd-gemme.js";
|
|||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { HtmlUtility } from "./html-utility.js";
|
import { HtmlUtility } from "./html-utility.js";
|
||||||
import { ReglesOptionelles } from "./regles-optionelles.js";
|
import { ReglesOptionelles } from "./regles-optionelles.js";
|
||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the basic ItemSheet with some very simple modifications
|
* Extend the basic ItemSheet with some very simple modifications
|
||||||
@ -17,7 +18,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return mergeObject(super.defaultOptions, {
|
return mergeObject(super.defaultOptions, {
|
||||||
classes: ["foundryvtt-reve-de-dragon", "sheet", "item"],
|
classes: [SYSTEM_RDD, "sheet", "item"],
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/item-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/item-sheet.html",
|
||||||
width: 550,
|
width: 550,
|
||||||
height: 550
|
height: 550
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
import { RdDItemSigneDraconique } from "./item-signedraconique.js";
|
import { RdDItemSigneDraconique } from "./item-signedraconique.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { TMRType, TMRUtility } from "./tmr-utility.js";
|
import { TMRType, TMRUtility } from "./tmr-utility.js";
|
||||||
@ -11,7 +12,7 @@ export class RdDSigneDraconiqueItemSheet extends ItemSheet {
|
|||||||
/** @override */
|
/** @override */
|
||||||
static get defaultOptions() {
|
static get defaultOptions() {
|
||||||
return mergeObject(super.defaultOptions, {
|
return mergeObject(super.defaultOptions, {
|
||||||
classes: ["foundryvtt-reve-de-dragon", "sheet", "item"],
|
classes: [SYSTEM_RDD, "sheet", "item"],
|
||||||
template: "systems/foundryvtt-reve-de-dragon/templates/item-signedraconique-sheet.html",
|
template: "systems/foundryvtt-reve-de-dragon/templates/item-signedraconique-sheet.html",
|
||||||
width: 550,
|
width: 550,
|
||||||
height: 550
|
height: 550
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const context2file = {
|
const context2file = {
|
||||||
@ -9,7 +10,7 @@ export class RdDAudio {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static PlayContextAudio(context) {
|
static PlayContextAudio(context) {
|
||||||
if (game.settings.get("foundryvtt-reve-de-dragon", "activer-sons-audio") ) {
|
if (game.settings.get(SYSTEM_RDD, "activer-sons-audio") ) {
|
||||||
let audioData = context2file[context];
|
let audioData = context2file[context];
|
||||||
if ( audioData ) {
|
if ( audioData ) {
|
||||||
let audioPath = "systems/foundryvtt-reve-de-dragon/sounds/" + audioData.file;
|
let audioPath = "systems/foundryvtt-reve-de-dragon/sounds/" + audioData.file;
|
||||||
|
@ -7,6 +7,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
|||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { RdDDice } from "./rdd-dice.js";
|
import { RdDDice } from "./rdd-dice.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const dossierIconesHeures = 'systems/foundryvtt-reve-de-dragon/icons/heures/'
|
const dossierIconesHeures = 'systems/foundryvtt-reve-de-dragon/icons/heures/'
|
||||||
@ -70,19 +71,19 @@ export class RdDCalendrier extends Application {
|
|||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
// position
|
// position
|
||||||
this.calendrierPos = duplicate(game.settings.get("foundryvtt-reve-de-dragon", "calendrier-pos"));
|
this.calendrierPos = duplicate(game.settings.get(SYSTEM_RDD, "calendrier-pos"));
|
||||||
if (this.calendrierPos == undefined || this.calendrierPos.top == undefined) {
|
if (this.calendrierPos == undefined || this.calendrierPos.top == undefined) {
|
||||||
this.calendrierPos = RdDCalendrier.createCalendrierPos();
|
this.calendrierPos = RdDCalendrier.createCalendrierPos();
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier-pos", this.calendrierPos);
|
game.settings.set(SYSTEM_RDD, "calendrier-pos", this.calendrierPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calendrier
|
// Calendrier
|
||||||
this.calendrier = duplicate(game.settings.get("foundryvtt-reve-de-dragon", "calendrier") ?? RdDCalendrier.getCalendrier(0));
|
this.calendrier = duplicate(game.settings.get(SYSTEM_RDD, "calendrier") ?? RdDCalendrier.getCalendrier(0));
|
||||||
this.calendrier.annee = this.calendrier.annee ?? Math.floor((this.calendrier.moisRdD ?? 0) / RDD_MOIS_PAR_AN);
|
this.calendrier.annee = this.calendrier.annee ?? Math.floor((this.calendrier.moisRdD ?? 0) / RDD_MOIS_PAR_AN);
|
||||||
this.calendrier.moisRdD = (this.calendrier.moisRdD ?? 0) % RDD_MOIS_PAR_AN;
|
this.calendrier.moisRdD = (this.calendrier.moisRdD ?? 0) % RDD_MOIS_PAR_AN;
|
||||||
|
|
||||||
if (game.user.isGM) { // Uniquement si GM
|
if (game.user.isGM) { // Uniquement si GM
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier", this.calendrier);
|
game.settings.set(SYSTEM_RDD, "calendrier", this.calendrier);
|
||||||
}
|
}
|
||||||
|
|
||||||
// nombre astral
|
// nombre astral
|
||||||
@ -95,7 +96,7 @@ export class RdDCalendrier extends Application {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getListeNombreAstral() {
|
getListeNombreAstral() {
|
||||||
return game.settings.get("foundryvtt-reve-de-dragon", "liste-nombre-astral") ?? [];
|
return game.settings.get(SYSTEM_RDD, "liste-nombre-astral") ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -172,7 +173,7 @@ export class RdDCalendrier extends Application {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
resetNombreAstral() {
|
resetNombreAstral() {
|
||||||
this.listeNombreAstral = [];
|
this.listeNombreAstral = [];
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
|
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", this.listeNombreAstral);
|
||||||
|
|
||||||
game.socket.emit("system.foundryvtt-reve-de-dragon", {
|
game.socket.emit("system.foundryvtt-reve-de-dragon", {
|
||||||
msg: "msg_reset_nombre_astral",
|
msg: "msg_reset_nombre_astral",
|
||||||
@ -203,7 +204,7 @@ export class RdDCalendrier extends Application {
|
|||||||
}
|
}
|
||||||
//console.log("SAVE list", newList, jourCourant);
|
//console.log("SAVE list", newList, jourCourant);
|
||||||
this.listeNombreAstral = newList;
|
this.listeNombreAstral = newList;
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
|
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", this.listeNombreAstral);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +256,7 @@ export class RdDCalendrier extends Application {
|
|||||||
this.checkMaladie("heure");
|
this.checkMaladie("heure");
|
||||||
this.checkMaladie("jour");
|
this.checkMaladie("jour");
|
||||||
}
|
}
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier", duplicate(this.calendrier));
|
game.settings.set(SYSTEM_RDD, "calendrier", duplicate(this.calendrier));
|
||||||
// Notification aux joueurs
|
// Notification aux joueurs
|
||||||
game.socket.emit("system.foundryvtt-reve-de-dragon", {
|
game.socket.emit("system.foundryvtt-reve-de-dragon", {
|
||||||
msg: "msg_sync_time",
|
msg: "msg_sync_time",
|
||||||
@ -283,7 +284,7 @@ export class RdDCalendrier extends Application {
|
|||||||
}
|
}
|
||||||
this.calendrier.heureRdD = indexHeure;
|
this.calendrier.heureRdD = indexHeure;
|
||||||
this.calendrier.minutesRelative = 0;
|
this.calendrier.minutesRelative = 0;
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier", duplicate(this.calendrier));
|
game.settings.set(SYSTEM_RDD, "calendrier", duplicate(this.calendrier));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -339,7 +340,7 @@ export class RdDCalendrier extends Application {
|
|||||||
// Mise à jour des nombres astraux du joueur
|
// Mise à jour des nombres astraux du joueur
|
||||||
let astralData = this.listeNombreAstral.find((nombreAstral, i) => nombreAstral.index == request.date);
|
let astralData = this.listeNombreAstral.find((nombreAstral, i) => nombreAstral.index == request.date);
|
||||||
astralData.valeursFausses.push({ actorId: request.id, nombreAstral: nbAstral });
|
astralData.valeursFausses.push({ actorId: request.id, nombreAstral: nbAstral });
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "liste-nombre-astral", this.listeNombreAstral);
|
game.settings.set(SYSTEM_RDD, "liste-nombre-astral", this.listeNombreAstral);
|
||||||
}
|
}
|
||||||
request.nbAstral = nbAstral;
|
request.nbAstral = nbAstral;
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
@ -472,7 +473,7 @@ export class RdDCalendrier extends Application {
|
|||||||
this.calendrier.jour = Number(calendrierData.jourMois) - 1;
|
this.calendrier.jour = Number(calendrierData.jourMois) - 1;
|
||||||
this.calendrier.moisRdD = RdDCalendrier.getChiffreFromSigne(calendrierData.moisKey);
|
this.calendrier.moisRdD = RdDCalendrier.getChiffreFromSigne(calendrierData.moisKey);
|
||||||
this.calendrier.heureRdD = RdDCalendrier.getChiffreFromSigne(calendrierData.heureKey);
|
this.calendrier.heureRdD = RdDCalendrier.getChiffreFromSigne(calendrierData.heureKey);
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier", duplicate(this.calendrier));
|
game.settings.set(SYSTEM_RDD, "calendrier", duplicate(this.calendrier));
|
||||||
|
|
||||||
await this.rebuildListeNombreAstral();
|
await this.rebuildListeNombreAstral();
|
||||||
|
|
||||||
@ -607,7 +608,7 @@ export class RdDCalendrier extends Application {
|
|||||||
game.system.rdd.calendrier.calendrierPos.top = yPos;
|
game.system.rdd.calendrier.calendrierPos.top = yPos;
|
||||||
game.system.rdd.calendrier.calendrierPos.left = xPos;
|
game.system.rdd.calendrier.calendrierPos.left = xPos;
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier-pos", duplicate(game.system.rdd.calendrier.calendrierPos));
|
game.settings.set(SYSTEM_RDD, "calendrier-pos", duplicate(game.system.rdd.calendrier.calendrierPos));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -615,7 +616,7 @@ export class RdDCalendrier extends Application {
|
|||||||
game.system.rdd.calendrier.calendrierPos.top = 200;
|
game.system.rdd.calendrier.calendrierPos.top = 200;
|
||||||
game.system.rdd.calendrier.calendrierPos.left = 200;
|
game.system.rdd.calendrier.calendrierPos.left = 200;
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier-pos", duplicate(game.system.rdd.calendrier.calendrierPos));
|
game.settings.set(SYSTEM_RDD, "calendrier-pos", duplicate(game.system.rdd.calendrier.calendrierPos));
|
||||||
}
|
}
|
||||||
this.setPos(game.system.rdd.calendrier.calendrierPos);
|
this.setPos(game.system.rdd.calendrier.calendrierPos);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { ChatUtility } from "./chat-utility.js";
|
import { ChatUtility } from "./chat-utility.js";
|
||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
import { RdDItemArme } from "./item-arme.js";
|
import { RdDItemArme } from "./item-arme.js";
|
||||||
import { RdDItemCompetence } from "./item-competence.js";
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
@ -686,7 +687,7 @@ export class RdDCombat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
removeChatMessageActionsPasseArme(passeArme) {
|
removeChatMessageActionsPasseArme(passeArme) {
|
||||||
if (game.settings.get("foundryvtt-reve-de-dragon", "supprimer-dialogues-combat-chat")) {
|
if (game.settings.get(SYSTEM_RDD, "supprimer-dialogues-combat-chat")) {
|
||||||
ChatUtility.removeChatMessageContaining(`<div data-passearme="${passeArme}">`);
|
ChatUtility.removeChatMessageContaining(`<div data-passearme="${passeArme}">`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1298,7 +1299,7 @@ export class RdDCombat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* retourne true si on peut continuer, false si on ne peut pas continuer */
|
/* retourne true si on peut continuer, false si on ne peut pas continuer */
|
||||||
async accorderEntite(when = 'avant-encaissement') {
|
async accorderEntite(when = 'avant-encaissement') {
|
||||||
if (when != game.settings.get("foundryvtt-reve-de-dragon", "accorder-entite-cauchemar")
|
if (when != game.settings.get(SYSTEM_RDD, "accorder-entite-cauchemar")
|
||||||
|| this.defender == undefined
|
|| this.defender == undefined
|
||||||
|| !this.defender.isEntiteCauchemar()
|
|| !this.defender.isEntiteCauchemar()
|
||||||
|| this.defender.isEntiteCauchemarAccordee(this.attacker)) {
|
|| this.defender.isEntiteCauchemarAccordee(this.attacker)) {
|
||||||
|
@ -54,7 +54,7 @@ Hooks.once("init", async function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "accorder-entite-cauchemar", {
|
game.settings.register(SYSTEM_RDD, "accorder-entite-cauchemar", {
|
||||||
name: "Accorder le rêve aux entités",
|
name: "Accorder le rêve aux entités",
|
||||||
hint: "A quel moment les personnages doivent accorder leur rêve aux entités de cauchemar",
|
hint: "A quel moment les personnages doivent accorder leur rêve aux entités de cauchemar",
|
||||||
scope: "world",
|
scope: "world",
|
||||||
@ -69,7 +69,7 @@ Hooks.once("init", async function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "calendrier", {
|
game.settings.register(SYSTEM_RDD, "calendrier", {
|
||||||
name: "calendrier",
|
name: "calendrier",
|
||||||
scope: "world",
|
scope: "world",
|
||||||
config: false,
|
config: false,
|
||||||
@ -96,7 +96,7 @@ Hooks.once("init", async function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "calendrier-pos", {
|
game.settings.register(SYSTEM_RDD, "calendrier-pos", {
|
||||||
name: "calendrierPos",
|
name: "calendrierPos",
|
||||||
scope: "client",
|
scope: "client",
|
||||||
config: false,
|
config: false,
|
||||||
@ -105,7 +105,7 @@ Hooks.once("init", async function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "dice-so-nice", {
|
game.settings.register(SYSTEM_RDD, "dice-so-nice", {
|
||||||
name: "Montrer les dés pour toutes les jets",
|
name: "Montrer les dés pour toutes les jets",
|
||||||
hint: "Utilise Dice So Nice pour tous les jets de dés possibles. Décocher pour limiter à la table de résolution",
|
hint: "Utilise Dice So Nice pour tous les jets de dés possibles. Décocher pour limiter à la table de résolution",
|
||||||
scope: "client",
|
scope: "client",
|
||||||
@ -115,7 +115,7 @@ Hooks.once("init", async function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "supprimer-dialogues-combat-chat", {
|
game.settings.register(SYSTEM_RDD, "supprimer-dialogues-combat-chat", {
|
||||||
name: "Supprimer les dialogues de combat",
|
name: "Supprimer les dialogues de combat",
|
||||||
hint: "Si désactivée, tous les dialogues de combat sont conservés dans la conversation",
|
hint: "Si désactivée, tous les dialogues de combat sont conservés dans la conversation",
|
||||||
scope: "world",
|
scope: "world",
|
||||||
@ -124,7 +124,7 @@ Hooks.once("init", async function () {
|
|||||||
type: Boolean
|
type: Boolean
|
||||||
});
|
});
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "activer-sons-audio", {
|
game.settings.register(SYSTEM_RDD, "activer-sons-audio", {
|
||||||
name: "Activer les bruitages intégrés",
|
name: "Activer les bruitages intégrés",
|
||||||
hint: "Si activé, certaines actions en jeu déclenchent un son d'ambiance",
|
hint: "Si activé, certaines actions en jeu déclenchent un son d'ambiance",
|
||||||
scope: "world",
|
scope: "world",
|
||||||
@ -133,7 +133,7 @@ Hooks.once("init", async function () {
|
|||||||
type: Boolean
|
type: Boolean
|
||||||
});
|
});
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "appliquer-famine-soif", {
|
game.settings.register(SYSTEM_RDD, "appliquer-famine-soif", {
|
||||||
name: "Notifier de la famine et la soif pour",
|
name: "Notifier de la famine et la soif pour",
|
||||||
hint: "Indique si les cas de famine et de soif seront indiqués durant Château Dormant",
|
hint: "Indique si les cas de famine et de soif seront indiqués durant Château Dormant",
|
||||||
scope: "world",
|
scope: "world",
|
||||||
@ -178,19 +178,21 @@ Hooks.once("init", async function () {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// Register sheet application classes
|
// Register sheet application classes
|
||||||
Actors.unregisterSheet("core", ActorSheet);
|
Actors.unregisterSheet("core", ActorSheet);
|
||||||
Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorSheet, { types: ["personnage"], makeDefault: true });
|
Actors.registerSheet(SYSTEM_RDD, RdDActorSheet, { types: ["personnage"], makeDefault: true });
|
||||||
Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorCreatureSheet, { types: ["creature"], makeDefault: true });
|
Actors.registerSheet(SYSTEM_RDD, RdDActorCreatureSheet, { types: ["creature"], makeDefault: true });
|
||||||
Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true });
|
Actors.registerSheet(SYSTEM_RDD, RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true });
|
||||||
Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorEntiteSheet, { types: ["entite"], makeDefault: true });
|
Actors.registerSheet(SYSTEM_RDD, RdDActorEntiteSheet, { types: ["entite"], makeDefault: true });
|
||||||
Items.unregisterSheet("core", ItemSheet);
|
Items.unregisterSheet("core", ItemSheet);
|
||||||
Items.registerSheet("foundryvtt-reve-de-dragon", RdDSigneDraconiqueItemSheet, {
|
Items.registerSheet(SYSTEM_RDD, RdDSigneDraconiqueItemSheet, {
|
||||||
label: "Signe draconique",
|
label: "Signe draconique",
|
||||||
types: ["signedraconique"],
|
types: ["signedraconique"],
|
||||||
makeDefault: true
|
makeDefault: true
|
||||||
});
|
});
|
||||||
Items.registerSheet("foundryvtt-reve-de-dragon", RdDItemSheet, { types: ["arme", "armure", "objet", "arme", "armure", "conteneur", "competence", "sort", "herbe", "ingredient", "livre", "potion", "munition", "rencontresTMR", "queue", "ombre", "souffle",
|
Items.registerSheet(SYSTEM_RDD, RdDItemSheet, {
|
||||||
|
types: ["arme", "armure", "objet", "arme", "armure", "conteneur", "competence", "sort", "herbe", "ingredient", "livre", "potion", "munition", "rencontresTMR", "queue", "ombre", "souffle",
|
||||||
"tete", "competencecreature", "tarot", "monnaie", "nombreastral", "tache", "meditation", "casetmr", "recettealchimique", "gemme",
|
"tete", "competencecreature", "tarot", "monnaie", "nombreastral", "tache", "meditation", "casetmr", "recettealchimique", "gemme",
|
||||||
"musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre", "nourritureboisson"], makeDefault: true });
|
"musique", "chant", "danse", "jeu", "recettecuisine", "maladie", "poison", "oeuvre", "nourritureboisson"], makeDefault: true
|
||||||
|
});
|
||||||
CONFIG.Combat.documentClass = RdDCombatManager;
|
CONFIG.Combat.documentClass = RdDCombatManager;
|
||||||
|
|
||||||
// préparation des différents modules
|
// préparation des différents modules
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
|
|
||||||
const listeReglesOptionelles = [
|
const listeReglesOptionelles = [
|
||||||
@ -21,10 +22,10 @@ export class ReglesOptionelles extends FormApplication {
|
|||||||
for (const regle of listeReglesOptionelles) {
|
for (const regle of listeReglesOptionelles) {
|
||||||
const name = regle.name;
|
const name = regle.name;
|
||||||
const id = ReglesOptionelles._getIdRegle(name);
|
const id = ReglesOptionelles._getIdRegle(name);
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", id, { name: id, scope: "world", config: false, default: regle.default == undefined ? true : regle.default, type: Boolean });
|
game.settings.register(SYSTEM_RDD, id, { name: id, scope: "world", config: false, default: regle.default == undefined ? true : regle.default, type: Boolean });
|
||||||
}
|
}
|
||||||
|
|
||||||
game.settings.registerMenu("foundryvtt-reve-de-dragon", "rdd-options-regles", {
|
game.settings.registerMenu(SYSTEM_RDD, "rdd-options-regles", {
|
||||||
name: "Choisir les règles optionelles",
|
name: "Choisir les règles optionelles",
|
||||||
label: "Choix des règles optionelles",
|
label: "Choix des règles optionelles",
|
||||||
hint: "Ouvre la fenêtre de sélection des règles optionelles",
|
hint: "Ouvre la fenêtre de sélection des règles optionelles",
|
||||||
@ -70,7 +71,7 @@ export class ReglesOptionelles extends FormApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static isUsing(name) {
|
static isUsing(name) {
|
||||||
return game.settings.get("foundryvtt-reve-de-dragon", ReglesOptionelles._getIdRegle(name));
|
return game.settings.get(SYSTEM_RDD, ReglesOptionelles._getIdRegle(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
@ -78,7 +79,7 @@ export class ReglesOptionelles extends FormApplication {
|
|||||||
if (event.currentTarget.attributes.name) {
|
if (event.currentTarget.attributes.name) {
|
||||||
let id = event.currentTarget.attributes.name.value;
|
let id = event.currentTarget.attributes.name.value;
|
||||||
let isChecked = event.currentTarget.checked;
|
let isChecked = event.currentTarget.checked;
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", id, isChecked);
|
game.settings.set(SYSTEM_RDD, id, isChecked);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { SYSTEM_RDD } from "./constants.js";
|
||||||
|
|
||||||
const rddStatusEffects = [
|
const rddStatusEffects = [
|
||||||
{ rdd: true, id: 'stun', label: 'EFFECT.StatusStunned', icon: 'icons/svg/stoned.svg', "duration.rounds": 1 },
|
{ rdd: true, id: 'stun', label: 'EFFECT.StatusStunned', icon: 'icons/svg/stoned.svg', "duration.rounds": 1 },
|
||||||
@ -21,7 +22,7 @@ export class StatusEffects {
|
|||||||
static onReady() {
|
static onReady() {
|
||||||
const rddStatusIds = rddStatusEffects.map(it => it.id);
|
const rddStatusIds = rddStatusEffects.map(it => it.id);
|
||||||
const defaultStatusEffectIds = CONFIG.statusEffects.map(it => it.id);
|
const defaultStatusEffectIds = CONFIG.statusEffects.map(it => it.id);
|
||||||
game.settings.register("foundryvtt-reve-de-dragon", "use-status-effects", {
|
game.settings.register(SYSTEM_RDD, "use-status-effects", {
|
||||||
name: "use-status-effects",
|
name: "use-status-effects",
|
||||||
scope: "world",
|
scope: "world",
|
||||||
config: false,
|
config: false,
|
||||||
@ -29,7 +30,7 @@ export class StatusEffects {
|
|||||||
type: String
|
type: String
|
||||||
});
|
});
|
||||||
|
|
||||||
game.settings.registerMenu("foundryvtt-reve-de-dragon", "select-status-effect", {
|
game.settings.registerMenu(SYSTEM_RDD, "select-status-effect", {
|
||||||
name: "Choisir les effets disponibles",
|
name: "Choisir les effets disponibles",
|
||||||
label: "Choix des effets",
|
label: "Choix des effets",
|
||||||
hint: "Ouvre la fenêtre de sélection des effets/status appliqués aux acteurs",
|
hint: "Ouvre la fenêtre de sélection des effets/status appliqués aux acteurs",
|
||||||
@ -58,13 +59,13 @@ export class StatusEffects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static _getUseStatusEffects() {
|
static _getUseStatusEffects() {
|
||||||
const setting = game.settings.get("foundryvtt-reve-de-dragon", "use-status-effects");
|
const setting = game.settings.get(SYSTEM_RDD, "use-status-effects");
|
||||||
return setting ? new Set(setting.split(',')) : new Set();
|
return setting ? new Set(setting.split(',')) : new Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
static _setUseStatusEffects(useStatusEffects) {
|
static _setUseStatusEffects(useStatusEffects) {
|
||||||
if (game.user.isGM) {
|
if (game.user.isGM) {
|
||||||
game.settings.set("foundryvtt-reve-de-dragon", "use-status-effects", StatusEffects._toSetting(useStatusEffects));
|
game.settings.set(SYSTEM_RDD, "use-status-effects", StatusEffects._toSetting(useStatusEffects));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let effect of CONFIG.RDD.allEffects) {
|
for (let effect of CONFIG.RDD.allEffects) {
|
||||||
|
Loading…
Reference in New Issue
Block a user