/** * RdD system * Author: LeRatierBretonnien * Software License: GNU GPLv3 */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { SoSActor } from "./actor.js"; import { SoSItemSheet } from "./item-sheet.js"; import { SoSActorSheet } from "./actor-sheet.js"; import { SoSUtility } from "./sos-utility.js"; import { SoSCombat } from "./sos-combat.js"; import { gearConverter } from "./gears_convert.js"; /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing Shadows Over Sol System`); // preload handlebars templates SoSUtility.preloadHandlebarsTemplates(); // Create useful storage space game.system.sos = { } /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1d3", decimals: 2 }; /* -------------------------------------------- */ game.socket.on("system.foundryvtt-shadows-over-sol", data => { SoSUtility.onSocketMesssage(data); }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Actor.entityClass = SoSActor; CONFIG.Combat.entityClass = SoSCombat; CONFIG.SoS = { } /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("foundryvtt-shadows-over-sol", SoSActorSheet, { types: ["character"], makeDefault: true }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("foundryvtt-shadows-over-sol", SoSItemSheet, { makeDefault: true }); // Init/registers Hooks.on('renderChatLog', (log, html, data) => { SoSUtility.registerChatCallbacks(html); }); // Init/registers Hooks.on('updateCombat', (combat, round, diff, id) => { SoSUtility.updateCombat(combat, round, diff, id); }); }); /* -------------------------------------------- */ function welcomeMessage() { //ChatUtility.removeMyChatMessageContaining('