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

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

override void Init ()
 
override string GetDebugText ()
 
override bool ActivateCondition (PlayerBase player)
 
override bool DeactivateCondition (PlayerBase player)
 
override void OnActivate (PlayerBase player)
 
override void OnReconnect (PlayerBase player)
 
override void OnDeactivate (PlayerBase player)
 
override void OnTick (PlayerBase player, float deltaT)
 

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

float m_ExhaustionTimer
 
bool m_Exhaustion
 

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

static const int AGENT_THRESHOLD_ACTIVATE = 150
 
static const int AGENT_THRESHOLD_DEACTIVATE = 0
 
static const int VOMIT_OCCURRENCES_PER_HOUR_MIN = 60
 
static const int VOMIT_OCCURRENCES_PER_HOUR_MAX = 120
 
static const int WATER_DRAIN_FROM_VOMIT = 70
 
static const int ENERGY_DRAIN_FROM_VOMIT = 55
 

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

Методы

◆ ActivateCondition()

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

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

◆ DeactivateCondition()

override bool DeactivateCondition ( PlayerBase player)
inlineprivate
37 {
38 return (player.GetSingleAgentCount(eAgents.FOOD_POISON) <= AGENT_THRESHOLD_DEACTIVATE);
39 }
static const int AGENT_THRESHOLD_DEACTIVATE
Definition Poisoning.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
17 {
20 m_IsPersistent = true;
21 m_ID = eModifiers.MDF_POISONING;
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
bool m_IsPersistent
should this modifier track overall time it was active ?
Definition ModifierBase.c:15
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_IsPersistent, m_TickIntervalActive, m_TickIntervalInactive и m_TrackActivatedTime.

◆ OnActivate()

override void OnActivate ( PlayerBase player)
inlineprivate
42 {
43 player.IncreaseDiseaseCount();
44
45 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom( SymptomIDs.SYMPTOM_VOMIT );
46 if (symptom)
47 {
50 symptom.SetDuration(5.0);
51 }
52 }
Definition UtilityClasses.c:10
static ref Param1< float > PARAM1_FLOAT
Definition UtilityClasses.c:13
Definition StateBase.c:2

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

◆ OnDeactivate()

override void OnDeactivate ( PlayerBase player)
inlineprivate
60 {
61 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
62 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.VOMIT_EXHAUSTION);
63 m_Exhaustion = false;
65 player.DecreaseDiseaseCount();
66 }
EStaminaMultiplierTypes
Definition StaminaHandler.c:2
bool m_Exhaustion
Definition Poisoning.c:14
float m_ExhaustionTimer
Definition Poisoning.c:13

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

◆ OnReconnect()

override void OnReconnect ( PlayerBase player)
inlineprivate
55 {
56 this.OnActivate(player);
57 }
void OnActivate()
Definition Trap_LandMine.c:67

Перекрестные ссылки OnActivate().

◆ OnTick()

override void OnTick ( PlayerBase player,
float deltaT )
inlineprivate
69 {
70 int agent_max = PluginTransmissionAgents.GetAgentMaxCount(eAgents.FOOD_POISON);
71 int agent_count = player.m_AgentPool.GetSingleAgentCount(eAgents.FOOD_POISON);
72 float stomach_volume = player.m_PlayerStomach.GetStomachVolume();
73
76
78 chance = (chance / 3000) * deltaT;
79
81 {
82 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
83 if (symptom)
84 {
87 symptom.SetDuration(5);
88 player.m_AgentPool.ReduceAgent(eAgents.FOOD_POISON, 80.0);
89
90 if (m_Player.GetStatWater().Get() > (WATER_DRAIN_FROM_VOMIT))
91 m_Player.GetStatWater().Add(-1 * WATER_DRAIN_FROM_VOMIT);
92 if (m_Player.GetStatEnergy().Get() > (ENERGY_DRAIN_FROM_VOMIT))
93 m_Player.GetStatEnergy().Add(-1 * ENERGY_DRAIN_FROM_VOMIT);
94
95 player.GetStaminaHandler().ActivateRecoveryModifier(EStaminaMultiplierTypes.DISEASE_PNEUMONIA);
96 player.GetStaminaHandler().ActivateDepletionModifier(EStaminaMultiplierTypes.DISEASE_PNEUMONIA);
97
98 m_Exhaustion = true;
100 }
101 }
102
103 if (m_Exhaustion)
104 {
106 if ( m_ExhaustionTimer >= 30)
107 {
108 player.GetStaminaHandler().DeactivateRecoveryModifier(EStaminaMultiplierTypes.DISEASE_PNEUMONIA);
109 player.GetStaminaHandler().DeactivateDepletionModifier(EStaminaMultiplierTypes.DISEASE_PNEUMONIA);
110
111 m_Exhaustion = false;
112 }
113 }
114 }
DayZPlayer m_Player
Definition Hand_Events.c:42
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Definition Easing.c:3
static float EaseInCirc(float t)
Definition Easing.c:142
Definition EnMath.c:7
static const int WATER_DRAIN_FROM_VOMIT
Definition Poisoning.c:9
static const int VOMIT_OCCURRENCES_PER_HOUR_MAX
Definition Poisoning.c:7
static const int ENERGY_DRAIN_FROM_VOMIT
Definition Poisoning.c:10
static const int VOMIT_OCCURRENCES_PER_HOUR_MIN
Definition Poisoning.c:6
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
static float RandomFloat01()
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:126
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.

Перекрестные ссылки Easing::EaseInCirc(), ENERGY_DRAIN_FROM_VOMIT, Math::InverseLerp(), Math::Lerp(), m_Exhaustion, m_ExhaustionTimer, m_Player, CachedObjectsParams::PARAM1_FLOAT, Math::RandomFloat01(), VOMIT_OCCURRENCES_PER_HOUR_MAX, VOMIT_OCCURRENCES_PER_HOUR_MIN и WATER_DRAIN_FROM_VOMIT.

Поля

◆ AGENT_THRESHOLD_ACTIVATE

const int AGENT_THRESHOLD_ACTIVATE = 150
staticprivate

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

◆ AGENT_THRESHOLD_DEACTIVATE

const int AGENT_THRESHOLD_DEACTIVATE = 0
staticprivate

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

◆ ENERGY_DRAIN_FROM_VOMIT

const int ENERGY_DRAIN_FROM_VOMIT = 55
staticprivate

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

◆ m_Exhaustion

bool m_Exhaustion
private

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

◆ m_ExhaustionTimer

float m_ExhaustionTimer
private

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

◆ VOMIT_OCCURRENCES_PER_HOUR_MAX

const int VOMIT_OCCURRENCES_PER_HOUR_MAX = 120
staticprivate

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

◆ VOMIT_OCCURRENCES_PER_HOUR_MIN

const int VOMIT_OCCURRENCES_PER_HOUR_MIN = 60
staticprivate

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

◆ WATER_DRAIN_FROM_VOMIT

const int WATER_DRAIN_FROM_VOMIT = 70
staticprivate

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


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