Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
hemolyticreaction.c
Go to the documentation of this file.
2{
3 private float m_RunningTime;
4
5 override void Init()
6 {
9 m_ID = eModifiers.MDF_HEMOLYTIC_REACTION;
12 m_IsPersistent = true;
13 m_RunningTime = CalculateRunTime();
14
16 }
17 override bool ActivateCondition(PlayerBase player)
18 {
19 return false;
20 }
21
22 override void OnActivate(PlayerBase player)
23 {
24 player.IncreaseDiseaseCount();
25 }
26
27 override void OnDeactivate(PlayerBase player)
28 {
29 player.DecreaseDiseaseCount();
30 }
31
32 override void OnReconnect(PlayerBase player)
33 {
34 OnActivate(player);
35 }
36
37 override bool DeactivateCondition(PlayerBase player)
38 {
39 float attached_time = GetAttachedTime();
40
41 if(attached_time > m_RunningTime )
42 {
43 return true;
44 }
45 else
46 {
47 return false;
48 }
49 }
50
51 override void OnTick(PlayerBase player, float deltaT)
52 {
53 player.AddHealth("","Blood",-PlayerConstants.HEMOLYTIC_BLOOD_DRAIN_PER_SEC * deltaT);
54 }
55
56 float CalculateRunTime()
57 {
58 float time = PlayerConstants.HEMOLYTIC_BLOODLOSS_AMOUNT / PlayerConstants.SALINE_BLOOD_REGEN_PER_SEC;
59 return time;
60 }
61};
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
eModifiers
Definition emodifiers.c:2
bool m_TrackActivatedTime
overall time this modifier was active
float GetAttachedTime()
void DisableActivateCheck()
bool m_AnalyticsStatsEnabled
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
should this modifier track overall time it was active ?
const int DEFAULT_TICK_TIME_INACTIVE
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
void OnActivate()