Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Releases: ElfFriend-DnD/foundryvtt-more-hooks-5e

Breaking: Massive Overhaul

02 Jul 17:08
Compare
Choose a tag to compare

Removed SW5e support, the new patching method is dependant on the 5e system's files.

Remember my goal here is to battle test these hooks to eventually hopefully get put directly into the core system. If you have any vested interest in being able to change 5e system behavior without patching things, I want your input in #dnd5e-dev about this.

200% As Much Jank
We have removed our dependency on libwrapper in favor of a far more janky DIY patching which uses regex to inject small pieces of code in specific places instead. This is powered by importing the 5e files at initialization time and doing the patching there, instead of waiting till init or setup. So far I've tested a little for compatibility with the obvious suspects and it has worked fine. This is one of those "if you're the only person doing it and everyone else is using libwrapper as they should, it will work" things I think.

My sanity checks will do their best to fall back to the existing method (i.e. with no hooks injected) if anything during the injection goes wrong. So worst-case, the hook your module uses to fire won't exist, and thus some part of your module won't ever fire.

As far as I can tell from f-hub searches, I'm the only person who actually uses this library in a module so I'm not overly worried about breakages or the jank-factor.

New Hooks
Any Hook that existed before now also has a pre version which follows the Core convention of return false to stop the overall process. This could allow one to completely bypass most all of the core 5e logic for the hooked methods if one wanted to, without patching them. Take a look at the develop branch readme for the full list:
https://github.com/ElfFriend-DnD/foundryvtt-more-hooks-5e/blob/develop/README.md

  • rollHitDie and preRollHitDie
  • applyDamage and preApplyDamage

Breaking Changes

  • actor was removed from all item hook arguments. Use item.parent instead.
  • options arguments for 'post' roll hooks were removed. These were only the arguments passed to the original method, and not necessarily the arguments passed to the output roll. I opted not to include the actual rollConfig objects here because I did not believe them to be useful after the roll was made. All pre hooks now have the full rollData being provided to the Roll instance.

What's Changed

Full Changelog: 0.5.0...0.6.2

Version 0.6.1 Pre-release

20 Mar 04:04
Compare
Choose a tag to compare
Pre-release

Builds off of https://github.com/ElfFriend-DnD/foundryvtt-more-hooks-5e/releases/tag/0.6.0

Fix a problem with dependance on 1.6.x code

Version 0.6 Pre-release

20 Mar 03:43
Compare
Choose a tag to compare
Pre-release

This is a huge refactor of the way hooks are injected which allows for "Pre" Hooks to exist.

Each existing hook has a pre counterpart now which has the ability to exit out of the method being called by returning false from the hook callback.

Refer to the develop branch's readme to see the new list of Hooks.

ApplyDamage Hook

06 Mar 20:40
cab0a2a
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.4.1...0.5.0

0.4.1

07 Jan 05:03
Compare
Choose a tag to compare

What's Changed

  • fix: fix false hook calls when the workflow was actually aborted by @akrigline in #5

Full Changelog: 0.4.0...0.4.1

New Hook: displayCard

07 Nov 01:01
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.3.1...0.4.0

SW5e Support

31 Oct 20:43
Compare
Choose a tag to compare

What's Changed

Full Changelog: 0.3.0...0.3.1

Breaking: Remove Sockets

23 Oct 19:32
ccc03fa
Compare
Choose a tag to compare

What's Changed

  • refactor: remove socket implementation by @akrigline in #2

This breaking change is detailed in #1 and in the PR itself. In short, hooks are only run on the initator's client now instead of everyone.

Full Changelog: 0.2.1...0.3.0

RollFormula Fix

18 Oct 02:15
Compare
Choose a tag to compare
  • fix: roll type for other formula was D20Roll when it should be just Roll

Full Changelog: 0.2.0...0.2.1

Common Arguments

18 Oct 01:22
Compare
Choose a tag to compare

Adds a commonArgs object to every hook call.

At the moment this contains only the userId of the user who triggered the action causing the hook. (Useful for getting that user's targets for instance, or for only performing an action on their client).

image

Full Changelog: 0.1.1...0.2.0