Skip to content

Conversation

@jimsworld
Copy link
Contributor

  • Added a variety of set values for Hazard Damage.
  • Added Hazard Damage log.

jimsworld and others added 30 commits March 11, 2025 11:43
First commit.
This file is the most up to date version since our last PM.
Removed unnecessary lowbattery function.
- reduced indentation and increased readability
- Added a list of instance variables to track timers. The remaining timers will be implemented properly next.
- Added a new method to HEVTimer, expired(), to check if a timer has expired.
- Redone the Clash logic to utilise the new HEVTimer class and respect the Debounce period.
- Removed logs and cleaned up Clash function.
- Removed CLASH_DEBOUNCE_MS from hev.h to hev_config.h. Renamed to HEV_CLASH_DEBOUNCE_MS. Default is 300ms.
- Removed expired() method and reworked check()
- Cleaned up the Clash function to account for the newer check() method
- Added a new method in HEVTimer to account for the hazarddecrease() function
- The new HEVTimer method is called hazard_sequence()
- It adheres and controls the timing for the delay before hazard damage then how frequent damage is applied
- By default, the delay is set to 6s to allow for the voice line to finish then damage is applied every 1s
- Damage per second will improved in a future update with random values per per damage tick
- Added new method called ready() to check if a specified time interval has elapsed since the timer started.
- Added checks on button presses to ensure the health_increase_timer and armor_increase_timer are started and reset correctly.
- When health and armor was at 100, increasing briefly allowed to go up to 101 before capping to 100.
- This was fixed by reordering to check if capped before increasing.
- Made the HEVTimer code more consise and added comments.
- Made ammendments based on latests reviews.
- Added more comments for clarity.
- Updated HEVTimer to be more consise and easier to use.
- Renamed all timers by prefixing with timer_ for clarity.
- Renamed HEVTimer to HEVTimerBase.
- Created new HEVTimerHazard subclass for hazard-specific timing:

    1. HEVTimerBase - Handles basic interval timing with:

        - Tracking active state
        - Start time
        - Simple interval checking
        - Basic configuration

    2. HEVTimerHazard - Extends HEVTimerBase for the specific hazard timing needs:

        - Adds next_tick_ for drift-free recurring events
        - Adds delay_ for initial grace periods
        - The specialized hazard_sequence() method
- This fixed the persistent stun02.wav issue used by hazards.
- Also removed comment bloat in Clash function.
- This class is no longer used, as the hazard delay logic has been refactored into HazardDecrease().
- Now provides a comprehensive overview of the HEV suit's functionality.
jimsworld and others added 17 commits July 17, 2025 11:24
- Made terminlogy more consistent.
- Added new EFFECTS.
- Updated top comment detailing how Minor and Major voice feedback works.
- added #ifndef and #endif to top defines.
- made else statements more readable.
- removed redundant .done() function and calls, it was only used once in HazardDecrease.
- replaced with if (!timer_hazard_delay_.running()).
- Rejigged DoDamage() to accept a damage type parameter.
- Added DAMAGE_HAZARD and DAMAGE_PHYSICAL constants for clarity.
- Updated calls to DoDamage() to specify the damage type.
- Added previous_health and previous_armor  to help track death sound and armor compromised so they play reliably.
- Removed the 'health at 0' condition preventing armor_readout from playing.
- Hazard Damage no longer limited to 1s intervals.
- If Heat/Shock hazard is triggered, start a surge timer.
- Surge timer only lasts for a short time (randomised between min and max).

void configure(uint32_t interval) { interval_ = interval; }
void configure_random(uint32_t min_ms, uint32_t max_ms) {
interval_ = min_ms + random(max_ms - min_ms + 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in a different PR.

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

Successfully merging this pull request may close these issues.

2 participants