DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
Antibiotics.c
Go to the documentation of this file.
2{
4 const int ANTIBIOTICS_LIFETIME = 300;
5 const float ANTIBIOTICS_STRENGTH = 1;
6
7 override void Init()
8 {
10 m_IsPersistent = true;
11 m_ID = eModifiers.MDF_ANTIBIOTICS;
15
17 }
18
19 override bool ActivateCondition(PlayerBase player)
20 {
21 return false;
22 }
23
24 override void OnReconnect(PlayerBase player)
25 {
26 OnActivate(player);
27 }
28
29 override string GetDebugText()
30 {
32 }
33
34
35 override string GetDebugTextSimple()
36 {
38 }
39
40 override void OnActivate(PlayerBase player)
41 {
42 player.IncreaseHealingsCount();
43 player.IncreaseAntibioticsCount();
44 /*
45 if ( player.GetNotifiersManager() )
46 player.GetNotifiersManager().ActivateByType(eNotifiers.NTF_PILLS);
47 */
48 }
49
50 override void OnDeactivate(PlayerBase player)
51 {
52 player.DecreaseHealingsCount();
53 player.DecreaseAntibioticsCount();
54 /*
55 if ( player.GetNotifiersManager() )
56 player.GetNotifiersManager().DeactivateByType(eNotifiers.NTF_PILLS);
57 */
58 }
59
60 override bool DeactivateCondition(PlayerBase player)
61 {
62 float attached_time = GetAttachedTime();
63
64 if ( attached_time >= m_RegenTime )
65 {
66 return true;
67 }
68 else
69 {
70 return false;
71 }
72 }
73
74 override void OnTick(PlayerBase player, float deltaT)
75 {
76 player.AntibioticsAttack( ANTIBIOTICS_STRENGTH * deltaT );
77 }
78};
protected 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 GetAttachedTime()
void DisableActivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
const int DEFAULT_TICK_TIME_INACTIVE
override bool DeactivateCondition(PlayerBase player)
Definition Antibiotics.c:60
override void OnReconnect(PlayerBase player)
Definition Antibiotics.c:24
override void OnActivate(PlayerBase player)
Definition Antibiotics.c:40
override string GetDebugText()
Definition Antibiotics.c:29
override string GetDebugTextSimple()
Definition Antibiotics.c:35
override void OnTick(PlayerBase player, float deltaT)
Definition Antibiotics.c:74
override void Init()
Definition Antibiotics.c:7
override bool ActivateCondition(PlayerBase player)
Definition Antibiotics.c:19
override void OnDeactivate(PlayerBase player)
Definition Antibiotics.c:50
const float ANTIBIOTICS_STRENGTH
Definition Antibiotics.c:5
const int ANTIBIOTICS_LIFETIME
Definition Antibiotics.c:4
eModifiers
Definition eModifiers.c:2
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
class HumanMovementState OnActivate()
HumanCommandScript fully scriptable command.
Definition human.c:1169