Improve system
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { MournbladeUtility } from "./mournblade-utility.js";
|
||||
import { MournbladeRollDialog } from "./Mournblade-roll-dialog.js";
|
||||
import { MournbladeRollDialog } from "./mournblade-roll-dialog.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class MournbladeActorSheet extends ActorSheet {
|
||||
|
||||
@@ -44,6 +44,14 @@ export class MournbladeActor extends Actor {
|
||||
return super.create(data, options);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getWeapons() {
|
||||
return this.data.items.filter(item => item.type == "arme" )
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getArmors() {
|
||||
return this.data.items.filter(item => item.type == "protection" )
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
prepareBaseData() {
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/* -------------------------------------------- */
|
||||
|
||||
import { MournbladeActorCreate } from "./mournblade-create-char.js";
|
||||
import { MournbladeUtility } from "./mournblade-utility.js";
|
||||
import { MournbladeRollDialog } from "./mournblade-roll-dialog.js";
|
||||
|
||||
@@ -8,15 +7,15 @@ import { MournbladeRollDialog } from "./mournblade-roll-dialog.js";
|
||||
export class MournbladeCommands {
|
||||
|
||||
static init() {
|
||||
if (!game.system.Mournblade.commands) {
|
||||
const MournbladeCommands = new MournbladeCommands();
|
||||
MournbladeCommands.registerCommand({ path: ["/char"], func: (content, msg, params) => MournbladeCommands.createChar(msg), descr: "Create a new character" });
|
||||
MournbladeCommands.registerCommand({ path: ["/pool"], func: (content, msg, params) => MournbladeCommands.poolRoll(msg), descr: "Generic Roll Window" });
|
||||
game.system.Mournblade.commands = MournbladeCommands;
|
||||
if (!game.system.mournblade.commands) {
|
||||
//const MournbladeCommands = new MournbladeCommands()
|
||||
//MournbladeCommands.registerCommand({ path: ["/char"], func: (content, msg, params) => MournbladeCommands.createChar(msg), descr: "Create a new character" });
|
||||
//game.system.mournblade.commands = MournbladeCommands
|
||||
}
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.commandsTable = {};
|
||||
this.commandsTable = {}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MournbladeUtility } from "./Mournblade-utility.js";
|
||||
import { MournbladeUtility } from "./mournblade-utility.js";
|
||||
|
||||
/**
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import { MournbladeActor } from "./mournblade-actor.js";
|
||||
import { MournbladeItemSheet } from "./mournblade-item-sheet.js";
|
||||
import { MournbladeActorSheet } from "./mournblade-actor-sheet.js";
|
||||
import { MournbladeNPCSheet } from "./mournblade-npc-sheet.js";
|
||||
//import { MournbladeNPCSheet } from "./mournblade-npc-sheet.js";
|
||||
import { MournbladeUtility } from "./mournblade-utility.js";
|
||||
import { MournbladeCombat } from "./mournblade-combat.js";
|
||||
import { MournbladeItem } from "./mournblade-item.js";
|
||||
@@ -45,14 +45,13 @@ Hooks.once("init", async function () {
|
||||
CONFIG.Combat.documentClass = MournbladeCombat
|
||||
CONFIG.Actor.documentClass = MournbladeActor
|
||||
CONFIG.Item.documentClass = MournbladeItem
|
||||
//CONFIG.Token.objectClass = MournbladeToken
|
||||
game.system.Mournblade = { };
|
||||
game.system.mournblade = { }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
Actors.registerSheet("fvtt-mournblade", MournbladeActorSheet, { types: ["character"], makeDefault: true });
|
||||
Actors.registerSheet("fvtt-mournblade", MournbladeNPCSheet, { types: ["npc"], makeDefault: false });
|
||||
//Actors.registerSheet("fvtt-mournblade", MournbladeNPCSheet, { types: ["npc"], makeDefault: false });
|
||||
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
Items.registerSheet("fvtt-mournblade", MournbladeItemSheet, { makeDefault: true });
|
||||
@@ -102,7 +101,7 @@ Hooks.on("chatMessage", (html, content, msg) => {
|
||||
if (content[0] == '/') {
|
||||
let regExp = /(\S+)/g;
|
||||
let commands = content.match(regExp);
|
||||
if (game.system.Mournblade.commands.processChatCommand(commands, content, msg)) {
|
||||
if (game.system.mournblade.commands.processChatCommand(commands, content, msg)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* -------------------------------------------- */
|
||||
import { MournbladeCombat } from "./mournblade-combat.js";
|
||||
import { MournbladeCommands } from "./mournblade-commands.js";
|
||||
import { MournbladeActorCreate } from "./mournblade-create-char.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class MournbladeUtility {
|
||||
@@ -52,7 +51,7 @@ export class MournbladeUtility {
|
||||
/* -------------------------------------------- */
|
||||
static async ready() {
|
||||
const skills = await MournbladeUtility.loadCompendium("fvtt-mournblade.skills")
|
||||
this.skills = specs.map(i => i.toObject())
|
||||
this.skills = skills.map(i => i.toObject())
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -83,13 +82,7 @@ export class MournbladeUtility {
|
||||
static async preloadHandlebarsTemplates() {
|
||||
|
||||
const templatePaths = [
|
||||
'systems/fvtt-mournblade/templates/editor-notes-gm.html',
|
||||
'systems/fvtt-mournblade/templates/partial-roll-select-effects.html',
|
||||
'systems/fvtt-mournblade/templates/partial-options-statistics.html',
|
||||
'systems/fvtt-mournblade/templates/partial-options-level.html',
|
||||
'systems/fvtt-mournblade/templates/partial-options-range.html',
|
||||
'systems/fvtt-mournblade/templates/partial-options-equipment-types.html',
|
||||
'systems/fvtt-mournblade/templates/partial-equipment-effects.html'
|
||||
'systems/fvtt-mournblade/templates/editor-notes-gm.html'
|
||||
]
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user