Skip to content

Commit 1a65128

Browse files
authored
Merge pull request #178 from dmdorman/degenesis-system
adding degenesis system
2 parents c051b7e + 0c5eb8e commit 1a65128

File tree

5 files changed

+298
-3
lines changed

5 files changed

+298
-3
lines changed

module.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
"coc",
8484
"demonlord",
8585
"ose",
86-
"foundry-chromatic-dungeons"
86+
"foundry-chromatic-dungeons",
87+
"degenesis"
8788
],
8889
"relationships": {
8990
"systems": [
@@ -166,6 +167,14 @@
166167
"compatibility": {
167168
"verified": "1.1.0"
168169
}
170+
},
171+
{
172+
"id": "degenesis",
173+
"type": "system",
174+
"manifest": "https://github.com/greedyj4ck/DEGENESIS-FoundryVTT/releases/latest/download/system.json",
175+
"compatibility": {
176+
"verified": "0.5.1"
177+
}
169178
}
170179
]
171180
},

src/lmrtfy.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,21 @@ class LMRTFY {
214214
LMRTFY.saves = CONFIG.CHROMATIC.saves;
215215
LMRTFY.specialRolls = {};
216216
LMRTFY.canFailChecks = game.settings.get('lmrtfy', 'showFailButtons'); // defaulted to false due to system
217-
break;
217+
break;
218+
219+
case 'degenesis':
220+
LMRTFY.skillRollMethod = 'rollSkill';
221+
222+
let skills = game.actors.contents[0].skills;
223+
for (const [key, value] of Object.entries(skills)) {
224+
skills[key]["label"] = key;
225+
skills[key]["ability"] = value.attribute;
226+
}
227+
LMRTFY.skills = skills;
228+
229+
LMRTFY.abilityModifiers = LMRTFY.parseAbilityModifiers();
230+
LMRTFY.canFailChecks = game.settings.get('lmrtfy', 'showFailButtons'); // defaulted to false due to system
231+
break;
218232

219233
default:
220234
console.error('LMRFTY | Unsupported system detected');

src/requestor.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,21 @@ class LMRTFYRequestor extends FormApplication {
2323
}
2424

2525
static get defaultOptions() {
26+
27+
let template;
28+
switch (game.system.id) {
29+
case "degenesis":
30+
template = "modules/lmrtfy/templates/degenesis-request-rolls.html";
31+
break;
32+
default:
33+
template = "modules/lmrtfy/templates/request-rolls.html";
34+
break;
35+
}
36+
2637
const options = super.defaultOptions;
2738
options.title = game.i18n.localize("LMRTFY.Title");
2839
options.id = "lmrtfy";
29-
options.template = "modules/lmrtfy/templates/request-rolls.html";
40+
options.template = template;
3041
options.closeOnSubmit = false;
3142
options.popOut = true;
3243
options.width = 600;

src/roller.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,12 @@ class LMRTFYRoller extends Application {
318318
break;
319319
}
320320

321+
case "degenesis": {
322+
const key = args[0];
323+
actor[rollMethod].call(actor, key, false)
324+
break;
325+
}
326+
321327
default: {
322328
await actor[rollMethod].call(actor, ...args, options);
323329
}
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
<form autocomplete="off" onsubmit="event.preventDefault();" class="app.window-app">
2+
<fieldset>
3+
<div class="form-group">
4+
<label>{{localize "LMRTFY.SelectUser"}}</label>
5+
6+
<select name="user" data-dtype="String">
7+
<option value="tokens" selected>{{localize "LMRTFY.ControlledTokens"}}</option>
8+
<option value="character">{{localize "LMRTFY.AssignedCharacters"}}</option>
9+
<optgroup label="{{localize "LMRTFY.Macros"}}">
10+
<option value="selected">{{localize "LMRTFY.Selected"}}</option>
11+
</optgroup>
12+
<optgroup label="{{localize "LMRTFY.Users"}}">
13+
{{#each users}}
14+
<option value="{{this.id}}">{{this.name}}</option>
15+
{{/each}}
16+
</optgroup>
17+
</select>
18+
</div>
19+
<div class="form-group">
20+
<label>{{localize "LMRTFY.SelectCharacters"}}</label>
21+
<button type="button" class="select-all"><i class="fas fa-check-square"></i>{{localize "LMRTFY.SelectAll"}}</button>
22+
<button type="button" class="deselect-all"><i class="fas fa-square"></i>{{localize "LMRTFY.SelectNone"}}</button>
23+
</div>
24+
<div class="form-group lmrtfy-actor-avatars">
25+
{{#each actors}}
26+
<div class="lmrtfy-actor" data-id="{{this.id}}">
27+
<input type="checkbox" name="actor-{{this.id}}" id="lmrtf-actor-{{this.id}}" data-dtype="Boolean" {{#if (lmrtfy-controlledToken this)}}checked{{/if}} />
28+
<label for="lmrtf-actor-{{this.id}}">
29+
{{#if (lmrtfy-showTokenImage this)}}<img src="{{this.prototypeToken.texture.src}}" />{{else}}<img src="{{this.img}}" />{{/if}}
30+
</label>
31+
</div>
32+
{{/each}}
33+
</div>
34+
</fieldset>
35+
36+
<fieldset>
37+
<div class="form-group">
38+
<label>{{localize "LMRTFY.Modifiers"}}</label>
39+
40+
<select name="mode" data-dtype="String">
41+
{{#each rollModes as |name mode|}}
42+
<option value="{{mode}}">{{localize name}}</option>
43+
{{/each}}
44+
</select>
45+
</div>
46+
<div class="form-group">
47+
<label>{{localize "LMRTFY.WindowTitle"}}</label>
48+
<input type="text" name="title" value='{{localize "LMRTFY.WindowTitleValue"}}' placeholder='{{localize "LMRTFY.WindowTitlePlaceholder"}}' data-dtype="String"/>
49+
</div>
50+
<div class="form-group">
51+
<label>{{localize "LMRTFY.Message"}}</label>
52+
<input type="text" name="message" value='' placeholder='{{localize "LMRTFY.MessagePlaceholder"}}' data-dtype="String"/>
53+
</div>
54+
<div class="form-group">
55+
<label>{{localize "LMRTFY.ChooseOneDM"}}</label>
56+
<div class="lmrtfy-extra-perception">
57+
<input type="checkbox" name="choose-one" id="lmrtf-choose-one" data-dtype="Boolean" />
58+
<label for="lmrtf-choose-one">{{localize "LMRTFY.Enabled"}}</label>
59+
</div>
60+
</div>
61+
</fieldset>
62+
63+
{{#if showDC}}
64+
<fieldset>
65+
<div class="form-group">
66+
<label>{{localize "LMRTFY.DC"}}</label>
67+
<input type="number" name="dc" value="" placeholder="20" data-dtype="Integer"/>
68+
69+
<label>&nbsp;{{localize "LMRTFY.Visibility"}}</label>
70+
<select name="visibility" data-dtype="String">
71+
<option value="gm" selected>{{localize "USER.RoleGamemaster"}}</option>
72+
<option value="owner">{{localize "PERMISSION.OWNER"}}</option>
73+
<option value="all">{{localize "PERMISSION.AllPlayers"}}</option>
74+
</select>
75+
</div>
76+
</fieldset>
77+
{{/if}}
78+
79+
<fieldset>
80+
<div class="form-group">
81+
<label>{{localize "LMRTFY.CustomFormula"}}</label>
82+
<input type="text" class="custom-formula" name="formula" value='' placeholder='{{localize "LMRTFY.CustomFormulaPlaceholder"}}' data-dtype="String"/>
83+
</div>
84+
<details class="lmrtfy-dice-tray-details">
85+
<summary class="lmrtfy-dice-tray-expander">{{localize "LMRTFY.Selectors"}}</summary>
86+
<div>
87+
<div class="lmrtfy-dice-tray-buttons flexrow lmrtfy-dice-row-flexrow">
88+
<!-- d4 -->
89+
<div class="lmrtfy-dice-tray-button" data-value="d4">
90+
<svg class="lmrtfy-dice-svg-normal" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
91+
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
92+
<g>
93+
<polygon points="31.7,15.7 13.2,47.8 31.7,37.1 "/>
94+
<polygon points="32.3,15.7 32.3,37.1 50.8,47.8 "/>
95+
<polygon points="32,37.6 13.5,48.3 50.5,48.3 "/>
96+
</g>
97+
</svg>
98+
</div>
99+
<!-- d6 -->
100+
<div class="lmrtfy-dice-tray-button" data-value="d6">
101+
<svg class="lmrtfy-dice-svg-normal" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
102+
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
103+
<g>
104+
<path d="M11.5,9h41c1.4,0,2.6,1.1,2.6,2.6v41c0,1.4-1.1,2.6-2.6,2.6h-41C10.1,55,9,53.9,9,52.5v-41C9,10.1,10.1,9,11.5,9z"/>
105+
</g>
106+
</svg>
107+
</div>
108+
<!-- d8 -->
109+
<div class="lmrtfy-dice-tray-button" data-value="d8">
110+
<svg class="lmrtfy-dice-svg-normal" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
111+
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
112+
<g>
113+
<g transform="translate(-242.40981,-473.89862)">
114+
<path d="M254.5,515.3l19.9-34.6l20.1,34.4L254.5,515.3z"/>
115+
<path d="M253.4,515.1l-0.3-19.6l20.2-14.9L253.4,515.1z"/>
116+
<path d="M295.4,514.9l0.3-19.3l-20.3-15L295.4,514.9z"/>
117+
<path d="M274.4,531.2l-19.9-14.9l40-0.3L274.4,531.2z"/>
118+
</g>
119+
</g>
120+
</svg>
121+
</div>
122+
<!-- d10 -->
123+
<div class="lmrtfy-dice-tray-button" data-value="d10">
124+
<svg class="lmrtfy-dice-svg-normal" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
125+
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
126+
<g>
127+
<g transform="matrix(1.1679092,0,0,1.1679092,-274.931,-137.53749)">
128+
<path d="M263.4,124.6L249.9,153l12.5,8.1l13.5-8.2L263.4,124.6z"/>
129+
<path d="M264.1,124.1l12.5,28.6l7.3-2.3l0.5-11.6L264.1,124.1z"/>
130+
<path d="M262.7,161.8v4.4l20.9-14.7l-7,2L262.7,161.8z"/>
131+
<path d="M262.7,124.2l-13.7,28.5l-7.1-3.1l-0.6-11.6L262.7,124.2z"/>
132+
<path d="M261.8,161.7v4.5l-20-15.4l6.9,2.7L261.8,161.7z"/>
133+
</g>
134+
</g>
135+
</svg>
136+
</div>
137+
<!-- d12 -->
138+
<div class="lmrtfy-dice-tray-button" data-value="d12">
139+
<svg class="lmrtfy-dice-svg-normal" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
140+
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
141+
<g>
142+
<path d="M24,43.7l-5.4-16.3l13.7-10.8l14.1,10.8L41.2,44L24,43.7z"/>
143+
<path d="M7.9,24l0.5,16.3l8.8,12.1l6.3-7.7l-5.8-17.5L7.9,24z"/>
144+
<path d="M41,45.1L23.9,45l-5.5,7.8l13.9,4.3l14.2-4.5L41,45.1z"/>
145+
<path d="M8.7,23.5l8.7-11.6l14.3-4.9v8.7L17.8,26.5L8.7,23.5z"/>
146+
<path d="M33.4,6.9l14.2,4.8l8.3,11.9l-8.7,3.1l-13.9-11L33.4,6.9z"/>
147+
<path d="M42.2,44.4l5.3-16.3l8.6-3l0,14.6l-8.5,11.9L42.2,44.4z"/>
148+
</g>
149+
</svg>
150+
</div>
151+
<!-- d20 -->
152+
<div class="lmrtfy-dice-tray-button" data-value="d20">
153+
<svg class="lmrtfy-dice-svg-normal" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
154+
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
155+
<g transform="translate(-246.69456,-375.66745)">
156+
<path d="M278.2,382.1c-0.1,0-0.2,0-0.3,0.1L264.8,398c-0.2,0.3-0.2,0.3,0.1,0.3l26.4-0.1c0.4,0,0.4,0,0.1-0.3l-13-15.8
157+
C278.4,382.1,278.3,382.1,278.2,382.1L278.2,382.1z M280.7,383.5l11.9,14.5c0.2,0.2,0.2,0.2,0.5,0.1l6.3-2.9
158+
c0.4-0.2,0.4-0.2,0.1-0.4L280.7,383.5z M275.2,384c0,0-0.1,0.1-0.3,0.2l-17.3,11.4l5.4,2.5c0.3,0.1,0.4,0.1,0.5-0.1l11.4-13.6
159+
C275.1,384.1,275.2,384,275.2,384L275.2,384z M300.3,395.8c-0.1,0-0.1,0-0.3,0.1l-6.4,2.9c-0.2,0.1-0.2,0.2-0.1,0.4l7.5,19
160+
l-0.5-22.1C300.4,395.9,300.4,395.8,300.3,395.8L300.3,395.8z M257.1,396.4l-0.7,21.5l6.3-18.6c0.1-0.3,0.1-0.3-0.1-0.4
161+
L257.1,396.4L257.1,396.4z M291.6,399.2l-27,0.1c-0.4,0-0.4,0-0.2,0.3l13.7,23.1c0.2,0.4,0.2,0.3,0.4,0l13.2-23.2
162+
C291.9,399.3,291.9,399.2,291.6,399.2L291.6,399.2z M292.7,399.8c0,0-0.1,0.1-0.1,0.2l-13.3,23.3c-0.1,0.2-0.2,0.3,0.2,0.3
163+
l21.1-2.9c0.3-0.1,0.3-0.2,0.2-0.5l-7.9-20.2C292.7,399.9,292.7,399.8,292.7,399.8L292.7,399.8z M263.6,400c0,0,0,0.1-0.1,0.3
164+
l-6.7,19.8c-0.1,0.4-0.1,0.6,0.3,0.7l20.1,2.9c0.4,0.1,0.3-0.1,0.2-0.3l-13.7-23.1C263.6,400,263.6,400,263.6,400L263.6,400z
165+
M258.3,421.9l19.7,11.2c0.3,0.2,0.3,0.1,0.3-0.2l-0.4-7.9c0-0.3,0-0.4-0.3-0.4L258.3,421.9L258.3,421.9z M299.1,421.9l-20,2.8
166+
c-0.3,0-0.2,0.2-0.2,0.4l0.4,8c0,0.2,0,0.3,0.3,0.2L299.1,421.9z"/>
167+
</g>
168+
</svg>
169+
</div>
170+
<!-- d100 -->
171+
<div class="lmrtfy-dice-tray-button" data-value="d100">
172+
<svg class="lmrtfy-dice-svg-normal lmrtfy-dice-svg-smaller" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
173+
viewBox="0 0 64 64" style="enable-background:new 0 0 64 64;" xml:space="preserve">
174+
<g>
175+
<g transform="matrix(1.1679092,0,0,1.1679092,-274.931,-137.53749)">
176+
<polygon points="264.7,150.8 263.7,151.4 262.2,152.3 261.4,152.8 259.6,153.8 253.3,157.7 242.7,150.8 254.2,126.6 258.2,135.9
177+
259.9,139.8 262.7,146.1 263.1,147 263.1,147 "/>
178+
<polygon points="271.9,138.7 271.5,148.5 265.4,150.5 263.5,146.2 263.1,145.3 258.8,135.5 257.8,133.3 254.7,126.2 255.8,127
179+
263.4,132.5 267.8,135.7 268.3,136 "/>
180+
<polygon points="271.3,149.5 264.9,154.1 264.6,154.2 264.2,154.5 262.3,155.9 253.6,162 253.6,158.2 260.2,154.3 262.1,153.2
181+
262.8,152.7 263.9,152 265.4,151.1 "/>
182+
<path d="M253.6,126.3L242,150.5l-6.1-2.6l-0.5-9.9L253.6,126.3z"/>
183+
<path d="M252.8,158.2v3.8l-17-13.1l5.9,2.3L252.8,158.2z"/>
184+
</g>
185+
</g>
186+
<g>
187+
<g transform="matrix(1.1679092,0,0,1.1679092,-274.931,-137.53749)">
188+
<polygon points="283,151.5 271.5,158.4 265.6,154.5 272.2,149.7 272.6,138.2 268.6,135.3 272.5,127.3 "/>
189+
<path d="M273,126.9l10.6,24.3l6.2-2l0.4-9.8L273,126.9z"/>
190+
<path d="M271.9,159v3.7l17.7-12.5l-5.9,1.7L271.9,159z"/>
191+
<polygon points="271.9,127 268.1,134.9 264.1,132 "/>
192+
<polygon points="265,155 271.1,158.9 271.1,162.7 262.9,156.4 "/>
193+
</g>
194+
</g>
195+
</svg>
196+
</div>
197+
</div>
198+
<div class="lmrtfy-dice-tray-buttons flexrow lmrtfy-dice-row-flexrow">
199+
<div class="lmrtfy-dice-tray-button lmrtfy-bonus-button" data-value="-1">
200+
-
201+
</div>
202+
<div class="lmrtfy-dice-tray-button lmrtfy-bonus-button" data-value="+1">
203+
+
204+
</div>
205+
</div>
206+
<div class="form-group lmrtfy-dice-tray-checks">
207+
<div class="lmrtfy-ability-checks">
208+
{{#each abilityModifiers as |name key|}}
209+
<div class="lmrtfy-ability">
210+
<input type="checkbox" class="lmrtfy-formula-ability" name="lmrtfy-formula-{{key}}" id="lmrtfy-formula-{{key}}" data-value="{{key}}" />
211+
<label for="lmrtfy-formula-{{key}}">{{localize name}}</label>
212+
</div>
213+
{{/each}}
214+
</div>
215+
</div>
216+
<div class="lmrtfy-clear-button-area">
217+
<button type="button" class="lmrtfy-clear-formula" name="lmrtfy-clear-custom" value="1"><i class="fas fa-pump-soap"></i>{{localize "LMRTFY.ClearCustomFormula"}}</button>
218+
</div>
219+
</div>
220+
</details>
221+
</fieldset>
222+
223+
<fieldset>
224+
<label>{{localize "LMRTFY.SkillChecks"}}</label>
225+
<div class="form-group">
226+
<div class="" style="display: flex; flex-wrap: wrap; flex-direction: column; justify-content: space-evenly; max-height: 180px; flex: 6;">
227+
{{#each skills as |name key|}}
228+
<div class="lmrtfy-skill" style="padding-left:7px;padding-right:20px;">
229+
<input type="checkbox" name="skill-{{key}}" id="lmrtf-skill-{{key}}" data-dtype="Boolean" />
230+
<label for="lmrtf-skill-{{key}}">{{localize name}}</label>
231+
</div>
232+
{{/each}}
233+
</div>
234+
</div>
235+
</fieldset>
236+
237+
{{#if tables}}
238+
<fieldset>
239+
<div class="form-group">
240+
<label>{{localize "LMRTFY.RollTables"}}</label>
241+
242+
<select name="table" class="lmrtfy-roll-table-list" data-dtype="String" multiple="multiple">
243+
{{#each tables as |name|}}
244+
<option value="{{name}}">{{name}}</option>
245+
{{/each}}
246+
</select>
247+
</div>
248+
</fieldset>
249+
{{/if}}
250+
251+
<div class="lmrtfy-submit">
252+
<button type="submit" class="item lmrtfy-request-roll" name="submit" value="1"><i class="fas fa-dice"></i>{{localize "LMRTFY.RequestRolls"}}</button>
253+
<button type="button" class="item lmrtfy-save-roll" name="submit" value="1"><i class="fas fa-download"></i>{{localize "LMRTFY.SaveRequest"}}</button>
254+
</div>
255+
</form>

0 commit comments

Comments
 (0)