Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8ddd7a9
Create hev.h
jimsworld Mar 11, 2025
0bb235c
Move hev.h to props directory
jimsworld Mar 12, 2025
f420319
Remove hev.h from root directory
jimsworld Mar 12, 2025
a8964f9
Uploading hev_config.h
jimsworld Mar 26, 2025
bd26622
Merge branch 'profezzorn:master' into patch-1
jimsworld Mar 26, 2025
1c653b8
Updated hev.h accounting changes from old branch
jimsworld Mar 27, 2025
27291d5
Removed hev_config.h
jimsworld Mar 27, 2025
e867fa3
Delay Hazard Damage
jimsworld Mar 28, 2025
57ed294
Update hev.h
jimsworld Apr 1, 2025
acba631
removed extra empty line
jimsworld Apr 1, 2025
f5cac73
Removed all extra lines
Apr 3, 2025
4bdb790
Removed /////// from the end of each function name
jimsworld Apr 9, 2025
e7138bc
Fixed indentation consistency
jimsworld Apr 9, 2025
2f33e2c
Inverted initial if statement in HazardDecrease
jimsworld Apr 10, 2025
145f483
Added descriptions for all sounds currently needed
jimsworld Apr 14, 2025
9aa5d40
Merge branch 'profezzorn:master' into props-hev.h
jimsworld Apr 16, 2025
3abec2d
Introduced HEVTimer class to manage timing events
jimsworld Apr 25, 2025
ba7c614
HEVTimer class reworked:
jimsworld Apr 25, 2025
8ce7404
Updated Random Hazard and Hazard Decrease function
jimsworld May 8, 2025
98887f4
Updated IncreaseHealth and IncreaseArmor functions
jimsworld May 9, 2025
086f434
Fixed an issue with Increase Health and Armor
jimsworld May 13, 2025
7f41d4c
Utilising prop_base's debounce for Clashes
jimsworld May 29, 2025
95b4317
Merge branch 'profezzorn:master' into props-hev.h
jimsworld May 29, 2025
af83a2b
Commiting updates to work over weekend.
jimsworld Jun 20, 2025
e3956aa
Created new HEVTimer subclass for finer control.
jimsworld Jun 25, 2025
949a816
Removed 3rd argument from DoEffect calls:
jimsworld Jul 2, 2025
7649730
Updated tweaks and changes to hev.h
jimsworld Jul 7, 2025
82098b9
Submitting changes so far, to work away from home.
jimsworld Jul 15, 2025
53e0e37
Removed HEVTimerHazard:
jimsworld Jul 15, 2025
9060279
Complete overhaul of top comment block:
jimsworld Jul 16, 2025
18b4fa9
Comment ammendments.
jimsworld Jul 17, 2025
228bdf3
Merge branch 'profezzorn:master' into props-hev.h
jimsworld Jul 17, 2025
9d02aad
Updated comments and catergorised EFFECTS
jimsworld Jul 18, 2025
cce563c
Added SB_Effect2 and preceding Armor Readout sfx
jimsworld Jul 21, 2025
801f1c7
Latest updates to props/hev.h:
jimsworld Jul 23, 2025
a1b3a8f
Merge branch 'profezzorn:master' into props-hev.h
jimsworld Jul 23, 2025
2ec51e7
Refactored DoDamage():
jimsworld Aug 7, 2025
543b108
Accounting for latest reviews.
jimsworld Aug 15, 2025
3a45bda
Minor amendment for Armor Compromised logic.
jimsworld Aug 15, 2025
cc14c95
Merge branch 'profezzorn:master' into props-hev.h
jimsworld Aug 29, 2025
b44af1d
Merge branch 'profezzorn:master' into props-hev.h
jimsworld Sep 1, 2025
e261f7f
Merge branch 'profezzorn:master' into props-hev.h
jimsworld Nov 1, 2025
c3c3a51
Fixed Armor Readout not firing properly.
jimsworld Nov 4, 2025
f9d12a7
Randomised Hazard Damage interval.
jimsworld Nov 7, 2025
1d8c464
testing
NoSloppy Nov 14, 2025
ab4efbd
Merge pull request #1 from jimsworld/test_push_BC
jimsworld Nov 15, 2025
356fac0
Merge branch 'profezzorn:master' into hev
jimsworld Dec 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
testing 1 2 3
39 changes: 23 additions & 16 deletions props/hev.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@
// - Delay (ms) before Hazard damage starts after checking and //
// triggering Hazard. Allows time for HEV Voice Line to finish. //
// //
// HEV_HAZARD_DECREASE_MS //
// - Time (ms) between each tick of Hazard damage. //
// Lower = faster damage-over-time. //
// HEV_HAZARD_DECREASE_MIN_MS //
// - Minimum time (ms) between each tick of Hazard damage. //
// //
// HEV_HAZARD_DECREASE_MAX_MS //
// - Maximum time (ms) between each tick of Hazard damage. //
// //
// HEV_HAZARD_AFTER_REVIVE_MS //
// - Time (ms) after reviving before Hazards can happen again. //
Expand All @@ -314,8 +316,11 @@
#ifndef HEV_HAZARD_DELAY_MS
#define HEV_HAZARD_DELAY_MS 6000
#endif
#ifndef HEV_HAZARD_DECREASE_MS
#define HEV_HAZARD_DECREASE_MS 1000
#ifndef HEV_HAZARD_DECREASE_MIN_MS
#define HEV_HAZARD_DECREASE_MIN_MS 1000
#endif
#ifndef HEV_HAZARD_DECREASE_MAX_MS
#define HEV_HAZARD_DECREASE_MAX_MS 4000
#endif
#ifndef HEV_HAZARD_AFTER_REVIVE_MS
#define HEV_HAZARD_AFTER_REVIVE_MS 60000
Expand Down Expand Up @@ -353,22 +358,19 @@ EFFECT(stun);

struct HEVTimerBase {
uint32_t start_ = 0;

uint32_t interval_ = 0;

bool active_ = false;

void reset() { active_ = false; }

void start() { active_ = true; start_ = millis(); }

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 selects an interval during startup, that's probably not what you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it was best to keep timing related stuff in the HEVTimer.

Is it not randomising in the HazardDecrease method? I've made a change there by adding 2 new parameters. I've tested it and it seems to trigger damage randomly between 1 - 4s, which is what I have min and max ms set as currently.

}

// Returns true if timer is inactive or timeout exceeded.
bool check() {
return !active_ || (millis() - start_ > interval_);
}

bool running() const {
return active_ && (millis() - start_) <= interval_;
}
Expand All @@ -385,8 +387,9 @@ class Hev : public PROP_INHERIT_PREFIX PropBase {
// Debounce to prevent false Clashes. //
// - timer_random_event_ - Interval timer for Random Hazards. //
// Controls how often Hazards can occur.//
// - timer_hazard_delay_ - Delay inbetween event trigger and //
// Hazard dps. Gap for voice to finish. //
// - timer_hazard_delay_ - Delay between event trigger and //
// Hazard DPS. Also used as a gap for //
// voice to end before stun sfx start. //
// - timer_hazard_after_revive_ - Cooldown after user revives. //
// Blocks Hazards until timer is done. //
// - timer_health_increase_ - Interval for Health recharge. //
Expand Down Expand Up @@ -433,7 +436,7 @@ class Hev : public PROP_INHERIT_PREFIX PropBase {

Hazard current_hazard_ = HAZARD_NONE;

// Calculate Physical Damage
// Calculate Physical and Hazard Damage
void DoDamage(int damage, bool quiet = false, DamageType type = DAMAGE_PHYSICAL) {
int previous_health = health_;
int previous_armor = armor_;
Expand Down Expand Up @@ -468,7 +471,7 @@ class Hev : public PROP_INHERIT_PREFIX PropBase {
if (armor_ < 0) armor_ = 0;

// (HEV VOICE LINE) Logic for Armor Compromised
if (previous_armor > 0 && armor_ == 0 && health_ == 0) {
if (previous_armor > 0 && armor_ == 0) {
SaberBase::DoEffect(EFFECT_USER2, 0.0);
PVLOG_NORMAL << "Armor Compromised!\n";
}
Expand Down Expand Up @@ -599,7 +602,11 @@ class Hev : public PROP_INHERIT_PREFIX PropBase {
return;
}

timer_hazard_delay_.configure(HEV_HAZARD_DECREASE_MS);
// Interval for continuous damage is randomized between min and max
timer_hazard_delay_.configure_random(
HEV_HAZARD_DECREASE_MIN_MS,
HEV_HAZARD_DECREASE_MAX_MS
);
timer_hazard_delay_.start();
}
}
Expand Down