DayZ 1.24
Loading...
Searching...
No Matches
DayZPlayerMeleeFightLogic_LightHeavy.c
Go to the documentation of this file.
1
6
8{
10 const float EVADE_COOLDOWN = 0.5;
11
12 //
13 const float CLOSE_TARGET_DISTANCE = 1.5;
14
16 const string DUMMY_LIGHT_AMMO = "Dummy_Light";
17 const string DUMMY_HEAVY_AMMO = "Dummy_Heavy";
18
23 protected Mission m_Mission;
24
25 protected bool m_IsInBlock;
26 protected bool m_IsEvading;
27
28 protected bool m_IsInComboRange;
30
35
37 {
41 m_Mission = GetGame().GetMission();
42
43 m_IsInBlock = false;
44 m_IsEvading = false;
47
49 }
50
52
53 bool IsInBlock()
54 {
55 return m_IsInBlock;
56 }
57
58 void SetBlock(bool block)
59 {
61 }
62
63 bool IsEvading()
64 {
65 return m_IsEvading;
66 }
67
69 {
70 return m_HitType;
71 }
72
73 bool CanFight()
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 }
83
89
91 {
92 if (pInputs.IsMeleeFastAttackModifier() && m_Player.CanConsumeStamina(EStaminaConsumers.MELEE_HEAVY))
93 return EMeleeHitType.HEAVY;
94
95 return EMeleeHitType.LIGHT;
96 }
97
99 {
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 }
111
113 {
114 if (pTargetType == EMeleeTargetType.NONALIGNABLE)
115 return 1.0;
116
119 return 1.0;
120
122 return 0.0;
123 }
124
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 {
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);
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 }
257
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 }
310
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());
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 }
356
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 {
400 if (m_Player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
401 {
403 m_Player.m_ShockHandler.CheckValue(true);
404 }
405 }
406 else
407 {
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 }
422
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());
446
447 return true;
448 }
449
450 return false;
451 }
452
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());
470
471 return true;
472 }
473
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:
530 break;
531 default:
533 break;
534 }
535
536 m_IsInComboRange = false;
537
538 return true;
539 }
540
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 }
559
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 }
592
594 {
595 //If the finisher attack haven't been performed, then use normal hit
598 }
599
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 }
615
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 }
660
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 }
677
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 }
699
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 }
716
719 {
720 switch (hitType)
721 {
723 case EMeleeHitType.KICK:
725 return true;
726 break;
727 }
728
730
731 return false;
732 }
733
736 {
737 return false;
738 }
739
741 {
743 if (m_CooldownTimers.Get(cooldownCategory).IsRunning())
745
748 m_CooldownTimers.Get(cooldownCategory).Run(time, this, "ResetCooldown", param);
749 }
750
752 {
753 switch (cooldownCategory)
754 {
756 m_IsEvading = false;
757 break;
758 }
759 }
760
761 protected void EnableControls();
762 protected void DisableControls();
763
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 }
846
849 {
850 return -1;
851 }
852
854 bool IsHitTypeFinisher(int type)
855 {
856 return false;
857 }
858
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 }
877
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 }
896
899 {
900 return -1;
901 }
902
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 }
907
910 protected bool m_IsFinisher;
911}
override Widget Init()
Definition DayZGame.c:120
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)
void EnableControls()
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)
DEPRECATED.
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
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)
void DisableControls()
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
eBrokenLegs
Definition EBrokenLegs.c:2
EMeleeTargetType
EStaminaConsumers
EStaminaModifiers
DayZPlayer m_Player
Definition Hand_Events.c:42
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
ProcessDirectDamageFlags
Definition Object.c:2
void SetCooldown(float val)
do not process rotations !
Definition DayZAnimal.c:573
void DepleteStamina(EStaminaModifiers modifier, float dT=-1)
bool CanConsumeStamina(EStaminaConsumers consumer)
Implementations only! - used on PlayerBase.
DayZPlayerImplementMeleeCombat GetMeleeCombat()
bool IsFighting()
static const int HIT_TYPE_FINISHER
Definition human.c:540
static const int HIT_TYPE_FINISHER_NECK
Definition human.c:541
HumanInventory... with FSM (synchronous, no anims)
Definition EnMath.c:7
Mission class.
Definition gameplay.c:668
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++
Definition dayzplayer.c:597
proto native CGame GetGame()
const float PVP_MAX_BLOCKABLE_ANGLE
Definition constants.c:922
const int STATE_RUINED
Definition constants.c:757
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
Definition EnMath.c:16
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].
Definition EnMath.c:54
const int CALL_CATEGORY_SYSTEM
Definition tools.c:8
proto native int GetCurrentHitType()