DayZ 1.24
Loading...
Searching...
No Matches
BloodRegen.c
Go to the documentation of this file.
2{
10
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 }
19
21 {
22 }
23
24
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 }
33
34 override void OnTick(PlayerBase player, float deltaT)
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 }
46
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 }
62
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 }
76
77
78};
EStatLevels
Definition EStatLevels.c:2
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
DayZPlayer m_Player
Definition Hand_Events.c:42
bool m_TrackActivatedTime
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
override void OnTick(PlayerBase player, float deltaT)
Definition BloodRegen.c:34
override bool ActivateCondition(PlayerBase player)
Definition BloodRegen.c:11
override void Init()
Definition BloodRegen.c:3
float GetRegenModifierEnergy(float energy)
Definition BloodRegen.c:63
override bool DeactivateCondition(PlayerBase player)
Definition BloodRegen.c:25
override void OnActivate(PlayerBase player)
Definition BloodRegen.c:20
float GetRegenModifierWater(float water)
Definition BloodRegen.c:47
static const float BLOOD_REGEN_MODIFIER_WATER_MID
static const float BLOOD_REGEN_MODIFIER_WATER_LOW
static const float BLOOD_REGEN_MODIFIER_ENERGY_HIGH
static const float BLOOD_REGEN_MODIFIER_WATER_HIGH
static const float BLOOD_REGEN_MODIFIER_ENERGY_LOW
static const float BLOOD_REGEN_MODIFIER_ENERGY_MID
static const float BLOOD_REGEN_RATE_PER_SEC
eModifiers
Definition eModifiers.c:2