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

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

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

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

override void Init ()
 
override string GetDebugText ()
 

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

float m_ExhaustionTimer
 
bool m_Exhaustion
 

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

static const int AGENT_THRESHOLD_ACTIVATE = 250
 
static const int AGENT_THRESHOLD_DEACTIVATE = 50
 
static const int CHANCE_OF_VOMIT = 10
 
static const int CHANCE_OF_VOMIT_AGENT = 30
 
static const int WATER_DRAIN_FROM_VOMIT = 450
 
static const int ENERGY_DRAIN_FROM_VOMIT = 310
 
static const float WATER_LOSS_CHOLERA = 0.5
 
static const float WATER_LOSS_CHOLERA_MIN = 0.1
 
static const float STOMACH_MIN_VOLUME = 200
 

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

Методы

◆ ActivateCondition()

bool ActivateCondition ( PlayerBase player)
inlineprotected
32 {
33 return (player.GetSingleAgentCount(eAgents.CHOLERA) >= AGENT_THRESHOLD_ACTIVATE);
34 }
eAgents
Definition EAgents.c:3
static const int AGENT_THRESHOLD_ACTIVATE
Definition Cholera.c:3
Definition EntityAI.c:95

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

◆ DeactivateCondition()

bool DeactivateCondition ( PlayerBase player)
inlineprotected
59 {
60 return (player.GetSingleAgentCount(eAgents.CHOLERA) <= AGENT_THRESHOLD_DEACTIVATE);
61 }
static const int AGENT_THRESHOLD_DEACTIVATE
Definition Cholera.c:4

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

◆ GetDebugText()

override string GetDebugText ( )
inlineprivate
27 {
28 return ("Activate threshold: "+AGENT_THRESHOLD_ACTIVATE + "| " +"Deativate threshold: "+AGENT_THRESHOLD_DEACTIVATE);
29 }

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

◆ Init()

override void Init ( )
inlineprivate
18 {
21 m_ID = eModifiers.MDF_CHOLERA;
24 }
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
37 {
38 player.IncreaseDiseaseCount();
39
40 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom( SymptomIDs.SYMPTOM_VOMIT );
41 if (symptom)
42 {
45 symptom.SetDuration(Math.RandomIntInclusive(4.0, 8.0));
46 }
47 }
Definition UtilityClasses.c:10
static ref Param1< float > PARAM1_FLOAT
Definition UtilityClasses.c:13
Definition EnMath.c:7
Definition StateBase.c:2
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

Перекрестные ссылки CachedObjectsParams::PARAM1_FLOAT и Math::RandomIntInclusive().

◆ OnDeactivate()

void OnDeactivate ( PlayerBase player)
inlineprotected
50 {
51 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
52 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
53 m_Exhaustion = false;
55 player.DecreaseDiseaseCount();
56 }
EStaminaMultiplierTypes
Definition StaminaHandler.c:2
bool m_Exhaustion
Definition Cholera.c:15
float m_ExhaustionTimer
Definition Cholera.c:14

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

◆ OnTick()

void OnTick ( PlayerBase player,
float deltaT )
inlineprotected
64 {
65 float waterLoss = ( deltaT * ( WATER_LOSS_CHOLERA * Math.Max( WATER_LOSS_CHOLERA_MIN, player.GetSingleAgentCountNormalized( eAgents.CHOLERA ) ) ) );
66 player.GetStatWater().Add(-waterLoss);
67
68 float stomachVolume = player.m_PlayerStomach.GetStomachVolume();
70 {
71 int roll = Math.RandomInt( 0, 100 );
72 if( roll < ( CHANCE_OF_VOMIT + ( CHANCE_OF_VOMIT_AGENT * player.GetSingleAgentCountNormalized( eAgents.CHOLERA ) ) ) )
73 {
74 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom( SymptomIDs.SYMPTOM_VOMIT );
75 if (symptom)
76 {
79 symptom.SetDuration(Math.RandomIntInclusive(4.0, 8.0));
80
81 if (m_Player.GetStatWater().Get() > (WATER_DRAIN_FROM_VOMIT))
82 m_Player.GetStatWater().Add(-1 * WATER_DRAIN_FROM_VOMIT);
83 if (m_Player.GetStatEnergy().Get() > (ENERGY_DRAIN_FROM_VOMIT))
84 m_Player.GetStatEnergy().Add(-1 * ENERGY_DRAIN_FROM_VOMIT);
85
86 player.GetStaminaHandler().ActivateRecoveryModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
87 player.GetStaminaHandler().ActivateDepletionModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
88
89 m_Exhaustion = true;
91 }
92 }
93 }
94
95 if (m_Exhaustion)
96 {
98 if (m_ExhaustionTimer >= 30)
99 {
100 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
101 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
102
103 m_Exhaustion = false;
104 }
105 }
106 }
DayZPlayer m_Player
Definition Hand_Events.c:42
static const int CHANCE_OF_VOMIT_AGENT
Definition Cholera.c:7
static const float STOMACH_MIN_VOLUME
Definition Cholera.c:12
static const float WATER_LOSS_CHOLERA
Definition Cholera.c:10
static const int WATER_DRAIN_FROM_VOMIT
Definition Cholera.c:8
static const int CHANCE_OF_VOMIT
Definition Cholera.c:6
static const float WATER_LOSS_CHOLERA_MIN
Definition Cholera.c:11
static const int ENERGY_DRAIN_FROM_VOMIT
Definition Cholera.c:9
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].

Перекрестные ссылки CHANCE_OF_VOMIT, CHANCE_OF_VOMIT_AGENT, ENERGY_DRAIN_FROM_VOMIT, m_Exhaustion, m_ExhaustionTimer, m_Player, Math::Max(), CachedObjectsParams::PARAM1_FLOAT, Math::RandomInt(), Math::RandomIntInclusive(), STOMACH_MIN_VOLUME, WATER_DRAIN_FROM_VOMIT, WATER_LOSS_CHOLERA и WATER_LOSS_CHOLERA_MIN.

Поля

◆ AGENT_THRESHOLD_ACTIVATE

const int AGENT_THRESHOLD_ACTIVATE = 250
staticprivate

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

◆ AGENT_THRESHOLD_DEACTIVATE

const int AGENT_THRESHOLD_DEACTIVATE = 50
staticprivate

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

◆ CHANCE_OF_VOMIT

const int CHANCE_OF_VOMIT = 10
staticprivate

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

◆ CHANCE_OF_VOMIT_AGENT

const int CHANCE_OF_VOMIT_AGENT = 30
staticprivate

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

◆ ENERGY_DRAIN_FROM_VOMIT

const int ENERGY_DRAIN_FROM_VOMIT = 310
staticprivate

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

◆ m_Exhaustion

bool m_Exhaustion
private

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

◆ m_ExhaustionTimer

float m_ExhaustionTimer
private

Используется в OnDeactivate() и 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().

◆ WATER_LOSS_CHOLERA

const float WATER_LOSS_CHOLERA = 0.5
staticprivate

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

◆ WATER_LOSS_CHOLERA_MIN

const float WATER_LOSS_CHOLERA_MIN = 0.1
staticprivate

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


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