Page MenuHomeFeedback Tracker

Blood regen modifiers go to low when energy/water are higher than medium
Closed, ResolvedPublic

Description

I was looking at the blood regen scripts in my P drive and noticed this code:

	float GetRegenModifierWater(float water)
	{
		float modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_WATER_HIGH;
		int water_level = m_Player.GetStatLevelWater();
		
		/*
		if( water < PlayerConstants.BLOOD_REGEN_THRESHOLD_WATER_MID ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_WATER_MID}
		if( water < PlayerConstants.BLOOD_REGEN_THRESHOLD_WATER_LOW ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_WATER_LOW}
		*/
		
		if( water_level == EStatLevels.MEDIUM ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_WATER_MID}
		if( water_level >= EStatLevels.LOW ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_WATER_LOW}
		
		return modifier;
	}
	
	float GetRegenModifierEnergy(float energy)
	{
		float modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_ENERGY_HIGH;
		int energy_level = m_Player.GetStatLevelEnergy();
				
		//if( energy < PlayerConstants.BLOOD_REGEN_THRESHOLD_ENERGY_MID ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_ENERGY_MID}
		//if( energy < PlayerConstants.BLOOD_REGEN_THRESHOLD_ENERGY_LOW ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_ENERGY_LOW}
		
		if( energy_level == EStatLevels.MEDIUM ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_ENERGY_MID}
		if( energy_level >= EStatLevels.LOW ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_ENERGY_LOW}
		
		return modifier;
	}

As far as I know this will make blood regen slow(er) if a player has his energy and/or water level higher than MEDIUM.

I think this is the I/O of these functions:

Details

Severity
Trivial
Resolution
Open
Reproducibility
Have Not Tried
Operating System
Windows 11 x64
Category
Health System

Event Timeline

boeman created this task.Jul 4 2023, 11:00 AM
Geez changed the task status from New to Awaiting internal Testing.Jul 10 2023, 10:58 AM
Geez closed this task as Resolved.Jul 14 2023, 10:52 AM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello boeman.

Code is written correctly. This is a correct input/output of those functions:
GREAT: BLOOD_REGEN_MODIFIER_level_HIGH
HIGH: BLOOD_REGEN_MODIFIER_level_HIGH
MEDIUM: BLOOD_REGEN_MODIFIER_level_MID
LOW: BLOOD_REGEN_MODIFIER_level_LOW
CRITICAL: BLOOD_REGEN_MODIFIER_level_LOW
enum EStatLevels
{

GREAT,
HIGH,
MEDIUM,
LOW,
CRITICAL,

}
Function means, that:
default modifier is PlayerConstants.blood_regen_modifier_high - GREAT and HIGH levels,
MID blood regen modifier - MEDIUM level,
LOW blood regen modifier - LOW and CRITICAL levels (everything that is greater than (or equal) EStatLevels.LOW, means worse in this case (Low and Critical levels respectively))

Ok, thanks for clarification. I noticed where I was reasoning about the code in a wrong manner.