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

Private Member Functions

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

Private Attributes

const float UNCONSCIOUS_LIMIT = 50
 
const float SHOCK_INCREMENT_PER_SEC = 1
 

Detailed Description

Definition at line 1 of file Shock.c.

Member Function Documentation

◆ ActivateCondition()

override bool ShockMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 15 of file Shock.c.

16 {
17 return true;
18 }

◆ DeactivateCondition()

override bool ShockMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 20 of file Shock.c.

21 {
22 return false;
23 }

◆ GetRefillSpeed()

float ShockMdfr::GetRefillSpeed ( PlayerBase player)
inlineprivate

Definition at line 33 of file Shock.c.

34 {
35 if (player.m_IsDrowning)
36 return 0;
37 if (player.IsUnconscious())
38 return CfgGameplayHandler.GetShockRefillSpeedUnconscious() * player.m_UnconRefillModifier;
39 if (player.GetBrokenLegs() != eBrokenLegs.BROKEN_LEGS || (player.m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_PRONE || player.m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE))
41 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS && (player.IsSwimming() || player.IsClimbingLadder()))
43 return 0; //Block shock regen when standing with broken legs
44 }
eBrokenLegs
Definition EBrokenLegs.c:2
static float GetShockRefillSpeedUnconscious()
static float GetShockRefillSpeedConscious()
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References CfgGameplayHandler::GetShockRefillSpeedConscious(), and CfgGameplayHandler::GetShockRefillSpeedUnconscious().

Referenced by OnTick().

◆ Init()

override void ShockMdfr::Init ( )
inlineprivate

Definition at line 6 of file Shock.c.

7 {
8 m_ID = eModifiers.MDF_SHOCK;
11 //DisableActivateCheck();
13 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
void DisableDeactivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
eModifiers
Definition eModifiers.c:2

References DisableDeactivateCheck(), m_ID, m_TickIntervalActive, and m_TickIntervalInactive.

◆ OnActivate()

override void ShockMdfr::OnActivate ( PlayerBase player)
inlineprivate

Definition at line 25 of file Shock.c.

26 {
27 }

◆ OnDeactivate()

override void ShockMdfr::OnDeactivate ( PlayerBase player)
inlineprivate

Definition at line 29 of file Shock.c.

30 {
31 }

◆ OnReconnect()

override void ShockMdfr::OnReconnect ( PlayerBase player)
inlineprivate

Definition at line 64 of file Shock.c.

65 {
66
67 }

◆ OnTick()

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

Definition at line 46 of file Shock.c.

47 {
48 //Print("m_UnconRefillModifier" + player.m_UnconRefillModifier);
49 if (GetGame().GetTime() > player.m_LastShockHitTime + PlayerConstants.SHOCK_REFILL_COOLDOWN_AFTER_HIT && player.GetPulseType() == EPulseType.REGULAR)
50 {
51 if (!player.IsUnconscious())
52 player.m_UnconRefillModifier = 1;//reset this UnconRefillModifier some time after the player has been hit(we want the UnconRefillModifier to only apply to uncon induced by a projectile)
53
54 if (player.GetHealth01("", "Shock") == 1) //no need to continue if the shock is full
55 return;
56
58 player.m_UnconRefillModifier = 1;
59
60 player.AddHealth("", "Shock", deltaT * GetRefillSpeed(player));
61 }
62 }
EPulseType
Definition EPulseType.c:2
float GetTime()
static bool GetAllowRefillSpeedModifier()
static const float SHOCK_REFILL_COOLDOWN_AFTER_HIT
float GetRefillSpeed(PlayerBase player)
Definition Shock.c:33
proto native CGame GetGame()

References CfgGameplayHandler::GetAllowRefillSpeedModifier(), GetGame(), GetRefillSpeed(), GetTime(), and PlayerConstants::SHOCK_REFILL_COOLDOWN_AFTER_HIT.

Member Data Documentation

◆ SHOCK_INCREMENT_PER_SEC

const float ShockMdfr::SHOCK_INCREMENT_PER_SEC = 1
private

Definition at line 4 of file Shock.c.

◆ UNCONSCIOUS_LIMIT

const float ShockMdfr::UNCONSCIOUS_LIMIT = 50
private

Definition at line 3 of file Shock.c.


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