DayZ 1.24
Loading...
Searching...
No Matches
DayZPlayerMeleeFightLogic_LightHeavy.c File Reference

Go to the source code of this file.

Enumerations

enum  EFightLogicCooldownCategory { EVADE = 0 }
 Light / Heavy punches. More...
 

Functions

void DayZPlayerMeleeFightLogic_LightHeavy (DayZPlayerImplement player)
 
void Init (DayZPlayerImplement player)
 
void ~DayZPlayerMeleeFightLogic_LightHeavy ()
 
bool IsInBlock ()
 
void SetBlock (bool block)
 
bool IsEvading ()
 
bool GetCurrentHitType ()
 
bool CanFight ()
 
void RegisterCooldowns ()
 
EMeleeHitType GetAttackTypeFromInputs (HumanInputController pInputs)
 
EMeleeHitType GetAttackTypeByWeaponAttachments (EntityAI pEntity)
 
float GetAttackTypeByDistanceToTarget (EntityAI pTarget, EMeleeTargetType pTargetType=EMeleeTargetType.ALIGNABLE)
 
bool HandleFightLogic (int pCurrentCommandID, HumanInputController pInputs, EntityAI pEntityInHands, HumanMovementState pMovementState, out bool pContinueAttack)
 
bool HandleHitEvent (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
 Handle the event that our melee hit something.
 
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.
 
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.
 
bool HandleProneKick (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
 kick from raised pne
 
bool HandleSprintAttack (int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
 sprint attack in erc stance
 
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
 
void EvaluateHit (InventoryItem weapon)
 
void EvaluateHit_Player (InventoryItem weapon, Object target)
 
void EvaluateHit_Infected (InventoryItem weapon, Object target)
 
bool EvaluateFinisherAttack (InventoryItem weapon, Object target)
 Check and evaluate stealth kill, if applicable.
 
void EvaluateHit_Common (InventoryItem weapon, Object target, bool forcedDummy=false, int forcedWeaponMode=-1)
 
void EvaluateHit_NonAlignableObjects (InventoryItem weapon, Object target)
 
bool WeaponDestroyedCheck (InventoryItem weapon, out string ammo)
 
void GetTargetData (out EntityAI target, out EMeleeTargetType targetType)
 
bool DummyHitSelector (EMeleeHitType hitType, out string ammoType)
 evaluation of hit player vs. player
 
bool IsBehindEntity (int angle, DayZPlayer source, Object target)
 DEPRECATED - moved into DayZPlayerImplementMeleeCombat.
 
void SetCooldown (float time, EFightLogicCooldownCategory cooldownCategory)
 
void ResetCooldown (EFightLogicCooldownCategory cooldownCategory)
 
void EnableControls ()
 
void DisableControls ()
 
void DamageHands (DayZPlayer DZPlayer, ClothingBase gloves, InventoryItem itemInHands)
 
int GetFinisherType (InventoryItem weapon, EntityAI target)
 DEPRECATED.
 
bool IsHitTypeFinisher (int type)
 DEPRECATED.
 
int DetermineFinisherAnimation (int finisher_type)
 Picks a specific finisher animation. Not used for mounted bayonet stabs.
 
string DetermineFinisherAmmo (int finisher_type)
 Picks a specific finisher ammo fot the hit type. This gets synchronized and guides further behaviour of the target.
 
int DetermineSpecificFinisherType (ItemBase weapon, int component)
 DEPRECATED.
 
bool IsShortDistance (EntityAI pTarget, float pDistanceSq)
 

Variables

enum EFightLogicCooldownCategory EVADE_COOLDOWN = 0.5
 cooldown timers settings
 
const float CLOSE_TARGET_DISTANCE = 1.5
 
const string DUMMY_LIGHT_AMMO = "Dummy_Light"
 dummy ammo types
 
const string DUMMY_HEAVY_AMMO = "Dummy_Heavy"
 
PlayerBase m_Player
 
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
 
EMeleeHitType m_HitType
 
ref map< int, ref Timerm_CooldownTimers
 
Mission m_Mission
 
bool m_IsInBlock
 
bool m_IsEvading
 
bool m_IsInComboRange
 
bool m_WasPreviousHitProcessed
 
DayZPlayerImplement m_DZPlayer
 DEPRECATED.
 
bool m_IsFinisher
 

Enumeration Type Documentation

◆ EFightLogicCooldownCategory

Light / Heavy punches.

Enumerator
EVADE 

Definition at line 2 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

Function Documentation

◆ CanFight()

bool CanFight ( )
protected

Definition at line 73 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

74 {
75 if (m_Player.IsEmotePlaying())
76 return false;
77
78 if (m_Player.GetActionManager() && m_Player.GetActionManager().GetRunningAction())
79 return false;
80
81 return true;
82 }

References m_Player.

◆ DamageHands()

void DamageHands ( DayZPlayer DZPlayer,
ClothingBase gloves,
InventoryItem itemInHands )
protected

Definition at line 764 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

765 {
766 EntityAI target = m_MeleeCombat.GetTargetEntity();
767
768 //We did not hit anything
769 if (itemInHands || !target || !DZPlayer)
770 return;
771
772 //Check if server side
773 if (GetGame().IsServer())
774 {
775 int randNum;
776
777 //If gloves, damage gloves
778 if (gloves && gloves.GetHealthLevel() < GameConstants.STATE_RUINED)
779 gloves.DecreaseHealth("", "", 1);
780 else
781 {
782 //Do not add bleeding if hitting player, zombie or animal
783 if (PlayerBase.Cast(target) || DayZCreatureAI.Cast(target))
784 return;
785
787
788 //We don't inflict bleeding to hands when kicking
789 if (m_HitType != EMeleeHitType.KICK)
790 {
791 //If no gloves, inflict hand damage and bleeding
792 //m_Player.DecreaseHealth("hands", "", 10); IN CASE WE WANT TO DO STUFF WITH HAND HEALTH
793
794 //Random bleeding source
796 switch (randNum)
797 {
798 case 1:
799 if (m_Player)
800 {
801 bleedingManager = m_Player.GetBleedingManagerServer();
802 if (bleedingManager)
803 bleedingManager.AttemptAddBleedingSourceBySelection("RightForeArmRoll");
804 }
805 break;
806
807 case 2:
808 if (m_Player)
809 {
810 bleedingManager = m_Player.GetBleedingManagerServer();
811 if (bleedingManager)
812 bleedingManager.AttemptAddBleedingSourceBySelection("LeftForeArmRoll");
813 }
814 break;
815 }
816 }
817 else
818 {
819 //Random bleeding source
821 //We only add bleeding to left foot as character kicks with left foot
822 switch (randNum)
823 {
824 case 1:
825 if (m_Player)
826 {
827 bleedingManager = m_Player.GetBleedingManagerServer();
828 if (bleedingManager)
829 bleedingManager.AttemptAddBleedingSourceBySelection("LeftToeBase");
830 }
831 break;
832
833 case 2:
834 if (m_Player)
835 {
836 bleedingManager = m_Player.GetBleedingManagerServer();
837 if (bleedingManager)
838 bleedingManager.AttemptAddBleedingSourceBySelection("LeftFoot");
839 }
840 break;
841 }
842 }
843 }
844 }
845 }
ref DayZPlayerImplementMeleeCombat m_MeleeCombat
EMeleeHitType m_HitType
do not process rotations !
Definition DayZAnimal.c:573
Definition EnMath.c:7
proto native CGame GetGame()
const int STATE_RUINED
Definition constants.c:757
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
Definition EnMath.c:54

References GetGame(), m_HitType, m_MeleeCombat, m_Player, Math::RandomIntInclusive(), and GameConstants::STATE_RUINED.

Referenced by HandleHitEvent().

◆ DayZPlayerMeleeFightLogic_LightHeavy()

void DayZPlayerMeleeFightLogic_LightHeavy ( DayZPlayerImplement player)
protected

Definition at line 31 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

32 {
33 Init(player);
34 }
override Widget Init()
Definition DayZGame.c:120

References Init().

Referenced by DayZPlayer::DayZPlayerImplement().

◆ DetermineFinisherAmmo()

string DetermineFinisherAmmo ( int finisher_type)
protected

Picks a specific finisher ammo fot the hit type. This gets synchronized and guides further behaviour of the target.

Definition at line 879 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

880 {
881 string ret = "";
882
883 switch (finisher_type)
884 {
885 case EMeleeHitType.FINISHER_NECKSTAB:
886 ret = "FinisherHitNeck";
887 break;
888
889 default:
890 ret = "FinisherHit";
891 break;
892 }
893
894 return ret;
895 }

Referenced by EvaluateFinisherAttack().

◆ DetermineFinisherAnimation()

int DetermineFinisherAnimation ( int finisher_type)
protected

Picks a specific finisher animation. Not used for mounted bayonet stabs.

Definition at line 860 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

861 {
862 int animation = -1;
863
864 switch (finisher_type)
865 {
866 case EMeleeHitType.FINISHER_LIVERSTAB:
868 break;
869
870 case EMeleeHitType.FINISHER_NECKSTAB:
872 break;
873 }
874
875 return animation;
876 }
static const int HIT_TYPE_FINISHER
Definition human.c:540
static const int HIT_TYPE_FINISHER_NECK
Definition human.c:541

References HumanCommandMelee2::HIT_TYPE_FINISHER, and HumanCommandMelee2::HIT_TYPE_FINISHER_NECK.

Referenced by HandleInitialMeleeErc().

◆ DetermineSpecificFinisherType()

int DetermineSpecificFinisherType ( ItemBase weapon,
int component )
protected

DEPRECATED.

Definition at line 898 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

899 {
900 return -1;
901 }

◆ DisableControls()

◆ DummyHitSelector()

bool DummyHitSelector ( EMeleeHitType hitType,
out string ammoType )
protected

evaluation of hit player vs. player

in case of kick (on back or push from erc) change the ammo type to dummy

Definition at line 718 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

719 {
720 switch (hitType)
721 {
723 case EMeleeHitType.KICK:
725 return true;
726 break;
727 }
728
730
731 return false;
732 }
const string DUMMY_HEAVY_AMMO
const string DUMMY_LIGHT_AMMO
dummy ammo types

References DUMMY_HEAVY_AMMO, and DUMMY_LIGHT_AMMO.

Referenced by EvaluateHit_Common().

◆ EnableControls()

void EnableControls ( )
protected

Referenced by HandleHitEvent().

◆ EvaluateFinisherAttack()

bool EvaluateFinisherAttack ( InventoryItem weapon,
Object target )
protected

Check and evaluate stealth kill, if applicable.

Definition at line 601 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

602 {
603 //Debug.MeleeLog(m_Player, string.Format("EvaluateFinisherAttack[1] target=%1, hitPos=%2, hitZoneIdx=%3, finisherType=%4", m_MeleeCombat.GetTargetEntity(), m_MeleeCombat.GetHitPos().ToString(), m_MeleeCombat.GetHitZoneIdx(), m_MeleeCombat.GetFinisherType()));
604
605 if (m_MeleeCombat.GetFinisherType() > -1)
606 {
607 if (GetGame().IsServer())
608 DamageSystem.CloseCombatDamage(m_Player, target, m_MeleeCombat.GetHitZoneIdx(), DetermineFinisherAmmo(m_MeleeCombat.GetFinisherType()), m_MeleeCombat.GetHitPos(), ProcessDirectDamageFlags.NO_ATTACHMENT_TRANSFER);
609
610 return true;
611 }
612
613 return false;
614 }
string DetermineFinisherAmmo(int finisher_type)
Picks a specific finisher ammo fot the hit type. This gets synchronized and guides further behaviour ...
ProcessDirectDamageFlags
Definition Object.c:2

References DetermineFinisherAmmo(), GetGame(), m_MeleeCombat, and m_Player.

Referenced by EvaluateHit_Infected().

◆ EvaluateHit()

void EvaluateHit ( InventoryItem weapon)
protected

Definition at line 541 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

542 {
543 EntityAI target = m_MeleeCombat.GetTargetEntity();
544
545 if (target)
546 {
547 if (target.IsInherited(DayZPlayer))
549 else if (target.IsInherited(DayZInfected))
551 else if (target.GetMeleeTargetType() == EMeleeTargetType.NONALIGNABLE)
553 else
555
556 m_MeleeCombat.CheckMeleeItem();
557 }
558 }
void EvaluateHit_Player(InventoryItem weapon, Object target)
void EvaluateHit_NonAlignableObjects(InventoryItem weapon, Object target)
void EvaluateHit_Infected(InventoryItem weapon, Object target)
void EvaluateHit_Common(InventoryItem weapon, Object target, bool forcedDummy=false, int forcedWeaponMode=-1)
EMeleeTargetType

References EvaluateHit_Common(), EvaluateHit_Infected(), EvaluateHit_NonAlignableObjects(), EvaluateHit_Player(), and m_MeleeCombat.

Referenced by HandleHitEvent().

◆ EvaluateHit_Common()

void EvaluateHit_Common ( InventoryItem weapon,
Object target,
bool forcedDummy = false,
int forcedWeaponMode = -1 )
protected

check if we need to use dummy hit

normal hit with applied damage to targeted component

play hit animation for dummy hits

override hit pos by pos defined in type

Definition at line 616 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

617 {
618 int hitZoneIdx = m_MeleeCombat.GetHitZoneIdx();
619 int weaponMode = m_MeleeCombat.GetWeaponMode();
621 string ammo;
622
623 if (forcedWeaponMode > -1)
625
627
630 {
632 if (hitZoneIdx >= 0)
633 {
634 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
635
637 {
638 DamageSystem.CloseCombatDamage(m_Player, target, hitZoneIdx, ammo, hitPosWS);
639 //Debug.MeleeLog(m_Player, string.Format("EvaluateHit_Common[a]::CloseCombatDamage:: target: %1, hitzone: %2, ammo: %3", target, hitZoneIdx, ammo));
640 }
641 else
642 {
643 m_Player.ProcessMeleeHit(weapon, weaponMode, target, hitZoneIdx, hitPosWS);
644 //Debug.MeleeLog(m_Player, string.Format("EvaluateHit_Common[b]::ProcessMeleeHit:: target: %1, hitzone: %2, meleeMode: %3, forcedWeaponMode:%4", target, hitZoneIdx, weaponMode));
645 }
646 }
647 }
648 else
649 {
651 if (GetGame().IsServer() && targetEntity)
652 {
654 hitPosWS = targetEntity.ModelToWorld(targetEntity.GetDefaultHitPosition());
655 DamageSystem.CloseCombatDamage(m_Player, target, hitZoneIdx, ammo, hitPosWS);
656 //Debug.MeleeLog(m_Player, string.Format("EvaluateHit_Common[c]::CloseCombatDamage:: target: %1, hitzone: %2, meleeMode: %3, ammo: %4", target, hitZoneIdx, weaponMode, ammo));
657 }
658 }
659 }
bool DummyHitSelector(EMeleeHitType hitType, out string ammoType)
evaluation of hit player vs. player
bool WeaponDestroyedCheck(InventoryItem weapon, out string ammo)

References DummyHitSelector(), GetGame(), m_HitType, m_MeleeCombat, m_Player, and WeaponDestroyedCheck().

Referenced by EvaluateHit(), EvaluateHit_Infected(), and EvaluateHit_Player().

◆ EvaluateHit_Infected()

void EvaluateHit_Infected ( InventoryItem weapon,
Object target )
protected

Definition at line 593 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

594 {
595 //If the finisher attack haven't been performed, then use normal hit
598 }
bool EvaluateFinisherAttack(InventoryItem weapon, Object target)
Check and evaluate stealth kill, if applicable.

References EvaluateFinisherAttack(), and EvaluateHit_Common().

Referenced by EvaluateHit().

◆ EvaluateHit_NonAlignableObjects()

void EvaluateHit_NonAlignableObjects ( InventoryItem weapon,
Object target )
protected

Definition at line 661 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

662 {
663 int hitZoneIdx = m_MeleeCombat.GetHitZoneIdx();
665 string ammo;
666
667 if (hitZoneIdx >= 0)
668 {
670 DamageSystem.CloseCombatDamage(m_Player, target, hitZoneIdx, ammo, m_MeleeCombat.GetHitPos());
671 else
672 m_Player.ProcessMeleeHit(weapon, m_MeleeCombat.GetWeaponMode(), target, hitZoneIdx, m_MeleeCombat.GetHitPos());
673 }
674
675 return;
676 }

References m_MeleeCombat, m_Player, and WeaponDestroyedCheck().

Referenced by EvaluateHit().

◆ EvaluateHit_Player()

void EvaluateHit_Player ( InventoryItem weapon,
Object target )
protected

Melee Hit/Impact modifiers

if the oponnent is in Melee Block shift the damage down

Definition at line 560 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

561 {
562 int hitZoneIdx = m_MeleeCombat.GetHitZoneIdx();
563 int weaponMode = m_MeleeCombat.GetWeaponMode();
564 int forcedWeaponMode = -1;
566 bool forcedDummy = false;
567
570 if (targetPlayer)
571 {
572 vector targetPos = targetPlayer.GetPosition();
573 vector agressorPos = m_Player.GetPosition();
574
575 // We get the angle from which an infected hit the blocking player
577
579 if (targetPlayer.GetMeleeFightLogic() && targetPlayer.GetMeleeFightLogic().IsInBlock() && hitAngle <= GameConstants.PVP_MAX_BLOCKABLE_ANGLE)
580 {
581 if (weaponMode > 0)
582 {
583 forcedWeaponMode = --weaponMode; // Heavy -> Light shift
584 }
585 else
586 forcedDummy = true; // dummy hits, cannot shift lower than 0
587 }
588 }
589
591 }
const float PVP_MAX_BLOCKABLE_ANGLE
Definition constants.c:922
static proto float AngleFromPosition(vector origin, vector originDir, vector target)
Angle that a target is from the direction of an origin.
static const float RAD2DEG
Definition EnMath.c:16
static proto float AbsFloat(float f)
Returns absolute value.

References Math::AbsFloat(), Math3D::AngleFromPosition(), EvaluateHit_Common(), m_MeleeCombat, m_Player, GameConstants::PVP_MAX_BLOCKABLE_ANGLE, and Math::RAD2DEG.

Referenced by EvaluateHit().

◆ GetAttackTypeByDistanceToTarget()

float GetAttackTypeByDistanceToTarget ( EntityAI pTarget,
EMeleeTargetType pTargetType = EMeleeTargetType.ALIGNABLE )
protected

target in short distance - in place attack

target is far from the player - forward movement attack

Definition at line 112 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

113 {
114 if (pTargetType == EMeleeTargetType.NONALIGNABLE)
115 return 1.0;
116
119 return 1.0;
120
122 return 0.0;
123 }
bool IsShortDistance(EntityAI pTarget, float pDistanceSq)
const float CLOSE_TARGET_DISTANCE
static proto float SqrFloat(float f)
Returns squared value.

References CLOSE_TARGET_DISTANCE, IsShortDistance(), and Math::SqrFloat().

Referenced by HandleComboHit(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), and HandleSprintAttack().

◆ GetAttackTypeByWeaponAttachments()

EMeleeHitType GetAttackTypeByWeaponAttachments ( EntityAI pEntity)
protected

use stabbing if the bayonet/knife is attached to firearm

Definition at line 98 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

99 {
100 if (!m_Player.CanConsumeStamina(EStaminaConsumers.MELEE_HEAVY))
101 return EMeleeHitType.NONE;
102
104 if (pEntity.HasBayonetAttached())
105 return EMeleeHitType.WPN_STAB;
106 else if (pEntity.HasButtstockAttached())
107 return EMeleeHitType.WPN_HIT_BUTTSTOCK;
108
109 return EMeleeHitType.WPN_HIT;
110 }
EStaminaConsumers

References DayZPlayer::CanConsumeStamina(), and m_Player.

Referenced by HandleComboHit(), and HandleInitialFirearmMelee().

◆ GetAttackTypeFromInputs()

EMeleeHitType GetAttackTypeFromInputs ( HumanInputController pInputs)
protected

Definition at line 90 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

91 {
92 if (pInputs.IsMeleeFastAttackModifier() && m_Player.CanConsumeStamina(EStaminaConsumers.MELEE_HEAVY))
93 return EMeleeHitType.HEAVY;
94
95 return EMeleeHitType.LIGHT;
96 }

References DayZPlayer::CanConsumeStamina(), and m_Player.

Referenced by HandleComboHit(), and HandleInitialMeleeErc().

◆ GetCurrentHitType()

bool GetCurrentHitType ( )
protected

Definition at line 68 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

69 {
70 return m_HitType;
71 }

References m_HitType.

◆ GetFinisherType()

int GetFinisherType ( InventoryItem weapon,
EntityAI target )
protected

DEPRECATED.

Definition at line 848 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

849 {
850 return -1;
851 }

◆ GetTargetData()

void GetTargetData ( out EntityAI target,
out EMeleeTargetType targetType )
protected

default

nullify target for nonalignable objects (big objects)

Definition at line 700 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

701 {
702 target = m_MeleeCombat.GetTargetEntity();
703 targetType = EMeleeTargetType.ALIGNABLE;
704
705 // If there is no hitzone defined, then we won't be able to hit the target anyways..
706 if (m_MeleeCombat.GetHitZoneIdx() < 0)
707 target = null;
708
709 if (target)
710 targetType = target.GetMeleeTargetType();
711
713 if (targetType == EMeleeTargetType.NONALIGNABLE)
714 target = null;
715 }

References m_MeleeCombat.

Referenced by HandleComboHit(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), and HandleSprintAttack().

◆ HandleComboHit()

bool HandleComboHit ( int pCurrentCommandID,
HumanInputController pInputs,
InventoryItem itemInHands,
HumanMovementState pMovementState,
out bool pContinueAttack )
protected

combo hits - when we are already in Melee command and clicking UseButton

no suitable attack - skip that

No combos for the finisher command

select if the next attack will light or heavy (based on input/attachment modifier)

targetting

wait for the previous hit commit before hitting again

continue 'combo' - left hand attacks

broken legs shock

stamina depletion per attack

Definition at line 475 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

476 {
477 //Debug.MeleeLog(m_Player, "HandleComboHit::");
478
480 if (m_HitType == EMeleeHitType.NONE)
481 return false;
482
484 if (m_MeleeCombat.GetFinisherType() > -1)
485 return false;
486
491
493 if (itemInHands && itemInHands.IsWeapon())
495 else
497
499 //Debug.MeleeLog(m_Player, string.Format("HandleComboHit:: %1", EnumTools.EnumToString(EMeleeHitType, m_HitType)));
503
505 bool isHeavy = (m_HitType == EMeleeHitType.HEAVY || m_HitType == EMeleeHitType.WPN_STAB);
506 m_Player.GetCommand_Melee2().ContinueCombo(isHeavy, attackByDistance, target, m_MeleeCombat.GetHitPos());
508
510 if (m_Player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
511 {
513
514 if (!isHeavy)
516
518 m_Player.m_ShockHandler.CheckValue(true);
519 }
520
522 switch (m_HitType)
523 {
524 case EMeleeHitType.HEAVY:
525 case EMeleeHitType.SPRINT:
526 case EMeleeHitType.WPN_STAB:
527 case EMeleeHitType.WPN_HIT_BUTTSTOCK:
528 case EMeleeHitType.WPN_HIT:
529 m_Player.DepleteStamina(EStaminaModifiers.MELEE_HEAVY);
530 break;
531 default:
532 m_Player.DepleteStamina(EStaminaModifiers.MELEE_LIGHT);
533 break;
534 }
535
536 m_IsInComboRange = false;
537
538 return true;
539 }
EMeleeHitType GetAttackTypeFromInputs(HumanInputController pInputs)
void GetTargetData(out EntityAI target, out EMeleeTargetType targetType)
float GetAttackTypeByDistanceToTarget(EntityAI pTarget, EMeleeTargetType pTargetType=EMeleeTargetType.ALIGNABLE)
EMeleeHitType GetAttackTypeByWeaponAttachments(EntityAI pEntity)
void DisableControls()
eBrokenLegs
Definition EBrokenLegs.c:2
EStaminaModifiers
static const float BROKEN_LEGS_LIGHT_MELEE_SHOCK
static const float BROKEN_LEGS_HEAVY_MELEE_SHOCK

References PlayerConstants::BROKEN_LEGS_HEAVY_MELEE_SHOCK, PlayerConstants::BROKEN_LEGS_LIGHT_MELEE_SHOCK, DayZPlayer::DepleteStamina(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetAttackTypeByWeaponAttachments(), GetAttackTypeFromInputs(), GetTargetData(), m_HitType, m_IsInComboRange, m_MeleeCombat, m_Player, and m_WasPreviousHitProcessed.

Referenced by HandleFightLogic().

◆ HandleFightLogic()

bool HandleFightLogic ( int pCurrentCommandID,
HumanInputController pInputs,
EntityAI pEntityInHands,
HumanMovementState pMovementState,
out bool pContinueAttack )
protected

Check if we need to damage

Actually pressing a button to start a melee attack

do not perform attacks when blocking

if the item in hands cannot be used as melee weapon

Currently not performing any attacks, so here we start the initial

melee with firearm

first attack in raised erc (light or heavy if modifier is used). Also added support for finishers

kick from raised pne

sprint attack in erc stance

combo hits - when we are already in Melee command and clicking UseButton

evade and blocking logic

evades in raised erc stance while moving

not enough stamina to do evades

stand up when crouching and raised pressed

blocks in raised erc/pro stance (bare hand or with melee weapon only)

Definition at line 125 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

126 {
128 if (invFSM && !invFSM.IsIdle())
129 return false;
130
131 HumanCommandMove hcm = m_Player.GetCommand_Move();
133 bool isFireWeapon = itemInHands && itemInHands.IsWeapon();
134
137 return false;
138
140 if ((pInputs.IsAttackButtonDown() && !isFireWeapon) || (pInputs.IsMeleeWeaponAttack() && isFireWeapon) || (pContinueAttack && isFireWeapon))
141 {
142 //Debug.MeleeLog(m_Player, string.Format("HandleFightLogic[1] attackButtonDown=%1, meleeWeaponAttack=%2, pContinueAttack=%3, isFireWeapon=%4", pInputs.IsAttackButtonDown(), pInputs.IsMeleeWeaponAttack(), pContinueAttack, isFireWeapon));
143
146 return false;
147
149 if (itemInHands && !itemInHands.IsMeleeWeapon() && !isFireWeapon)
150 return false;
151
153 if (pCurrentCommandID == DayZPlayerConstants.COMMANDID_MOVE)
154 {
155 //Debug.MeleeLog(m_Player, "HandleFightLogic[1a]");
157 if (isFireWeapon)
159 else
160 {
162 if (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT)
165 else if (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE)
168 else if (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_ERECT && m_Player.IsSprintFull())
170 }
171 }
173 else if (pCurrentCommandID == DayZPlayerConstants.COMMANDID_MELEE2)
174 {
175 m_IsInComboRange = m_Player.GetCommand_Melee2().IsInComboRange();
178 }
179 }
181 else if (!isFireWeapon && pCurrentCommandID == DayZPlayerConstants.COMMANDID_MOVE)
182 {
184 if (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT)
185 {
186 int roll = pInputs.IsMeleeLREvade();
187 if (roll != 0)
188 {
190 if (!m_Player.CanConsumeStamina(EStaminaConsumers.MELEE_EVADE))
191 return false;
192
193 float angle;
194 if (roll == 1)
195 {
196 angle = -90; // left
197 }
198 else
199 {
200 angle = 90; // right
201 }
202
203 // start melee evade
204 m_IsEvading = true;
206 hcm.StartMeleeEvadeA(angle);
207 m_Player.DepleteStamina(EStaminaModifiers.MELEE_EVADE);
208
209 //Inflict shock when sidestepping with broken legs
210 if (m_Player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
211 {
213 m_Player.m_ShockHandler.CheckValue(true);
214 }
215 }
216 }
217
219 if (pInputs.IsWeaponRaised() && pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_CROUCH)
220 {
221 //Debug.MeleeLog(m_Player, "HandleFightLogic[2b]");
222 if (DayZPlayerUtils.PlayerCanChangeStance(m_Player, DayZPlayerConstants.STANCEIDX_RAISEDERECT))
223 {
224 //Debug.MeleeLog(m_Player, "HandleFightLogic[2c]");
225 hcm.ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDERECT);
226
227 return false;
228 }
229 }
230
233 if (!isFireWeapon && (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT || pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDPRONE))
234 {
235 float angle2;
236
237 if (hcm.GetCurrentInputAngle(angle2) && (angle2 < -130.0 || angle2 > 130))
238 {
239 hcm.SetMeleeBlock(true);
240 SetBlock(true);
241 }
242 else
243 {
244 hcm.SetMeleeBlock(false);
245 SetBlock(false);
246 }
247 }
248 else
249 {
250 hcm.SetMeleeBlock(false);
251 SetBlock(false);
252 }
253 }
254
255 return false;
256 }
bool HandleProneKick(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
kick from raised pne
EFightLogicCooldownCategory
Light / Heavy punches.
bool HandleHitEvent(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
Handle the event that our melee hit something.
enum EFightLogicCooldownCategory EVADE_COOLDOWN
cooldown timers settings
void SetBlock(bool block)
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.
bool HandleSprintAttack(int pCurrentCommandID, HumanInputController pInputs, InventoryItem itemInHands, HumanMovementState pMovementState, out bool pContinueAttack)
sprint attack in erc stance
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
void SetCooldown(float time, EFightLogicCooldownCategory cooldownCategory)
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
HumanInventory... with FSM (synchronous, no anims)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References PlayerConstants::BROKEN_LEGS_LIGHT_MELEE_SHOCK, DayZPlayer::CanConsumeStamina(), DayZPlayerUtils(), DayZPlayer::DepleteStamina(), EVADE_COOLDOWN, HandleComboHit(), HandleHitEvent(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), HandleSprintAttack(), DayZPlayer::IsSprintFull(), m_IsEvading, m_IsInBlock, m_IsInComboRange, m_Player, SetBlock(), and SetCooldown().

◆ HandleHitEvent()

bool HandleHitEvent ( int pCurrentCommandID,
HumanInputController pInputs,
InventoryItem itemInHands,
HumanMovementState pMovementState,
out bool pContinueAttack )
protected

Handle the event that our melee hit something.

Check if we need to damage

on anim event Hit received

re-target (enemy can have moved out of range or disappeared)

evaluate hit - selection of cfg 'ammo' type

Definition at line 259 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

260 {
262 if (pCurrentCommandID == DayZPlayerConstants.COMMANDID_MELEE2)
263 {
264 HumanCommandMelee2 hmc2a = m_Player.GetCommand_Melee2();
265 if (hmc2a)
266 {
268 if (hmc2a.WasHit())
269 {
270 //Debug.MeleeLog(m_Player, "HandleHitEvent[START]");
271 //Debug.MeleeLog(m_Player, string.Format("HandleHitEvent[1] target=%1, hitPos=%2, hitZoneIdx=%3, finisherType=%4", m_MeleeCombat.GetTargetEntity(), m_MeleeCombat.GetHitPos().ToString(), m_MeleeCombat.GetHitZoneIdx(), m_MeleeCombat.GetFinisherType()));
272 if (m_MeleeCombat.GetFinisherType() == -1)
273 {
274 //Debug.MeleeLog(m_Player, string.Format("HandleHitEvent[2] target=%1, hitPos=%2, hitZoneIdx=%3, finisherType=%4", m_MeleeCombat.GetTargetEntity(), m_MeleeCombat.GetHitPos().ToString(), m_MeleeCombat.GetHitZoneIdx(), m_MeleeCombat.GetFinisherType()));
276 m_MeleeCombat.Update(itemInHands, m_HitType, true);
277 }
278
281
282 //Get gloves
284 if (m_HitType == EMeleeHitType.KICK)
285 {
286 //We kick so "gloves" will be the shoes
287 gloves = ClothingBase.Cast(m_Player.GetItemOnSlot("FEET"));
288 }
289 else
290 gloves = ClothingBase.Cast(m_Player.GetItemOnSlot("GLOVES"));
291
292 //If we hit something, inflict damage
294
295 m_MeleeCombat.ResetTarget();
296
298
300
301 //Debug.MeleeLog(m_Player, "HandleHitEvent[END]");
302
303 return true;
304 }
305 }
306 }
307
308 return false;
309 }
void EnableControls()
void DamageHands(DayZPlayer DZPlayer, ClothingBase gloves, InventoryItem itemInHands)
void EvaluateHit(InventoryItem weapon)

References DamageHands(), EnableControls(), EvaluateHit(), m_HitType, m_MeleeCombat, m_Player, and m_WasPreviousHitProcessed.

Referenced by HandleFightLogic().

◆ 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

Definition at line 312 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

313 {
316 if (weapon.IsWaitingForActionFinish())
317 return false;
318
319 HumanCommandMove hcm = m_Player.GetCommand_Move();
320
322 if (hcm.GetCurrentMovementSpeed() <= 2.05 && (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDERECT || pContinueAttack) && !m_Player.IsFighting())
323 {
325 if (m_HitType == EMeleeHitType.NONE)
326 return false;
327
329
334
335 m_Player.StartCommand_Melee2(target, m_HitType == EMeleeHitType.WPN_STAB, attackByDistance, m_MeleeCombat.GetHitPos());
336 m_Player.DepleteStamina(EStaminaModifiers.MELEE_HEAVY);
338
339 pContinueAttack = false; // reset continueAttack flag
340
341 return true;
342 }
344 else if (pMovementState.m_iStanceIdx == DayZPlayerConstants.STANCEIDX_RAISEDCROUCH)
345 {
346 if (hcm)
347 {
348 hcm.ForceStance(DayZPlayerConstants.STANCEIDX_RAISEDERECT);
349 pContinueAttack = true;
350 return false;
351 }
352 }
353
354 return false;
355 }

References DayZPlayer::DepleteStamina(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetAttackTypeByWeaponAttachments(), GetTargetData(), DayZPlayer::IsFighting(), m_HitType, m_MeleeCombat, and m_Player.

Referenced by HandleFightLogic().

◆ HandleInitialMeleeErc()

bool HandleInitialMeleeErc ( int pCurrentCommandID,
HumanInputController pInputs,
InventoryItem itemInHands,
HumanMovementState pMovementState,
out bool pContinueAttack )
protected

First attack in raised erc (light or heavy if modifier is used). Also added support for finishers.

Definition at line 358 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

359 {
360 //Debug.MeleeLog(m_Player, "HandleInitialMeleeErc[1]");
361
364
365 //Debug.MeleeLog(m_Player, string.Format("HandleInitialMeleeErc[2] %1", EnumTools.EnumToString(EMeleeHitType, m_HitType)));
366
371
372 // finisher attack hittype override
373 int finisherType = m_MeleeCombat.GetFinisherType();
374 if (finisherType != -1)
375 {
377 if (animationType > -1)
378 {
379 //Debug.MeleeLog(m_Player, string.Format("HandleInitialMeleeErc[3a] target=%1, finisherType=%2, animationType=%3, hitPositionWS=%4", target, finisherType, animationType, m_MeleeCombat.GetHitPos().ToString()));
380 m_Player.StartCommand_Melee2(target, animationType, attackByDistance, m_MeleeCombat.GetHitPos());
381 }
382 else
383 {
384 //Debug.MeleeLog(m_Player, string.Format("HandleInitialMeleeErc[3b] target=%1, finisherType=%2, animationType=%3, hitPositionWS=%4", target, finisherType, (m_HitType == EMeleeHitType.HEAVY).ToString(), m_MeleeCombat.GetHitPos().ToString()));
385 m_Player.StartCommand_Melee2(target, m_HitType == EMeleeHitType.HEAVY, attackByDistance, m_MeleeCombat.GetHitPos());
386 }
387
389 target.SetBeingBackstabbed(finisherType);
390 }
391 else
392 {
393 //Debug.MeleeLog(m_Player, string.Format("HandleInitialMeleeErc[3d] target=%1, animationType=%2, hitPositionWS=%3", target, (m_HitType == EMeleeHitType.HEAVY).ToString(), m_MeleeCombat.GetHitPos().ToString()));
394 m_Player.StartCommand_Melee2(target, m_HitType == EMeleeHitType.HEAVY, attackByDistance, m_MeleeCombat.GetHitPos());
395 }
396
397 if (m_HitType == EMeleeHitType.HEAVY)
398 {
399 m_Player.DepleteStamina(EStaminaModifiers.MELEE_HEAVY);
400 if (m_Player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
401 {
403 m_Player.m_ShockHandler.CheckValue(true);
404 }
405 }
406 else
407 {
408 m_Player.DepleteStamina(EStaminaModifiers.MELEE_LIGHT);
409 if (m_Player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
410 {
412 m_Player.m_ShockHandler.CheckValue(true);
413 }
414 }
415
417
419
420 return true;
421 }
int DetermineFinisherAnimation(int finisher_type)
Picks a specific finisher animation. Not used for mounted bayonet stabs.

References PlayerConstants::BROKEN_LEGS_HEAVY_MELEE_SHOCK, PlayerConstants::BROKEN_LEGS_LIGHT_MELEE_SHOCK, DayZPlayer::DepleteStamina(), DetermineFinisherAnimation(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetAttackTypeFromInputs(), GetTargetData(), m_HitType, m_MeleeCombat, m_Player, and m_WasPreviousHitProcessed.

Referenced by HandleFightLogic().

◆ HandleProneKick()

bool HandleProneKick ( int pCurrentCommandID,
HumanInputController pInputs,
InventoryItem itemInHands,
HumanMovementState pMovementState,
out bool pContinueAttack )
protected

kick from raised pne

check if player is on back (situation where the player is raised in prone and on back is not in anim graph)

Definition at line 424 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

425 {
426 HumanCommandWeapons hcw = m_Player.GetCommandModifier_Weapons();
427
428 float hcw_angle = hcw.GetBaseAimingAngleLR();
431 if ((hcw_angle < -90 || hcw_angle > 90) && m_Player.GetBrokenLegs() != eBrokenLegs.BROKEN_LEGS)
432 {
433 // targetting
436
441
442 // command
443 m_Player.StartCommand_Melee2(target, false, attackByDistance, m_MeleeCombat.GetHitPos());
444 m_Player.DepleteStamina(EStaminaModifiers.MELEE_HEAVY);
446
447 return true;
448 }
449
450 return false;
451 }

References DayZPlayer::DepleteStamina(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetTargetData(), m_HitType, m_MeleeCombat, and m_Player.

Referenced by HandleFightLogic().

◆ HandleSprintAttack()

bool HandleSprintAttack ( int pCurrentCommandID,
HumanInputController pInputs,
InventoryItem itemInHands,
HumanMovementState pMovementState,
out bool pContinueAttack )
protected

sprint attack in erc stance

targetting

command

Definition at line 454 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

455 {
457 m_HitType = EMeleeHitType.SPRINT;
459
464
466 //Debug.MeleeLog(m_Player, string.Format("HandleSprintAttack[1] target=%1, animationType=%2, hitPositionWS=%3", target, false, m_MeleeCombat.GetHitPos().ToString()));
467 m_Player.StartCommand_Melee2(target, false, attackByDistance, m_MeleeCombat.GetHitPos());
468 m_Player.DepleteStamina(EStaminaModifiers.MELEE_HEAVY);
470
471 return true;
472 }

References DayZPlayer::DepleteStamina(), DisableControls(), GetAttackTypeByDistanceToTarget(), GetTargetData(), m_HitType, m_MeleeCombat, and m_Player.

Referenced by HandleFightLogic().

◆ Init()

void Init ( DayZPlayerImplement player)
protected

◆ IsBehindEntity()

bool IsBehindEntity ( int angle,
DayZPlayer source,
Object target )
protected

DEPRECATED - moved into DayZPlayerImplementMeleeCombat.

Definition at line 735 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

736 {
737 return false;
738 }

◆ IsEvading()

bool IsEvading ( )
protected

Definition at line 63 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

64 {
65 return m_IsEvading;
66 }

References m_IsEvading.

◆ IsHitTypeFinisher()

bool IsHitTypeFinisher ( int type)
protected

DEPRECATED.

Definition at line 854 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

855 {
856 return false;
857 }

◆ IsInBlock()

bool IsInBlock ( )
protected

Definition at line 53 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

54 {
55 return m_IsInBlock;
56 }

References m_IsInBlock.

◆ IsShortDistance()

bool IsShortDistance ( EntityAI pTarget,
float pDistanceSq )
protected

Definition at line 903 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

904 {
905 return pTarget && vector.DistanceSq(m_Player.GetPosition(), m_MeleeCombat.GetHitPos()) <= pDistanceSq || vector.DistanceSq(m_Player.GetBonePositionWS(m_Player.GetBoneIndexByName("Head")), m_MeleeCombat.GetHitPos()) <= pDistanceSq)
906 }
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.

References vector::DistanceSq(), m_MeleeCombat, and m_Player.

Referenced by GetAttackTypeByDistanceToTarget().

◆ RegisterCooldowns()

void RegisterCooldowns ( )
protected

Definition at line 84 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

85 {
88 }
ref map< int, ref Timer > m_CooldownTimers
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8

References CALL_CATEGORY_SYSTEM, and m_CooldownTimers.

Referenced by Init().

◆ ResetCooldown()

void ResetCooldown ( EFightLogicCooldownCategory cooldownCategory)
protected

Definition at line 751 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

752 {
753 switch (cooldownCategory)
754 {
756 m_IsEvading = false;
757 break;
758 }
759 }

References m_IsEvading.

◆ SetBlock()

void SetBlock ( bool block)
protected

Definition at line 58 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

59 {
61 }

References m_IsInBlock.

Referenced by HandleFightLogic().

◆ SetCooldown()

void SetCooldown ( float time,
EFightLogicCooldownCategory cooldownCategory )
protected

stops currently running cooldown timer (for specific category)

param for ResetCooldown

Definition at line 740 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

741 {
743 if (m_CooldownTimers.Get(cooldownCategory).IsRunning())
745
748 m_CooldownTimers.Get(cooldownCategory).Run(time, this, "ResetCooldown", param);
749 }

References m_CooldownTimers.

◆ WeaponDestroyedCheck()

bool WeaponDestroyedCheck ( InventoryItem weapon,
out string ammo )
protected

Definition at line 678 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

679 {
680 if (!weapon)
681 return false;
682
684 ItemBase bayonet = ItemBase.Cast(weapon.GetInventory().FindAttachment(weapon.GetBayonetAttachmentIdx()));
685
686 if (firearm && bayonet && bayonet.IsRuined())
687 {
688 ammo = bayonet.GetRuinedMeleeAmmoType();
689 return true;
690 }
691 else if (weapon.IsRuined())
692 {
693 ammo = weapon.GetRuinedMeleeAmmoType();
694 return true;
695 }
696 else
697 return false;
698 }

Referenced by EvaluateHit_Common(), and EvaluateHit_NonAlignableObjects().

◆ ~DayZPlayerMeleeFightLogic_LightHeavy()

Variable Documentation

◆ CLOSE_TARGET_DISTANCE

const float CLOSE_TARGET_DISTANCE = 1.5

◆ DUMMY_HEAVY_AMMO

const string DUMMY_HEAVY_AMMO = "Dummy_Heavy"

Definition at line 17 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

Referenced by DummyHitSelector().

◆ DUMMY_LIGHT_AMMO

const string DUMMY_LIGHT_AMMO = "Dummy_Light"

dummy ammo types

Definition at line 16 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

Referenced by DummyHitSelector().

◆ EVADE_COOLDOWN

enum EFightLogicCooldownCategory EVADE_COOLDOWN = 0.5

cooldown timers settings

Referenced by HandleFightLogic().

◆ m_CooldownTimers

ref map<int, ref Timer> m_CooldownTimers
protected

Definition at line 22 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

Referenced by RegisterCooldowns(), and SetCooldown().

◆ m_DZPlayer

DayZPlayerImplement m_DZPlayer
protected

DEPRECATED.

Definition at line 909 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

◆ m_HitType

EMeleeHitType m_HitType
protected

Definition at line 21 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

◆ m_IsEvading

bool m_IsEvading
protected

◆ m_IsFinisher

bool m_IsFinisher
protected

Definition at line 910 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

◆ m_IsInBlock

bool m_IsInBlock
protected

Definition at line 25 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

Referenced by HandleFightLogic(), Init(), IsInBlock(), and SetBlock().

◆ m_IsInComboRange

bool m_IsInComboRange
protected

Definition at line 28 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

Referenced by HandleComboHit(), and HandleFightLogic().

◆ m_MeleeCombat

◆ m_Mission

◆ m_Player

PlayerBase m_Player
protected

Definition at line 19 of file DayZPlayerMeleeFightLogic_LightHeavy.c.

◆ m_WasPreviousHitProcessed

bool m_WasPreviousHitProcessed
protected