Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
morphinemdfr.c
Go to the documentation of this file.
2{
3 const int LIFETIME = 60;
4
5 override void Init()
6 {
9 m_IsPersistent = true;
10 m_ID = eModifiers.MDF_MORPHINE;
13
15 }
16
17 override bool ActivateCondition(PlayerBase player)
18 {
19 return false;
20 }
21
22 override void OnReconnect(PlayerBase player)
23 {
24 OnActivate(player);
25 }
26
27 override string GetDebugText()
28 {
29 return (LIFETIME - GetAttachedTime()).ToString();
30 }
31
32 override void OnActivate(PlayerBase player)
33 {
34 if (player.GetBrokenLegs() != eBrokenLegs.NO_BROKEN_LEGS)
35 player.m_ShockHandler.SetMultiplier(0.1); //was 0.5 //Switch the shock multiplier NEED A CONST
36
37 player.IncreaseHealingsCount();
38 m_Player.m_InjuryHandler.m_ForceInjuryAnimMask = m_Player.m_InjuryHandler.m_ForceInjuryAnimMask | eInjuryOverrides.MORPHINE;
39 }
40
41 override void OnDeactivate(PlayerBase player)
42 {
43
44 if (player.GetBrokenLegs() != eBrokenLegs.NO_BROKEN_LEGS)
45 player.m_ShockHandler.SetMultiplier(1); //Reset the shock multiplier when modifier stops
46
47 player.DecreaseHealingsCount();
48 m_Player.m_InjuryHandler.m_ForceInjuryAnimMask = m_Player.m_InjuryHandler.m_ForceInjuryAnimMask & ~eInjuryOverrides.MORPHINE;
49 }
50
51 override bool DeactivateCondition(PlayerBase player)
52 {
53 float attached_time = GetAttachedTime();
54
55 if (attached_time >= LIFETIME)
56 return true;
57 else
58 return false;
59 }
60}
eBrokenLegs
Definition ebrokenlegs.c:2
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition effect.c:51
eModifiers
Definition emodifiers.c:2
@ LIFETIME
Float R/W.
Definition envisual.c:161
DayZPlayer m_Player
Definition hand_events.c:42
bool m_TrackActivatedTime
overall time this modifier was active
float GetAttachedTime()
void DisableActivateCheck()
bool m_AnalyticsStatsEnabled
float m_TickIntervalActive
float m_TickIntervalInactive
bool m_IsPersistent
should this modifier track overall time it was active ?
const int DEFAULT_TICK_TIME_INACTIVE
void OnActivate()