DFreds / dfreds-convenient-effects

A FoundryVTT module that adds easy to use toggleable active effects for any system.
MIT License
44 stars 37 forks source link

[BUG] 4th level exhaustion doesn't cut hitpoint maximum in half & it is causing visual artifact #327

Open TrofimSelbs opened 3 months ago

TrofimSelbs commented 3 months ago

Describe the Bug

When 4th level of exhaustion is applied to an actor - its hit points are not halved. Also, it is causing a visual artifact shown in the image below. A PC on the image has their max hp already reduced by 9, and then they the 4th level of exhaustion was applied.

Context

image

To Reproduce

Steps to reproduce the behavior:

  1. Add a PC token to the scene
  2. Reduce their hit points maximum from 17 hp, to 4 using the character sheet's option to do so. Use "temp max hp"
  3. Save the change
  4. Add Convenient effect of 4th level exhaustion
  5. See as their health bar on the token moves out of bounds
  6. See as their hp is not halved from 4 to 2.

Expected Behavior

When adding the effect - it will be half the current max of hit points. As the actor's current maximum is 4 - then it is 2. Also, it shouldn't display the health bar incorrectly

CptLucky27 commented 3 months ago

Exhaustion 4 still used system.attributes.hp.max which is not available anymore. We are now supposed to use system.attributes.hp.tempmax which has not been implemented yet it seems.

I have fixed it myself by replacing it with the new attribute key with effect value: -@attributes.hp.max * 0.5 and mode is Override.

CptLucky27 commented 3 months ago

I fixed it by going in the modules folder and finding the module. Open this file: "\AppData\Local\FoundryVTT\Data\modules\dfreds-convenient-effects\scripts\effects\effect-definitions.js" And change

      key: 'system.attributes.hp.max',
      mode: CONST.ACTIVE_EFFECT_MODES.MULTIPLY,
      value: '0.5',
      priority: 5,

With:

      key: 'system.attributes.hp.tempmax',
      mode: CONST.ACTIVE_EFFECT_MODES.OVERRIDE,
      value: '-@attributes.hp.max * 0.5',
      priority: 5,
TrofimSelbs commented 3 months ago

Thank you @CptLucky27 ! Will this be reverted when the module updates?

TrofimSelbs commented 3 months ago

I have replied but I think Github didn’t send. Sorry if 2 same messages

@CptLucky27 thank you for sharing fix! Will try. Will it revert after an update?

CptLucky27 commented 3 months ago

Not sure to be honest with you. But you can always check if it has been changed or not by going into that file.

TrofimSelbs commented 3 months ago

Got it, thanks! Will try and see

DFreds commented 1 week ago

Seeing that - @attributes.hp.max * 0.5 isn't working 🤔

CptLucky27 commented 1 week ago

@DFreds image Not sure but I changed in the file itself and now exhaustion 4 comes up with this (see the image). And it seems to be working for me.

Not sure if it helps but I follow Chris's Premades dependencies: Midi-QOL: 11.4.34 DFred's Convenient Effects: 6.0.3 Warpgate: 1.19.2 (up to 1.closing) Effect Macro: 11.2.1 Template Macro: 11.0.1 Sequencer: 3.1.4 Token Attacher: v4.5.15 Build-A-Bonus: 11.8.0 (up to 11.10.6) Socketlib: 1.0.13 Dynamic Active Effects: 11.3.29 Automated Animations: 4.2.71 Times Up: 11.3.12

DFreds commented 1 week ago

What version of dnd5e? It's definitely not working for me, and I have the same inputs.