The Happy Anarchist 2020-09-24 23:06:11 -10:00
commit 860317e90b
6 changed files with 63 additions and 28 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
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.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",

View File

@ -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;

View File

@ -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: '<i class="fas fa-dice-d20"></i>',
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: '<i class="fas fa-dice-d20"></i>',
callback: (html) => {
rolled = true;
rollData.form = html[0].children[0];
roll = AcksDice.sendRoll(rollData);
},
},
},
magic: {
label: game.i18n.localize("ACKS.saves.magic.short"),
icon: '<i class="fas fa-magic"></i>',
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: '<i class="fas fa-magic"></i>',
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: '<i class="fas fa-times"></i>',
label: game.i18n.localize("ACKS.Cancel"),
callback: (html) => { },
},
};
cancel: {
icon: '<i class="fas fa-times"></i>',
label: game.i18n.localize("ACKS.Cancel"),
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);
let roll;

View File

@ -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"),

View File

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