Skip to content

Commit 80f9887

Browse files
authored
Fix Death Saving Throws for dnd5e (#70)
* Update en.json * Update roller.js * Update module.json * Update module.json
1 parent 88e84ec commit 80f9887

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

lang/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"LMRTFY.DeathSave": "Death Save",
3737
"LMRTFY.Perception": "Perception",
3838
"LMRTFY.InitiativeRollMessage": "Roll for Initiative!",
39-
"LMRTFY.DeathSaveRollMessage": "Death Savings Throw",
39+
"LMRTFY.DeathSaveRollMessage": "Death Saving Throw",
4040
"LMRTFY.PerceptionRollMessage": "Perception Check",
4141
"LMRTFY.Extras": "Extras",
4242
"LMRTFY.EnableParchmentTheme": "Enable parchment theme",

module.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@
8484
"minimumCoreVersion": "0.7.5",
8585
"compatibleCoreVersion": "0.7.9",
8686
"allowBugReporter": true
87-
}
87+
}

src/roller.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,16 @@ class LMRTFYRoller extends Application {
286286
}
287287
_onDeathSave(event) {
288288
event.preventDefault();
289-
this._makeDiceRoll(event, "1d20", game.i18n.localize("LMRTFY.DeathSaveRollMessage"));
289+
if(game.system.id == "dnd5e") {
290+
for (let actor of this.actors) {
291+
actor.rollDeathSave(event);
292+
}
293+
event.currentTarget.disabled = true;
294+
if (this.element.find("button").filter((i, e) => !e.disabled).length === 0)
295+
this.close();
296+
} else {
297+
this._makeDiceRoll(event, "1d20", game.i18n.localize("LMRTFY.DeathSaveRollMessage"));
298+
}
290299
}
291300

292301
_onPerception(event) {

0 commit comments

Comments
 (0)