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

◆ OnUnconsciousUpdate()

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

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

3871 {
3872 m_UnconsciousTime += pDt;
3873 if (g_Game.IsServer())
3874 {
3875 int shock_simplified = SimplifyShock();
3876
3877 if (m_ShockSimplified != shock_simplified)
3878 {
3879 m_ShockSimplified = shock_simplified;
3880 SetSynchDirty();
3881 }
3882
3883 if (m_UnconsciousTime > PlayerConstants.UNCONSCIOUS_IN_WATER_TIME_LIMIT_TO_DEATH && last_command == DayZPlayerConstants.COMMANDID_SWIM)
3884 {
3885 PluginAdminLog adm = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
3886 adm.PlayerKilledByDrowningUncon(this);
3887
3888 SetHealth("","",-100);
3889 }
3890 }
3891 if (GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT)
3892 {
3893#ifndef NO_GUI
3894 g_Game.GetMission().GetHud().ShowQuickbarUI(false);
3895#endif
3896 if (GetPulseType() == EPulseType.REGULAR)
3897 {
3898 float shock_simple_normalized = GetSimplifiedShockNormalized();
3899
3900 float sin = Math.Sin(m_UnconsciousTime * 0.35);
3901 float sin_normalized = (sin + 1) / 2;
3902 if (sin_normalized < 0.05)
3903 {
3904 m_UnconsciousVignetteTarget = (1 - shock_simple_normalized / 3) * 2/*vignette max*/;
3905 }
3906 float vignette = Math.Lerp(2,m_UnconsciousVignetteTarget, sin_normalized);
3907 m_UnconParam.param1 = vignette;
3908 PPERequesterBank.GetRequester(PPERequester_UnconEffects).Start(m_UnconParam);
3909 }
3910 }
3911 }
DayZGame g_Game
Определения DayZGame.c:4074
EPulseType
Определения EPulseType.c:2
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:326
float GetSimplifiedShockNormalized()
Определения PlayerBase.c:3920
int m_ShockSimplified
Определения PlayerBase.c:155
EPulseType GetPulseType()
Определения PlayerBase.c:1125
float m_UnconsciousTime
Определения PlayerBase.c:154
float m_UnconsciousVignetteTarget
Определения PlayerBase.c:164
int SimplifyShock()
Определения PlayerBase.c:3913
ref Param1< float > m_UnconParam
Определения PlayerBase.c:115
DayZPlayerInstanceType
defined in C++
Определения dayzplayer.c:1084
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().