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

◆ CanChangeStance()

override bool ManBase::CanChangeStance ( int previousStance,
int newStance )
inlineprotected

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

4476 {
4477 // Check if the player is trying to perform restricted action while changing stance
4479 return false;
4480
4481 // Allow stance changes in plain throwing mode, but not once the actual throw wind-up / release animation has started
4482 if (GetThrowing().IsThrowingInProgress() || GetThrowing().IsThrowingAnimationPlaying())
4483 return false;
4484
4485 // don't allow base stance change, only raised hands change
4486 if (IsRolling())
4487 {
4488 if (Math.AbsInt(previousStance - newStance) == 3)
4489 return true;
4490
4491 return false;
4492 }
4493
4494 // Check if the player tries to drop or throw an item in hands while changing stance
4495 UAInterface inputInterface = GetInputInterface();
4496 if (inputInterface.SyncedValue_ID(UAThrowitem) > 0 || inputInterface.SyncedValue_ID(UADropitem) > 0)
4497 return false;
4498
4499 // Check if the player is going to crouch or raised crouch
4500 if (newStance == DayZPlayerConstants.STANCEIDX_CROUCH || newStance == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH)
4501 {
4502 return GetCurrentWaterLevel() <= GetDayZPlayerType().CommandSwimSettingsW().m_fToErectLevel;
4503 }
4504
4505 // Check if the player is going to prone
4506 if (newStance == DayZPlayerConstants.STANCEIDX_PRONE || newStance == DayZPlayerConstants.STANCEIDX_RAISEDPRONE)
4507 {
4508 return GetCurrentWaterLevel() <= GetDayZPlayerType().CommandSwimSettingsW().m_fToCrouchLevel;
4509 }
4510
4511 // The player can change stance if none of the conditions above are met
4512 return true;
4513 }
bool CanBePerformedWhileChangingStance()
Condition used in PlayerBase::CanChangeStance to check if stance can be changed while action is perfo...
Определения ActionBase.c:346
bool IsRolling()
Определения PlayerBase.c:5645
ActionManagerBase GetActionManager()
Определения PlayerBase.c:1887
proto native float SyncedValue_ID(int action, bool check_focus=true)
Get action state.
proto native DayZPlayerType GetDayZPlayerType()
returns appropriate DayZPlayerType
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
float GetCurrentWaterLevel()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
Определения ActionManagerBase.c:91

Перекрестные ссылки Math::AbsInt(), CanBePerformedWhileChangingStance(), GetActionManager(), GetCurrentWaterLevel(), GetDayZPlayerType(), GetRunningAction(), IsRolling() и UAInterface::SyncedValue_ID().