DayZ 1.24
Loading...
Searching...
No Matches
PoisoningMdfr Class Reference
Inheritance diagram for PoisoningMdfr:
[legend]
Collaboration diagram for PoisoningMdfr:
[legend]

Private Member Functions

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)
 

Static Private Attributes

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
 

Detailed Description

Definition at line 1 of file Poisoning.c.

Member Function Documentation

◆ ActivateCondition()

override bool PoisoningMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 26 of file Poisoning.c.

27 {
28 if (player.GetSingleAgentCount(eAgents.FOOD_POISON) >= AGENT_THRESHOLD_ACTIVATE)
29 return true;
30 else
31 return false;
32 }
eAgents
Definition EAgents.c:3
static const int AGENT_THRESHOLD_ACTIVATE
Definition Poisoning.c:3

References AGENT_THRESHOLD_ACTIVATE.

◆ DeactivateCondition()

override bool PoisoningMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 34 of file Poisoning.c.

35 {
36 if (player.GetSingleAgentCount(eAgents.FOOD_POISON) <= AGENT_THRESHOLD_DEACTIVATE)
37 return true;
38 else
39 return false;
40 }
static const int AGENT_THRESHOLD_DEACTIVATE
Definition Poisoning.c:4

References AGENT_THRESHOLD_DEACTIVATE.

◆ GetDebugText()

override string PoisoningMdfr::GetDebugText ( )
inlineprivate

Definition at line 21 of file Poisoning.c.

22 {
23 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
24 }

References AGENT_THRESHOLD_ACTIVATE, and AGENT_THRESHOLD_DEACTIVATE.

◆ Init()

override void PoisoningMdfr::Init ( )
inlineprivate

Definition at line 12 of file Poisoning.c.

13 {
15 m_IsPersistent = true;
16 m_ID = eModifiers.MDF_POISONING;
19 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
eModifiers
Definition eModifiers.c:2

References DEFAULT_TICK_TIME_ACTIVE, DEFAULT_TICK_TIME_INACTIVE, m_ID, m_IsPersistent, m_TickIntervalActive, m_TickIntervalInactive, and m_TrackActivatedTime.

◆ OnActivate()

override void PoisoningMdfr::OnActivate ( PlayerBase player)
inlineprivate

Definition at line 42 of file Poisoning.c.

43 {
44 player.IncreaseDiseaseCount();
45 }

◆ OnDeactivate()

override void PoisoningMdfr::OnDeactivate ( PlayerBase player)
inlineprivate

Definition at line 52 of file Poisoning.c.

53 {
54 player.DecreaseDiseaseCount();
55 }

◆ OnReconnect()

override void PoisoningMdfr::OnReconnect ( PlayerBase player)
inlineprivate

Definition at line 47 of file Poisoning.c.

48 {
49 this.OnActivate(player);
50 }
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.
Definition human.c:1167

References OnActivate().

◆ OnTick()

override void PoisoningMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

Definition at line 57 of file Poisoning.c.

58 {
59 int agent_max = PluginTransmissionAgents.GetAgentMaxCount(eAgents.FOOD_POISON);
60 int agent_count = player.m_AgentPool.GetSingleAgentCount(eAgents.FOOD_POISON);
61 float stomach_volume = player.m_PlayerStomach.GetStomachVolume();
62
66 chance = (chance / 3600) * deltaT;
67
69 {
70 SymptomBase symptom = player.GetSymptomManager().QueueUpPrimarySymptom(SymptomIDs.SYMPTOM_VOMIT);
71
72 if (symptom)
73 {
74 symptom.SetDuration(5);
75
76 if (m_Player.GetStatWater().Get() > (WATER_DRAIN_FROM_VOMIT))
77 m_Player.GetStatWater().Add(-1 * WATER_DRAIN_FROM_VOMIT);
78 if (m_Player.GetStatEnergy().Get() > (ENERGY_DRAIN_FROM_VOMIT))
79 m_Player.GetStatEnergy().Add(-1 * ENERGY_DRAIN_FROM_VOMIT);
80 }
81 }
82 }
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:131
Definition EnMath.c:7
static const int VOMIT_OCCURRENCES_PER_HOUR_MIN
Definition Poisoning.c:6
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 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'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

References Easing::EaseInCirc(), ENERGY_DRAIN_FROM_VOMIT, Math::InverseLerp(), Math::Lerp(), m_Player, Math::RandomFloat01(), VOMIT_OCCURRENCES_PER_HOUR_MAX, VOMIT_OCCURRENCES_PER_HOUR_MIN, and WATER_DRAIN_FROM_VOMIT.

Member Data Documentation

◆ AGENT_THRESHOLD_ACTIVATE

const int PoisoningMdfr::AGENT_THRESHOLD_ACTIVATE = 150
staticprivate

Definition at line 3 of file Poisoning.c.

Referenced by ActivateCondition(), and GetDebugText().

◆ AGENT_THRESHOLD_DEACTIVATE

const int PoisoningMdfr::AGENT_THRESHOLD_DEACTIVATE = 0
staticprivate

Definition at line 4 of file Poisoning.c.

Referenced by DeactivateCondition(), and GetDebugText().

◆ ENERGY_DRAIN_FROM_VOMIT

const int PoisoningMdfr::ENERGY_DRAIN_FROM_VOMIT = 55
staticprivate

Definition at line 10 of file Poisoning.c.

Referenced by OnTick().

◆ VOMIT_OCCURRENCES_PER_HOUR_MAX

const int PoisoningMdfr::VOMIT_OCCURRENCES_PER_HOUR_MAX = 120
staticprivate

Definition at line 7 of file Poisoning.c.

Referenced by OnTick().

◆ VOMIT_OCCURRENCES_PER_HOUR_MIN

const int PoisoningMdfr::VOMIT_OCCURRENCES_PER_HOUR_MIN = 60
staticprivate

Definition at line 6 of file Poisoning.c.

Referenced by OnTick().

◆ WATER_DRAIN_FROM_VOMIT

const int PoisoningMdfr::WATER_DRAIN_FROM_VOMIT = 70
staticprivate

Definition at line 9 of file Poisoning.c.

Referenced by OnTick().


The documentation for this class was generated from the following file: