Skip to content

Commit

Permalink
Merge pull request dmdorman#1566 from phBalance/phBalance/allow-resou…
Browse files Browse the repository at this point in the history
…rce-override-for-attack

allow resource override for attack
  • Loading branch information
phBalance authored Dec 1, 2024
2 parents 34a4d8f + f825412 commit f55bdb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix for SPD purchased as a power not contributing to final values during upload. [#1439](https://github.com/dmdorman/hero6e-foundryvtt/issues/1439)
- Fix for combat tracker where sometimes it would skip combatants when new combatants were added/removed. [#1447](https://github.com/dmdorman/hero6e-foundryvtt/issues/1447)
- Attacks can override resource usage by using the override key on the "Roll to Hit" button.

## Version 4.0.11 [Hero System 6e (Unofficial) v2](https://github.com/dmdorman/hero6e-foundryvtt)

Expand Down
9 changes: 6 additions & 3 deletions module/item/item-attack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { clamp } from "../utility/compatibility.mjs";
import { calculateVelocityInSystemUnits } from "../ruler.mjs";
import { Attack } from "../utility/attack.mjs";
import { calculateDistanceBetween, calculateRangePenaltyFromDistanceInMetres } from "../utility/range.mjs";
import { overrideCanAct } from "../settings/settings-helpers.mjs";

export async function chatListeners(html) {
html.on("click", "button.roll-damage", this._onRollDamage.bind(this));
Expand Down Expand Up @@ -485,7 +486,7 @@ export async function AttackToHit(item, options) {
resourcesUsedDescriptionRenderedRoll,
} = await userInteractiveVerifyOptionallyPromptThenSpendResources(effectiveItem, {
...options,
...{ noResourceUse: false },
...{ noResourceUse: overrideCanAct },
});
if (resourceError) {
return ui.notifications.error(`${item.name} ${resourceError}`);
Expand Down Expand Up @@ -3312,8 +3313,10 @@ async function _calcKnockback(body, item, options, knockbackMultiplier) {
*
* @param {HeroSystem6eItem} item
* @param {Object} options
* @param {boolean} options.noResourceUse - true to not consume resources but still indicate how many would have been consumed
* @param {boolean} options.forceStunUsage - true to force STUN to be used if there is insufficient END
* @param {boolean} [options.noResourceUse] - true to not consume resources but still indicate how many would have been consumed
* @param {boolean} [options.forceStunUsage] - true to force STUN to be used if there is insufficient END
* @param {number} [options.effectiveStr] - strength used for END calculations
* @param {number} [options.boostableChargesToUse] - number of boostable charges to use
*
* @returns Object - discriminated union based on error or warning being falsy/truthy
*/
Expand Down

0 comments on commit f55bdb3

Please sign in to comment.