Skip to content

Draft: System specifc Statuses for Actors/Tokens

Ryan Walder requested to merge ryanw/status-effects into master

Intent

  • Add system specific Status map for Actors/Tokens
    • Core status map (Explicit and Implicit)
      • Core statuses do not show in Effects Tab on Character Sheet
      • Exceptions (statuses with AEs)
        • Grappled (Applies -2 to allActions)
        • Iron Grip (Applies -2 to brawling and contortionist)
    • Generate Statuses from Critical Injury Items (from the compendia defined in Settings)
      • Add statusIcon to criticalInjury datamodel
      • Add statusIcon to criticalInjury item sheet
      • When Rolling/Adding a Critical Injury on a Character it should set the relevant Status Icon
      • When Adding a Critical Injury Status on a token it should Add that Critical Injury Item to the Token/Actor
      • When Removing a Critical Injury Status on a token it should Remove that Critical Injury Item from the Token/Actor
    • Dead Status
      • When marking a Combatant dead from the Combat Tracker it should use our status
      • When setting the Dead status from the token hud it should mark the combatant dead in the Combat Tracker
      • The Dead status should be an overlay status (covers token)
    • Provide a Macro to remove statuses from a Token
      • As we are replacing the default statuses from the system and replacing them with our own we need to provide a way for GMs to remove any old statuses from Tokens as they won't be available via the Token HUD
      • We could do this as part of a migration but we can't easily remove old statuses then add in our custom ones automatically so providing an easy way for the GM to do it seems like the best path
    • Condition Lab & Triggler Compatibility/Handling
      • Work out how to handle CLT
        • Make PR to remove the current system integration in CLT
        • CLT does not appear to offer any Hooks for integration
        • CLT uses the same hooks this MR does, this means race conditions if CLT is installed
        • First thoughts when CLT is detected as installed/active are:
          • Disable our statuses and automations
          • Notify the user via ChatMessage
          • See Discord Dscussion
  • Add error checking and notification for mis-configured critical injury rolltables
    • Note: This uses ChatMessage as notifications are transient and easily missed
    • This kinda abuses the fact that the function is indirectly run on Hook.on("ready") we could probably do some better error handling/notification for custom settings but that's way out of scope for this MR
    • image

  • This is meant for a hotfix
  • This is meant for the next release (see milestone)
  • This needs more reviewers than normal; there may be controversy or high complexity
  • This intentionally introduces regressions that will be addressed later
  • There is/will be documentation changes on the wiki
  • Please do not send commits here without coordinating closely with the owner
  • This is a Build System change

Related Issues

Steps to Test

Base functionality:

  1. Checkout / Build / Load
  2. Right Click Token > Status Effects
    • See Core Status Effects
    • See Critical Injury Effects
  3. Add/Remove Statuses
    • All statuses except Grappled & Iron Grip do not show in Character Sheet > Effects tab
    • Grappled & Iron Grip do show in Character Sheet > Effects tab
      • Grappled applies -2 All Actions AE
      • Iron Grip applies -4 All Actions AE
      • Both affect all rolls

Custom Critical Injury Error Message (Quick and dirty)

  1. Checkout
  2. Edit src/modules/utils/cpr-systemUtils.js
    1. Find GetCriticalInjuryItems function
    2. Comment out the line injuries.push(...(await Promise.all(promises)).flat());
    3. Replace with injuries = [];
  3. Build / Load
  4. On load see ChatMessage error message

Custom Critical Injury Error Message (The proper way)

  1. Checkout / Build / Load
  2. Add custom Critical Injury tables as per wiki
    • Make sure to misconfigure this by not actually linking to any items
  3. Make sure you point to your broken Critical Injury tables compendia in Settings
  4. Reload/Refresh
  5. See error message

Future Work

While just having a custom set of statuses is nice we should ideally perform some automation with them:

Nice to haves for this MR:

If these are not implemented in this MR I will raise them as issues

  • Add exclusivity for certain statuses
    • EG: You can only have one onFire status at a time.
    • If you set onFireStrong it should unset onFireMild etc.
  • Add new derivedStats datapoints/getters for statuses where it makes sense.
    • A couple of examples:
      • onFire|poisoned|radiation: { value: bool, level: "mild"}
      • isBlinded|isDeafened|isGrappled: bool
  • Automation for setting Mooks as DEAD when they reach Mortally Wounded
    • System option to enable/disable
  • Chat message when certain statues are present on Combat round start
    • State if a Token/Actor is onFire etc.
    • Potentially add an option to resolve the status (EG: Put out Fire if onFire)
Edited by Ryan Walder

Merge request reports