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

◆ OnTick()

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

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

31 {
32 player.GetMovementState(m_MovementState);
33 float water = player.GetStatWater().Get();
34 float metabolic_speed = MiscGameplayFunctions.GetWaterMetabolicSpeed(m_MovementState.m_iMovement);
35
36 float modifier = water/PlayerConstants.SL_WATER_MAX + PlayerConstants.CONSUMPTION_MULTIPLIER_BASE;
37 metabolic_speed *= modifier; //non linear shaping for consumption curve (comment out to have it linear)
38
39 player.GetStatWater().Add( (-metabolic_speed * deltaT) );
40
41 if ( water <= PlayerConstants.LOW_WATER_THRESHOLD )
42 {
43 player.SetMixedSoundState( eMixedSoundStates.THIRSTY );
44 if ((player.GetStomach().GetDigestingType() & PlayerStomach.DIGESTING_WATER) == 0)
45 player.AddHealth("GlobalHealth", "Health", -PlayerConstants.LOW_WATER_DAMAGE_PER_SEC * deltaT );
46 }
47 else
48 {
49 player.UnsetMixedSoundState( eMixedSoundStates.THIRSTY );
50 }
51 }
eMixedSoundStates
bits
Определения EMixedSoundStates.c:3
void PlayerStomach(PlayerBase player)
Определения PlayerStomach.c:142
ref HumanMovementState m_MovementState
Определения Thirst.c:4

Перекрестные ссылки PlayerConstants::CONSUMPTION_MULTIPLIER_BASE, PlayerConstants::LOW_WATER_DAMAGE_PER_SEC, PlayerConstants::LOW_WATER_THRESHOLD, m_MovementState, PlayerStomach() и PlayerConstants::SL_WATER_MAX.