DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CommonCold.c
См. документацию.
2{
3 const int AGENT_THRESHOLD_ACTIVATE = 100;
5
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;
10
11 private const int TEMPORARY_RESISTANCE_TIME = 900;
12
14
23
24 override string GetDebugText()
25 {
26 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
27 }
28
29 override bool ActivateCondition(PlayerBase player)
30 {
31 if (player.GetSingleAgentCount(eAgents.INFLUENZA) >= AGENT_THRESHOLD_ACTIVATE)
32 return true;
33
34 return false;
35 }
36
37 override protected void OnActivate(PlayerBase player)
38 {
39 player.IncreaseDiseaseCount();
40
41 m_ModifiersManager = player.GetModifiersManager();
42 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_SNEEZE);
43 }
44
45 override protected void OnDeactivate(PlayerBase player)
46 {
47 player.DecreaseDiseaseCount();
48
49 player.SetTemporaryResistanceToAgent(eAgents.INFLUENZA, TEMPORARY_RESISTANCE_TIME);
50 }
51
52 override protected bool DeactivateCondition(PlayerBase player)
53 {
54 return (player.GetSingleAgentCount(eAgents.INFLUENZA) <= AGENT_THRESHOLD_DEACTIVATE);
55 }
56
57 override protected void OnTick(PlayerBase player, float deltaT)
58 {
59 float chanceOfSneeze = Math.Clamp(player.GetSingleAgentCountNormalized(eAgents.INFLUENZA),0.4,0.75);
60
62 if (m_ModifiersManager.IsModifierActive(eModifiers.MDF_PAINKILLERS) || m_ModifiersManager.IsModifierActive(eModifiers.MDF_MORPHINE))
64
65 if (Math.RandomFloat01() < chanceOfSneeze / randomDivider)
66 {
67 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_SNEEZE);
68 }
69 }
70}
eAgents
Определения EAgents.c:3
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Определения Effect.c:49
bool m_TrackActivatedTime
overall time this modifier was active
Определения ModifierBase.c:14
bool m_AnalyticsStatsEnabled
Определения ModifierBase.c:31
float m_TickIntervalActive
Определения ModifierBase.c:18
float m_TickIntervalInactive
Определения ModifierBase.c:17
const int DEFAULT_TICK_TIME_INACTIVE
Определения ModifiersManager.c:29
void ModifiersManager(PlayerBase player)
Определения ModifiersManager.c:80
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
const int SNEEZE_RND_DIVIDER_SUPPRESSED_MAX
Определения CommonCold.c:9
bool DeactivateCondition(PlayerBase player)
Определения CommonCold.c:52
const int SNEEZE_RND_DIVIDER_NORMAL_MAX
Определения CommonCold.c:7
const int AGENT_THRESHOLD_DEACTIVATE
Определения CommonCold.c:4
void OnDeactivate(PlayerBase player)
Определения CommonCold.c:45
override string GetDebugText()
Определения CommonCold.c:24
override void Init()
Определения CommonCold.c:15
const int TEMPORARY_RESISTANCE_TIME
Определения CommonCold.c:11
const int SNEEZE_RND_DIVIDER_NORMAL_MIN
Определения CommonCold.c:6
const int AGENT_THRESHOLD_ACTIVATE
Определения CommonCold.c:3
const int SNEEZE_RND_DIVIDER_SUPPRESSED_MIN
Определения CommonCold.c:8
override bool ActivateCondition(PlayerBase player)
Определения CommonCold.c:29
void OnActivate(PlayerBase player)
Определения CommonCold.c:37
ModifiersManager m_ModifiersManager
Определения CommonCold.c:13
void OnTick(PlayerBase player, float deltaT)
Определения CommonCold.c:57
Определения CommonCold.c:2
Определения EnMath.c:7
Определения BreathVapourMdfr.c:4
Определения PlayerBaseClient.c:2
eModifiers
Определения eModifiers.c:2
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:126
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].