3 static const int AGENT_THRESHOLD_ACTIVATE = 150;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 0;
6 static const int VOMIT_OCCURRENCES_PER_HOUR_MIN = 60;
7 static const int VOMIT_OCCURRENCES_PER_HOUR_MAX = 120;
9 static const int WATER_DRAIN_FROM_VOMIT = 70;
10 static const int ENERGY_DRAIN_FROM_VOMIT = 55;
21 override string GetDebugText()
23 return (
"Activate threshold: "+AGENT_THRESHOLD_ACTIVATE +
"| " +
"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
26 override bool ActivateCondition(
PlayerBase player)
28 if(player.GetSingleAgentCount(
eAgents.FOOD_POISON) >= AGENT_THRESHOLD_ACTIVATE)
38 override bool DeactivateCondition(
PlayerBase player)
40 if(player.GetSingleAgentCount(
eAgents.FOOD_POISON) <= AGENT_THRESHOLD_DEACTIVATE)
52 player.IncreaseDiseaseCount();
57 this.OnActivate(player);
62 player.DecreaseDiseaseCount();
65 override void OnTick(
PlayerBase player,
float deltaT)
67 int agent_max = PluginTransmissionAgents.GetAgentMaxCount(
eAgents.FOOD_POISON);
68 int agent_count = player.m_AgentPool.GetSingleAgentCount(
eAgents.FOOD_POISON);
69 float stomach_volume = player.m_PlayerStomach.GetStomachVolume();
71 float norm_value =
Math.InverseLerp(0, agent_max, agent_count );
72 float eased_value =
Easing.EaseInCirc(norm_value);
73 float chance =
Math.Lerp(VOMIT_OCCURRENCES_PER_HOUR_MIN, VOMIT_OCCURRENCES_PER_HOUR_MAX, eased_value );
74 chance = (chance / 3600) * deltaT;
76 if(
Math.RandomFloat01() < chance )
78 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
82 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);