DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
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 {
8 m_IsPersistent = true;
9 m_ID = eModifiers.MDF_MORPHINE;
13 }
14
15 override bool ActivateCondition(PlayerBase player)
16 {
17 return false;
18 }
19
20 override void OnReconnect(PlayerBase player)
21 {
22 OnActivate(player);
23 }
24
25 override string GetDebugText()
26 {
27 return (LIFETIME - GetAttachedTime()).ToString();
28 }
29
30 override void OnActivate(PlayerBase player)
31 {
32 if (player.GetBrokenLegs() != eBrokenLegs.NO_BROKEN_LEGS)
33 {
34 player.m_ShockHandler.SetMultiplier(0.1); //was 0.5 //Switch the shock multiplier NEED A CONST
35 }
36 //if( player.GetNotifiersManager() ) player.GetNotifiersManager().ActivateByType(eNotifiers.NTF_PILLS);
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 //if( player.GetNotifiersManager() ) player.GetNotifiersManager().DeactivateByType(eNotifiers.NTF_PILLS);
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 {
57 return true;
58 }
59 else
60 {
61 return false;
62 }
63 }
64
65 override void OnTick(PlayerBase player, float deltaT)
66 {
67
68 }
69};
eBrokenLegs
Definition EBrokenLegs.c:2
protected 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 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)
override string GetDebugText()
override void OnTick(PlayerBase player, float deltaT)
const int LIFETIME
Definition MorphineMdfr.c:3
override void Init()
Definition MorphineMdfr.c:5
override bool ActivateCondition(PlayerBase player)
override void OnDeactivate(PlayerBase player)
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