2021-03-16 08:22:27 +01:00
|
|
|
import { DS4Actor } from "../actor/actor";
|
|
|
|
import { DS4CharacterActorSheet } from "../actor/sheets/character-sheet";
|
|
|
|
import { DS4CreatureActorSheet } from "../actor/sheets/creature-sheet";
|
|
|
|
import { DS4 } from "../config";
|
|
|
|
import registerHandlebarsHelpers from "../handlebars/handlebars-helpers";
|
|
|
|
import registerHandlebarsPartials from "../handlebars/handlebars-partials";
|
|
|
|
import { DS4Item } from "../item/item";
|
|
|
|
import { DS4ItemSheet } from "../item/item-sheet";
|
2021-06-26 14:32:40 +02:00
|
|
|
import logger from "../logger";
|
2021-03-16 08:22:27 +01:00
|
|
|
import { macros } from "../macros/macros";
|
|
|
|
import { migration } from "../migrations";
|
|
|
|
import { DS4Check } from "../rolls/check";
|
|
|
|
import { createCheckRoll } from "../rolls/check-factory";
|
|
|
|
import { DS4Roll } from "../rolls/roll";
|
|
|
|
import registerSlayingDiceModifier from "../rolls/slaying-dice-modifier";
|
|
|
|
import { registerSystemSettings } from "../settings";
|
|
|
|
|
|
|
|
export default function registerForInitHook(): void {
|
|
|
|
Hooks.once("init", init);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function init() {
|
2021-06-26 14:32:40 +02:00
|
|
|
logger.info(`Initializing the DS4 Game System\n${DS4.ASCII}`);
|
2021-03-16 08:22:27 +01:00
|
|
|
|
|
|
|
game.ds4 = {
|
|
|
|
DS4Actor,
|
|
|
|
DS4Item,
|
|
|
|
DS4,
|
|
|
|
createCheckRoll,
|
|
|
|
migration,
|
|
|
|
macros,
|
|
|
|
};
|
|
|
|
|
|
|
|
CONFIG.DS4 = DS4;
|
|
|
|
|
|
|
|
CONFIG.Actor.entityClass = DS4Actor;
|
|
|
|
CONFIG.Item.entityClass = DS4Item;
|
|
|
|
|
|
|
|
CONFIG.Actor.typeLabels = DS4.i18n.actorTypes;
|
|
|
|
CONFIG.Item.typeLabels = DS4.i18n.itemTypes;
|
|
|
|
|
|
|
|
CONFIG.Dice.types.push(DS4Check);
|
|
|
|
CONFIG.Dice.terms.s = DS4Check;
|
|
|
|
|
|
|
|
CONFIG.Dice.rolls.unshift(DS4Roll);
|
|
|
|
|
|
|
|
registerSlayingDiceModifier();
|
|
|
|
|
|
|
|
registerSystemSettings();
|
|
|
|
|
|
|
|
Actors.unregisterSheet("core", ActorSheet);
|
|
|
|
Actors.registerSheet("ds4", DS4CharacterActorSheet, { types: ["character"], makeDefault: true });
|
|
|
|
Actors.registerSheet("ds4", DS4CreatureActorSheet, { types: ["creature"], makeDefault: true });
|
|
|
|
Items.unregisterSheet("core", ItemSheet);
|
|
|
|
Items.registerSheet("ds4", DS4ItemSheet, { makeDefault: true });
|
|
|
|
|
|
|
|
await registerHandlebarsPartials();
|
|
|
|
registerHandlebarsHelpers();
|
|
|
|
}
|