diff --git a/CHANGELOG.md b/CHANGELOG.md index 519281ad..8933f690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Releases -## Version 4.0.5 (So Far...) [Hero System 6e (Unofficial) v2](https://github.com/dmdorman/hero6e-foundryvtt) +## Version 4.0.5 [Hero System 6e (Unofficial) v2](https://github.com/dmdorman/hero6e-foundryvtt) - OCV/OMCV bonuses are no longer active effects. They only work for a specific instant attack. [#1285](https://github.com/dmdorman/hero6e-foundryvtt/issues/1285) - Fixed rare issue where adding some 6e powers to a 5e actor would prevent actor sheet from opening. @@ -8,7 +8,7 @@ - Support for STR 0 rolls including DCV and movement penalties. [#1401](https://github.com/dmdorman/hero6e-foundryvtt/issues/1401) - Support for PRE 0 rolls. [#1403](https://github.com/dmdorman/hero6e-foundryvtt/issues/1403) - Fixed issue where FLIGHT was impacting KB rolls even when FLIGHT was turned off. [#1400](https://github.com/dmdorman/hero6e-foundryvtt/issues/1400) -- Fixed issue where full END for an attack was used even when lowering Effective Strength. [#1399](https://github.com/dmdorman/hero6e-foundryvtt/issues/1399) +- Fixed issue where full END for an attack was used even when lowering Effective Strength/Levels. [#1399](https://github.com/dmdorman/hero6e-foundryvtt/issues/1399) - AUTOMATION's can't use STUN in place of END. [#1398](https://github.com/dmdorman/hero6e-foundryvtt/issues/1398) ## Version 4.0.4 diff --git a/module/actor/actor-sheet.mjs b/module/actor/actor-sheet.mjs index e29ca0a1..ea36e66f 100644 --- a/module/actor/actor-sheet.mjs +++ b/module/actor/actor-sheet.mjs @@ -126,9 +126,7 @@ export class HeroSystemActorSheet extends ActorSheet { const powers = getCharacteristicInfoArrayForActor(this.actor); for (const powerInfo of powers) { - this.actor.updateRollable(powerInfo.key.toLowerCase()); - - let characteristic = { + const characteristic = { ...data.actor.system.characteristics[powerInfo.key.toLowerCase()], }; diff --git a/module/actor/actor.mjs b/module/actor/actor.mjs index 62186323..405c6dcd 100644 --- a/module/actor/actor.mjs +++ b/module/actor/actor.mjs @@ -264,6 +264,18 @@ export class HeroSystem6eActor extends Actor { } } + if (data?.system?.characteristics) { + const changes = {}; + + for (const charName of Object.keys(data.system.characteristics)) { + const charChanges = this.updateRollable(charName); + + foundry.utils.mergeObject(changes, charChanges); + } + + await this.update(changes); + } + // Display changes from _preUpdate for (let d of options.displayScrollingChanges) { this._displayScrollingChange(d.value, d.options); @@ -2063,7 +2075,6 @@ export class HeroSystem6eActor extends Actor { if (rollableChanges) { changed = true; - // TODO: FIXME: Not quite right. foundry.utils.mergeObject(changes, rollableChanges); } } diff --git a/module/item/item-attack.mjs b/module/item/item-attack.mjs index 1dd8cbcc..f971a951 100644 --- a/module/item/item-attack.mjs +++ b/module/item/item-attack.mjs @@ -379,23 +379,6 @@ export async function AttackToHit(item, options) { const actor = item.actor; let effectiveItem = item; - // Make sure there are enough resources and consume them - const { - error: resourceError, - warning: resourceWarning, - resourcesRequired, - resourcesUsedDescription, - resourcesUsedDescriptionRenderedRoll, - } = await userInteractiveVerifyOptionallyPromptThenSpendResources(effectiveItem, { - ...options, - ...{ noResourceUse: false }, - }); - if (resourceError) { - return ui.notifications.error(`${item.name} ${resourceError}`); - } else if (resourceWarning) { - return ui.notifications.warn(`${item.name} ${resourceWarning}`); - } - // STR 0 character must succeed with // a STR Roll in order to perform any Action that uses STR, such // as aiming an attack, pulling a trigger, or using a Power with the @@ -450,6 +433,23 @@ export async function AttackToHit(item, options) { } } + // Make sure there are enough resources and consume them + const { + error: resourceError, + warning: resourceWarning, + resourcesRequired, + resourcesUsedDescription, + resourcesUsedDescriptionRenderedRoll, + } = await userInteractiveVerifyOptionallyPromptThenSpendResources(effectiveItem, { + ...options, + ...{ noResourceUse: false }, + }); + if (resourceError) { + return ui.notifications.error(`${item.name} ${resourceError}`); + } else if (resourceWarning) { + return ui.notifications.warn(`${item.name} ${resourceWarning}`); + } + const itemData = item.system; const hitCharacteristic = actor.system.characteristics[itemData.uses].value; diff --git a/module/item/item.mjs b/module/item/item.mjs index af88055c..d95552b0 100644 --- a/module/item/item.mjs +++ b/module/item/item.mjs @@ -5011,7 +5011,7 @@ export async function RequiresACharacteristicRollCheck(actor, characteristic, re speaker.alias = actor.name; const chatData = { - type: CONST.CHAT_MESSAGE_TYPES.ROLL, + style: CONST.CHAT_MESSAGE_STYLES.OOC, rolls: activationRoller.rawRolls(), user: game.user._id, content: cardHtml, @@ -5083,7 +5083,6 @@ export async function RequiresASkillRollCheck(item) { } else { ui.notifications.warn( `${item.actor.name} has a power ${item.name}. Expecting 'SKILL roll', where SKILL is the name of an owned skill.`, - // { console: true, permanent: true }, ); } } diff --git a/system.json b/system.json index feffa3ad..a213a46e 100644 --- a/system.json +++ b/system.json @@ -3,7 +3,7 @@ "name": "hero6e-foundryvtt-v2", "title": "Hero System 6e (Unofficial) v2", "description": "The Hero System 6e for FoundryVTT!", - "version": "4.0.4", + "version": "4.0.5", "compatibility": { "minimum": "12", "verified": "12.331",