3 static const int AGENT_THRESHOLD_ACTIVATE = 100;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 400;
6 static const int EVENT_1_INTERVAL_MIN = 20;
7 static const int EVENT_1_INTERVAL_MAX = 40;
9 protected float m_NextEvent1;
10 protected float m_Time1;
13 static const int EVENT_2_INTERVAL_MIN = 200;
14 static const int EVENT_2_INTERVAL_MAX = 400;
16 protected float m_NextEvent2;
17 protected float m_Time2;
27 override string GetDebugText()
29 return (
"Activate threshold: "+AGENT_THRESHOLD_ACTIVATE +
"| " +
"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
32 override protected bool ActivateCondition(
PlayerBase player)
34 return ( player.GetSingleAgentCount(
eAgents.CHEMICAL_POISON) >= AGENT_THRESHOLD_ACTIVATE && player.GetSingleAgentCount(
eAgents.CHEMICAL_POISON) < AGENT_THRESHOLD_DEACTIVATE);
37 override protected void OnActivate(
PlayerBase player)
39 player.IncreaseDiseaseCount();
40 m_NextEvent1 =
Math.RandomFloatInclusive( EVENT_1_INTERVAL_MIN, EVENT_1_INTERVAL_MAX );
41 m_NextEvent2 =
Math.RandomFloatInclusive( EVENT_2_INTERVAL_MIN, EVENT_2_INTERVAL_MAX );
44 override protected void OnDeactivate(
PlayerBase player)
46 player.DecreaseDiseaseCount();
49 override protected bool DeactivateCondition(
PlayerBase player)
51 return !ActivateCondition(player);
54 override protected void OnTick(
PlayerBase player,
float deltaT)
61 if ( m_Time1 >= m_NextEvent1 )
63 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH);
65 m_NextEvent1 =
Math.RandomFloatInclusive( EVENT_1_INTERVAL_MIN, EVENT_1_INTERVAL_MAX );
67 if ( m_Time2 >= m_NextEvent2 )
69 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
71 m_NextEvent2 =
Math.RandomFloatInclusive( EVENT_2_INTERVAL_MIN, EVENT_2_INTERVAL_MAX );