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

Protected Member Functions

bool ActivateCondition (PlayerBase player)
 
void OnActivate (PlayerBase player)
 
void OnDeactivate (PlayerBase player)
 
bool DeactivateCondition (PlayerBase player)
 
void OnTick (PlayerBase player, float deltaT)
 

Private Member Functions

override void Init ()
 
override string GetDebugText ()
 

Private Attributes

const int SHAKE_INTERVAL_MIN = 1
 
const int SHAKE_INTERVAL_MAX = 4
 
float m_Time
 
float m_ShakeTime
 

Static Private Attributes

static const int AGENT_THRESHOLD_ACTIVATE = 2000
 
static const int AGENT_THRESHOLD_DEACTIVATE = 0
 

Detailed Description

Definition at line 1 of file BrainDisease.c.

Member Function Documentation

◆ ActivateCondition()

bool BrainDiseaseMdfr::ActivateCondition ( PlayerBase player)
inlineprotected

Definition at line 25 of file BrainDisease.c.

26 {
27 if (player.GetSingleAgentCount(eAgents.BRAIN) >= AGENT_THRESHOLD_ACTIVATE)
28 return true;
29 else
30 return false;
31 }
eAgents
Definition EAgents.c:3
static const int AGENT_THRESHOLD_ACTIVATE
Definition BrainDisease.c:3

References AGENT_THRESHOLD_ACTIVATE.

◆ DeactivateCondition()

bool BrainDiseaseMdfr::DeactivateCondition ( PlayerBase player)
inlineprotected

Definition at line 43 of file BrainDisease.c.

44 {
45 if (player.GetSingleAgentCount(eAgents.BRAIN) <= AGENT_THRESHOLD_DEACTIVATE)
46 return true;
47 else
48 return false;
49 }
static const int AGENT_THRESHOLD_DEACTIVATE
Definition BrainDisease.c:4

References AGENT_THRESHOLD_DEACTIVATE.

◆ GetDebugText()

override string BrainDiseaseMdfr::GetDebugText ( )
inlineprivate

Definition at line 20 of file BrainDisease.c.

21 {
22 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
23 }

References AGENT_THRESHOLD_ACTIVATE, and AGENT_THRESHOLD_DEACTIVATE.

◆ Init()

override void BrainDiseaseMdfr::Init ( )
inlineprivate

Definition at line 12 of file BrainDisease.c.

13 {
15 m_ID = eModifiers.MDF_BRAIN;
18 }
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()

void BrainDiseaseMdfr::OnActivate ( PlayerBase player)
inlineprotected

Definition at line 33 of file BrainDisease.c.

34 {
35 player.IncreaseDiseaseCount();
36 }

◆ OnDeactivate()

void BrainDiseaseMdfr::OnDeactivate ( PlayerBase player)
inlineprotected

Definition at line 38 of file BrainDisease.c.

39 {
40 player.DecreaseDiseaseCount();
41 }

◆ OnTick()

void BrainDiseaseMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprotected

Definition at line 51 of file BrainDisease.c.

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 }
const int SHAKE_INTERVAL_MIN
Definition BrainDisease.c:5
const int SHAKE_INTERVAL_MAX
Definition BrainDisease.c:6
static void SendKuruRequest(DayZPlayer pPlayer, float amount)
Definition EnMath.c:7
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].

References m_ShakeTime, m_Time, Math::RandomFloat(), Math::RandomFloat01(), DayZPlayerSyncJunctures::SendKuruRequest(), SHAKE_INTERVAL_MAX, and SHAKE_INTERVAL_MIN.

Member Data Documentation

◆ AGENT_THRESHOLD_ACTIVATE

const int BrainDiseaseMdfr::AGENT_THRESHOLD_ACTIVATE = 2000
staticprivate

Definition at line 3 of file BrainDisease.c.

Referenced by ActivateCondition(), and GetDebugText().

◆ AGENT_THRESHOLD_DEACTIVATE

const int BrainDiseaseMdfr::AGENT_THRESHOLD_DEACTIVATE = 0
staticprivate

Definition at line 4 of file BrainDisease.c.

Referenced by DeactivateCondition(), and GetDebugText().

◆ m_ShakeTime

float BrainDiseaseMdfr::m_ShakeTime
private

Definition at line 10 of file BrainDisease.c.

Referenced by OnTick().

◆ m_Time

float BrainDiseaseMdfr::m_Time
private

Definition at line 9 of file BrainDisease.c.

Referenced by OnTick().

◆ SHAKE_INTERVAL_MAX

const int BrainDiseaseMdfr::SHAKE_INTERVAL_MAX = 4
private

Definition at line 6 of file BrainDisease.c.

Referenced by OnTick().

◆ SHAKE_INTERVAL_MIN

const int BrainDiseaseMdfr::SHAKE_INTERVAL_MIN = 1
private

Definition at line 5 of file BrainDisease.c.

Referenced by OnTick().


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