diff --git a/lang/en.json b/lang/en.json index 6a0d72d1..d2386744 100755 --- a/lang/en.json +++ b/lang/en.json @@ -386,7 +386,8 @@ "hideNewCountdowns": "Hide New Countdowns" }, "DaggerheartMenu": { - "title": "GM Tools" + "title": "GM Tools", + "refreshFeatures": "Refresh Features" }, "DeleteConfirmation": { "title": "Delete {type} - {name}", @@ -504,6 +505,7 @@ }, "navigateLevel": "To Level {level}", "navigateToLevelup": "Return To Levelup", + "finishLevelup": "Finish Levelup", "navigateToSummary": "To Summary", "options": { "trait": "Gain a +1 bonus to two unmarked character traits and mark them.", @@ -2105,6 +2107,7 @@ }, "hope": "Hope", "hordeHp": "Horde HP", + "icon": "Icon", "identify": "Identity", "imagePath": "Image Path", "inactiveEffects": "Inactive Effects", @@ -2141,6 +2144,7 @@ "recovery": "Recovery", "refresh": "Refresh", "reroll": "Reroll", + "rerolled": "Rerolled", "rerollThing": "Reroll {thing}", "resource": "Resource", "roll": "Roll", @@ -2240,7 +2244,9 @@ "evolvedDrag": "Drag a form here to evolve it.", "hybridize": "Hybridize", "hybridizeFeatureTitle": "Hybrid Features", - "hybridizeDrag": "Drag a form here to hybridize it." + "hybridizeDrag": "Drag a form here to hybridize it.", + "mainTrait": "Main Trait", + "traitBonus": "Trait Bonus" }, "Class": { "hopeFeatures": "Hope Features", @@ -2583,7 +2589,8 @@ "selectMember": "Select a Member", "rerollTitle": "Reroll Group Roll", "rerollContent": "Are you sure you want to reroll your {trait} check?", - "rerollTooltip": "Reroll" + "rerollTooltip": "Reroll", + "wholePartySelected": "The whole party is selected" }, "healingRoll": { "title": "Heal - {damage}", diff --git a/module/applications/dialogs/downtime.mjs b/module/applications/dialogs/downtime.mjs index f7bab430..96e06446 100644 --- a/module/applications/dialogs/downtime.mjs +++ b/module/applications/dialogs/downtime.mjs @@ -118,7 +118,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV if ( x.system.resource && x.system.resource.type && - refreshIsAllowed([this.shortrest ? 'shortRest' : 'longRest'], action.uses.recovery) + refreshIsAllowed([this.shortrest ? 'shortRest' : 'longRest'], x.system.resource.recovery) ) { acc.push({ title: game.i18n.localize(`TYPES.Item.${x.type}`), diff --git a/module/applications/sheets/actors/character.mjs b/module/applications/sheets/actors/character.mjs index b59fc7a4..016cff13 100644 --- a/module/applications/sheets/actors/character.mjs +++ b/module/applications/sheets/actors/character.mjs @@ -139,10 +139,6 @@ export default class CharacterSheet extends DHBaseActorSheet { element.addEventListener('change', this.updateItemResource.bind(this)); element.addEventListener('click', e => e.stopPropagation()); }); - htmlElement.querySelectorAll('.inventory-item-quantity').forEach(element => { - element.addEventListener('change', this.updateItemQuantity.bind(this)); - element.addEventListener('click', e => e.stopPropagation()); - }); // Add listener for armor marks input htmlElement.querySelectorAll('.armor-marks-input').forEach(element => { @@ -593,14 +589,6 @@ export default class CharacterSheet extends DHBaseActorSheet { this.render(); } - async updateItemQuantity(event) { - const item = await getDocFromElement(event.currentTarget); - if (!item) return; - - await item.update({ 'system.quantity': event.currentTarget.value }); - this.render(); - } - async updateArmorMarks(event) { const armor = this.document.system.armor; if (!armor) return; diff --git a/module/applications/sheets/api/application-mixin.mjs b/module/applications/sheets/api/application-mixin.mjs index 6f0bf3f4..449d6723 100644 --- a/module/applications/sheets/api/application-mixin.mjs +++ b/module/applications/sheets/api/application-mixin.mjs @@ -325,7 +325,8 @@ export default function DHApplicationMixin(Base) { if (data.type === 'ActiveEffect' && data.fromInternal !== this.document.uuid) { this.document.createEmbeddedDocuments('ActiveEffect', [data.data]); } else { - return super._onDrop(event); + // Fallback to super, but note that item sheets do not have this function + return super._onDrop?.(event); } } diff --git a/module/applications/sheets/api/base-actor.mjs b/module/applications/sheets/api/base-actor.mjs index 02dcc448..adb0d39a 100644 --- a/module/applications/sheets/api/base-actor.mjs +++ b/module/applications/sheets/api/base-actor.mjs @@ -89,6 +89,7 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) { value: context.source.system.gold[key] }; } + context.inventory.hasCurrency = Object.values(context.inventory.currencies).some((c) => c.enabled); } return context; @@ -134,6 +135,10 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) { _attachPartListeners(partId, htmlElement, options) { super._attachPartListeners(partId, htmlElement, options); + htmlElement.querySelectorAll('.inventory-item-quantity').forEach(element => { + element.addEventListener('change', this.updateItemQuantity.bind(this)); + element.addEventListener('click', e => e.stopPropagation()); + }); htmlElement.querySelectorAll('.item-button .action-uses-button').forEach(element => { element.addEventListener('contextmenu', DHBaseActorSheet.#modifyActionUses); }); @@ -172,6 +177,15 @@ export default class DHBaseActorSheet extends DHApplicationMixin(ActorSheetV2) { return this._getContextMenuCommonOptions.call(this, { usable: true, toChat: true }); } + /* -------------------------------------------- */ + /* Application Listener Actions */ + /* -------------------------------------------- */ + + async updateItemQuantity(event) { + const item = await getDocFromElement(event.currentTarget); + await item?.update({ 'system.quantity': event.currentTarget.value }); + } + /* -------------------------------------------- */ /* Application Clicks Actions */ /* -------------------------------------------- */ diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index a8fae2b5..39d5298d 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -471,5 +471,5 @@ export function refreshIsAllowed(allowedTypes, typeToCheck) { export async function getCritDamageBonus(formula) { const critRoll = new Roll(formula); - return critRoll.dice.reduce((acc, dice) => acc + dice.faces, 0); + return critRoll.dice.reduce((acc, dice) => acc + dice.faces * dice.number, 0); } diff --git a/src/packs/domains/domainCard_Book_of_Grynn_R0LNheiZycZlZzV3.json b/src/packs/domains/domainCard_Book_of_Grynn_R0LNheiZycZlZzV3.json index c388c9ce..05276707 100644 --- a/src/packs/domains/domainCard_Book_of_Grynn_R0LNheiZycZlZzV3.json +++ b/src/packs/domains/domainCard_Book_of_Grynn_R0LNheiZycZlZzV3.json @@ -4,7 +4,7 @@ "type": "domainCard", "folder": "rUGDM9JvGfhh9a2Y", "system": { - "description": "
Arcane Deflection: Once per long rest, spend a Hope to negate the damage of an attack targeting you or an ally within Very Close range.
Time Lock: Target an object within Far range. That object stops in time and space exactly where it is until your next rest. If a creature tries to move it, make a Spellcast Roll against them to maintain this spell.
Wall of Flame: Make a Spellcast Roll (15). On a success, create a wall of magical flame between two points within Far range. All creatures in its path must choose a side to be on, and anything that subsequently passes through the wall takes 4d10+3 magic damage.
", + "description": "Arcane Deflection: Once per long rest, spend a Hope to negate the damage of an attack targeting you or an ally within Very Close range.
Time Lock: Target an object within Far range. That object stops in time and space exactly where it is until your next rest. If a creature tries to move it, make a Spellcast Roll against them to maintain this spell.
Wall of Flame: Make a Spellcast Roll (15). On a success, create a temporary wall of magical flame between two points within Far range. All creatures in its path must choose a side to be on, and anything that subsequently passes through the wall takes 4d10+3 magic damage.
", "domain": "codex", "recallCost": 2, "level": 4, @@ -66,7 +66,7 @@ "type": "attack", "_id": "K26kfjmTEH9zPMMO", "systemPath": "actions", - "description": "Make a Spellcast Roll (15). On a success, create a wall of magical flame between two points within Far range. All creatures in its path must choose a side to be on, and anything that subsequently passes through the wall takes 4d10+3 magic damage.
@Template[type:ray|range:f]
", + "description": "Make a Spellcast Roll (15). On a success, create a temporary wall of magical flame between two points within Far range. All creatures in its path must choose a side to be on, and anything that subsequently passes through the wall takes 4d10+3 magic damage.
@Template[type:ray|range:f]
", "chatDisplay": true, "actionType": "action", "cost": [], diff --git a/src/packs/domains/domainCard_Splintering_Strike_TYKfM3H9vBXyWiH4.json b/src/packs/domains/domainCard_Splintering_Strike_TYKfM3H9vBXyWiH4.json index 9fa8f92d..e36c744c 100644 --- a/src/packs/domains/domainCard_Splintering_Strike_TYKfM3H9vBXyWiH4.json +++ b/src/packs/domains/domainCard_Splintering_Strike_TYKfM3H9vBXyWiH4.json @@ -4,7 +4,7 @@ "type": "domainCard", "folder": "eg2vM8j9xhya9Rwa", "system": { - "description": "Spend a Hope and make an attack against all adversaries within your weapon’s range. Once per long rest, on a success against any targets, add up the damage dealt, then redistribute that damage however you wish between the targets you succeeded against. When you deal damage to a target, roll an additional damage die and add its result to the damage you deal to that target.
", + "description": "Spend a Hope and make an attack against all adversaries within your weapon’s range. Once per long rest, on a success against any targets, roll your weapon’s damage and distribute that damage however you wish between the targets you succeeded against. Before you deal damage to each target, roll an additional damage die and add its result to the damage you deal to them.
", "domain": "bone", "recallCost": 3, "level": 9, @@ -14,7 +14,7 @@ "type": "attack", "_id": "yjEcSlzsWGX79gpB", "systemPath": "actions", - "description": "Spend a Hope and make an attack against all adversaries within your weapon’s range. Once per long rest, on a success against any targets, add up the damage dealt, then redistribute that damage however you wish between the targets you succeeded against. When you deal damage to a target, roll an additional damage die and add its result to the damage you deal to that target.
", + "description": "", "chatDisplay": true, "actionType": "action", "cost": [ diff --git a/src/packs/items/weapons/weapon_Improved_Small_Dagger_nMuF8ZDZ2aXZVTg6.json b/src/packs/items/weapons/weapon_Improved_Small_Dagger_nMuF8ZDZ2aXZVTg6.json index 6a149ec7..b69332a5 100644 --- a/src/packs/items/weapons/weapon_Improved_Small_Dagger_nMuF8ZDZ2aXZVTg6.json +++ b/src/packs/items/weapons/weapon_Improved_Small_Dagger_nMuF8ZDZ2aXZVTg6.json @@ -10,7 +10,7 @@ "attached": [], "tier": 2, "equipped": false, - "secondary": false, + "secondary": true, "burden": "oneHanded", "weaponFeatures": [ { diff --git a/system.json b/system.json index bca8a0c9..7e3c6b07 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "daggerheart", "title": "Daggerheart", "description": "An unofficial implementation of the Daggerheart system", - "version": "1.3.0", + "version": "1.3.1", "compatibility": { "minimum": "13.346", "verified": "13.351", diff --git a/templates/characterCreation/tabs/traits.hbs b/templates/characterCreation/tabs/traits.hbs index bf32dd16..7bbf4b52 100644 --- a/templates/characterCreation/tabs/traits.hbs +++ b/templates/characterCreation/tabs/traits.hbs @@ -14,7 +14,7 @@