3 const int AGENT_THRESHOLD_ACTIVATE = 100;
4 const int AGENT_THRESHOLD_DEACTIVATE = 0;
6 private const int SNEEZE_RND_DIVIDER_NORMAL_MIN = 15;
7 private const int SNEEZE_RND_DIVIDER_NORMAL_MAX = 20;
8 private const int SNEEZE_RND_DIVIDER_SUPPRESSED_MIN = 30;
9 private const int SNEEZE_RND_DIVIDER_SUPPRESSED_MAX = 40;
11 private const int TEMPORARY_RESISTANCE_TIME = 900;
24 override string GetDebugText()
29 override bool ActivateCondition(
PlayerBase player)
39 player.IncreaseDiseaseCount();
41 m_ModifiersManager = player.GetModifiersManager();
42 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_SNEEZE);
47 player.DecreaseDiseaseCount();
49 player.SetTemporaryResistanceToAgent(
eAgents.INFLUENZA, TEMPORARY_RESISTANCE_TIME);
54 return (player.GetSingleAgentCount(
eAgents.INFLUENZA) <= AGENT_THRESHOLD_DEACTIVATE);
59 float chanceOfSneeze =
Math.Clamp(player.GetSingleAgentCountNormalized(
eAgents.INFLUENZA),0.4,0.75);
61 float randomDivider =
Math.RandomInt(SNEEZE_RND_DIVIDER_NORMAL_MIN, SNEEZE_RND_DIVIDER_NORMAL_MAX);
62 if (m_ModifiersManager.IsModifierActive(
eModifiers.MDF_PAINKILLERS) || m_ModifiersManager.IsModifierActive(
eModifiers.MDF_MORPHINE))
63 randomDivider =
Math.RandomInt(SNEEZE_RND_DIVIDER_SUPPRESSED_MIN, SNEEZE_RND_DIVIDER_SUPPRESSED_MAX);
65 if (
Math.RandomFloat01() < chanceOfSneeze / randomDivider)
67 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_SNEEZE);
bool DeactivateCondition(PlayerBase player)
void OnDeactivate(PlayerBase player)
void OnActivate(PlayerBase player)
void OnTick(PlayerBase player, float deltaT)
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