diff --git a/src/lang/en.json b/src/lang/en.json index d1f6493..c011e71 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -1,6 +1,7 @@ { "OSE.Edit": "Edit", "OSE.Delete": "Delete", + "OSE.Show": "Show", "OSE.Add": "Add", "OSE.Ok": "Ok", "OSE.Cancel": "Cancel", @@ -150,6 +151,7 @@ "OSE.items.Slow": "Slow", "OSE.items.ArmorAC": "AC", "OSE.items.ArmorAAC": "AAC", + "OSE.items.Bonus": "Bonus", "OSE.armor.type": "Armor Type", "OSE.armor.unarmored": "Unarmored", @@ -185,6 +187,7 @@ "OSE.messages.GetExperience": "{name} gained {value} experience points!", "OSE.messages.AttackSuccess": "Hits AC {result}! ({bonus})", + "OSE.messages.AttackAscendingSuccess": "Hits AC {result}!", "OSE.messages.AttackFailure": "Attack fails ({bonus})", "OSE.messages.InflictsDamage": "Inflicts damage!", "OSE.ChatContextDamage": "Apply Damage", diff --git a/src/module/actor/entity.js b/src/module/actor/entity.js index bdfc364..d41bd55 100644 --- a/src/module/actor/entity.js +++ b/src/module/actor/entity.js @@ -72,7 +72,7 @@ export class OseActor extends Actor { rollData: { type: "Above", target: this.data.data.saves[save].value, - details: game.i18n.format("OSE.SavingThrowDetails", {save: label}), + details: game.i18n.format("OSE.SavingThrowDetails", { save: label }), }, }, }; @@ -127,7 +127,9 @@ export class OseActor extends Actor { rollData: { type: "Check", target: this.data.data.scores[score].value, - details: game.i18n.format("OSE.AttributeCheckDetails", {score: label}), + details: game.i18n.format("OSE.AttributeCheckDetails", { + score: label, + }), }, }, }; @@ -181,7 +183,9 @@ export class OseActor extends Actor { rollData: { type: "Below", target: this.data.data.exploration[expl], - details: game.i18n.format("OSE.ExplorationCheckDetails", {expl: label}), + details: game.i18n.format("OSE.ExplorationCheckDetails", { + expl: label, + }), }, }, }; @@ -215,7 +219,10 @@ export class OseActor extends Actor { }; let dmgParts = []; - if ((!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) && this.type == "character") { + if ( + (!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) && + this.type == "character" + ) { dmgParts.push("1d6"); } else { dmgParts.push(attData.dmg); @@ -243,38 +250,35 @@ export class OseActor extends Actor { const rollParts = ["1d20"]; const dmgParts = []; - - if ((!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) && this.data.type == "character") { + + if ((!attData.dmg || !game.settings.get("ose", "variableWeaponDamage")) && + this.data.type == "character") { dmgParts.push("1d6"); } else { dmgParts.push(attData.dmg); } - let ascending = game.settings.get("ose", "ascendingAC"); if (ascending) { rollParts.push(data.thac0.bba.toString()); - if (attData.type == "missile") { - rollParts.push( - data.scores.dex.mod.toString(), - data.thac0.mod.missile.toString() - ); - } else if (attData.type == "melee") { - rollParts.push( - data.scores.str.mod.toString(), - data.thac0.mod.melee.toString() - ); - } } - - let thac0 = 0; + if (attData.type == "missile") { + rollParts.push( + data.scores.dex.mod.toString(), + data.thac0.mod.missile.toString() + ); + } else if (attData.type == "melee") { + rollParts.push( + data.scores.str.mod.toString(), + data.thac0.mod.melee.toString() + ); + } + if (attData.bonus) { + rollParts.push(attData.bonus); + } + let thac0 = data.thac0.value; if (attData.type == "melee") { dmgParts.push(data.scores.str.mod); - thac0 = data.thac0.melee; - } else if (attData.type == "missile") { - thac0 = data.thac0.missile; - } else { - thac0 = data.thac0.value; } const rollData = { @@ -290,7 +294,7 @@ export class OseActor extends Actor { }, }; let skip = options.event && options.event.ctrlKey; - + // Roll and return return OseDice.Roll({ event: options.event, @@ -303,7 +307,7 @@ export class OseActor extends Actor { }); } - async applyDamage(amount=0, multiplier=1) { + async applyDamage(amount = 0, multiplier = 1) { amount = Math.floor(parseInt(amount) * multiplier); const hp = this.data.data.hp; @@ -312,7 +316,7 @@ export class OseActor extends Actor { // Update the Actor return this.update({ - "data.hp.value": dh + "data.hp.value": dh, }); } diff --git a/src/module/dice.js b/src/module/dice.js index 96eda66..ccdf77a 100644 --- a/src/module/dice.js +++ b/src/module/dice.js @@ -112,7 +112,7 @@ export class OseDice { }; result.target = data.rollData.thac0; if (game.settings.get("ose", "ascendingAC")) { - result.details = game.i18n.format('OSE.messages.AttackSuccess', {result: roll.total, bonus: result.target}); + result.details = game.i18n.format('OSE.messages.AttackAscendingSuccess', {result: roll.total}); result.isSuccess = true; } else { // B/X Historic THAC0 Calculation diff --git a/src/module/item/entity.js b/src/module/item/entity.js index 2cc9e9d..b3834c3 100644 --- a/src/module/item/entity.js +++ b/src/module/item/entity.js @@ -53,14 +53,19 @@ export class OseItem extends Item { // Dialog new Dialog({ title: "Choose Attack Range", - content: '', + content: "", buttons: { melee: { icon: '', label: "Melee", callback: () => { this.actor.rollAttack( - { type: "melee", label: this.name, dmg: this.data.data.damage }, + { + type: "melee", + label: this.name, + dmg: this.data.data.damage, + bonus: data.bonus, + }, { event: { ctrlKey: skipDialog } } ); }, @@ -89,7 +94,7 @@ export class OseItem extends Item { type = "melee"; } this.actor.rollAttack( - { type: type, label: this.name, dmg: this.data.data.damage }, + { type: type, label: this.name, dmg: data.damage, bonus: data.bonus }, { event: { ctrlKey: skipDialog } } ); diff --git a/src/scss/item.scss b/src/scss/item.scss index 786cb35..2811145 100644 --- a/src/scss/item.scss +++ b/src/scss/item.scss @@ -11,7 +11,7 @@ padding-right: 2px; font-size: 13px; .form-group { - margin: 2px; + margin: 1px; border: 1px solid rgba(0, 0, 0, 0.15); label { background: rgba(0, 0, 0, 0.1); diff --git a/src/template.json b/src/template.json index 6e7ad2e..1968e1e 100644 --- a/src/template.json +++ b/src/template.json @@ -166,6 +166,7 @@ "weapon": { "description": "", "damage": "1d6", + "bonus": 0, "qualities": "", "slow": false, "missile": true, diff --git a/src/templates/actors/partials/character-abilities-tab.html b/src/templates/actors/partials/character-abilities-tab.html index c321c9a..4604697 100644 --- a/src/templates/actors/partials/character-abilities-tab.html +++ b/src/templates/actors/partials/character-abilities-tab.html @@ -54,8 +54,8 @@
diff --git a/src/templates/actors/partials/character-attributes-tab.html b/src/templates/actors/partials/character-attributes-tab.html index f46bd49..66e1b5c 100644 --- a/src/templates/actors/partials/character-attributes-tab.html +++ b/src/templates/actors/partials/character-attributes-tab.html @@ -160,8 +160,8 @@ {{else}}