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

◆ OnUnconsciousUpdate()

void ManBase::OnUnconsciousUpdate ( float pDt,
int last_command )
inlineprotected

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

3603 {
3604 m_UnconsciousTime += pDt;
3605 if (g_Game.IsServer())
3606 {
3607 int shock_simplified = SimplifyShock();
3608
3609 if (m_ShockSimplified != shock_simplified)
3610 {
3611 m_ShockSimplified = shock_simplified;
3612 SetSynchDirty();
3613 }
3614
3615 if (m_UnconsciousTime > PlayerConstants.UNCONSCIOUS_IN_WATER_TIME_LIMIT_TO_DEATH && last_command == DayZPlayerConstants.COMMANDID_SWIM)
3616 {
3617 PluginAdminLog adm = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
3618 adm.PlayerKilledByDrowningUncon(this);
3619
3620 SetHealth("","",-100);
3621 }
3622 }
3623 if (GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT)
3624 {
3625 g_Game.GetMission().GetHud().ShowQuickbarUI(false);
3626 if (GetPulseType() == EPulseType.REGULAR)
3627 {
3628 float shock_simple_normalized = GetSimplifiedShockNormalized();
3629
3630 float sin = Math.Sin(m_UnconsciousTime * 0.35);
3631 float sin_normalized = (sin + 1) / 2;
3632 if (sin_normalized < 0.05)
3633 {
3634 m_UnconsciousVignetteTarget = (1 - shock_simple_normalized / 3) * 2/*vignette max*/;
3635 }
3636 float vignette = Math.Lerp(2,m_UnconsciousVignetteTarget, sin_normalized);
3637 m_UnconParam.param1 = vignette;
3638 PPERequesterBank.GetRequester(PPERequester_UnconEffects).Start(m_UnconParam);
3639 }
3640 }
3641 }
DayZGame g_Game
Определения DayZGame.c:3942
EPulseType
Определения EPulseType.c:2
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:325
float GetSimplifiedShockNormalized()
Определения PlayerBase.c:3650
int m_ShockSimplified
Определения PlayerBase.c:156
EPulseType GetPulseType()
Определения PlayerBase.c:1094
float m_UnconsciousTime
Определения PlayerBase.c:155
float m_UnconsciousVignetteTarget
Определения PlayerBase.c:165
int SimplifyShock()
Определения PlayerBase.c:3643
ref Param1< float > m_UnconParam
Определения PlayerBase.c:116
DayZPlayerInstanceType
defined in C++
Определения dayzplayer.c:1071
proto native DayZPlayerInstanceType GetInstanceType()
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602

Перекрестные ссылки g_Game, GetInstanceType(), GetPlugin(), GetPulseType(), GetSimplifiedShockNormalized(), Math::Lerp(), m_ShockSimplified, m_UnconParam, m_UnconsciousTime, m_UnconsciousVignetteTarget, SimplifyShock(), Math::Sin() и PlayerConstants::UNCONSCIOUS_IN_WATER_TIME_LIMIT_TO_DEATH.

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