68 bool GetCurrentHitType()
78 if (
m_Player.GetActionManager() &&
m_Player.GetActionManager().GetRunningAction())
108 if (pEntity.HasBayonetAttached())
112 else if (pEntity.HasButtstockAttached())
140 if (invFSM && !invFSM.
IsIdle())
143 HumanCommandMove hcm =
m_Player.GetCommand_Move();
145 bool isFireWeapon = itemInHands && itemInHands.IsWeapon();
148 HandleHitEvent(pCurrentCommandID, pInputs, itemInHands, pMovementState, pContinueAttack);
151 if ((pInputs.IsAttackButtonDown() && !isFireWeapon) || (pInputs.IsMeleeWeaponAttack() && isFireWeapon) || (pContinueAttack && isFireWeapon))
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);
207 int roll = pInputs.IsMeleeLREvade();
229 hcm.StartMeleeEvadeA(angle);
236 m_Player.m_ShockHandler.CheckValue(
true);
242 if (pInputs.IsWeaponRaised() && pMovementState.m_iStanceIdx ==
DayZPlayerConstants.STANCEIDX_CROUCH)
260 if (hcm.GetCurrentInputAngle(angle2) && (angle2 < -130.0 || angle2 > 130))
262 hcm.SetMeleeBlock(
true);
267 hcm.SetMeleeBlock(
false);
273 hcm.SetMeleeBlock(
false);
287 HumanCommandMelee2 hmc2a =
m_Player.GetCommand_Melee2();
341 if (weapon.IsWaitingForActionFinish())
344 HumanCommandMove hcm =
m_Player.GetCommand_Move();
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);
454 HumanCommandWeapons hcw =
m_Player.GetCommandModifier_Weapons();
456 float hcw_angle = hcw.GetBaseAimingAngleLR();
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();
620 float hitAngle =
Math.RAD2DEG *
Math.AbsFloat(
Math3D.AngleFromPosition(targetPos, MiscGameplayFunctions.GetHeadingVector(targetPlayer), agressorPos));
623 if (targetPlayer.GetMeleeFightLogic() && targetPlayer.GetMeleeFightLogic().IsInBlock() && hitAngle <=
GameConstants.PVP_MAX_BLOCKABLE_ANGLE)
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)
832 if (gloves && gloves.GetHealthLevel() <
GameConstants.STATE_RUINED)
834 gloves.DecreaseHealth(
"",
"", 1);
842 BleedingSourcesManagerServer bleedingManager;
848 randNum =
Math.RandomIntInclusive(1, 15);
854 bleedingManager =
m_Player.GetBleedingManagerServer();
856 bleedingManager.AttemptAddBleedingSourceBySelection(
"RightForeArmRoll");
863 bleedingManager =
m_Player.GetBleedingManagerServer();
865 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftForeArmRoll");
873 randNum =
Math.RandomIntInclusive(1, 15);
880 bleedingManager =
m_Player.GetBleedingManagerServer();
882 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftToeBase");
889 bleedingManager =
m_Player.GetBleedingManagerServer();
891 bleedingManager.AttemptAddBleedingSourceBySelection(
"LeftFoot");
905 switch (finisher_type)
908 animation = HumanCommandMelee2.HIT_TYPE_FINISHER;
912 animation = HumanCommandMelee2.HIT_TYPE_FINISHER_NECK;
924 switch (finisher_type)
927 ret =
"FinisherHitNeck";
do not process rotations !
void DepleteStamina(EStaminaModifiers modifier, float dT=-1)
bool CanConsumeStamina(EStaminaConsumers consumer)
Implementations only! - used on PlayerBase.
DayZPlayerImplementMeleeCombat GetMeleeCombat()
HumanInventory... with FSM (synchronous, no anims)
DayZPlayerConstants
defined in C++
DayZPlayerImplement m_DZPlayer
Parent.
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.
proto native CGame GetGame()
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
void SetCooldown(float val)