DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Contamination2.c
См. документацию.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 100;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 400;
5
6 static const int EVENT_1_INTERVAL_MIN = 20;
7 static const int EVENT_1_INTERVAL_MAX = 40;
8
9 protected float m_NextEvent1;
10 protected float m_Time1;
11
12
13 static const int EVENT_2_INTERVAL_MIN = 200;
14 static const int EVENT_2_INTERVAL_MAX = 400;
15
16 protected float m_NextEvent2;
17 protected float m_Time2;
18
19 override void Init()
20 {
22 m_ID = eModifiers.MDF_CONTAMINATION2;
25 m_SyncID = eModifierSyncIDs.MODIFIER_SYNC_CONTAMINATION2;
26 }
27
28 override string GetDebugText()
29 {
30 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
31 }
32
33 override protected bool ActivateCondition(PlayerBase player)
34 {
35 return ( player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) >= AGENT_THRESHOLD_ACTIVATE && player.GetSingleAgentCount(eAgents.CHEMICAL_POISON) < AGENT_THRESHOLD_DEACTIVATE);
36 }
37
44
45 override protected void OnDeactivate(PlayerBase player)
46 {
47 player.DecreaseDiseaseCount();
48 }
49
50 override protected bool DeactivateCondition(PlayerBase player)
51 {
52 return !ActivateCondition(player);
53 }
54
55 override protected void OnTick(PlayerBase player, float deltaT)
56 {
57
58 m_Time1 += deltaT;
59 m_Time2 += deltaT;
60
61
62 if ( m_Time1 >= m_NextEvent1 )
63 {
64 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_COUGH);
65 m_Time1 = 0;
67 }
68 if ( m_Time2 >= m_NextEvent2 )
69 {
70 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
71 m_Time2 = 0;
73 }
74
75 }
76};
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_AnalyticsStatsEnabled
Определения ModifierBase.c:31
eModifierSyncIDs m_SyncID
Определения ModifierBase.c:28
float m_TickIntervalActive
Определения ModifierBase.c:18
float m_TickIntervalInactive
Определения ModifierBase.c:17
eModifierSyncIDs
Определения ModifiersManager.c:3
const int DEFAULT_TICK_TIME_INACTIVE
Определения ModifiersManager.c:29
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
static const int AGENT_THRESHOLD_DEACTIVATE
Определения Contamination2.c:4
float m_Time1
Определения Contamination2.c:10
static const int EVENT_1_INTERVAL_MIN
Определения Contamination2.c:6
bool DeactivateCondition(PlayerBase player)
Определения Contamination2.c:50
static const int EVENT_2_INTERVAL_MIN
Определения Contamination2.c:13
void OnDeactivate(PlayerBase player)
Определения Contamination2.c:45
override void Init()
Определения Contamination2.c:19
void OnActivate(PlayerBase player)
Определения Contamination2.c:38
float m_NextEvent1
Определения Contamination2.c:9
static const int EVENT_2_INTERVAL_MAX
Определения Contamination2.c:14
bool ActivateCondition(PlayerBase player)
Определения Contamination2.c:33
static const int AGENT_THRESHOLD_ACTIVATE
Определения Contamination2.c:3
static const int EVENT_1_INTERVAL_MAX
Определения Contamination2.c:7
float m_Time2
Определения Contamination2.c:17
float m_NextEvent2
Определения Contamination2.c:16
override string GetDebugText()
Определения Contamination2.c:28
void OnTick(PlayerBase player, float deltaT)
Определения Contamination2.c:55
Определения EnMath.c:7
Определения BreathVapourMdfr.c:4
Определения PlayerBaseClient.c:2
eModifiers
Определения eModifiers.c:2
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:106