DayZ 1.24
Loading...
Searching...
No Matches
Stomach.c
Go to the documentation of this file.
2{
12
14 {
15 return true;
16 }
17
19 {
20 return false;
21 }
22
24 {
25
26 }
27
28 override void OnTick(PlayerBase player, float deltaT)
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 }
70};
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
override void OnReconnect(PlayerBase player)
Definition Stomach.c:23
override void OnTick(PlayerBase player, float deltaT)
Definition Stomach.c:28
override bool DeactivateCondition(PlayerBase player)
Definition Stomach.c:18
override void Init()
Definition Stomach.c:3
override bool ActivateCondition(PlayerBase player)
Definition Stomach.c:13
eModifiers
Definition eModifiers.c:2