DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
CharcoalMdfr.c
Go to the documentation of this file.
2{
3 float m_Killrate;
4 const int CHARCOAL_LIFETIME = 300;
5 const int CHARCOAL_EFFECT_TIME = 100;
6
7 override void Init()
8 {
10 m_IsPersistent = true;
11 m_ID = eModifiers.MDF_CHARCOAL;
14 m_Killrate = 2.85; // # of killed agents per sec
16 }
17
18 override bool ActivateCondition(PlayerBase player)
19 {
20 return false;
21 }
22
23 override void OnReconnect(PlayerBase player)
24 {
25 OnActivate( player );
26 }
27
28 /*
29 override string GetDebugText()
30 {
31
32 string text;
33 float time_till_effective = CHARCOAL_LIFETIME - CHARCOAL_EFFECT_TIME - GetAttachedTime();
34
35 text = "time till effective: " + time_till_effective.ToString() + "\n";
36
37 if(time_till_effective > 0)
38 text += "killing agents:" + "NO";
39 else
40 text += "killing agents:" + "YES";
41
42
43 return text;
44
45 }
46 */
47
48
49 override string GetDebugTextSimple()
50 {
52 }
53
54 override void OnActivate(PlayerBase player)
55 {
56 player.IncreaseHealingsCount();
57
58 }
59
60 override void OnDeactivate(PlayerBase player)
61 {
62 player.DecreaseHealingsCount();
63
64 }
65
66 override bool DeactivateCondition(PlayerBase player)
67 {
68 float attached_time = GetAttachedTime();
69
70 if ( attached_time >= CHARCOAL_LIFETIME )
71 {
72 return true;
73 }
74 else
75 {
76 return false;
77 }
78 }
79
80 override void OnTick(PlayerBase player, float deltaT)
81 {
83 {
84 player.m_AgentPool.AddAgent(eAgents.SALMONELLA, -m_Killrate * deltaT);
85 }
86 }
87};
class RecipeCacheData int
eAgents
Definition EAgents.c:3
protected int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
proto string ToString()
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)
override void OnReconnect(PlayerBase player)
override void OnActivate(PlayerBase player)
const int CHARCOAL_LIFETIME
Definition CharcoalMdfr.c:4
override string GetDebugTextSimple()
override void OnTick(PlayerBase player, float deltaT)
override void Init()
Definition CharcoalMdfr.c:7
override bool ActivateCondition(PlayerBase player)
override void OnDeactivate(PlayerBase player)
const int CHARCOAL_EFFECT_TIME
Definition CharcoalMdfr.c:5
float m_Killrate
Definition CharcoalMdfr.c:3
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