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

Private Member Functions

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

Private Attributes

const int UNCONSIOUSS_COOLDOWN_TIME = 60
 

Detailed Description

Definition at line 1 of file ShockDamage.c.

Member Function Documentation

◆ ActivateCondition()

override bool ShockDamageMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 22 of file ShockDamage.c.

23 {
24 if (!player.IsUnconscious() && player.GetHealth("", "Blood") <= PlayerConstants.SHOCK_DAMAGE_BLOOD_THRESHOLD_HIGH && GetGame().GetTime() > (player.m_UnconsciousEndTime + UNCONSIOUSS_COOLDOWN_TIME))
25 return true;
26 else
27 return false;
28 }
float GetTime()
static const float SHOCK_DAMAGE_BLOOD_THRESHOLD_HIGH
const int UNCONSIOUSS_COOLDOWN_TIME
Definition ShockDamage.c:3
proto native CGame GetGame()

References GetGame(), GetTime(), PlayerConstants::SHOCK_DAMAGE_BLOOD_THRESHOLD_HIGH, and UNCONSIOUSS_COOLDOWN_TIME.

Referenced by DeactivateCondition().

◆ DeactivateCondition()

override bool ShockDamageMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 30 of file ShockDamage.c.

31 {
33 }
override bool ActivateCondition(PlayerBase player)
Definition ShockDamage.c:22

References ActivateCondition().

◆ Init()

override void ShockDamageMdfr::Init ( )
inlineprivate

Definition at line 4 of file ShockDamage.c.

5 {
7 m_ID = eModifiers.MDF_SHOCK_DAMAGE;
10 }
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
const int DEFAULT_TICK_TIME_INACTIVE
eModifiers
Definition eModifiers.c:2

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

◆ OnActivate()

override void ShockDamageMdfr::OnActivate ( PlayerBase player)
inlineprivate

Definition at line 12 of file ShockDamage.c.

13 {
14
15 }

◆ OnReconnect()

override void ShockDamageMdfr::OnReconnect ( PlayerBase player)
inlineprivate

Definition at line 17 of file ShockDamage.c.

18 {
19
20 }

◆ OnTick()

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

Definition at line 36 of file ShockDamage.c.

37 {
38 float blood = player.GetHealth("", "Blood");
40 value = Math.Clamp(value, 0, 1);
42 float damage = -dmg * deltaT;
43 player.AddHealth("", "Shock", damage);
44 //PrintString(damage.ToString());
45 }
Definition EnMath.c:7
static const float SHOCK_DAMAGE_BLOOD_THRESHOLD_LOW
static const float SHOCK_DAMAGE_HIGH
static const float SHOCK_DAMAGE_LOW
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...

References Math::Clamp(), Math::InverseLerp(), Math::Lerp(), PlayerConstants::SHOCK_DAMAGE_BLOOD_THRESHOLD_HIGH, PlayerConstants::SHOCK_DAMAGE_BLOOD_THRESHOLD_LOW, PlayerConstants::SHOCK_DAMAGE_HIGH, and PlayerConstants::SHOCK_DAMAGE_LOW.

Member Data Documentation

◆ UNCONSIOUSS_COOLDOWN_TIME

const int ShockDamageMdfr::UNCONSIOUSS_COOLDOWN_TIME = 60
private

Definition at line 3 of file ShockDamage.c.

Referenced by ActivateCondition().


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