Skip to content

Commit

Permalink
Merge pull request dmdorman#1425 from phBalance/phBalance/saturday-ni…
Browse files Browse the repository at this point in the history
…ght-fun

Saturday night code review and publish 4.0.5
  • Loading branch information
phBalance authored Nov 10, 2024
2 parents 0f35c15 + f2ee5ba commit 50779d0
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 26 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# 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.
- Support for STR Minimum OCV penalty. [#384](https://github.com/dmdorman/hero6e-foundryvtt/issues/384)
- 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
Expand Down
4 changes: 1 addition & 3 deletions module/actor/actor-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
};

Expand Down
13 changes: 12 additions & 1 deletion module/actor/actor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -2063,7 +2075,6 @@ export class HeroSystem6eActor extends Actor {
if (rollableChanges) {
changed = true;

// TODO: FIXME: Not quite right.
foundry.utils.mergeObject(changes, rollableChanges);
}
}
Expand Down
34 changes: 17 additions & 17 deletions module/item/item-attack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions module/item/item.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 },
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion system.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 50779d0

Please sign in to comment.