/** * Warhero system * Author: Uberwald * Software License: Prop */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { WarheroActor } from "./warhero-actor.js"; import { WarheroItemSheet } from "./warhero-item-sheet.js"; import { WarheroActorSheet } from "./warhero-actor-sheet.js"; import { WarheroNPCSheet } from "./warhero-npc-sheet.js"; import { WarheroUtility } from "./warhero-utility.js"; import { WarheroCombat } from "./warhero-combat.js"; import { WarheroItem } from "./warhero-item.js"; import { WarheroHotbar } from "./warhero-hotbar.js" import { WarheroCommands } from "./warhero-commands.js" import { WARHERO_CONFIG } from "./warhero-config.js" /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing Warhero RPG`); game.system.warhero = { WarheroHotbar, WarheroCommands, config: WARHERO_CONFIG } /* -------------------------------------------- */ // preload handlebars templates WarheroUtility.preloadHandlebarsTemplates(); /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1d6", decimals: 1 }; /* -------------------------------------------- */ game.socket.on("system.fvtt-warhero", data => { WarheroUtility.onSocketMesssage(data) }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Combat.documentClass = WarheroCombat CONFIG.Actor.documentClass = WarheroActor CONFIG.Item.documentClass = WarheroItem //CONFIG.Token.objectClass = WarheroToken /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("fvtt-crucible", WarheroActorSheet, { types: ["character"], makeDefault: true }); Actors.registerSheet("fvtt-crucible", WarheroNPCSheet, { types: ["npc"], makeDefault: false }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("fvtt-crucible", WarheroItemSheet, { makeDefault: true }); WarheroUtility.init() }); /* -------------------------------------------- */ function welcomeMessage() { ChatMessage.create({ user: game.user.id, whisper: [game.user.id], content: `