From 0c5eb8e819234d3a41d0c46396884584dbb4e37b Mon Sep 17 00:00:00 2001 From: dmdorman Date: Thu, 2 Feb 2023 01:29:48 -0600 Subject: [PATCH] adding degenesis system besides the basic system config... added a degenesis specific html file. The existing one had a bunch of fields that aren't relevant to the degenesis system. The skills were also overflowing off the sheet because of many skills with longer names had to create LMRTFY.skills by reading from an actor. I had to do this because this type of system info wasn't readily available without importing a file and even then it wouldn't be in the proper format to work with LMRTFY --- module.json | 11 +- src/lmrtfy.js | 16 +- src/requestor.js | 13 +- src/roller.js | 6 + templates/degenesis-request-rolls.html | 255 +++++++++++++++++++++++++ 5 files changed, 298 insertions(+), 3 deletions(-) create mode 100644 templates/degenesis-request-rolls.html diff --git a/module.json b/module.json index f76c594..10127ff 100644 --- a/module.json +++ b/module.json @@ -83,7 +83,8 @@ "coc", "demonlord", "ose", - "foundry-chromatic-dungeons" + "foundry-chromatic-dungeons", + "degenesis" ], "relationships": { "systems": [ @@ -166,6 +167,14 @@ "compatibility": { "verified": "1.1.0" } + }, + { + "id": "degenesis", + "type": "system", + "manifest": "https://github.com/greedyj4ck/DEGENESIS-FoundryVTT/releases/latest/download/system.json", + "compatibility": { + "verified": "0.5.1" + } } ] }, diff --git a/src/lmrtfy.js b/src/lmrtfy.js index 6a1afcc..767e9cb 100644 --- a/src/lmrtfy.js +++ b/src/lmrtfy.js @@ -214,7 +214,21 @@ class LMRTFY { LMRTFY.saves = CONFIG.CHROMATIC.saves; LMRTFY.specialRolls = {}; LMRTFY.canFailChecks = game.settings.get('lmrtfy', 'showFailButtons'); // defaulted to false due to system - break; + break; + + case 'degenesis': + LMRTFY.skillRollMethod = 'rollSkill'; + + let skills = game.actors.contents[0].skills; + for (const [key, value] of Object.entries(skills)) { + skills[key]["label"] = key; + skills[key]["ability"] = value.attribute; + } + LMRTFY.skills = skills; + + LMRTFY.abilityModifiers = LMRTFY.parseAbilityModifiers(); + LMRTFY.canFailChecks = game.settings.get('lmrtfy', 'showFailButtons'); // defaulted to false due to system + break; default: console.error('LMRFTY | Unsupported system detected'); diff --git a/src/requestor.js b/src/requestor.js index 314b305..9401161 100644 --- a/src/requestor.js +++ b/src/requestor.js @@ -23,10 +23,21 @@ class LMRTFYRequestor extends FormApplication { } static get defaultOptions() { + + let template; + switch (game.system.id) { + case "degenesis": + template = "modules/lmrtfy/templates/degenesis-request-rolls.html"; + break; + default: + template = "modules/lmrtfy/templates/request-rolls.html"; + break; + } + const options = super.defaultOptions; options.title = game.i18n.localize("LMRTFY.Title"); options.id = "lmrtfy"; - options.template = "modules/lmrtfy/templates/request-rolls.html"; + options.template = template; options.closeOnSubmit = false; options.popOut = true; options.width = 600; diff --git a/src/roller.js b/src/roller.js index 4fb1ad5..93d9256 100644 --- a/src/roller.js +++ b/src/roller.js @@ -318,6 +318,12 @@ class LMRTFYRoller extends Application { break; } + case "degenesis": { + const key = args[0]; + actor[rollMethod].call(actor, key, false) + break; + } + default: { await actor[rollMethod].call(actor, ...args, options); } diff --git a/templates/degenesis-request-rolls.html b/templates/degenesis-request-rolls.html new file mode 100644 index 0000000..76edc28 --- /dev/null +++ b/templates/degenesis-request-rolls.html @@ -0,0 +1,255 @@ +
+
+
+ + + +
+
+ + + +
+
+ {{#each actors}} +
+ + +
+ {{/each}} +
+
+ +
+
+ + + +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+ + {{#if showDC}} +
+
+ + + + + +
+
+ {{/if}} + +
+
+ + +
+
+ {{localize "LMRTFY.Selectors"}} +
+
+ +
+ + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+ +
+ + + + + + + + + + +
+ +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + +
+
+
+
+ - +
+
+ + +
+
+
+
+ {{#each abilityModifiers as |name key|}} +
+ + +
+ {{/each}} +
+
+
+ +
+
+
+
+ +
+ +
+
+ {{#each skills as |name key|}} +
+ + +
+ {{/each}} +
+
+
+ + {{#if tables}} +
+
+ + + +
+
+ {{/if}} + +
+ + +
+