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

Private 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)
 

Detailed Description

Definition at line 1 of file Stomach.c.

Member Function Documentation

◆ ActivateCondition()

override bool StomachMdfr::ActivateCondition ( PlayerBase player)
inlineprivate

Definition at line 13 of file Stomach.c.

14 {
15 return true;
16 }

◆ DeactivateCondition()

override bool StomachMdfr::DeactivateCondition ( PlayerBase player)
inlineprivate

Definition at line 18 of file Stomach.c.

19 {
20 return false;
21 }

◆ Init()

override void StomachMdfr::Init ( )
inlineprivate

Definition at line 3 of file Stomach.c.

4 {
6 m_ID = eModifiers.MDF_STOMACH;
9
11 }
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
const int DEFAULT_TICK_TIME_ACTIVE
eModifiers
Definition eModifiers.c:2

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

◆ OnReconnect()

override void StomachMdfr::OnReconnect ( PlayerBase player)
inlineprivate

Definition at line 23 of file Stomach.c.

24 {
25
26 }

◆ OnTick()

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

Definition at line 28 of file Stomach.c.

29 {
30 player.m_PlayerStomach.Update(deltaT);
31 /*
32 float stomachs_combined_before = player.GetStatStomachWater().Get() + player.GetStatStomachEnergy().Get();
33 if(stomachs_combined_before <=0) // takes care of division by 0 also there is no point in doing anything if there is nothing to transfer
34 {
35 player.GetStatStomachVolume().Set(0);
36 return;
37 }
38
39 // Energy
40 if ( player.GetStatStomachEnergy().Get() >= PlayerConstants.STOMACH_ENERGY_TRANSFERED_PER_SEC*deltaT )
41 {
42 player.GetStatEnergy().Add(PlayerConstants.STOMACH_ENERGY_TRANSFERED_PER_SEC*deltaT);
43 player.GetStatStomachEnergy().Add(-PlayerConstants.STOMACH_ENERGY_TRANSFERED_PER_SEC*deltaT);
44 }
45 else
46 {
47 player.GetStatEnergy().Add(player.GetStatStomachEnergy().Get());
48 player.GetStatStomachEnergy().Set(0);
49 }
50 //Water
51 if ( player.GetStatStomachWater().Get() >= PlayerConstants.STOMACH_WATER_TRANSFERED_PER_SEC*deltaT )
52 {
53 player.GetStatWater().Add(PlayerConstants.STOMACH_WATER_TRANSFERED_PER_SEC*deltaT);
54 player.GetStatStomachWater().Add(-PlayerConstants.STOMACH_WATER_TRANSFERED_PER_SEC*deltaT);
55
56 }
57 else
58 {
59 player.GetStatWater().Add(player.GetStatStomachWater().Get());
60 player.GetStatStomachWater().Set(0);
61
62 }
63
64 float stomachs_combined_after = player.GetStatStomachWater().Get() + player.GetStatStomachEnergy().Get();
65 float percentage = stomachs_combined_after / stomachs_combined_before;
66
67 player.GetStatStomachVolume().Set( player.GetStatStomachVolume().Get() * percentage );
68 */
69 }

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