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

◆ OnUnconsciousUpdate()

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

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

3484 {
3485 m_UnconsciousTime += pDt;
3486 if (GetGame().IsServer())
3487 {
3488 int shock_simplified = SimplifyShock();
3489
3490 if (m_ShockSimplified != shock_simplified)
3491 {
3492 m_ShockSimplified = shock_simplified;
3493 SetSynchDirty();
3494 }
3495
3496 if (m_UnconsciousTime > PlayerConstants.UNCONSCIOUS_IN_WATER_TIME_LIMIT_TO_DEATH && last_command == DayZPlayerConstants.COMMANDID_SWIM)
3497 {
3498 PluginAdminLog adm = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
3499 adm.PlayerKilledByDrowningUncon(this);
3500
3501 SetHealth("","",-100);
3502 }
3503 }
3504 if (GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT)
3505 {
3507 if (GetPulseType() == EPulseType.REGULAR)
3508 {
3509 float shock_simple_normalized = GetSimplifiedShockNormalized();
3510
3511 float sin = Math.Sin(m_UnconsciousTime * 0.3);
3512 float sin_normalized = (sin + 1) / 2;
3513 if (sin_normalized < 0.05)
3514 {
3515 m_UnconsciousVignetteTarget = (1 - shock_simple_normalized / 3) * 2/*vignette max*/;
3516 }
3517 float vignette = Math.Lerp(2,m_UnconsciousVignetteTarget, sin_normalized);
3518 m_UnconParam.param1 = vignette;
3519 PPERequesterBank.GetRequester(PPERequester_UnconEffects).Start(m_UnconParam);
3520 }
3521 }
3522 }
EPulseType
Определения EPulseType.c:2
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
proto native Mission GetMission()
void ShowQuickbarUI(bool show)
float GetSimplifiedShockNormalized()
Определения PlayerBase.c:3531
int m_ShockSimplified
Определения PlayerBase.c:109
EPulseType GetPulseType()
Определения PlayerBase.c:956
float m_UnconsciousTime
Определения PlayerBase.c:108
float m_UnconsciousVignetteTarget
Определения PlayerBase.c:118
int SimplifyShock()
Определения PlayerBase.c:3524
ref Param1< float > m_UnconParam
Определения PlayerBase.c:69
Hud GetHud()
Определения gameplay.c:721
DayZPlayerInstanceType
defined in C++
Определения dayzplayer.c:1068
proto native DayZPlayerInstanceType GetInstanceType()
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()

Перекрестные ссылки GetGame(), Mission::GetHud(), GetInstanceType(), CGame::GetMission(), GetPlugin(), GetPulseType(), GetSimplifiedShockNormalized(), Math::Lerp(), m_ShockSimplified, m_UnconParam, m_UnconsciousTime, m_UnconsciousVignetteTarget, Hud::ShowQuickbarUI(), SimplifyShock(), Math::Sin() и PlayerConstants::UNCONSCIOUS_IN_WATER_TIME_LIMIT_TO_DEATH.

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