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

Protected Member Functions

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

Protected Attributes

float m_EnergyDelta
 
float m_LastEnergyLevel
 
ref HumanMovementState m_MovementState = new HumanMovementState()
 

Detailed Description

Definition at line 1 of file Hunger.c.

Member Function Documentation

◆ ActivateCondition()

override bool HungerMdfr::ActivateCondition ( PlayerBase player)
inlineprotected

Definition at line 16 of file Hunger.c.

17 {
18 return true;
19 }

◆ DeactivateCondition()

override bool HungerMdfr::DeactivateCondition ( PlayerBase player)
inlineprotected

Definition at line 21 of file Hunger.c.

22 {
23 return false;
24 }

◆ Init()

override void HungerMdfr::Init ( )
inlineprotected

Definition at line 7 of file Hunger.c.

8 {
10 m_ID = eModifiers.MDF_HUNGER;
14 }
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
Definition Effect.c:49
bool m_TrackActivatedTime
void DisableDeactivateCheck()
float m_TickIntervalActive
float m_TickIntervalInactive
const int DEFAULT_TICK_TIME_INACTIVE
eModifiers
Definition eModifiers.c:2

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

◆ OnReconnect()

override void HungerMdfr::OnReconnect ( PlayerBase player)
inlineprotected

Definition at line 26 of file Hunger.c.

27 {
28
29 }

◆ OnTick()

override void HungerMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprotected

Definition at line 31 of file Hunger.c.

32 {
33 player.GetMovementState(m_MovementState);
34 float energy = player.GetStatEnergy().Get();
35 float metabolic_speed = MiscGameplayFunctions.GetEnergyMetabolicSpeed(m_MovementState.m_iMovement);
36
38 metabolic_speed *= modifier; //non linear shaping for consumption curve (comment out to have it linear)
39
40 player.GetStatEnergy().Add(-metabolic_speed * deltaT);
42 {
43 player.SetMixedSoundState(eMixedSoundStates.HUNGRY);
44 if ((player.GetStomach().GetDigestingType() & PlayerStomach.DIGESTING_ENERGY) == 0)
45 player.AddHealth("GlobalHealth", "Health", -PlayerConstants.LOW_ENERGY_DAMAGE_PER_SEC * deltaT);
46 }
47 else
48 player.UnsetMixedSoundState(eMixedSoundStates.HUNGRY);
49 }
eMixedSoundStates
bits
void PlayerStomach(PlayerBase player)
ref HumanMovementState m_MovementState
Definition Hunger.c:5
static const float CONSUMPTION_MULTIPLIER_BASE
static const float LOW_ENERGY_DAMAGE_PER_SEC
static const float SL_ENERGY_MAX
static const float LOW_ENERGY_THRESHOLD

References PlayerConstants::CONSUMPTION_MULTIPLIER_BASE, PlayerConstants::LOW_ENERGY_DAMAGE_PER_SEC, PlayerConstants::LOW_ENERGY_THRESHOLD, m_MovementState, PlayerStomach(), and PlayerConstants::SL_ENERGY_MAX.

Member Data Documentation

◆ m_EnergyDelta

float HungerMdfr::m_EnergyDelta
protected

Definition at line 3 of file Hunger.c.

◆ m_LastEnergyLevel

float HungerMdfr::m_LastEnergyLevel
protected

Definition at line 4 of file Hunger.c.

◆ m_MovementState

ref HumanMovementState HungerMdfr::m_MovementState = new HumanMovementState()
protected

Definition at line 5 of file Hunger.c.

Referenced by OnTick().


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