This repository has been archived by the owner on May 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
This file contains 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
Frityet
reviewed
Jul 26, 2021
Comment on lines
+17
to
+19
private float RegenToGo; | ||
private float currentRegenDelayLength; | ||
private float healthMonitor; |
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.
Use _hungarianNotation
for private fields, private properties should use CamelCase
Frityet
reviewed
Jul 26, 2021
Comment on lines
+50
to
74
private void RegenerationHandler() | ||
{ | ||
//if player is below RegenCap | ||
if (_hadesSystem.Player.GetPlayerHealth() < | ||
HADESConfig.EnhancedHealth.RegenCap * _hadesSystem.Player.GetMaxHealthPlayerRaw()) | ||
{ | ||
//The health before healing | ||
float curHealth = CurrentHealth; | ||
Logging.Debug.Print($"Current health {curHealth}\nInit health {initHealth}"); | ||
//If the player was damaged (The current health before healing is less than the health before starting regeneration), | ||
//then restart the loop with the cooldown | ||
if (curHealth < initHealth) goto regen; | ||
//TODO: make the player heal in n intervals until the regen cap is reached | ||
Player.HealPercent(i); | ||
//if the delay time's up | ||
if(currentRegenDelayLength >= HADESConfig.EnhancedHealth.RegenDelay * 50) | ||
{ | ||
//if the player's hp is lower than what it was, assume damage taken, lower hp | ||
if (_hadesSystem.Player.GetPlayerHealth() < healthMonitor) | ||
{ | ||
currentRegenDelayLength = 0; | ||
} | ||
|
||
//go add player hp | ||
_hadesSystem.Player.HealPercent(HADESConfig.EnhancedHealth.RegenSpeed * 0.02f); | ||
} else currentRegenDelayLength++; //count down (up?) if the delay time is not finished | ||
} | ||
|
||
Logging.Debug.Print("Done Regeneration"); | ||
else | ||
{ | ||
currentRegenDelayLength = 0; | ||
} | ||
healthMonitor = _hadesSystem.Player.GetPlayerHealth(); | ||
} |
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.
Put into FixedUpdate()
Frityet
suggested changes
Jul 26, 2021
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.
Naming and brevity
im really bored so ill fix it myself |
Open
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.