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 if (
HandleHitEvent(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack))
161 if (itemInHands && !itemInHands.IsMeleeWeapon() && !isFireWeapon)
178 return HandleInitialMeleeErc(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
183 return HandleProneKick(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
188 return HandleSprintAttack(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
198 return HandleComboHit(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
237 m_Player.m_ShockHandler.CheckValue(
true);
342 if (weapon.IsWaitingForActionFinish())
353 pContinueAttack =
false;
368 pContinueAttack =
false;
378 pContinueAttack =
true;
403 if (finisherType != -1)
406 if (animationType > -1)
418 target.SetBeingBackstabbed(finisherType);
432 m_Player.m_ShockHandler.CheckValue(
true);
441 m_Player.m_ShockHandler.CheckValue(
true);
460 if ( ( hcw_angle < -90 || hcw_angle > 90 ) &&
m_Player.GetBrokenLegs() !=
eBrokenLegs.BROKEN_LEGS )
514 if (itemInHands && itemInHands.IsWeapon())
538 m_Player.GetCommand_Melee2().ContinueCombo(isHeavy, attackByDistance, target,
m_MeleeCombat.GetHitPos());
550 m_Player.m_ShockHandler.CheckValue(
true);
602 int forcedWeaponMode = -1;
604 bool forcedDummy =
false;
610 vector targetPos = targetPlayer.GetPosition();
621 forcedWeaponMode = --weaponMode;
661 if (forcedWeaponMode > -1)
662 weaponMode = forcedWeaponMode;
672 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
676 DamageSystem.CloseCombatDamage(
m_Player, target, hitZoneIdx, ammo, hitPosWS);
681 m_Player.ProcessMeleeHit(weapon, weaponMode, target, hitZoneIdx, hitPosWS);
689 if (
GetGame().IsServer() && targetEntity)
692 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
693 DamageSystem.CloseCombatDamage(
m_Player, target, hitZoneIdx, ammo, hitPosWS);
722 ItemBase bayonet =
ItemBase.Cast(weapon.GetInventory().FindAttachment(weapon.GetBayonetAttachmentIdx()));
724 if ( firearm && bayonet && bayonet.IsRuined() )
726 ammo = bayonet.GetRuinedMeleeAmmoType();
729 else if (weapon.IsRuined())
731 ammo = weapon.GetRuinedMeleeAmmoType();
753 targetType = target.GetMeleeTargetType();
795 Param1<int> param =
new Param1<int>(cooldownCategory);
796 m_CooldownTimers.Get(cooldownCategory).Run(time,
this,
"ResetCooldown", param);
801 switch (cooldownCategory)
817 if (itemInHands || !target || !DZPlayer)
828 gloves.DecreaseHealth(
"",
"", 1);
836 BleedingSourcesManagerServer bleedingManager;
848 bleedingManager =
m_Player.GetBleedingManagerServer();
850 bleedingManager.AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
857 bleedingManager =
m_Player.GetBleedingManagerServer();
859 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
874 bleedingManager =
m_Player.GetBleedingManagerServer();
876 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftToeBase");
883 bleedingManager =
m_Player.GetBleedingManagerServer();
885 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftFoot");
899 switch (finisher_type)
918 switch (finisher_type)
921 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()