3 const int AGENT_THRESHOLD_ACTIVATE = 600;
4 const int AGENT_THRESHOLD_DEACTIVATE = 400;
6 private const int COUGH_RND_DIVIDER_NORMAL_MIN = 5;
7 private const int COUGH_RND_DIVIDER_NORMAL_MAX = 20;
8 private const int COUGH_RND_DIVIDER_SUPPRESSED_MIN = 10;
9 private const int COUGH_RND_DIVIDER_SUPPRESSED_MAX = 40;
11 private const int TEMPORARY_RESISTANCE_TIME = 300;
24 override string GetDebugText()
39 player.IncreaseDiseaseCount();
41 m_ModifiersManager = player.GetModifiersManager();
46 player.DecreaseDiseaseCount();
48 player.SetTemporaryResistanceToAgent(
eAgents.INFLUENZA, TEMPORARY_RESISTANCE_TIME);
53 return (player.GetSingleAgentCount(
eAgents.INFLUENZA) <= AGENT_THRESHOLD_DEACTIVATE);
58 float chanceOfCough =
Math.Clamp(player.GetSingleAgentCountNormalized(
eAgents.INFLUENZA),0,0.85);
60 float coughRandomDivider =
Math.RandomInt(COUGH_RND_DIVIDER_NORMAL_MIN, COUGH_RND_DIVIDER_NORMAL_MAX);
61 if (m_ModifiersManager.IsModifierActive(
eModifiers.MDF_PAINKILLERS) || m_ModifiersManager.IsModifierActive(
eModifiers.MDF_MORPHINE))
62 coughRandomDivider =
Math.RandomInt(COUGH_RND_DIVIDER_SUPPRESSED_MIN, COUGH_RND_DIVIDER_SUPPRESSED_MAX);
64 if (
Math.RandomFloat01() < chanceOfCough / coughRandomDivider)
66 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH);
void OnActivate(PlayerBase player)
void OnTick(PlayerBase player, float deltaT)
bool ActivateCondition(PlayerBase player)
void OnDeactivate(PlayerBase player)
bool DeactivateCondition(PlayerBase player)
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
bool m_TrackActivatedTime
overall time this modifier was active
bool m_AnalyticsStatsEnabled
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
void ModifiersManager(PlayerBase player)
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE