3 static const int AGENT_THRESHOLD_ACTIVATE = 60;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 20;
6 static const int CHANCE_OF_VOMIT = 10;
7 static const int CHANCE_OF_VOMIT_AGENT = 20;
8 static const int WATER_DRAIN_FROM_VOMIT = 450;
9 static const int ENERGY_DRAIN_FROM_VOMIT = 310;
10 static const float STOMACH_MIN_VOLUME = 200;
12 static const float EVENT_INTERVAL_MIN = 12;
13 static const float EVENT_INTERVAL_MAX = 18;
28 override string GetDebugText()
30 return (
"Activate threshold: "+AGENT_THRESHOLD_ACTIVATE +
"| " +
"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
33 override protected bool ActivateCondition(
PlayerBase player)
35 if(player.GetSingleAgentCount(
eAgents.SALMONELLA) >= AGENT_THRESHOLD_ACTIVATE)
45 override protected void OnActivate(
PlayerBase player)
48 player.IncreaseDiseaseCount();
51 override protected void OnDeactivate(
PlayerBase player)
53 player.DecreaseDiseaseCount();
56 override protected bool DeactivateCondition(
PlayerBase player)
58 if( player.GetSingleAgentCount(
eAgents.SALMONELLA ) <= AGENT_THRESHOLD_DEACTIVATE )
68 override protected void OnTick(
PlayerBase player,
float deltaT)
70 float stomach_volume = player.m_PlayerStomach.GetStomachVolume();
71 if( stomach_volume >= STOMACH_MIN_VOLUME )
73 int roll =
Math.RandomInt( 0, 100 );
74 int chance_of_vomit = CHANCE_OF_VOMIT + ( CHANCE_OF_VOMIT_AGENT * player.GetSingleAgentCountNormalized(
eAgents.SALMONELLA ) );
75 if( roll < chance_of_vomit )
77 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom( SymptomIDs.SYMPTOM_VOMIT );
81 symptom.SetDuration( 5 );
84 if (
m_Player.GetStatWater().Get() > WATER_DRAIN_FROM_VOMIT )
85 m_Player.GetStatWater().Add( -1 * WATER_DRAIN_FROM_VOMIT );
86 if (
m_Player.GetStatEnergy().Get() > ENERGY_DRAIN_FROM_VOMIT )
87 m_Player.GetStatEnergy().Add( -1 * ENERGY_DRAIN_FROM_VOMIT );
94 if (
m_Time >= m_NextEvent )
97 m_NextEvent =
Math.RandomFloatInclusive( EVENT_INTERVAL_MIN, EVENT_INTERVAL_MAX );
98 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);