DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс HeavyMetalPhase2Mdfr
+ Граф наследования:HeavyMetalPhase2Mdfr:

Защищенные члены

bool ActivateCondition (PlayerBase player)
 
bool DeactivateCondition (PlayerBase player)
 
void OnTick (PlayerBase player, float deltaT)
 

Закрытые члены

override void Init ()
 
override string GetDebugText ()
 
- Закрытые члены унаследованные от HeavyMetalMdfr
override void Init ()
 
void OnActivate (PlayerBase player)
 
void OnDeactivate (PlayerBase player)
 

Закрытые статические данные

static const int AGENT_THRESHOLD_ACTIVATE = 200
 
static const int AGENT_THRESHOLD_DEACTIVATE = 400
 
static const int PAIN_EVENT_INTERVAL_MIN = 20
 
static const int PAIN_EVENT_INTERVAL_MAX = 40
 
static const int DEAFNESS_INTERVAL = 3
 

Дополнительные унаследованные члены

- Закрытые данные унаследованные от HeavyMetalMdfr
float m_NextEvent
 
float m_Time
 
float m_DeafnessTime
 
bool m_IsDeaf
 

Подробное описание

Методы

◆ ActivateCondition()

bool ActivateCondition ( PlayerBase player)
inlineprotected
114 {
115 return (player.GetSingleAgentCount(eAgents.HEAVYMETAL) >= AGENT_THRESHOLD_ACTIVATE && player.GetSingleAgentCount(eAgents.HEAVYMETAL) < AGENT_THRESHOLD_DEACTIVATE);
116 }
eAgents
Definition EAgents.c:3
static const int AGENT_THRESHOLD_ACTIVATE
Definition HeavyMetal.c:93
static const int AGENT_THRESHOLD_DEACTIVATE
Definition HeavyMetal.c:94
Definition EntityAI.c:95

Перекрестные ссылки AGENT_THRESHOLD_ACTIVATE и AGENT_THRESHOLD_DEACTIVATE.

◆ DeactivateCondition()

bool DeactivateCondition ( PlayerBase player)
inlineprotected
119 {
120 return (player.GetSingleAgentCount(eAgents.HEAVYMETAL) < AGENT_THRESHOLD_ACTIVATE || player.GetSingleAgentCount(eAgents.HEAVYMETAL) > AGENT_THRESHOLD_DEACTIVATE);
121 }

Перекрестные ссылки AGENT_THRESHOLD_ACTIVATE и AGENT_THRESHOLD_DEACTIVATE.

◆ GetDebugText()

override string GetDebugText ( )
inlineprivate
109 {
110 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
111 }

Перекрестные ссылки AGENT_THRESHOLD_ACTIVATE и AGENT_THRESHOLD_DEACTIVATE.

◆ Init()

override void Init ( )
inlineprivate
102 {
103 super.Init();
104
105 m_ID = eModifiers.MDF_HEAVYMETAL2;
106 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
eModifiers
Definition eModifiers.c:2

Перекрестные ссылки m_ID.

◆ OnTick()

void OnTick ( PlayerBase player,
float deltaT )
inlineprotected
124 {
125 m_Time += deltaT;
126
127 if (m_IsDeaf)
128 {
130 }
131
132 if (m_Time >= m_NextEvent)
133 {
134 if (player.GetSingleAgentCount(eAgents.HEAVYMETAL) >= SYMPTOMFALLOFF_THRESHOLD1)
135 {
136 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
137 m_Time = 0;
138
140 }
141 }
142
143 float chanceOfDeafness = player.GetSingleAgentCountNormalized(eAgents.HEAVYMETAL);
145 {
146 player.GetSymptomManager().QueueUpSecondarySymptom(SymptomIDs.SYMPTOM_DEAFNESS_COMPLETE);
147 m_Time = 0;
148 m_DeafnessTime = 0;
149 m_IsDeaf = true;
150
152 }
153
154 if (m_IsDeaf && m_DeafnessTime > DEAFNESS_INTERVAL + player.GetSingleAgentCountNormalized(eAgents.HEAVYMETAL)*0.6)
155 {
156 player.GetSymptomManager().RemoveSecondarySymptom(SymptomIDs.SYMPTOM_DEAFNESS_COMPLETE);
157 m_IsDeaf = false;
158 }
159
160 if (player.GetSingleAgentCount(eAgents.HEAVYMETAL) <= SYMPTOMFALLOFF_THRESHOLD3 && eAgents.HEAVYMETAL >= SYMPTOMFALLOFF_THRESHOLD1)
161 {
162 float waterLoss = (deltaT * (WATER_LOSS_HEAVYMETAL_MAX * Math.Max(WATER_LOSS_HEAVYMETAL_MIN, player.GetSingleAgentCountNormalized(eAgents.HEAVYMETAL))));
163 player.GetStatWater().Add(-waterLoss);
164 }
165
166 if (player.GetSingleAgentCount(eAgents.HEAVYMETAL) <= SYMPTOMFALLOFF_THRESHOLD3)
167 {
168 player.m_AgentPool.AddAgent(eAgents.HEAVYMETAL, -0.5);
169 }
170 }
float m_NextEvent
Definition HeavyMetal.c:13
float m_Time
Definition HeavyMetal.c:14
static const float WATER_LOSS_HEAVYMETAL_MIN
Definition HeavyMetal.c:3
static const float WATER_LOSS_HEAVYMETAL_MAX
Definition HeavyMetal.c:4
float m_DeafnessTime
Definition HeavyMetal.c:16
static const int SYMPTOMFALLOFF_THRESHOLD3
Definition HeavyMetal.c:11
bool m_IsDeaf
Definition HeavyMetal.c:17
static const int SYMPTOMFALLOFF_THRESHOLD1
Definition HeavyMetal.c:9
static const int DEAFNESS_INTERVAL
Definition HeavyMetal.c:99
static const int PAIN_EVENT_INTERVAL_MIN
Definition HeavyMetal.c:96
static const int PAIN_EVENT_INTERVAL_MAX
Definition HeavyMetal.c:97
Definition EnMath.c:7
static proto float Max(float x, float y)
Returns bigger of two given values.
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:126

Перекрестные ссылки DEAFNESS_INTERVAL, HeavyMetalMdfr::m_DeafnessTime, HeavyMetalMdfr::m_IsDeaf, HeavyMetalMdfr::m_NextEvent, HeavyMetalMdfr::m_Time, Math::Max(), PAIN_EVENT_INTERVAL_MAX, PAIN_EVENT_INTERVAL_MIN, Math::RandomFloat01(), Math::RandomFloatInclusive(), Math::RandomInt(), HeavyMetalMdfr::SYMPTOMFALLOFF_THRESHOLD1, HeavyMetalMdfr::SYMPTOMFALLOFF_THRESHOLD3, HeavyMetalMdfr::WATER_LOSS_HEAVYMETAL_MAX и HeavyMetalMdfr::WATER_LOSS_HEAVYMETAL_MIN.

Поля

◆ AGENT_THRESHOLD_ACTIVATE

const int AGENT_THRESHOLD_ACTIVATE = 200
staticprivate

Используется в ActivateCondition(), DeactivateCondition() и GetDebugText().

◆ AGENT_THRESHOLD_DEACTIVATE

const int AGENT_THRESHOLD_DEACTIVATE = 400
staticprivate

Используется в ActivateCondition(), DeactivateCondition() и GetDebugText().

◆ DEAFNESS_INTERVAL

const int DEAFNESS_INTERVAL = 3
staticprivate

Используется в OnTick().

◆ PAIN_EVENT_INTERVAL_MAX

const int PAIN_EVENT_INTERVAL_MAX = 40
staticprivate

Используется в OnTick().

◆ PAIN_EVENT_INTERVAL_MIN

const int PAIN_EVENT_INTERVAL_MIN = 20
staticprivate

Используется в OnTick().


Объявления и описания членов класса находятся в файле: