Initial Import

This commit is contained in:
2023-01-04 22:21:49 +01:00
parent da4efccad5
commit 405539e077
10 changed files with 1570 additions and 1565 deletions

View File

@@ -10,11 +10,11 @@ const __saveFirstToKey = { r: "reflex", f: "fortitude", w: "willpower"}
export class WarheroCommands {
static init() {
if (!game.system.cruciblerpg.commands) {
if (!game.system.warhero.commands) {
const crucibleCommands = new WarheroCommands();
crucibleCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => WarheroCommands.rollTarget(msg, params), descr: "Launch the target roll window" });
crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => WarheroCommands.rollSave(msg, params), descr: "Performs a save roll" });
game.system.cruciblerpg.commands = crucibleCommands;
//crucibleCommands.registerCommand({ path: ["/rtarget"], func: (content, msg, params) => WarheroCommands.rollTarget(msg, params), descr: "Launch the target roll window" });
//crucibleCommands.registerCommand({ path: ["/rsave"], func: (content, msg, params) => WarheroCommands.rollSave(msg, params), descr: "Performs a save roll" });
game.system.warhero.commands = crucibleCommands;
}
}

View File

@@ -63,10 +63,9 @@ export class WarheroItemSheet extends ItemSheet {
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
weaponSkills: WarheroUtility.getWeaponSkills(),
shieldSkills: WarheroUtility.getShieldSkills(),
config: game.system.warhero.config,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
data: itemData,
system: itemData,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,

View File

@@ -17,6 +17,7 @@ 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 */
@@ -27,9 +28,10 @@ Hooks.once("init", async function () {
console.log(`Initializing Warhero RPG`);
game.system.cruciblerpg = {
game.system.warhero = {
WarheroHotbar,
WarheroCommands
WarheroCommands,
config: WARHERO_CONFIG
}
/* -------------------------------------------- */

View File

@@ -66,33 +66,6 @@ export class WarheroUtility {
console.log("Element Found !!!!")
}) */
}
/*-------------------------------------------- */
static addDiceColors() {
game.dice3d.addColorset({
name: 'warhero-orange',
category: "crucible",
foreground: '#9F8003',
background: "#FFA500",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'warhero-purple',
category: "crucible",
foreground: '#9F8003',
background: "#800080",
visibility: 'visible'
}, "preferred");
game.dice3d.addColorset({
name: 'warhero-darkgreen',
category: "crucible",
foreground: '#9F8003',
background: "#006400",
visibility: 'visible'
}, "preferred");
}
/*-------------------------------------------- */
static upperFirst(text) {
@@ -115,16 +88,6 @@ export class WarheroUtility {
/* -------------------------------------------- */
static async ready() {
const skills = await WarheroUtility.loadCompendium("fvtt-warhero.skills")
this.skills = skills.map(i => i.toObject())
this.weaponSkills = duplicate(this.skills.filter(item => item.system.isweaponskill))
this.shieldSkills = duplicate(this.skills.filter(item => item.system.isshieldskill))
const rollTables = await WarheroUtility.loadCompendium("fvtt-warhero.rolltables")
this.rollTables = rollTables.map(i => i.toObject())
this.addDiceColors()
}
/* -------------------------------------------- */