2020-05-21 21:48:20 +02:00
|
|
|
/**
|
2020-05-22 19:28:01 +02:00
|
|
|
* RdD system
|
|
|
|
* Author: LeRatierBretonnien
|
2020-05-21 21:48:20 +02:00
|
|
|
* Software License: GNU GPLv3
|
|
|
|
*/
|
|
|
|
|
2020-05-22 19:28:01 +02:00
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
2020-05-21 21:48:20 +02:00
|
|
|
// Import Modules
|
2020-05-22 00:48:43 +02:00
|
|
|
import { RdDActor } from "./actor.js";
|
|
|
|
import { RdDItemSheet } from "./item-sheet.js";
|
|
|
|
import { RdDActorSheet } from "./actor-sheet.js";
|
2020-05-22 22:37:02 +02:00
|
|
|
import { RdDUtility } from "./rdd-utility.js";
|
2020-05-22 19:28:01 +02:00
|
|
|
|
2020-05-21 21:48:20 +02:00
|
|
|
/* -------------------------------------------- */
|
|
|
|
/* Foundry VTT Initialization */
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
|
|
|
Hooks.once("init", async function() {
|
2020-05-22 00:48:43 +02:00
|
|
|
console.log(`Initializing Reve de Dragon System`);
|
2020-05-22 19:28:01 +02:00
|
|
|
|
2020-05-24 20:19:57 +02:00
|
|
|
// preload handlebars templates
|
|
|
|
RdDUtility.preloadHandlebarsTemplates();
|
|
|
|
|
2020-05-21 21:48:20 +02:00
|
|
|
/**
|
|
|
|
* Set an initiative formula for the system
|
|
|
|
* @type {String}
|
|
|
|
*/
|
|
|
|
CONFIG.Combat.initiative = {
|
|
|
|
formula: "1d20",
|
|
|
|
decimals: 2
|
|
|
|
};
|
|
|
|
|
|
|
|
// Define custom Entity classes
|
2020-05-22 00:48:43 +02:00
|
|
|
CONFIG.Actor.entityClass = RdDActor;
|
2020-05-24 20:19:57 +02:00
|
|
|
CONFIG.RDD = {}
|
|
|
|
CONFIG.RDD.resolutionTable = RdDUtility.buildResolutionTable();
|
|
|
|
CONFIG.RDD.level_category = RdDUtility.getLevelCategory();
|
|
|
|
CONFIG.RDD.carac_array = RdDUtility.getCaracArray();
|
|
|
|
CONFIG.RDD.bonusmalus = RdDUtility.getBonusMalus();
|
|
|
|
game.data.RdDUtility = RdDUtility;
|
2020-05-22 19:28:01 +02:00
|
|
|
|
2020-05-21 21:48:20 +02:00
|
|
|
// Register sheet application classes
|
|
|
|
Actors.unregisterSheet("core", ActorSheet);
|
2020-05-22 00:48:43 +02:00
|
|
|
Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorSheet, { makeDefault: true });
|
2020-05-21 21:48:20 +02:00
|
|
|
Items.unregisterSheet("core", ItemSheet);
|
2020-05-22 00:48:43 +02:00
|
|
|
Items.registerSheet("foundryvtt-reve-de-dragon", RdDItemSheet, {makeDefault: true});
|
2020-05-21 21:48:20 +02:00
|
|
|
|
|
|
|
});
|