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

◆ HandleInitialFirearmMelee()

bool HandleInitialFirearmMelee ( int pCurrentCommandID,
HumanInputController pInputs,
InventoryItem itemInHands,
HumanMovementState pMovementState,
out bool pContinueAttack )
protected

NOTE: Only singular (or first) hits, combo attacks are handled in combo.

don't allow bash to interfere with actions like chambering or ejecting bullets

perform firearm melee from raised erect or continue with attack after character stand up from crouch

exit if there is no suitable attack

char stand up when performing firearm melee from crouch

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

339 {
341 Weapon_Base weapon = Weapon_Base.Cast(itemInHands);
342 if (weapon.IsWaitingForActionFinish())
343 return false;
344
345 HumanCommandMove hcm = m_Player.GetCommand_Move();
346
348 if (hcm.GetCurrentMovementSpeed() <= 2.05 && (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT || pContinueAttack) && !m_Player.IsFighting())
349 {
351 if ( m_HitType == EMeleeHitType.NONE )
352 {
353 pContinueAttack = false;
354 return false;
355 }
356
357 m_MeleeCombat.Update(itemInHands, m_HitType);
358
359 EntityAI target;
360 EMeleeTargetType targetType;
361 GetTargetData(target, targetType);
362 float attackByDistance = GetAttackTypeByDistanceToTarget(target, targetType);
363
364 m_Player.StartCommand_Melee2(target, m_HitType == EMeleeHitType.WPN_STAB, attackByDistance, m_MeleeCombat.GetHitPos());
365 m_Player.DepleteStamina(EStaminaModifiers.MELEE_HEAVY);
367
368 pContinueAttack = false; // reset continueAttack flag
369
370 return true;
371 }
373 else if ( pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH )
374 {
375 if (hcm)
376 {
377 hcm.ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDERECT);
378 pContinueAttack = true;
379 return false;
380 }
381 }
382
383 return false;
384 }
EMeleeHitType
Определения DayZPlayerImplementMeleeCombat.c:2
EMeleeHitType m_HitType
Hit type of the most recent attack.
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
void GetTargetData(out EntityAI target, out EMeleeTargetType targetType)
float GetAttackTypeByDistanceToTarget(EntityAI pTarget, EMeleeTargetType pTargetType=EMeleeTargetType.ALIGNABLE)
EMeleeHitType GetAttackTypeByWeaponAttachments(EntityAI pEntity)
void DisableControls()
EMeleeTargetType
Определения EMeleeTargetType.c:2
EStaminaModifiers
Определения EStaminaModifiers.c:2
DayZPlayer m_Player
Определения Hand_Events.c:42
Определения Building.c:6
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
proto native void ForceStance(int pStanceIdx)
Определения human.c:434
int m_iStanceIdx
current command's id
Определения human.c:1141
shorthand
Определения BoltActionRifle_Base.c:6
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602

Перекрестные ссылки DisableControls(), HumanCommandMove::ForceStance(), GetAttackTypeByDistanceToTarget(), GetAttackTypeByWeaponAttachments(), HumanCommandMove::GetCurrentMovementSpeed(), GetTargetData(), m_HitType, HumanMovementState::m_iStanceIdx, m_MeleeCombat и m_Player.

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