Skip to content

Conversation

@roth-michael
Copy link
Contributor

Closes #580
Nothing changes for Adversary actors, since we never consider any bonus for abilities to them. Can change that, if desired. For Hero actors:
prepareBaseData now calls _prepareBaseAbilities, which is the same as it was before but doesn't clamp ability.value and doesn't include ability.bonus
prepareDerivedData now calls the prepareAbilities actor hook, then _prepareAbilities, which adds ability.bonus to each ability.value and clamps it between 0 and 12.
This means one can now provide bonuses to ability scores for Hero actors by either:

  • Targeting system.abilities.[ability].bonus ( or .value, as before) via AE
  • Modifying abilities.[ability].bonus or .value in the prepareAbilities hook.

/* -------------------------------------------- */

/** @inheritDoc */
_prepareAbilities() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but I'm worried about order of operations and whether we can wait to compute total ability scores until prepareDerivedData. I suspect that there are some things that happen during prepareEmbeddedDocuments that currently reference and depend on the values of ability scores.

I have not looked closely, just a hunch. Do you foresee any issues with computing a final ability score after embedded items are prepared?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah, you're right. Specifically preparing defenses (physical and save) and preparing skills. Not sure what the best way to work around this is. Can discuss later with the other PR concerns.

@aaclayton aaclayton added pr:pending Issues that are currently being worked on as part of a pull request. blocked Issues or PRs that currently cannot be worked on due to some blocker labels Jan 15, 2026
@roth-michael roth-michael marked this pull request as draft January 15, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Issues or PRs that currently cannot be worked on due to some blocker pr:pending Issues that are currently being worked on as part of a pull request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an actor hook for prepareAbilities that allows programmatically giving an ability score bonus prior to total ability values being computed.

2 participants