DayZ 1.24
Loading...
Searching...
No Matches
BloodRegenMdfr Class Reference
Inheritance diagram for BloodRegenMdfr:
[legend]
Collaboration diagram for BloodRegenMdfr:
[legend]

Private Member Functions

override void Init ()
 
override bool ActivateCondition (PlayerBase player)
 
override void OnActivate (PlayerBase player)
 
override bool DeactivateCondition (PlayerBase player)
 
override void OnTick (PlayerBase player, float deltaT)
 
float GetRegenModifierWater (float water)
 
float GetRegenModifierEnergy (float energy)
 

Detailed Description

Definition at line 1 of file BloodRegen.c.

Member Function Documentation

◆ ActivateCondition()

override bool BloodRegenMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 11 of file BloodRegen.c.

12 {
13 float m_MaxBlood = player.GetMaxHealth("GlobalHealth", "Blood");
14 if (player.GetHealth("GlobalHealth", "Blood") <= m_MaxBlood)
15 return true;
16 else
17 return false;
18 }

◆ DeactivateCondition()

override bool BloodRegenMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 25 of file BloodRegen.c.

26 {
27 float m_MaxBlood = player.GetMaxHealth("GlobalHealth", "Blood");
28 if (player.GetHealth("GlobalHealth", "Blood") >= m_MaxBlood)
29 return true;
30 else
31 return false;
32 }

◆ GetRegenModifierEnergy()

float BloodRegenMdfr::GetRegenModifierEnergy ( float energy)
inlineprivate

Definition at line 63 of file BloodRegen.c.

64 {
66 int energy_level = m_Player.GetStatLevelEnergy();
67
68 //if( energy < PlayerConstants.BLOOD_REGEN_THRESHOLD_ENERGY_MID ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_ENERGY_MID}
69 //if( energy < PlayerConstants.BLOOD_REGEN_THRESHOLD_ENERGY_LOW ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_ENERGY_LOW}
70
73
74 return modifier;
75 }
EStatLevels
Definition EStatLevels.c:2
DayZPlayer m_Player
Definition Hand_Events.c:42
static const float BLOOD_REGEN_MODIFIER_ENERGY_HIGH
static const float BLOOD_REGEN_MODIFIER_ENERGY_LOW
static const float BLOOD_REGEN_MODIFIER_ENERGY_MID

References PlayerConstants::BLOOD_REGEN_MODIFIER_ENERGY_HIGH, PlayerConstants::BLOOD_REGEN_MODIFIER_ENERGY_LOW, PlayerConstants::BLOOD_REGEN_MODIFIER_ENERGY_MID, and m_Player.

Referenced by OnTick().

◆ GetRegenModifierWater()

float BloodRegenMdfr::GetRegenModifierWater ( float water)
inlineprivate

Definition at line 47 of file BloodRegen.c.

48 {
50 int water_level = m_Player.GetStatLevelWater();
51
52 /*
53 if( water < PlayerConstants.BLOOD_REGEN_THRESHOLD_WATER_MID ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_WATER_MID}
54 if( water < PlayerConstants.BLOOD_REGEN_THRESHOLD_WATER_LOW ) {modifier = PlayerConstants.BLOOD_REGEN_MODIFIER_WATER_LOW}
55 */
56
59
60 return modifier;
61 }
static const float BLOOD_REGEN_MODIFIER_WATER_MID
static const float BLOOD_REGEN_MODIFIER_WATER_LOW
static const float BLOOD_REGEN_MODIFIER_WATER_HIGH

References PlayerConstants::BLOOD_REGEN_MODIFIER_WATER_HIGH, PlayerConstants::BLOOD_REGEN_MODIFIER_WATER_LOW, PlayerConstants::BLOOD_REGEN_MODIFIER_WATER_MID, and m_Player.

Referenced by OnTick().

◆ Init()

override void BloodRegenMdfr::Init ( )
inlineprivate

Definition at line 3 of file BloodRegen.c.

4 {
6 m_ID = eModifiers.MDF_BLOOD_REGEN;
9 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
eModifiers
Definition eModifiers.c:2

References DEFAULT_TICK_TIME_ACTIVE, DEFAULT_TICK_TIME_INACTIVE, m_ID, m_TickIntervalActive, m_TickIntervalInactive, and m_TrackActivatedTime.

◆ OnActivate()

override void BloodRegenMdfr::OnActivate ( PlayerBase player)
inlineprivate

Definition at line 20 of file BloodRegen.c.

21 {
22 }

◆ OnTick()

override void BloodRegenMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

Definition at line 34 of file BloodRegen.c.

35 {
36 float regen_modifier_water = GetRegenModifierWater(player.GetStatWater().Get());
37 float regen_modifier_energy = GetRegenModifierEnergy(player.GetStatEnergy().Get());
39 /*
40 PrintString("regen_modifier_water" + regen_modifier_water);
41 PrintString("regen_modifier_energy" + regen_modifier_energy);
42 PrintString("blood_regen_speed" + blood_regen_speed);
43 */
44 player.AddHealth("", "Blood", blood_regen_speed * deltaT);
45 }
float GetRegenModifierEnergy(float energy)
Definition BloodRegen.c:63
float GetRegenModifierWater(float water)
Definition BloodRegen.c:47
static const float BLOOD_REGEN_RATE_PER_SEC

References PlayerConstants::BLOOD_REGEN_RATE_PER_SEC, GetRegenModifierEnergy(), and GetRegenModifierWater().


The documentation for this class was generated from the following file: