-
Notifications
You must be signed in to change notification settings - Fork 94
HEV Hazard Damage Additions #862
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
Open
jimsworld
wants to merge
47
commits into
profezzorn:master
Choose a base branch
from
jimsworld:hev-hazard-damage-adjustments
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
HEV Hazard Damage Additions #862
jimsworld
wants to merge
47
commits into
profezzorn:master
from
jimsworld:hev-hazard-damage-adjustments
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
jimsworld
commented
Nov 11, 2025
- Added a variety of set values for Hazard Damage.
- Added Hazard Damage log.
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.
- 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).
profezzorn
reviewed
Jan 6, 2026
|
|
||
| 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); |
Owner
There was a problem hiding this comment.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.