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

◆ OnTick()

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

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

42 {
43 if( !player.m_Environment.IsTemperatureSet() )
44 return;
45 float air_temperature = player.m_Environment.GetTemperature();
46 int level = 0;//default
47 if( MiscGameplayFunctions.IsValueInRange( air_temperature, PlayerConstants.BREATH_VAPOUR_THRESHOLD_HIGH, PlayerConstants.BREATH_VAPOUR_THRESHOLD_LOW) )
48 {
49 float value = Math.InverseLerp( PlayerConstants.BREATH_VAPOUR_THRESHOLD_LOW, PlayerConstants.BREATH_VAPOUR_THRESHOLD_HIGH,air_temperature);
50 value = Math.Clamp(value,0,1);
51 level = Math.Round(Math.Lerp(1,BREATH_VAPOUR_LEVEL_MAX,value));
52 }
53 else if(air_temperature < PlayerConstants.BREATH_VAPOUR_THRESHOLD_HIGH)
54 {
56 }
57 if( level != player.m_BreathVapour )
58 {
59 player.m_BreathVapour = level;
60 player.SetSynchDirty();
61 }
62 }
const int BREATH_VAPOUR_LEVEL_MAX
Определения BreathVapourMdfr.c:1

Перекрестные ссылки BREATH_VAPOUR_LEVEL_MAX, PlayerConstants::BREATH_VAPOUR_THRESHOLD_HIGH, PlayerConstants::BREATH_VAPOUR_THRESHOLD_LOW, Math::Clamp(), Math::InverseLerp(), Math::Lerp() и Math::Round().

Используется в Tick().