/** * Crucible system * Author: Uberwald * Software License: Prop */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { CrucibleActor } from "./crucible-actor.js"; import { CrucibleItemSheet } from "./crucible-item-sheet.js"; import { CrucibleActorSheet } from "./crucible-actor-sheet.js"; import { CrucibleNPCSheet } from "./crucible-npc-sheet.js"; import { CrucibleUtility } from "./crucible-utility.js"; import { CrucibleCombat } from "./crucible-combat.js"; import { CrucibleItem } from "./crucible-item.js"; import { CrucibleHotbar } from "./crucible-hotbar.js" /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing Crucible RPG`); game.system.cruciblerpg = { CrucibleHotbar } /* -------------------------------------------- */ // preload handlebars templates CrucibleUtility.preloadHandlebarsTemplates(); /* -------------------------------------------- */ game.settings.register("fvtt-crucible-rpg", "dice-max-level", { name: "Maximum level value for dices lists", hint: "Set the maximum level value for dices lists", scope: "world", config: true, default: 20, type: Number }) /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1d6", decimals: 1 }; /* -------------------------------------------- */ game.socket.on("system.fvtt-crucible-rpg", data => { CrucibleUtility.onSocketMesssage(data) }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Combat.documentClass = CrucibleCombat CONFIG.Actor.documentClass = CrucibleActor CONFIG.Item.documentClass = CrucibleItem //CONFIG.Token.objectClass = CrucibleToken /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("fvtt-crucible", CrucibleActorSheet, { types: ["character"], makeDefault: true }); Actors.registerSheet("fvtt-crucible", CrucibleNPCSheet, { types: ["npc"], makeDefault: false }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("fvtt-crucible", CrucibleItemSheet, { makeDefault: true }); CrucibleUtility.init() }); /* -------------------------------------------- */ function welcomeMessage() { ChatMessage.create({ user: game.user.id, whisper: [game.user.id], content: `