diff --git a/Changelog.txt b/Changelog.txt index f82e33d..90a2172 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -63,3 +63,15 @@ v0.6.2 Further Compendium updates MINOR CHANGES: Added Class Abilities, Monster Abilities, Monsters, Treasure Tables, and tokens and icons for all. Swapped map with .webp format to save about 2MB from download package. + +v0.7.0 Compatibility with new Foundry release +MAJOR CHANGES: +FoundryACKS is now compatible with release 7.5 of Foundry. + +MINOR CHANGES: +Added support for ability scores above 18. It is assumed that every point above 18 adds a further +1 modifier. All dialogs adjusted accordingly. +Added a saving throw modifier to the tweaks dialog. This allows for a bonus or penalty to be applied to all saving throws (ex. Divine Blessing or Ring/Cloak of Protection). Suggested by Bobloblah. +Added support for applying half (resistant) or double (vulnerable) damage from chat cards. Suggested by Bobloblah. + +BUG FIXES: +Added support for HP to dip into the negatives when auto-applied from chat cards. It was previously clamped to zero. diff --git a/package/acks-v0.7.0.zip b/package/acks-v0.7.0.zip new file mode 100644 index 0000000..7c80527 Binary files /dev/null and b/package/acks-v0.7.0.zip differ diff --git a/src/acks.css b/src/acks.css index 5f4ff6b..4bce7a7 100644 --- a/src/acks.css +++ b/src/acks.css @@ -83,12 +83,15 @@ top: 365px; right: -169px; width: 320px; + border-top: none; + height: 20px; z-index: -1; } .acks.sheet.actor .sheet-tabs .item { padding: 2px 10px 0; margin-left: -5px; text-indent: 4px; + line-height: 18px; background: url("/ui/parchment.jpg"); border-top-right-radius: 4px; border-top-left-radius: 80px; diff --git a/src/lang/en.json b/src/lang/en.json index 117d489..cdd4b7e 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -97,6 +97,7 @@ "ACKS.saves.spell.long": "Spells", "ACKS.saves.magic.long": "Bonus vs Magic", "ACKS.saves.magic.short": "vs Magic", + "ACKS.SaveBonus": "Saving Throw Bonus", "ACKS.Health": "Hit Points", "ACKS.HealthMax": "Maximum Hit Points", @@ -152,6 +153,13 @@ "ACKS.NativePlus1": "Native + 1", "ACKS.NativePlus2": "Native + 2", "ACKS.NativePlus3": "Native + 3", + "ACKS.NativePlus4": "Native + 4", + "ACKS.NativePlus5": "Native + 5", + "ACKS.NativePlus6": "Native + 6", + "ACKS.NativePlus7": "Native + 7", + "ACKS.NativePlus8": "Native + 8", + "ACKS.NativePlus9": "Native + 9", + "ACKS.NativePlus10": "Native + 10", "ACKS.NPCReaction": "NPC Reaction", "ACKS.RetainersMax": "#Retainers", @@ -274,6 +282,8 @@ "ACKS.messages.InflictsDamage": "Inflicts damage!", "ACKS.messages.applyDamage": "Apply Damage", "ACKS.messages.applyHealing": "Apply Healing", + "ACKS.messages.applyHalf": "Apply Half Damage", + "ACKS.messages.applyDouble": "Apply 2x Damage", "ACKS.messages.Fumble": "1! Automatic Miss!", "ACKS.messages.Critical": "20! Automatic Hit!", diff --git a/src/module/actor/entity.js b/src/module/actor/entity.js index 21a157b..3e12272 100644 --- a/src/module/actor/entity.js +++ b/src/module/actor/entity.js @@ -121,6 +121,8 @@ export class AcksActor extends Actor { rollSave(save, options = {}) { const label = game.i18n.localize(`ACKS.saves.${save}.long`); const rollParts = ["1d20"]; + rollParts.push(this.data.data.save.mod); + let data = {}; if (this.data.type == "character") { @@ -562,11 +564,11 @@ export class AcksActor extends Actor { } async applyDamage(amount = 0, multiplier = 1) { - amount = Math.floor(parseInt(amount) * multiplier); + amount = Math.ceil(parseInt(amount) * multiplier); const hp = this.data.data.hp; // Remaining goes to health - const dh = Math.clamped(hp.value - amount, 0, hp.max); + const dh = Math.clamped(hp.value - amount, -99, hp.max); // Update the Actor return this.update({ @@ -746,6 +748,13 @@ export class AcksActor extends Actor { 13: 1, 16: 2, 18: 3, + 19: 4, + 20: 5, + 21: 6, + 22: 7, + 23: 8, + 24: 9, + 25: 10 }; data.scores.str.mod = AcksActor._valueFromTable( standard, @@ -791,7 +800,7 @@ export class AcksActor extends Actor { data.scores.cha.value ); data.scores.cha.retain = data.scores.cha.mod + 4; - data.scores.cha.loyalty = data.scores.cha.mod + 7; + data.scores.cha.loyalty = data.scores.cha.mod; const od = { 0: 0, @@ -802,6 +811,7 @@ export class AcksActor extends Actor { 13: 14, 16: 10, 18: 6, + 19: 2, }; data.exploration.odMod = AcksActor._valueFromTable( od, @@ -823,6 +833,13 @@ export class AcksActor extends Actor { 13: "ACKS.NativePlus1", 16: "ACKS.NativePlus2", 18: "ACKS.NativePlus3", + 19: "ACKS.NativePlus4", + 20: "ACKS.NativePlus5", + 21: "ACKS.NativePlus6", + 22: "ACKS.NativePlus7", + 23: "ACKS.NativePlus8", + 24: "ACKS.NativePlus9", + 25: "ACKS.NativePlus10", }; data.languages.spoken = AcksActor._valueFromTable( spoken, diff --git a/src/module/chat.js b/src/module/chat.js index d4c445c..0364898 100644 --- a/src/module/chat.js +++ b/src/module/chat.js @@ -21,6 +21,18 @@ export const addChatMessageContextOptions = function(html, options) { icon: '', condition: canApply, callback: li => applyChatCardDamage(li, -1) + }, + { + name: game.i18n.localize("ACKS.messages.applyHalf"), + icon: '', + condition: canApply, + callback: li => applyChatCardDamage(li, 0.5) + }, + { + name: game.i18n.localize("ACKS.messages.applyDouble"), + icon: '', + condition: canApply, + callback: li => applyChatCardDamage(li, 2) } ); return options; diff --git a/src/module/dice.js b/src/module/dice.js index f6c8cf7..a019e8b 100644 --- a/src/module/dice.js +++ b/src/module/dice.js @@ -331,7 +331,7 @@ export class AcksDice { }; let buttons = {} - if (skipDialog) { AcksDice.sendRoll(rollData); } + if (skipDialog) { return AcksDice.sendRoll(rollData); } if (game.settings.get("acks", "removeMagicBonus") == false) { buttons = { ok: { @@ -339,7 +339,7 @@ export class AcksDice { icon: '', callback: (html) => { rolled = true; - rollData.form = html[0].children[0]; + rollData.form = html[0].querySelector("form"); roll = AcksDice.sendRoll(rollData); }, }, @@ -348,7 +348,7 @@ export class AcksDice { icon: '', callback: (html) => { rolled = true; - rollData.form = html[0].children[0]; + rollData.form = html[0].querySelector("form"); 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); @@ -431,7 +431,7 @@ export class AcksDice { icon: '', callback: (html) => { rolled = true; - rollData.form = html[0].children[0]; + rollData.form = html[0].querySelector("form"); roll = ["melee", "missile", "attack"].includes(data.roll.type) ? AcksDice.sendAttackRoll(rollData) : AcksDice.sendRoll(rollData); diff --git a/src/system.json b/src/system.json index 5f3fe12..bf1baac 100644 --- a/src/system.json +++ b/src/system.json @@ -2,9 +2,9 @@ "name": "acks", "title": "Adventurer Conqueror King System", "description": "Play B/X or other OSR compatible content using the ACKS system", - "version": "0.6.2", - "minimumCoreVersion": "0.6.2", - "compatibleCoreVersion": "0.6.6", + "version": "0.7.0", + "minimumCoreVersion": "0.7.4", + "compatibleCoreVersion": "0.7.5", "templateVersion": 2, "author": "The Happy Anarchist", "esmodules": ["acks.js"], @@ -185,5 +185,5 @@ "gridUnits": "ft", "url": "https://github.com/thehappyanarchist/foundryacks", "manifest": "https://github.com/thehappyanarchist/foundryacks/raw/master/src/system.json", - "download": "https://github.com/thehappyanarchist/foundryacks/raw/master/package/acks-v0.6.2.zip" + "download": "https://github.com/thehappyanarchist/foundryacks/raw/master/package/acks-v0.7.0.zip" } diff --git a/src/template.json b/src/template.json index b3df1c8..b7ed9a5 100644 --- a/src/template.json +++ b/src/template.json @@ -53,6 +53,9 @@ "value": 0 } }, + "save": { + "mod": 0 + }, "movement": { "base": 120 }, diff --git a/src/templates/actors/dialogs/modifiers-dialog.html b/src/templates/actors/dialogs/modifiers-dialog.html index c01ea67..0a1da23 100644 --- a/src/templates/actors/dialogs/modifiers-dialog.html +++ b/src/templates/actors/dialogs/modifiers-dialog.html @@ -61,7 +61,7 @@ {{localize 'ACKS.RetainersMax'}} ({{add data.scores.cha.mod 4}})