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

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

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

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

override void Init ()
 
override string GetDebugText ()
 

Закрытые данные

float m_Time
 
float m_NextEvent
 
float m_ExhaustionTimer
 
bool m_Exhaustion
 

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

static const int AGENT_THRESHOLD_ACTIVATE = 60
 
static const int AGENT_THRESHOLD_DEACTIVATE = 20
 
static const int CHANCE_OF_VOMIT = 10
 
static const int CHANCE_OF_VOMIT_AGENT = 20
 
static const int WATER_DRAIN_FROM_VOMIT = 450
 
static const int ENERGY_DRAIN_FROM_VOMIT = 310
 
static const float STOMACH_MIN_VOLUME = 200
 
static const float EVENT_INTERVAL_MIN = 12
 
static const float EVENT_INTERVAL_MAX = 18
 

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

Методы

◆ ActivateCondition()

bool ActivateCondition ( PlayerBase player)
inlineprotected
36 {
37 return player.GetSingleAgentCount(eAgents.SALMONELLA) >= AGENT_THRESHOLD_ACTIVATE);
38 }
eAgents
Definition EAgents.c:3
Definition EntityAI.c:95
static const int AGENT_THRESHOLD_ACTIVATE
Definition Salmonella.c:3

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

◆ DeactivateCondition()

bool DeactivateCondition ( PlayerBase player)
inlineprotected
41 {
42 return player.GetSingleAgentCount(eAgents.SALMONELLA) <= AGENT_THRESHOLD_DEACTIVATE);
43 }
static const int AGENT_THRESHOLD_DEACTIVATE
Definition Salmonella.c:4

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

◆ GetDebugText()

override string GetDebugText ( )
inlineprivate
31 {
32 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
33 }

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

◆ Init()

override void Init ( )
inlineprivate
22 {
25 m_ID = eModifiers.MDF_SALMONELLA;
28 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
overall time this modifier was active
Definition ModifierBase.c:14
bool m_AnalyticsStatsEnabled
Definition ModifierBase.c:31
float m_TickIntervalActive
Definition ModifierBase.c:18
float m_TickIntervalInactive
Definition ModifierBase.c:17
const int DEFAULT_TICK_TIME_INACTIVE
Definition ModifiersManager.c:29
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
eModifiers
Definition eModifiers.c:2

Перекрестные ссылки DEFAULT_TICK_TIME_ACTIVE, DEFAULT_TICK_TIME_INACTIVE, m_AnalyticsStatsEnabled, m_ID, m_TickIntervalActive, m_TickIntervalInactive и m_TrackActivatedTime.

◆ OnActivate()

void OnActivate ( PlayerBase player)
inlineprotected
46 {
47 player.IncreaseDiseaseCount();
48
49 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom( SymptomIDs.SYMPTOM_VOMIT );
50 if (symptom)
51 {
54 symptom.SetDuration(5.0);
55 }
56 }
Definition UtilityClasses.c:10
static ref Param1< float > PARAM1_FLOAT
Definition UtilityClasses.c:13
Definition StateBase.c:2

Перекрестные ссылки CachedObjectsParams::PARAM1_FLOAT.

◆ OnDeactivate()

void OnDeactivate ( PlayerBase player)
inlineprotected
59 {
60 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
61 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
62 m_Exhaustion = false;
64 player.DecreaseDiseaseCount();
65 }
EStaminaMultiplierTypes
Definition StaminaHandler.c:2
bool m_Exhaustion
Definition Salmonella.c:19
float m_ExhaustionTimer
Definition Salmonella.c:17

Перекрестные ссылки m_Exhaustion и m_ExhaustionTimer.

◆ OnTick()

void OnTick ( PlayerBase player,
float deltaT )
inlineprotected
68 {
69 float stomach_volume = player.m_PlayerStomach.GetStomachVolume();
71 {
72 int roll = Math.RandomInt(0, 100);
73 int chanceOfVomit = CHANCE_OF_VOMIT + (CHANCE_OF_VOMIT_AGENT * player.GetSingleAgentCountNormalized(eAgents.SALMONELLA));
74 if (roll < chanceOfVomit)
75 {
76 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
77
78 if (symptom)
79 {
82 symptom.SetDuration(5);
83 player.m_AgentPool.ReduceAgent(eAgents.SALMONELLA, 30.0);
84
85 if (m_Player.GetStatWater().Get() > WATER_DRAIN_FROM_VOMIT)
86 m_Player.GetStatWater().Add(-1 * WATER_DRAIN_FROM_VOMIT);
87 if (m_Player.GetStatEnergy().Get() > ENERGY_DRAIN_FROM_VOMIT)
88 m_Player.GetStatEnergy().Add(-1 * ENERGY_DRAIN_FROM_VOMIT);
89
90 player.GetStaminaHandler().ActivateRecoveryModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
91 player.GetStaminaHandler().ActivateDepletionModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
92
93 m_Exhaustion = true;
95 }
96 }
97 }
98
99 m_Time += deltaT;
100
101 if (m_Time >= m_NextEvent)
102 {
103 m_Time = 0;
105 player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_PAIN_LIGHT);
106 }
107
108 if (m_Exhaustion)
109 {
111 if (m_ExhaustionTimer >= 45)
112 {
113 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.DISEASE_PNEUMONIA);
114 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.DISEASE_PNEUMONIA);
115
116 m_Exhaustion = false;
117 }
118 }
119
120
121 }
DayZPlayer m_Player
Definition Hand_Events.c:42
Definition EnMath.c:7
float m_NextEvent
Definition Salmonella.c:16
static const int CHANCE_OF_VOMIT_AGENT
Definition Salmonella.c:7
static const float STOMACH_MIN_VOLUME
Definition Salmonella.c:10
float m_Time
Definition Salmonella.c:15
static const int WATER_DRAIN_FROM_VOMIT
Definition Salmonella.c:8
static const float EVENT_INTERVAL_MIN
Definition Salmonella.c:12
static const int CHANCE_OF_VOMIT
Definition Salmonella.c:6
static const int ENERGY_DRAIN_FROM_VOMIT
Definition Salmonella.c:9
static const float EVENT_INTERVAL_MAX
Definition Salmonella.c:13
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

Перекрестные ссылки CHANCE_OF_VOMIT, CHANCE_OF_VOMIT_AGENT, ENERGY_DRAIN_FROM_VOMIT, EVENT_INTERVAL_MAX, EVENT_INTERVAL_MIN, m_Exhaustion, m_ExhaustionTimer, m_NextEvent, m_Player, m_Time, CachedObjectsParams::PARAM1_FLOAT, Math::RandomFloatInclusive(), Math::RandomInt(), STOMACH_MIN_VOLUME и WATER_DRAIN_FROM_VOMIT.

Поля

◆ AGENT_THRESHOLD_ACTIVATE

const int AGENT_THRESHOLD_ACTIVATE = 60
staticprivate

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

◆ AGENT_THRESHOLD_DEACTIVATE

const int AGENT_THRESHOLD_DEACTIVATE = 20
staticprivate

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

◆ CHANCE_OF_VOMIT

const int CHANCE_OF_VOMIT = 10
staticprivate

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

◆ CHANCE_OF_VOMIT_AGENT

const int CHANCE_OF_VOMIT_AGENT = 20
staticprivate

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

◆ ENERGY_DRAIN_FROM_VOMIT

const int ENERGY_DRAIN_FROM_VOMIT = 310
staticprivate

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

◆ EVENT_INTERVAL_MAX

const float EVENT_INTERVAL_MAX = 18
staticprivate

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

◆ EVENT_INTERVAL_MIN

const float EVENT_INTERVAL_MIN = 12
staticprivate

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

◆ m_Exhaustion

bool m_Exhaustion
private

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

◆ m_ExhaustionTimer

float m_ExhaustionTimer
private

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

◆ m_NextEvent

float m_NextEvent
private

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

◆ m_Time

float m_Time
private

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

◆ STOMACH_MIN_VOLUME

const float STOMACH_MIN_VOLUME = 200
staticprivate

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

◆ WATER_DRAIN_FROM_VOMIT

const int WATER_DRAIN_FROM_VOMIT = 450
staticprivate

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


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