Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log only says creature was knocked unconscious if HP already at 0 when taking new damage (ALSO: log should preferably not say "Creature took X damage and was knocked unconscious" if Automatic Unconscious Status Application is disabled) #288

Open
3 of 7 tasks
anfrimov opened this issue Jul 3, 2024 · 0 comments

Comments

@anfrimov
Copy link

anfrimov commented Jul 3, 2024

Check for existing bug reports before submitting.

  • I searched for existing Bug Reports and found no similar reports.

Expected Behavior

Creature with HP > 0 takes damage > HP...

..when Automatic Unconscious Status Application is enabled:

  • Log indicates the damage AND that the Unconscious tag has been applied. Example:

Goblin took 3 damage and was knocked unconscious.

..when Automatic Unconscious Status Application is disabled:

  • Log indicates the damage. Example:

Goblin took 3 damage.

Creature with HP <= 0 takes damage > 0...

..when Automatic Unconscious Status Application is enabled:

  • Log indicates the damage. Example:

Goblin took 3 damage.

..when Automatic Unconscious Status Application is disabled:

  • Log indicates the damage. Example:

Goblin took 3 damage.

Current behaviour

Creature with HP > 0 takes damage > HP...

..when Automatic Unconscious Status Application is enabled:

  • Log indicates the damage. Example:

Goblin took 3 damage.

..when Automatic Unconscious Status Application is disabled:

  • Log indicates the damage. Example:

Goblin took 3 damage.

Creature with HP <= 0 takes damage > 0...

..when Automatic Unconscious Status Application is enabled:

  • Log indicates the damage AND that the Unconscious tag has been applied. Example:

Goblin took 3 damage and was knocked unconscious.

..when Automatic Unconscious Status Application is disabled:

  • Log indicates the damage AND that the Unconscious tag has been applied. Example:

Goblin took 3 damage and was knocked unconscious.

Reproduction

Example 1

  1. Enable Automatic Unconscious Status Application
  2. Start encounter with creature (set HP to 1/1)
  3. Apply 2 damage to creature
  4. Creature HP is now 0 and creature has Unconscious tag
  5. Log says "Creature took 2 damage"
  6. Apply 2 damage to creature
  7. Creature HP is still 0, but...
  8. Log says "Creature took 2 damage and was knocked unconscious"

Example 2

  1. Disable Automatic Unconscious Status Application
  2. Start encounter with a creature which has not been assigned an HP value or whose HP is 0
  3. Apply 2 damage to creature
  4. Creature has no Unconscious tag, but...
  5. Log says "Creature took 2 damage and was knocked unconscious."

Example 3

  1. Disable Automatic Unconscious Status Application
  2. Start encounter with a creature which has not been assigned an HP value or whose HP is 0
  3. Apply 2 damage to creature and manually apply Unconscious tag
  4. Log says "Creature took 2 damage and was knocked unconscious and took Unconscious status."

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version Check

Version 1.6.5 (Installer 1.4.16)

Plugin Version

13.0.12

Confirmation

  • I have disabled all other plugins and the issue still persists.

Possible solution

Not a solution but a bit more info:

My use case for wanting to not see the unconscious message in the logs is that I'm using the initiative tracker as a player, thus I do not necessarily know the current or maximum HP of the enemies we face, but I would still like to track (using the log) damage dealt to each creature on every turn. However, because of the bug, the log says these creatures are knocked unconscious every time they take any damage, even though this status should not automatically be applied, and it says it twice when I add it manually.

Possible solution to part 1?:

Looking into the code (though this is not a coding language I know), it seems like change.hp is set as a variable (tracker.ts lines 512 and 1276) just the line before the check if the creature HP is <= 0. This check is thus before the function which updates creature.hp is called, I think? So it appears to be checking if the old HP is <= 0 in order to set message.unc = true rather than checking if the new HP is <=0.

Possible solution to part 2?:

Rather than having separate key:value pairs (in logger.ts and logger.types.ts) in the UpdateMessageLog type for status and unconscious (unc), perhaps it would be simpler to just have status. The simplest method would then just apply the status tag "Unconscious" when HP is <= 0 (if Auto Apply Unconscious is enabled), and the log would read "Creature took X damage and took Unconscious status." Less pretty than "was knocked unconscious" but all around functional.

With a little extra work, maybe you could add a text field to each status in the settings which would determine how the status was displayed in the log, with the default being something like "is status_name" (as most statuses, like blinded, paralyzed, etc. would work quite well this way, grammatically). "Creature takes 2 damage and is paralyzed." But that way one has the freedom, if desired, to add for example a Sleeping condition with the preferred log text "falls asleep". Unconscious could then be easily changed to "falls unconscious" or "is knocked unconscious". Invisible could be "turns invisible" or "becomes invisible", Petrified could be "is turned to stone". However people want it to appear in the log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant