Merge pull request #24 from thehappyanarchist/THA-Dev

Implemented Wisdom bonus to all Saves houserule.
master
thehappyanarchist 2020-09-24 22:57:08 -10:00 committed by GitHub
commit c745bfd259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 28 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
acks/ acks/
acks.zip

View File

@ -192,6 +192,8 @@
"ACKS.Setting.Explode20Hint": "Heroic Fantasy Option: Attack throws explode on 20 - Critical if exceed target AC by 10", "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.BHR": "HFH: Base Healing Rate",
"ACKS.Setting.BHRHint": "Heroic Fantasy Option: Base Healing Rate per day varies by Max HP", "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.Equip": "Equip",
"ACKS.items.Unequip": "Unequip", "ACKS.items.Unequip": "Unequip",

View File

@ -52,6 +52,7 @@ export class AcksActorSheetCharacter extends AcksActorSheet {
data.config.initiative = game.settings.get("acks", "initiative") != "group"; data.config.initiative = game.settings.get("acks", "initiative") != "group";
data.config.encumbrance = game.settings.get("acks", "encumbranceOption"); data.config.encumbrance = game.settings.get("acks", "encumbranceOption");
data.config.BHR = game.settings.get("acks", "bhr"); data.config.BHR = game.settings.get("acks", "bhr");
data.config.removeMagicBonus = game.settings.get("acks", "removeMagicBonus");
data.isNew = this.actor.isNew(); data.isNew = this.actor.isNew();
return data; return data;

View File

@ -325,36 +325,55 @@ export class AcksDice {
flavor: flavor, flavor: flavor,
speaker: speaker, speaker: speaker,
}; };
let buttons = {}
if (skipDialog) { AcksDice.sendRoll(rollData); } if (skipDialog) { AcksDice.sendRoll(rollData); }
if (game.settings.get("acks", "removeMagicBonus") == false) {
let buttons = { buttons = {
ok: { ok: {
label: game.i18n.localize("ACKS.Roll"), label: game.i18n.localize("ACKS.Roll"),
icon: '<i class="fas fa-dice-d20"></i>', icon: '<i class="fas fa-dice-d20"></i>',
callback: (html) => { callback: (html) => {
rolled = true; rolled = true;
rollData.form = html[0].children[0]; rollData.form = html[0].children[0];
roll = AcksDice.sendRoll(rollData); roll = AcksDice.sendRoll(rollData);
},
}, },
}, magic: {
magic: { label: game.i18n.localize("ACKS.saves.magic.short"),
label: game.i18n.localize("ACKS.saves.magic.short"), icon: '<i class="fas fa-magic"></i>',
icon: '<i class="fas fa-magic"></i>', callback: (html) => {
callback: (html) => { rolled = true;
rolled = true; rollData.form = html[0].children[0];
rollData.form = html[0].children[0]; rollData.data.roll.target = parseInt(rollData.data.roll.target) + parseInt(rollData.data.roll.magic);
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})`;
rollData.title += ` ${game.i18n.localize("ACKS.saves.magic.short")} (${rollData.data.roll.magic})`; roll = AcksDice.sendRoll(rollData);
roll = AcksDice.sendRoll(rollData); },
}, },
}, cancel: {
cancel: { icon: '<i class="fas fa-times"></i>',
icon: '<i class="fas fa-times"></i>', label: game.i18n.localize("ACKS.Cancel"),
label: game.i18n.localize("ACKS.Cancel"), callback: (html) => { },
callback: (html) => { }, },
}, };
}; } else {
buttons = {
ok: {
label: game.i18n.localize("ACKS.Roll"),
icon: '<i class="fas fa-dice-d20"></i>',
callback: (html) => {
rolled = true;
rollData.form = html[0].children[0];
roll = AcksDice.sendRoll(rollData);
},
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: game.i18n.localize("ACKS.Cancel"),
callback: (html) => { },
},
};
}
const html = await renderTemplate(template, dialogData); const html = await renderTemplate(template, dialogData);
let roll; let roll;

View File

@ -47,6 +47,16 @@ export const registerSettings = function () {
config: true, 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", { game.settings.register("acks", "exploding20s", {
name: game.i18n.localize("ACKS.Setting.Explode20"), name: game.i18n.localize("ACKS.Setting.Explode20"),
hint: game.i18n.localize("ACKS.Setting.Explode20Hint"), hint: game.i18n.localize("ACKS.Setting.Explode20Hint"),

View File

@ -247,6 +247,7 @@
<input name="data.saves.spell.value" type="text" value="{{data.saves.spell.value}}" <input name="data.saves.spell.value" type="text" value="{{data.saves.spell.value}}"
placeholder="0" /> placeholder="0" />
</li> </li>
{{#unless config.removeMagicBonus}}
<li class="attribute saving-throw"> <li class="attribute saving-throw">
<h4 class="attribute-name box-title" title="{{ localize 'ACKS.saves.magic.long' }}"> <h4 class="attribute-name box-title" title="{{ localize 'ACKS.saves.magic.long' }}">
{{ localize "ACKS.saves.magic.long"}}</h4> {{ localize "ACKS.saves.magic.long"}}</h4>
@ -254,6 +255,7 @@
{{mod data.scores.wis.mod}} {{mod data.scores.wis.mod}}
</div> </div>
</li> </li>
{{/unless}}
</ul> </ul>
</div> </div>
</section> </section>