DayZ 1.24
Loading...
Searching...
No Matches
BrainDisease.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 2000;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 0;
5 const int SHAKE_INTERVAL_MIN = 1;
6 const int SHAKE_INTERVAL_MAX = 4;
7 //const float SHAKE_INTERVAL_DEVIATION = 1;
8
9 float m_Time;
11
19
20 override string GetDebugText()
21 {
22 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
23 }
24
25 override protected bool ActivateCondition(PlayerBase player)
26 {
27 if (player.GetSingleAgentCount(eAgents.BRAIN) >= AGENT_THRESHOLD_ACTIVATE)
28 return true;
29 else
30 return false;
31 }
32
33 override protected void OnActivate(PlayerBase player)
34 {
35 player.IncreaseDiseaseCount();
36 }
37
38 override protected void OnDeactivate(PlayerBase player)
39 {
40 player.DecreaseDiseaseCount();
41 }
42
43 override protected bool DeactivateCondition(PlayerBase player)
44 {
45 if (player.GetSingleAgentCount(eAgents.BRAIN) <= AGENT_THRESHOLD_DEACTIVATE)
46 return true;
47 else
48 return false;
49 }
50
51 override protected void OnTick(PlayerBase player, float deltaT)
52 {
53 m_Time += deltaT;
54 float brain_agents = player.GetSingleAgentCountNormalized(eAgents.BRAIN) / 8.0;
56
58 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_LAUGHTER);
59
60 if (m_Time >= m_ShakeTime)
61 {
64 }
65
66 }
67};
eAgents
Definition EAgents.c:3
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
static const int AGENT_THRESHOLD_DEACTIVATE
Definition BrainDisease.c:4
void OnTick(PlayerBase player, float deltaT)
void OnActivate(PlayerBase player)
override void Init()
bool DeactivateCondition(PlayerBase player)
static const int AGENT_THRESHOLD_ACTIVATE
Definition BrainDisease.c:3
const int SHAKE_INTERVAL_MIN
Definition BrainDisease.c:5
override string GetDebugText()
bool ActivateCondition(PlayerBase player)
const int SHAKE_INTERVAL_MAX
Definition BrainDisease.c:6
void OnDeactivate(PlayerBase player)
static void SendKuruRequest(DayZPlayer pPlayer, float amount)
Definition EnMath.c:7
eModifiers
Definition eModifiers.c:2
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:126
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].