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

◆ BrokenLegWalkShock()

void ManBase::BrokenLegWalkShock ( )
inlineprotected

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

4085 {
4086 //No need to pursue here if player is prone as the following logic is not applied
4087 if (m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_PRONE && m_MovementState.m_iStanceIdx != DayZPlayerConstants.STANCEIDX_RAISEDPRONE)
4088 {
4089 float avgLegHealth = GetHealth("RightLeg","") + GetHealth("LeftLeg","") + GetHealth("RightFoot","") + GetHealth("LeftFoot","");
4090 avgLegHealth *= 0.25; //divide by 4 to make the average leg health;
4091
4092 if (IsSwimming())
4093 {
4094 //swimming other than forward is not detectable in script other than through velocity check
4095 vector v;
4096 PhysicsGetVelocity(v);
4097
4098 if (v.LengthSq() > 0)
4099 {
4100 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_SHOCK_SWIM);
4101 }
4102 }
4103 else if (m_MovementState.m_iMovement != 0)
4104 {
4105 if (IsClimbingLadder())
4106 {
4107 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
4108 }
4109 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT)
4110 {
4111 if (m_MovementState.m_iMovement > 1)//only jog and faster
4112 {
4113 MovingShock(avgLegHealth, PlayerConstants.BROKEN_LEGS_HIGH_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_MID_SHOCK_WALK, PlayerConstants.BROKEN_LEGS_LOW_SHOCK_WALK);
4114 }
4115 }
4116 else if (m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_CROUCH || m_MovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH)
4117 {
4118 //any speed other than idle
4119 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);
4120 }
4121 }
4122 else
4123 {
4124 //Here apply shock if player is standing or crouched and STANDING STILL
4125 m_ShockHandler.SetShock(PlayerConstants.BROKEN_LEGS_STAND_SHOCK);
4126 }
4127
4128 m_ShockHandler.CheckValue(true);
4129 }
4130 }
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:1184
int m_iStanceIdx
current command's id
Определения human.c:1183
void MovingShock(float legHealth, float highShock, float midShock, float lowShock)
Определения PlayerBase.c:4133
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().