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

◆ BrokenLegWalkShock()

void ManBase::BrokenLegWalkShock ( )
inlineprotected

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

3696 {
3697 //No need to pursue here if player is prone as the following logic is not applied
3698 if (m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_PRONE && m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_RAISEDPRONE)
3699 {
3700 float avgLegHealth = GetHealth("RightLeg","") + GetHealth("LeftLeg","") + GetHealth("RightFoot","") + GetHealth("LeftFoot","");
3701 avgLegHealth *= 0.25; //divide by 4 to make the average leg health;
3702
3703 if (IsSwimming())
3704 {
3705 //swimming other than forward is not detectable in script other than through velocity check
3706 vector v;
3707 PhysicsGetVelocity(v);
3708
3709 if (v.LengthSq() > 0)
3710 {
3711 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_SHOCK_SWIM);
3712 }
3713 }
3714 else if (m_MovementState.m_iMovement != 0)
3715 {
3716 if (IsClimbingLadder())
3717 {
3718 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
3719 }
3720 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT)
3721 {
3722 if (m_MovementState.m_iMovement > 1)//only jog and faster
3723 {
3724 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
3725 }
3726 }
3727 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_CROUCH || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH)
3728 {
3729 //any speed other than idle
3730 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK * PlayerConstants.BROKEN_CROUCH_MODIFIER, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK * PlayerConstants.BROKEN_CROUCH_MODIFIER, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK * PlayerConstants.BROKEN_CROUCH_MODIFIER);
3731 }
3732 }
3733 else
3734 {
3735 //Here apply shock if player is standing or crouched and STANDING STILL
3736 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_STAND_SHOCK);
3737 }
3738
3739 m_ShockHandler.CheckValue(true);
3740 }
3741 }
ref HumanMovementState m_MovementState
movement state
Определения DayZPlayerCamera3rdPerson.c:324
int m_iMovement
current stance (DayZPlayerConstants.STANCEIDX_ERECT, ...), only if the command has a stance
Определения human.c:1142
int m_iStanceIdx
current command's id
Определения human.c:1141
void MovingShock(float legHealth, float highShock, float midShock, float lowShock)
Определения PlayerBase.c:3744
ref ShockHandler m_ShockHandler
Определения PlayerBase.c:52
proto native float LengthSq()
Returns squared length (magnitudeSqr)
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602

Перекрестные ссылки PlayerConstants::BROKEN_CROUCH_MODIFIER, PlayerConstants::BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants::BROKEN_LEGS_LOW_SHOCK_WALK, PlayerConstants::BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants::BROKEN_LEGS_SHOCK_SWIM, PlayerConstants::BROKEN_LEGS_STAND_SHOCK, vector::LengthSq(), m_MovementState, m_ShockHandler и MovingShock().

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