foundryvtt-reve-de-dragon/module/simple.js

47 lines
1.5 KiB
JavaScript
Raw Normal View History

2020-05-21 21:48:20 +02:00
/**
* A simple and flexible system for world-building using an arbitrary collection of character and item attributes
* Author: Atropos
* Software License: GNU GPLv3
*/
// Import Modules
import { SimpleActor } from "./actor.js";
import { SimpleItemSheet } from "./item-sheet.js";
import { SimpleActorSheet } from "./actor-sheet.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("init", async function() {
console.log(`Initializing Simple Worldbuilding System`);
/**
* Set an initiative formula for the system
* @type {String}
*/
CONFIG.Combat.initiative = {
formula: "1d20",
decimals: 2
};
// Define custom Entity classes
CONFIG.Actor.entityClass = SimpleActor;
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("dnd5e", SimpleActorSheet, { makeDefault: true });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("dnd5e", SimpleItemSheet, {makeDefault: true});
// Register system settings
game.settings.register("worldbuilding", "macroShorthand", {
name: "Shortened Macro Syntax",
hint: "Enable a shortened macro syntax which allows referencing attributes directly, for example @str instead of @attributes.str.value. Disable this setting if you need the ability to reference the full attribute model, for example @attributes.str.label.",
scope: "world",
type: Boolean,
default: true,
config: true
});
});