DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnTick()

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

См. определение в файле Hunger.c строка 31

32 {
33 player.GetMovementState(m_MovementState);
34 float energy = player.GetStatEnergy().Get();
35 float metabolic_speed = MiscGameplayFunctions.GetEnergyMetabolicSpeed(m_MovementState.m_iMovement);
36
37 float modifier = energy/PlayerConstants.SL_ENERGY_MAX + PlayerConstants.CONSUMPTION_MULTIPLIER_BASE;
38 metabolic_speed *= modifier; //non linear shaping for consumption curve (comment out to have it linear)
39
40 player.GetStatEnergy().Add( -metabolic_speed * deltaT );
41 if ( energy <= PlayerConstants.LOW_ENERGY_THRESHOLD )
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 {
49 player.UnsetMixedSoundState( eMixedSoundStates.HUNGRY );
50 }
51 }
eMixedSoundStates
bits
Определения EMixedSoundStates.c:3
void PlayerStomach(PlayerBase player)
Определения PlayerStomach.c:142
ref HumanMovementState m_MovementState
Определения Hunger.c:5

Перекрестные ссылки PlayerConstants::CONSUMPTION_MULTIPLIER_BASE, PlayerConstants::LOW_ENERGY_DAMAGE_PER_SEC, PlayerConstants::LOW_ENERGY_THRESHOLD, m_MovementState, PlayerStomach() и PlayerConstants::SL_ENERGY_MAX.