dfreds-convenient-effects icon indicating copy to clipboard operation
dfreds-convenient-effects copied to clipboard

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

Open TrofimSelbs opened this issue 1 year ago • 9 comments

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

  • Any errors in the console; access it by pressing F12
  • Ran [Find the Culprit] and it led to this module
  • Foundry version 11.315
  • System and version dnd 5e 3.1.2
  • Module version 6.0.3
  • Chrome, Forge

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

TrofimSelbs avatar May 17 '24 23:05 TrofimSelbs

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: [email protected] * 0.5 and mode is Override.

CptLucky27 avatar May 22 '24 21:05 CptLucky27

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: '[email protected] * 0.5',
      priority: 5,

CptLucky27 avatar May 22 '24 22:05 CptLucky27

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

TrofimSelbs avatar May 22 '24 22:05 TrofimSelbs

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?

TrofimSelbs avatar May 23 '24 08:05 TrofimSelbs

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

CptLucky27 avatar May 23 '24 08:05 CptLucky27

Got it, thanks! Will try and see

TrofimSelbs avatar May 23 '24 10:05 TrofimSelbs

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

DFreds avatar Aug 16 '24 18:08 DFreds

@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

CptLucky27 avatar Aug 16 '24 18:08 CptLucky27

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

DFreds avatar Aug 17 '24 05:08 DFreds