/** * RdD system * Author: Uberwald * Software License: Prop */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { VadentisActor } from "./vadentis-actor.js"; import { VadentisItemSheet } from "./vadentis-item-sheet.js"; import { VadentisActorSheet } from "./vadentis-actor-sheet.js"; import { VadentisUtility } from "./vadentis-utility.js"; import { VadentisCombat } from "./vadentis-combat.js"; import { VadentisTokenHud } from "./vadentis-hud.js"; /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing Vadentis`); /* -------------------------------------------- */ // preload handlebars templates VadentisUtility.preloadHandlebarsTemplates(); /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1d20", decimals: 0 }; /* -------------------------------------------- */ game.socket.on("system.foundryvtt-vadentis", data => { VadentisUtility.onSocketMesssage(data); }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Actor.documentClass = VadentisActor; CONFIG.Combat.documentClass = VadentisCombat; CONFIG.Vadentis = { } /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("foundryvtt-vadentis", VadentisActorSheet, { types: ["personnage"], makeDefault: true }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("foundryvtt-vadentis", VadentisItemSheet, { makeDefault: true }); // Init/registers Hooks.on('renderChatLog', (log, html, data) => { VadentisUtility.registerChatCallbacks(html); }); // Init/registers Hooks.on('updateCombat', (combat, round, diff, id) => { VadentisUtility.updateCombat(combat, round, diff, id); }); VadentisTokenHud.init(); }); /* -------------------------------------------- */ function welcomeMessage() { //ChatUtility.removeMyChatMessageContaining('