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

◆ BrokenLegWalkShock()

void ManBase::BrokenLegWalkShock ( )
inlineprotected

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

3678 {
3679 //No need to pursue here if player is prone as the following logic is not applied
3680 if (m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_PRONE && m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_RAISEDPRONE)
3681 {
3682 float avgLegHealth = GetHealth("RightLeg","") + GetHealth("LeftLeg","") + GetHealth("RightFoot","") + GetHealth("LeftFoot","");
3683 avgLegHealth *= 0.25; //divide by 4 to make the average leg health;
3684
3685 if (IsSwimming())
3686 {
3687 //swimming other than forward is not detectable in script other than through velocity check
3688 vector v;
3689 PhysicsGetVelocity(v);
3690
3691 if (v.LengthSq() > 0)
3692 {
3693 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_SHOCK_SWIM);
3694 }
3695 }
3696 else if (m_MovementState.m_iMovement != 0)
3697 {
3698 if (IsClimbingLadder())
3699 {
3700 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
3701 }
3702 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT)
3703 {
3704 if (m_MovementState.m_iMovement > 1)//only jog and faster
3705 {
3706 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
3707 }
3708 }
3709 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_CROUCH || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH)
3710 {
3711 //any speed other than idle
3712 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);
3713 }
3714 }
3715 else
3716 {
3717 //Here apply shock if player is standing or crouched and STANDING STILL
3718 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_STAND_SHOCK);
3719 }
3720
3721 m_ShockHandler.CheckValue(true);
3722 }
3723 }
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:1155
int m_iStanceIdx
current command's id
Определения human.c:1154
void MovingShock(float legHealth, float highShock, float midShock, float lowShock)
Определения PlayerBase.c:3726
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().