/** * RdD system * Author: LeRatierBretonnien * Software License: GNU GPLv3 */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { RdDActor } from "./actor.js"; import { RdDItemSheet } from "./item-sheet.js"; import { RdDActorSheet } from "./actor-sheet.js"; import { RdDActorCreatureSheet } from "./actor-creature-sheet.js"; import { RdDActorVehiculeSheet } from "./actor-vehicule-sheet.js"; import { RdDActorEntiteSheet } from "./actor-entite-sheet.js"; import { RdDUtility } from "./rdd-utility.js"; import { TMRUtility } from "./tmr-utility.js"; import { RdDCalendrier } from "./rdd-calendrier.js"; import { RdDResolutionTable } from "./rdd-resolution-table.js"; import { RdDTokenHud } from "./rdd-token-hud.js"; import { RdDCommands } from "./rdd-commands.js"; import { RdDCombatManager, RdDCombat } from "./rdd-combat.js"; import { ChatUtility } from "./chat-utility.js"; import { RdDItemCompetence } from "./item-competence.js"; import { StatusEffects } from "./status-effects.js"; import { RddCompendiumOrganiser } from "./rdd-compendium-organiser.js"; import { ReglesOptionelles } from "./regles-optionelles.js"; import { TMRRencontres } from "./tmr-rencontres.js"; import { RdDHotbar } from "./rdd-hotbar-drop.js" import { EffetsDraconiques } from "./tmr/effets-draconiques.js"; /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing Reve de Dragon System`); // preload handlebars templates RdDUtility.preloadHandlebarsTemplates(); // Create useful storage space game.system.rdd = { TMRUtility, RdDUtility, RdDHotbar } /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "accorder-entite-cauchemar", { name: "Accorder le rêve aux entités", hint: "A quel moment les personnages doivent accorder leur rêve aux entités de cauchemar", scope: "world", config: true, type: String, choices: { // If choices are defined, the resulting setting will be a select menu "avant-attaque": "Avant l'attaque", "avant-defense": "Avant la défense", "avant-encaissement": "Avant l'encaissement", }, default: "avant-encaissement" }); /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "calendrier", { name: "calendrier", scope: "world", config: false, type: Object }); /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "liste-nombre-astral", { name: "liste-nombre-astral", scope: "world", config: false, type: Object }); /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "calendrier-pos", { name: "calendrierPos", scope: "world", config: false, type: Object }); /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "dice-so-nice", { 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", scope: "client", config: true, default: false, type: Boolean }); /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "supprimer-dialogues-combat-chat", { name: "Supprimer les dialogues de combat", hint: "Si désactivée, tous les dialogues de combat sont conservés dans la conversation", scope: "world", config: true, default: true, type: Boolean }); /* -------------------------------------------- */ game.settings.register("foundryvtt-reve-de-dragon", "activer-sons-audio", { name: "Activer les bruitages intégrés", hint: "Si activé, certaines actions en jeu déclenchent un son d'ambiance", scope: "world", config: true, default: true, type: Boolean }); /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1+(1d6/10)", decimals: 2 }; /* -------------------------------------------- */ game.socket.on("system.foundryvtt-reve-de-dragon", data => { RdDUtility.onSocketMesssage(data); RdDCombat.onSocketMessage(data); ChatUtility.onSocketMessage(data); }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Actor.entityClass = RdDActor; CONFIG.RDD = { resolutionTable: RdDResolutionTable.resolutionTable, carac_array: RdDUtility.getCaracArray(), ajustementsConditions: RdDUtility.getAjustementsConditions(), difficultesLibres: RdDUtility.getDifficultesLibres() } /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorSheet, { types: ["personnage"], makeDefault: true }); Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorCreatureSheet, { types: ["creature"], makeDefault: true }); Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorVehiculeSheet, { types: ["vehicule"], makeDefault: true }); Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorEntiteSheet, { types: ["entite"], makeDefault: true }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("foundryvtt-reve-de-dragon", RdDItemSheet, { makeDefault: true }); CONFIG.Combat.entityClass = RdDCombatManager; // préparation des différents modules RdDCommands.init(); RdDCombat.init(); RdDCombatManager.init(), RdDTokenHud.init(); RdDActor.init(); RddCompendiumOrganiser.init(); ReglesOptionelles.init(); EffetsDraconiques.init() TMRUtility.init(); TMRRencontres.init(); RdDHotbar.initDropbar(); }); /* -------------------------------------------- */ function messageDeBienvenue() { if (game.user.isGM) { ChatUtility.removeChatMessageContaining('
/aide
dans le chat permet de voir les commandes spécifiques à Rêve de Dragon.