DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс StomachMdfr
+ Граф наследования:StomachMdfr:

Закрытые члены

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)
 

Подробное описание

Методы

◆ ActivateCondition()

override bool ActivateCondition ( PlayerBase player)
inlineprivate
14 {
15 return true;
16 }

◆ DeactivateCondition()

override bool DeactivateCondition ( PlayerBase player)
inlineprivate
19 {
20 return false;
21 }

◆ Init()

override void Init ( )
inlineprivate
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
overall time this modifier was active
Definition ModifierBase.c:14
void DisableDeactivateCheck()
Definition ModifierBase.c:86
float m_TickIntervalActive
Definition ModifierBase.c:18
float m_TickIntervalInactive
Definition ModifierBase.c:17
const int DEFAULT_TICK_TIME_INACTIVE
Definition ModifiersManager.c:29
enum eModifierSyncIDs DEFAULT_TICK_TIME_ACTIVE
eModifiers
Definition eModifiers.c:2

Перекрестные ссылки DEFAULT_TICK_TIME_ACTIVE, DEFAULT_TICK_TIME_INACTIVE, DisableDeactivateCheck(), m_ID, m_TickIntervalActive, m_TickIntervalInactive и m_TrackActivatedTime.

◆ OnReconnect()

override void OnReconnect ( PlayerBase player)
inlineprivate
24 {
25
26 }

◆ OnTick()

override void OnTick ( PlayerBase player,
float deltaT )
inlineprivate
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 }
Definition EntityAI.c:95

Объявления и описания членов класса находятся в файле: