DayZ 1.24
Loading...
Searching...
No Matches
Poisoning.c
Go to the documentation of this file.
2{
3 static const int AGENT_THRESHOLD_ACTIVATE = 150;
4 static const int AGENT_THRESHOLD_DEACTIVATE = 0;
5
6 static const int VOMIT_OCCURRENCES_PER_HOUR_MIN = 60;
7 static const int VOMIT_OCCURRENCES_PER_HOUR_MAX = 120;
8
9 static const int WATER_DRAIN_FROM_VOMIT = 70;
10 static const int ENERGY_DRAIN_FROM_VOMIT = 55;
11
20
21 override string GetDebugText()
22 {
23 return ("Activate threshold: " + AGENT_THRESHOLD_ACTIVATE + "| " + "Deativate threshold: " + AGENT_THRESHOLD_DEACTIVATE);
24 }
25
27 {
28 if (player.GetSingleAgentCount(eAgents.FOOD_POISON) >= AGENT_THRESHOLD_ACTIVATE)
29 return true;
30 else
31 return false;
32 }
33
35 {
36 if (player.GetSingleAgentCount(eAgents.FOOD_POISON) <= AGENT_THRESHOLD_DEACTIVATE)
37 return true;
38 else
39 return false;
40 }
41
43 {
44 player.IncreaseDiseaseCount();
45 }
46
48 {
49 this.OnActivate(player);
50 }
51
53 {
54 player.DecreaseDiseaseCount();
55 }
56
57 override void OnTick(PlayerBase player, float deltaT)
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 }
83};
eAgents
Definition EAgents.c:3
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
DayZPlayer m_Player
Definition Hand_Events.c:42
bool m_TrackActivatedTime
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
const int DEFAULT_TICK_TIME_INACTIVE
const int DEFAULT_TICK_TIME_ACTIVE
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
override string GetDebugText()
Definition Poisoning.c:21
override void OnTick(PlayerBase player, float deltaT)
Definition Poisoning.c:57
override void OnDeactivate(PlayerBase player)
Definition Poisoning.c:52
static const int VOMIT_OCCURRENCES_PER_HOUR_MIN
Definition Poisoning.c:6
static const int WATER_DRAIN_FROM_VOMIT
Definition Poisoning.c:9
override bool DeactivateCondition(PlayerBase player)
Definition Poisoning.c:34
static const int VOMIT_OCCURRENCES_PER_HOUR_MAX
Definition Poisoning.c:7
override void OnActivate(PlayerBase player)
Definition Poisoning.c:42
static const int AGENT_THRESHOLD_DEACTIVATE
Definition Poisoning.c:4
override void Init()
Definition Poisoning.c:12
override bool ActivateCondition(PlayerBase player)
Definition Poisoning.c:26
static const int ENERGY_DRAIN_FROM_VOMIT
Definition Poisoning.c:10
override void OnReconnect(PlayerBase player)
Definition Poisoning.c:47
static const int AGENT_THRESHOLD_ACTIVATE
Definition Poisoning.c:3
eModifiers
Definition eModifiers.c:2
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,...
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.
Definition human.c:1167