DayZ 1.24
Loading...
Searching...
No Matches
BrokenLegsMdfr Class Reference
Inheritance diagram for BrokenLegsMdfr:
[legend]
Collaboration diagram for BrokenLegsMdfr:
[legend]

Private Member Functions

override void Init ()
 
override void OnActivate (PlayerBase player)
 
override void OnReconnect (PlayerBase player)
 
override void OnDeactivate (PlayerBase player)
 
override bool DeactivateCondition (PlayerBase player)
 
override void OnTick (PlayerBase player, float deltaT)
 

Private Attributes

const float HEALTHY_LEG = 100
 
int currentState = -1
 
const float TIME_TO_UPDATE = 0.5
 
float elapsedTime = TIME_TO_UPDATE + 1
 

Detailed Description

Definition at line 1 of file BrokenLegs.c.

Member Function Documentation

◆ DeactivateCondition()

override bool BrokenLegsMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 49 of file BrokenLegs.c.

50 {
51 if (player.GetHealth("RightLeg", "Health") >= HEALTHY_LEG && player.GetHealth("LeftLeg", "Health") >= HEALTHY_LEG)
52
53 return true;
54 else
55 return false;
56 }
const float HEALTHY_LEG
Definition BrokenLegs.c:3

References HEALTHY_LEG.

◆ Init()

override void BrokenLegsMdfr::Init ( )
inlineprivate

Definition at line 12 of file BrokenLegs.c.

13 {
15 m_ID = eModifiers.MDF_BROKEN_LEGS;
18 m_ActivationType = EActivationType.TRIGGER_EVENT_ON_ACTIVATION;
19 m_IsPersistent = true;
20 }
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 m_TickIntervalActive
float m_TickIntervalInactive
EActivationType m_ActivationType
bool m_IsPersistent
EActivationType
const int DEFAULT_TICK_TIME_INACTIVE
eModifiers
Definition eModifiers.c:2

References DEFAULT_TICK_TIME_INACTIVE, m_ActivationType, m_ID, m_IsPersistent, m_TickIntervalActive, m_TickIntervalInactive, and m_TrackActivatedTime.

◆ OnActivate()

override void BrokenLegsMdfr::OnActivate ( PlayerBase player)
inlineprivate

Definition at line 22 of file BrokenLegs.c.

23 {
24 //Print("------------> OnActivate - BrokenLegsMdfr");
25 player.SetBrokenLegs(-eBrokenLegs.BROKEN_LEGS);//note the negative sign
26 player.GetNotifiersManager().ActivateByType(eNotifiers.NTF_FRACTURE);
27 }
eBrokenLegs
Definition EBrokenLegs.c:2
eNotifiers

◆ OnDeactivate()

override void BrokenLegsMdfr::OnDeactivate ( PlayerBase player)
inlineprivate

Definition at line 37 of file BrokenLegs.c.

38 {
39 player.UpdateBrokenLegs(eBrokenLegs.NO_BROKEN_LEGS);
40 if (player.IsWearingSplint())
41 {
42 MiscGameplayFunctions.RemoveSplint(player); //Remove splint when leg is healed
43 }
44
45 player.SetBrokenLegs(eBrokenLegs.NO_BROKEN_LEGS);
46 player.GetNotifiersManager().DeactivateByType(eNotifiers.NTF_FRACTURE);
47 }

◆ OnReconnect()

override void BrokenLegsMdfr::OnReconnect ( PlayerBase player)
inlineprivate

Definition at line 29 of file BrokenLegs.c.

30 {
31 //Print("------------> OnReconnect - BrokenLegsMdfr");
32 player.SetBrokenLegs(player.GetBrokenLegs());
33 player.GetNotifiersManager().ActivateByType(eNotifiers.NTF_FRACTURE);
34 }

◆ OnTick()

override void BrokenLegsMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

Definition at line 58 of file BrokenLegs.c.

59 {
60 player.UpdateBrokenLegs(/*legacy param - value not used*/0);
61 }

Member Data Documentation

◆ currentState

int BrokenLegsMdfr::currentState = -1
private

Definition at line 4 of file BrokenLegs.c.

◆ elapsedTime

float BrokenLegsMdfr::elapsedTime = TIME_TO_UPDATE + 1
private

Definition at line 6 of file BrokenLegs.c.

◆ HEALTHY_LEG

const float BrokenLegsMdfr::HEALTHY_LEG = 100
private

Definition at line 3 of file BrokenLegs.c.

Referenced by DeactivateCondition().

◆ TIME_TO_UPDATE

const float BrokenLegsMdfr::TIME_TO_UPDATE = 0.5
private

Definition at line 5 of file BrokenLegs.c.


The documentation for this class was generated from the following file: