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

◆ BrokenLegWalkShock()

void ManBase::BrokenLegWalkShock ( )
inlineprotected

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

3815 {
3816 //No need to pursue here if player is prone as the following logic is not applied
3817 if (m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_PRONE && m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_RAISEDPRONE)
3818 {
3819 float avgLegHealth = GetHealth("RightLeg","") + GetHealth("LeftLeg","") + GetHealth("RightFoot","") + GetHealth("LeftFoot","");
3820 avgLegHealth *= 0.25; //divide by 4 to make the average leg health;
3821
3822 if (IsSwimming())
3823 {
3824 //swimming other than forward is not detectable in script other than through velocity check
3825 vector v;
3826 PhysicsGetVelocity(v);
3827
3828 if (v.LengthSq() > 0)
3829 {
3830 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_SHOCK_SWIM);
3831 }
3832 }
3833 else if (m_MovementState.m_iMovement != 0)
3834 {
3835 if (IsClimbingLadder())
3836 {
3837 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
3838 }
3839 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT)
3840 {
3841 if (m_MovementState.m_iMovement > 1)//only jog and faster
3842 {
3843 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
3844 }
3845 }
3846 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_CROUCH || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH)
3847 {
3848 //any speed other than idle
3849 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);
3850 }
3851 }
3852 else
3853 {
3854 //Here apply shock if player is standing or crouched and STANDING STILL
3855 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_STAND_SHOCK);
3856 }
3857
3858 m_ShockHandler.CheckValue(true);
3859 }
3860 }
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:1157
int m_iStanceIdx
current command's id
Определения human.c:1156
void MovingShock(float legHealth, float highShock, float midShock, float lowShock)
Определения PlayerBase.c:3863
ref ShockHandler m_ShockHandler
Определения PlayerBase.c:99
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().