/** * DarkStars system * Author: Uberwald * Software License: Prop */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { DarkStarsActor } from "./dark-stars-actor.js"; import { DarkStarsItemSheet } from "./dark-stars-item-sheet.js"; import { DarkStarsActorSheet } from "./dark-stars-actor-sheet.js"; import { DarkStarsNPCSheet } from "./dark-stars-npc-sheet.js"; import { DarkStarsUtility } from "./dark-stars-utility.js"; import { DarkStarsCombat } from "./dark-stars-combat.js"; import { DarkStarsItem } from "./dark-stars-item.js"; import { DarkStarsHotbar } from "./dark-stars-hotbar.js" import { DarkStarsCommands } from "./dark-stars-commands.js" import { DARKSTARS_CONFIG } from "./dark-stars-config.js"; /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing DarkStars RPG`); game.system.darkstars = { DarkStarsCommands, config: DARKSTARS_CONFIG } /* -------------------------------------------- */ // preload handlebars templates DarkStarsUtility.preloadHandlebarsTemplates(); /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1d6", decimals: 1 }; /* -------------------------------------------- */ game.socket.on("system.fvtt-dark-stars", data => { DarkStarsUtility.onSocketMesssage(data) }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Combat.documentClass = DarkStarsCombat CONFIG.Actor.documentClass = DarkStarsActor CONFIG.Item.documentClass = DarkStarsItem /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("fvtt-dark-stars", DarkStarsActorSheet, { types: ["character"], makeDefault: true }); Actors.registerSheet("fvtt-dark-stars", DarkStarsNPCSheet, { types: ["npc"], makeDefault: false }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("fvtt-dark-stars", DarkStarsItemSheet, { makeDefault: true }); DarkStarsUtility.init() }); /* -------------------------------------------- */ function welcomeMessage() { ChatMessage.create({ user: game.user.id, whisper: [game.user.id], content: `