78 if (
m_Player.GetActionManager() &&
m_Player.GetActionManager().GetRunningAction())
108 if (pEntity.HasBayonetAttached())
112 else if (pEntity.HasButtstockAttached())
140 if (invFSM && !invFSM.
IsIdle())
145 bool isFireWeapon = itemInHands && itemInHands.IsWeapon();
148 HandleHitEvent(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
160 if (itemInHands && !itemInHands.IsMeleeWeapon() && !isFireWeapon)
177 return HandleInitialMeleeErc(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
182 return HandleProneKick(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
187 return HandleSprintAttack(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
197 return HandleComboHit(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
236 m_Player.m_ShockHandler.CheckValue(
true);
341 if (weapon.IsWaitingForActionFinish())
352 pContinueAttack =
false;
367 pContinueAttack =
false;
377 pContinueAttack =
true;
402 if (finisherType != -1)
405 if (animationType > -1)
417 target.SetBeingBackstabbed(finisherType);
431 m_Player.m_ShockHandler.CheckValue(
true);
440 m_Player.m_ShockHandler.CheckValue(
true);
459 if ( ( hcw_angle < -90 || hcw_angle > 90 ) &&
m_Player.GetBrokenLegs() !=
eBrokenLegs.BROKEN_LEGS )
510 if (itemInHands && itemInHands.IsWeapon())
544 m_Player.GetCommand_Melee2().ContinueCombo(isHeavy, attackByDistance, target,
m_MeleeCombat.GetHitPos());
556 m_Player.m_ShockHandler.CheckValue(
true);
608 int forcedWeaponMode = -1;
610 bool forcedDummy =
false;
616 vector targetPos = targetPlayer.GetPosition();
627 forcedWeaponMode = --weaponMode;
667 if (forcedWeaponMode > -1)
668 weaponMode = forcedWeaponMode;
678 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
682 DamageSystem.CloseCombatDamage(
m_Player, target, hitZoneIdx, ammo, hitPosWS);
687 m_Player.ProcessMeleeHit(weapon, weaponMode, target, hitZoneIdx, hitPosWS);
695 if (
GetGame().IsServer() && targetEntity)
698 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
699 DamageSystem.CloseCombatDamage(
m_Player, target, hitZoneIdx, ammo, hitPosWS);
728 ItemBase bayonet =
ItemBase.Cast(weapon.GetInventory().FindAttachment(weapon.GetBayonetAttachmentIdx()));
730 if ( firearm && bayonet && bayonet.IsRuined() )
732 ammo = bayonet.GetRuinedMeleeAmmoType();
735 else if (weapon.IsRuined())
737 ammo = weapon.GetRuinedMeleeAmmoType();
759 targetType = target.GetMeleeTargetType();
801 Param1<int> param =
new Param1<int>(cooldownCategory);
802 m_CooldownTimers.Get(cooldownCategory).Run(time,
this,
"ResetCooldown", param);
807 switch (cooldownCategory)
823 if (itemInHands || !target || !DZPlayer)
834 gloves.DecreaseHealth(
"",
"", 1);
842 BleedingSourcesManagerServer bleedingManager;
854 bleedingManager =
m_Player.GetBleedingManagerServer();
856 bleedingManager.AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
863 bleedingManager =
m_Player.GetBleedingManagerServer();
865 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
880 bleedingManager =
m_Player.GetBleedingManagerServer();
882 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftToeBase");
889 bleedingManager =
m_Player.GetBleedingManagerServer();
891 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftFoot");
905 switch (finisher_type)
924 switch (finisher_type)
927 ret =
"FinisherHitNeck";
DayZPlayerImplement m_DZPlayer
Parent.
void DayZPlayerImplementMeleeCombat(DayZPlayerImplement player)
EMeleeHitType m_HitType
Hit type of the most recent attack.
int DetermineSpecificFinisherType(ItemBase weapon)
bool HandleProneKick(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
kick from raised pne
void EvaluateHit_Player(InventoryItem weapon, Object target)
bool IsShortDistance(EntityAI pTarget, float pDistanceSq)
EFightLogicCooldownCategory
Light / Heavy punches.
void DamageHands(DayZPlayer DZPlayer, ClothingBase gloves, InventoryItem itemInHands)
void ~DayZPlayerMeleeFightLogic_LightHeavy()
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
bool HandleHitEvent(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
Handle the event that our melee hit something.
EMeleeHitType GetAttackTypeFromInputs(HumanInputController pInputs)
enum EFightLogicCooldownCategory EVADE_COOLDOWN
cooldown timers settings
bool IsBehindEntity(int angle, DayZPlayer source, Object target)
DEPRECATED - moved into DayZPlayerImplementMeleeCombat.
bool EvaluateFinisherAttack(InventoryItem weapon, Object target)
Check and evaluate stealth kill, if applicable.
string DetermineFinisherAmmo(int finisher_type)
Picks a specific finisher ammo fot the hit type. This gets synchronized and guides further behaviour ...
void DayZPlayerMeleeFightLogic_LightHeavy(DayZPlayerImplement player)
bool IsHitTypeFinisher(int type)
const float CLOSE_TARGET_DISTANCE
void EvaluateHit_NonAlignableObjects(InventoryItem weapon, Object target)
void SetBlock(bool block)
ref map< int, ref Timer > m_CooldownTimers
bool HandleInitialFirearmMelee(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
NOTE: Only singular (or first) hits, combo attacks are handled in combo.
int DetermineFinisherAnimation(int finisher_type)
Picks a specific finisher animation. Not used for mounted bayonet stabs.
void GetTargetData(out EntityAI target, out EMeleeTargetType targetType)
bool HandleFightLogic(int pCurrentCommandID, HumanInputController pInputs, EntityAI pEntityInHands, HumanMovementState pMovementState, out bool pContinueAttack)
bool HandleSprintAttack(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
sprint attack in erc stance
bool DummyHitSelector(EMeleeHitType hitType, out string ammoType)
evaluation of hit player vs. player
void EvaluateHit_Infected(InventoryItem weapon, Object target)
float GetAttackTypeByDistanceToTarget(EntityAI pTarget, EMeleeTargetType pTargetType=EMeleeTargetType.ALIGNABLE)
const string DUMMY_HEAVY_AMMO
void EvaluateHit(InventoryItem weapon)
bool HandleComboHit(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
combo hits - when we are already in Melee command and clicking UseButton
bool m_WasPreviousHitProcessed
EMeleeHitType GetAttackTypeByWeaponAttachments(EntityAI pEntity)
bool WeaponDestroyedCheck(InventoryItem weapon, out string ammo)
const string DUMMY_LIGHT_AMMO
dummy ammo types
void ResetCooldown(EFightLogicCooldownCategory cooldownCategory)
void EvaluateHit_Common(InventoryItem weapon, Object target, bool forcedDummy=false, int forcedWeaponMode=-1)
bool HandleInitialMeleeErc(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
First attack in raised erc (light or heavy if modifier is used). Also added support for finishers.
void DayZPlayerUtils()
cannot be instantiated
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
void SetCooldown(float val)
proto native Mission GetMission()
do not process rotations !
override int GetMeleeTargetType()
proto native bool WasHit()
is true only once after hit event
static const int HIT_TYPE_FINISHER
static const int HIT_TYPE_FINISHER_NECK
proto native void StartMeleeEvadeA(float pDirAngle)
marks command to continue to combo, pDirAngle specifies angle
proto native float GetCurrentMovementSpeed()
0,1,2..3 idle, walk, run, sprint
proto native void ForceStance(int pStanceIdx)
proto bool GetCurrentInputAngle(out float pAngle)
proto native void SetMeleeBlock(bool pBlock)
this enables/disables block
proto native float GetBaseAimingAngleLR()
returns base aiming angle LR - without sway/offsets/...
HumanInventory... with FSM (synchronous, no anims)
int m_iStanceIdx
current command's id
static const float BROKEN_LEGS_LIGHT_MELEE_SHOCK
static const float BROKEN_LEGS_HEAVY_MELEE_SHOCK
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
DayZPlayerConstants
defined in C++
proto native CGame GetGame()
const float PVP_MAX_BLOCKABLE_ANGLE
static proto float AngleFromPosition(vector origin, vector originDir, vector target)
Angle that a target is from the direction of an origin.
static proto float SqrFloat(float f)
Returns squared value.
static const float RAD2DEG
static proto float AbsFloat(float f)
Returns absolute value.
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
proto native int GetCurrentHitType()