3 static const int AGENT_THRESHOLD_ACTIVATE = 1;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 40;
6 static const int VOMIT_OCCURRENCES_MIN = 2;
7 static const int VOMIT_OCCURRENCES_MAX = 5;
9 static const int WATER_DRAIN_FROM_VOMIT = 70;
10 static const int ENERGY_DRAIN_FROM_VOMIT = 55;
12 private float m_ExhaustionTimer;
13 private bool m_Exhaustion;
25 override string GetDebugText()
30 override bool ActivateCondition(
PlayerBase player)
35 override bool DeactivateCondition(
PlayerBase player)
37 return !ActivateCondition(player);
42 player.IncreaseDiseaseCount();
55 m_ExhaustionTimer = 0;
56 player.DecreaseDiseaseCount();
59 override void OnTick(
PlayerBase player,
float deltaT)
61 int agentCount = player.m_AgentPool.GetSingleAgentCount(
eAgents.FOOD_POISON);
62 if (agentCount <= AGENT_THRESHOLD_DEACTIVATE)
65 int agentMax = PluginTransmissionAgents.GetAgentMaxCount(
eAgents.FOOD_POISON);
67 float invertedAgentCountValue =
Math.InverseLerp(0, agentMax, agentCount);
68 float chance =
Math.Lerp(VOMIT_OCCURRENCES_MIN, VOMIT_OCCURRENCES_MAX, invertedAgentCountValue);
69 chance = (chance / 300) * deltaT;
71 if (
Math.RandomFloat01() < chance)
73 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
78 symptom.SetDuration(
Math.Max(3.0, 10 * invertedAgentCountValue));
80 player.m_AgentPool.ReduceAgent(
eAgents.FOOD_POISON, 60);
81 if (
m_Player.GetStatWater().Get() > (WATER_DRAIN_FROM_VOMIT))
82 m_Player.GetStatWater().Add(-1 * WATER_DRAIN_FROM_VOMIT);
83 if (
m_Player.GetStatEnergy().Get() > (ENERGY_DRAIN_FROM_VOMIT))
84 m_Player.GetStatEnergy().Add(-1 * ENERGY_DRAIN_FROM_VOMIT);
90 m_ExhaustionTimer = 0;
96 m_ExhaustionTimer += deltaT;
97 if (m_ExhaustionTimer >= 30 * invertedAgentCountValue)
102 m_Exhaustion =
false;
108 static const int VOMIT_OCCURRENCES_PER_HOUR_MIN = 60;
109 static const int VOMIT_OCCURRENCES_PER_HOUR_MAX = 120;