97 if (pEntity.HasBayonetAttached())
101 else if (pEntity.HasButtstockAttached())
129 if (invFSM && !invFSM.
IsIdle())
135 bool isFireWeapon = itemInHands && itemInHands.IsWeapon();
138 if (
HandleHitEvent(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack))
155 if (itemInHands && !itemInHands.IsMeleeWeapon() && !isFireWeapon)
174 return HandleInitialMeleeErc(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
179 return HandleProneKick(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
184 return HandleSprintAttack(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
194 return HandleComboHit(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
230 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
233 player.m_ShockHandler.CheckValue(
true);
309 gloves =
ClothingBase.Cast(player.GetItemOnSlot(
"FEET"));
313 gloves =
ClothingBase.Cast(player.GetItemOnSlot(
"GLOVES"));
341 if (weapon.IsWaitingForActionFinish() || player.GetActionManager().GetRunningAction())
364 pContinueAttack =
false;
374 pContinueAttack =
true;
400 if (finisherType != -1)
403 if (animationType > -1)
415 target.SetBeingBackstabbed(finisherType);
426 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
429 player.m_ShockHandler.CheckValue(
true);
435 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
438 player.m_ShockHandler.CheckValue(
true);
459 if ( ( hcw_angle < -90 || hcw_angle > 90 ) && player.GetBrokenLegs() !=
eBrokenLegs.BROKEN_LEGS )
523 if (itemInHands && itemInHands.IsWeapon())
546 if (player.GetBrokenLegs() ==
eBrokenLegs.BROKEN_LEGS)
554 player.m_ShockHandler.CheckValue(
true);
609 bool forcedDummy =
false;
616 vector targetPos = targetPlayer.GetPosition();
625 if ( weaponMode > 0 )
677 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
681 DamageSystem.CloseCombatDamage(
m_DZPlayer, target, hitZoneIdx, ammo, hitPosWS);
686 m_DZPlayer.ProcessMeleeHit(weapon, weaponMode, target, hitZoneIdx, hitPosWS);
694 if (
GetGame().IsServer() && targetEntity)
697 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
698 DamageSystem.CloseCombatDamage(
m_DZPlayer, target, hitZoneIdx, ammo, hitPosWS);
727 ItemBase bayonet =
ItemBase.Cast(weapon.GetInventory().FindAttachment(weapon.GetBayonetAttachmentIdx()));
729 if ( firearm && bayonet && bayonet.IsRuined() )
731 ammo = bayonet.GetRuinedMeleeAmmoType();
734 else if (weapon.IsRuined())
736 ammo = weapon.GetRuinedMeleeAmmoType();
758 targetType = target.GetMeleeTargetType();
800 Param1<int> param =
new Param1<int>(cooldownCategory);
801 m_CooldownTimers.Get(cooldownCategory).Run(time,
this,
"ResetCooldown", param);
806 switch (cooldownCategory)
822 if ( itemInHands || !target || !DZPlayer )
833 gloves.DecreaseHealth(
"",
"", 1);
842 BleedingSourcesManagerServer bleedingManager;
858 bleedingManager = player.GetBleedingManagerServer();
859 if ( bleedingManager )
861 bleedingManager.AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
870 bleedingManager = player.GetBleedingManagerServer();
871 if ( bleedingManager )
873 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
890 bleedingManager = player.GetBleedingManagerServer();
891 if ( bleedingManager )
893 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftToeBase");
902 bleedingManager = player.GetBleedingManagerServer();
903 if ( bleedingManager )
905 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftFoot");
932 switch (finisher_type)
951 switch (finisher_type)
954 ret =
"FinisherHitNeck";
protected int DetermineSpecificFinisherType(ItemBase weapon)
protected DayZPlayerImplement m_DZPlayer
Parent.
void DayZPlayerImplementMeleeCombat(DayZPlayerImplement player)
protected EMeleeHitType m_HitType
Hit type of the most recent attack.
protected bool m_IsEvading
EFightLogicCooldownCategory
Light / Heavy punches.
protected bool m_IsInComboRange
DEPRECATED.
protected bool HandleProneKick(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
kick from raised pne
void ~DayZPlayerMeleeFightLogic_LightHeavy()
protected void RegisterCooldowns()
protected bool m_IsInBlock
protected void EvaluateHit_Common(InventoryItem weapon, Object target, bool forcedDummy=false)
enum EFightLogicCooldownCategory EVADE_COOLDOWN
cooldown timers settings
protected ref DayZPlayerImplementMeleeCombat m_MeleeCombat
protected void EvaluateHit_Player(InventoryItem weapon, Object target)
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)
protected EMeleeHitType GetAttackTypeByWeaponAttachments(EntityAI pEntity)
bool IsHitTypeFinisher(int type)
DEPRECATED.
protected bool m_IsFinisher
protected bool DummyHitSelector(EMeleeHitType hitType, out string ammoType)
evaluation of hit player vs. player
protected void DisableControls()
const float CLOSE_TARGET_DISTANCE
protected EMeleeHitType GetAttackTypeFromInputs(HumanInputController pInputs)
protected void EvaluateHit_NonAlignableObjects(InventoryItem weapon, Object target)
void SetBlock(bool block)
protected 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.
bool HandleFightLogic(int pCurrentCommandID, HumanInputController pInputs, EntityAI pEntityInHands, HumanMovementState pMovementState, out bool pContinueAttack)
protected bool EvaluateFinisherAttack(InventoryItem weapon, Object target)
Check and evaluate stealth kill, if applicable.
protected void DamageHands(DayZPlayer DZPlayer, ClothingBase gloves, InventoryItem itemInHands)
protected void EvaluateHit(InventoryItem weapon)
protected bool HandleSprintAttack(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
sprint attack in erc stance
protected void GetTargetData(out EntityAI target, out EMeleeTargetType targetType)
const string DUMMY_HEAVY_AMMO
protected bool HandleHitEvent(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
Handle the event that our melee hit something.
protected ref map< int, ref Timer > m_CooldownTimers
protected 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.
protected 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
protected bool IsBehindEntity(int angle, DayZPlayer source, Object target)
DEPRECATED - moved into DayZPlayerImplementMeleeCombat.
protected Mission m_Mission
protected bool m_WasPreviousHitProcessed
protected void EvaluateHit_Infected(InventoryItem weapon, Object target)
protected bool IsShortDistance(EntityAI pTarget, float pDistanceSq)
protected void EnableControls()
bool WeaponDestroyedCheck(InventoryItem weapon, out string ammo)
const string DUMMY_LIGHT_AMMO
dummy ammo types
protected float GetAttackTypeByDistanceToTarget(EntityAI pTarget, EMeleeTargetType pTargetType=EMeleeTargetType.ALIGNABLE)
private void DayZPlayerUtils()
cannot be instantiated
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
protected void ResetCooldown(int modifier=-1)
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 bool GetCurrentInputAngle(out float pAngle)
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 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_HEAVY_MELEE_SHOCK
static const float BROKEN_LEGS_LIGHT_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 int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
static proto float SqrFloat(float f)
Returns squared value.
static proto float AbsFloat(float f)
Returns absolute value.
static const float RAD2DEG
proto native int GetCurrentHitType()