DayZ 1.28
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 строка 337

338 {
340 Weapon_Base weapon = Weapon_Base.Cast(itemInHands);
341 if (weapon.IsWaitingForActionFinish())
342 return false;
343
344 HumanCommandMove hcm = m_Player.GetCommand_Move();
345
347 if (hcm.GetCurrentMovementSpeed() <= 2.05 && (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT || pContinueAttack) && !m_Player.IsFighting())
348 {
350 if ( m_HitType == EMeleeHitType.NONE )
351 {
352 pContinueAttack = false;
353 return false;
354 }
355
356 m_MeleeCombat.Update(itemInHands, m_HitType);
357
358 EntityAI target;
359 EMeleeTargetType targetType;
360 GetTargetData(target, targetType);
361 float attackByDistance = GetAttackTypeByDistanceToTarget(target, targetType);
362
363 m_Player.StartCommand_Melee2(target, m_HitType == EMeleeHitType.WPN_STAB, attackByDistance, m_MeleeCombat.GetHitPos());
364 m_Player.DepleteStamina(EStaminaModifiers.MELEE_HEAVY);
366
367 pContinueAttack = false; // reset continueAttack flag
368
369 return true;
370 }
372 else if ( pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH )
373 {
374 if (hcm)
375 {
376 hcm.ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDERECT);
377 pContinueAttack = true;
378 return false;
379 }
380 }
381
382 return false;
383 }
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
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:1154
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().