/** * Hero6 system * Author: Uberwald * Software License: Prop */ /* -------------------------------------------- */ /* -------------------------------------------- */ // Import Modules import { Hero6Actor } from "./hero6-actor.js"; import { Hero6ItemSheet } from "./hero6-item-sheet.js"; import { Hero6ActorSheet } from "./hero6-actor-sheet.js"; import { Hero6NPCSheet } from "./hero6-npc-sheet.js"; import { Hero6Utility } from "./hero6-utility.js"; import { Hero6Combat, Hero6CombatTracker } from "./hero6-combat.js"; import { Hero6Item } from "./hero6-item.js"; import { Hero6Hotbar } from "./hero6-hotbar.js" import { Hero6Commands } from "./hero6-commands.js" import { Hero6_CONFIG } from "./hero6-config.js"; /* -------------------------------------------- */ /* Foundry VTT Initialization */ /* -------------------------------------------- */ /************************************************************************************/ Hooks.once("init", async function () { console.log(`Initializing Hero6 RPG`); game.system.hero6 = { Hero6Commands, config: Hero6_CONFIG } /* -------------------------------------------- */ // preload handlebars templates Hero6Utility.preloadHandlebarsTemplates(); /* -------------------------------------------- */ // Set an initiative formula for the system CONFIG.Combat.initiative = { formula: "1d6", decimals: 2 }; /* ------------------------------- ------------- */ game.socket.on("system.fvtt-hero-system-6", data => { Hero6Utility.onSocketMesssage(data) }); /* -------------------------------------------- */ // Define custom Entity classes CONFIG.Combat.documentClass = Hero6Combat CONFIG.Actor.documentClass = Hero6Actor CONFIG.Item.documentClass = Hero6Item CONFIG.ui.combat = Hero6CombatTracker; /* -------------------------------------------- */ // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); Actors.registerSheet("fvtt-hero-system-6", Hero6ActorSheet, { types: ["character"], makeDefault: true }); Actors.registerSheet("fvtt-hero-system-6", Hero6ActorSheet, { types: ["minion"], makeDefault: false }); Items.unregisterSheet("core", ItemSheet); Items.registerSheet("fvtt-hero-system-6", Hero6ItemSheet, { makeDefault: true }); Hero6Utility.init() }); /* -------------------------------------------- */ function welcomeMessage() { ChatMessage.create({ user: game.user.id, whisper: [game.user.id], content: `