Manage game systems

This commit is contained in:
2024-08-07 17:27:08 +02:00
parent 8be95c20bd
commit 534fcb04fb
15 changed files with 68 additions and 27 deletions

View File

@ -21,6 +21,12 @@ rmss.difficulties = {
absurd: {key: "absurd", label:"Absurd (-70)", value: -70},
};
rmss.gameSystems = [
{key: "common", label:"Common"},
{key: "merp", label:"Middle Earth Role Playing (MERP)"},
{key: "rmfrp", label:"Rolemaster Fantasy Role Playing (RMFRP)"},
];
rmss.combatSituations = [
{key: "none", label:"None (0)", modifier: 0},
{key: "melee", label:"Melee environment (-20)", modifier: -20},

View File

@ -8,8 +8,12 @@ export class RFRPUtility {
/* -------------------------------------------- */
static async ready() {
this.registerSettings();
this.gameSystem = game.settings.get("fvtt-rolemaster-frp", "game_system");
const skillCategories = await RFRPUtility.loadCompendium("fvtt-rolemaster-frp.skill_categories")
this.skillCategories = skillCategories.map(i => i.toObject())
this.skillCategories = skillCategories.map(i => i.toObject()).filter( i => i.system.game_system == "common" || i.system.game_system == this.gameSystem);
}
/* -------------------------------------------- */
@ -17,6 +21,23 @@ export class RFRPUtility {
return this.skillCategories
}
/* -------------------------------------------- */
static registerSettings() {
game.settings.register("fvtt-rolemaster-frp", "game_system", {
name: "Game System",
hint: "List of Game Systems",
scope: "world",
default: "rmfrp",
requiresReload: true,
type: String,
config: true,
choices: {
rmfrp: "Rolemaster Fantasy Role Playing (RMFRP)",
merp: "Middle Earth Role Playing (MERP)"
}
});
}
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium);

View File

@ -208,7 +208,7 @@ export default class RMSSPlayerSheet extends ActorSheet {
context.spells = spells;
// Dump context to console
console.log(context);
console.log("ACTOR CONTEXT", context);
}

View File

@ -76,7 +76,7 @@ export default class RMSSSkillSheet extends ItemSheet {
if (this.item.isEmbedded) {
skillCategories = this.item.parent.items.filter(it => it.type == "skill_category");
}
console.log("CATEG", skillCategories);
//console.log("CATEG", skillCategories);
return (skillCategories);
}