From 10fc0298be3cb009e446aefc878ea81d076c2d69 Mon Sep 17 00:00:00 2001 From: The Happy Anarchist Date: Thu, 24 Sep 2020 21:46:15 -1000 Subject: [PATCH 1/2] Update .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7976a35..918a569 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -acks/ \ No newline at end of file +acks/ +acks.zip \ No newline at end of file From cb02e52d4f82d830a76bdab1e28bf908c2be8cc1 Mon Sep 17 00:00:00 2001 From: The Happy Anarchist Date: Thu, 24 Sep 2020 22:55:11 -1000 Subject: [PATCH 2/2] Implemented Wisdom bonus to all Saves houserule Implemented Wisdom bonus to all Saves houserule per Issue #11 . --- src/lang/en.json | 2 + src/module/actor/character-sheet.js | 1 + src/module/dice.js | 73 ++++++++++++------- src/module/settings.js | 10 +++ .../partials/character-attributes-tab.html | 2 + 5 files changed, 61 insertions(+), 27 deletions(-) diff --git a/src/lang/en.json b/src/lang/en.json index 7a5c3f5..ed62d2d 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -192,6 +192,8 @@ "ACKS.Setting.Explode20Hint": "Heroic Fantasy Option: Attack throws explode on 20 - Critical if exceed target AC by 10", "ACKS.Setting.BHR": "HFH: Base Healing Rate", "ACKS.Setting.BHRHint": "Heroic Fantasy Option: Base Healing Rate per day varies by Max HP", + "ACKS.Setting.RemoveMagicBonus": "Houserule: Wisdom Bonus to All Saves", + "ACKS.Setting.RemoveMagicBonusHint": "A popular houserule, for use when PCs will add their wisdom modifier to all saving throws", "ACKS.items.Equip": "Equip", "ACKS.items.Unequip": "Unequip", diff --git a/src/module/actor/character-sheet.js b/src/module/actor/character-sheet.js index 006af01..b81c6dd 100644 --- a/src/module/actor/character-sheet.js +++ b/src/module/actor/character-sheet.js @@ -52,6 +52,7 @@ export class AcksActorSheetCharacter extends AcksActorSheet { data.config.initiative = game.settings.get("acks", "initiative") != "group"; data.config.encumbrance = game.settings.get("acks", "encumbranceOption"); data.config.BHR = game.settings.get("acks", "bhr"); + data.config.removeMagicBonus = game.settings.get("acks", "removeMagicBonus"); data.isNew = this.actor.isNew(); return data; diff --git a/src/module/dice.js b/src/module/dice.js index 2a9b8bc..58fb885 100644 --- a/src/module/dice.js +++ b/src/module/dice.js @@ -325,36 +325,55 @@ export class AcksDice { flavor: flavor, speaker: speaker, }; + + let buttons = {} if (skipDialog) { AcksDice.sendRoll(rollData); } - - let buttons = { - ok: { - label: game.i18n.localize("ACKS.Roll"), - icon: '', - callback: (html) => { - rolled = true; - rollData.form = html[0].children[0]; - roll = AcksDice.sendRoll(rollData); + if (game.settings.get("acks", "removeMagicBonus") == false) { + buttons = { + ok: { + label: game.i18n.localize("ACKS.Roll"), + icon: '', + callback: (html) => { + rolled = true; + rollData.form = html[0].children[0]; + roll = AcksDice.sendRoll(rollData); + }, }, - }, - magic: { - label: game.i18n.localize("ACKS.saves.magic.short"), - icon: '', - callback: (html) => { - rolled = true; - rollData.form = html[0].children[0]; - rollData.data.roll.target = parseInt(rollData.data.roll.target) + parseInt(rollData.data.roll.magic); - rollData.title += ` ${game.i18n.localize("ACKS.saves.magic.short")} (${rollData.data.roll.magic})`; - roll = AcksDice.sendRoll(rollData); + magic: { + label: game.i18n.localize("ACKS.saves.magic.short"), + icon: '', + callback: (html) => { + rolled = true; + rollData.form = html[0].children[0]; + rollData.data.roll.target = parseInt(rollData.data.roll.target) + parseInt(rollData.data.roll.magic); + rollData.title += ` ${game.i18n.localize("ACKS.saves.magic.short")} (${rollData.data.roll.magic})`; + roll = AcksDice.sendRoll(rollData); + }, }, - }, - cancel: { - icon: '', - label: game.i18n.localize("ACKS.Cancel"), - callback: (html) => { }, - }, - }; - + cancel: { + icon: '', + label: game.i18n.localize("ACKS.Cancel"), + callback: (html) => { }, + }, + }; + } else { + buttons = { + ok: { + label: game.i18n.localize("ACKS.Roll"), + icon: '', + callback: (html) => { + rolled = true; + rollData.form = html[0].children[0]; + roll = AcksDice.sendRoll(rollData); + }, + }, + cancel: { + icon: '', + label: game.i18n.localize("ACKS.Cancel"), + callback: (html) => { }, + }, + }; + } const html = await renderTemplate(template, dialogData); let roll; diff --git a/src/module/settings.js b/src/module/settings.js index 2ec5b61..3c0d718 100644 --- a/src/module/settings.js +++ b/src/module/settings.js @@ -47,6 +47,16 @@ export const registerSettings = function () { config: true, }); + game.settings.register("acks", "removeMagicBonus", { + name: game.i18n.localize("ACKS.Setting.RemoveMagicBonus"), + hint: game.i18n.localize("ACKS.Setting.RemoveMagicBonusHint"), + default: false, + scope: "world", + type: Boolean, + config: true, + onChange: _ => window.location.reload() + }); + game.settings.register("acks", "exploding20s", { name: game.i18n.localize("ACKS.Setting.Explode20"), hint: game.i18n.localize("ACKS.Setting.Explode20Hint"), diff --git a/src/templates/actors/partials/character-attributes-tab.html b/src/templates/actors/partials/character-attributes-tab.html index e08e233..3c74e9f 100644 --- a/src/templates/actors/partials/character-attributes-tab.html +++ b/src/templates/actors/partials/character-attributes-tab.html @@ -247,6 +247,7 @@ + {{#unless config.removeMagicBonus}}
  • {{ localize "ACKS.saves.magic.long"}}

    @@ -254,6 +255,7 @@ {{mod data.scores.wis.mod}}
  • + {{/unless}} \ No newline at end of file