Enumerations | |
| enum | EMeleeHitType { NONE = -1 , LIGHT , HEAVY , SPRINT , KICK , FINISHER_LIVERSTAB , FINISHER_NECKSTAB , FINISHER_GENERIC , WPN_HIT , WPN_HIT_BUTTSTOCK , WPN_STAB , WPN_STAB_FINISHER } |
Functions | |
| void | DayZPlayerImplementMeleeCombat (DayZPlayerImplement player) |
| void | Init (DayZPlayerImplement player) |
| void | ~DayZPlayerImplementMeleeCombat () |
| EMeleeHitType | GetHitType () |
| void | SetHitZoneIdx (int pHitZone) |
| EntityAI | GetTargetEntity () |
| void | SetTargetObject (Object pTarget) |
| int | GetHitZoneIdx () |
| component idx | |
| vector | GetHitPos () |
| void | SetHitPos (vector pHitPos) |
| int | GetFinisherType () |
| void | SetFinisherType (int pFinisherType) |
| int | GetWeaponMode () |
| void | Reset (InventoryItem weapon, EMeleeHitType hitMask, bool wasHitEvent=false) |
| void | ResetTarget () |
| void | Update (InventoryItem weapon, EMeleeHitType hitMask, bool wasHitEvent=false) |
| void | CheckMeleeItem () |
| protected int | SelectWeaponMode (InventoryItem weapon) |
| protected float | GetWeaponRange (InventoryItem weapon, int weaponMode) |
| protected float | GetRange () |
| protected float | GetAngle () |
| protected void | TargetSelection () |
| protected int | TrySelectFinisherType (InventoryItem weapon, EntityAI target) |
| General condition for finisher attacks. | |
| protected int | DetermineSpecificFinisherType (ItemBase weapon) |
| protected void | InternalResetTarget () |
| protected void | SetTarget (Object obj, vector hitPos, int hitZone) |
| protected bool | CanObjectBeTargeted (Object obj, bool checkNonAligneAble=false) |
| protected bool | HitZoneSelectionRaycastHelper (out vector hitPos, out int hitZone, out Object target) |
| protected bool | HitZoneSelectionRaycast (out vector hitPos, out int hitZone, out Object target, bool useCamera) |
| protected void | HitZoneSelection () |
| DEPRECATED. | |
| protected bool | IsObstructed (Object object) |
| DEPRECATED - New function in MeleeTargeting. | |
| private bool | IsEntityBehindEntityInAngle (EntityAI source, EntityAI target, float angle) |
Variables | |
| enum EMeleeHitType | TARGETING_ANGLE_NORMAL = 30.0 |
| Target selection settings. | |
| protected const float | TARGETING_ANGLE_SPRINT = 15.0 |
| Second Pass: Half angle of cone during sprint. | |
| protected const float | TARGETING_MIN_HEIGHT = -2.0 |
| Second Pass: How deep the cone goes in meters from player position. | |
| protected const float | TARGETING_MAX_HEIGHT = 2.0 |
| Second Pass: How high the cone goes in meters from player position. | |
| protected const float | TARGETING_RAY_RADIUS_EX = 0.5 |
| Second Pass: Max distance from ray projected from player looking direction. | |
| protected const float | TARGETING_RAY_RADIUS = 0.25 |
| DEPRECATED: "HitZoneSelection". | |
| protected const float | TARGETING_RAY_DIST = 5.0 |
| DEPRECATED: "HitZoneSelection". | |
| protected const float | TARGETING_RAY_DIST_SHORT = 2.0 |
| DEPRECATED: "HitZoneSelection". | |
| protected const float | RANGE_EXTENDER_NORMAL = 0.65 |
| General range extension. | |
| protected const float | RANGE_EXTENDER_SPRINT = 1.35 |
| General range extension while in sprint. | |
| protected const string | DEFAULT_HIT_ZONE = "Torso" |
| DEPRECATED: "HitZoneSelection". | |
| protected ref MeleeTargeting | m_MeleeTargeting |
| Target selecting "component". | |
| protected Object | m_TargetObject |
| Targets - types. | |
| protected EMeleeTargetType | m_TargetType |
| DEPRECATED: Was added but never used..? | |
| protected ref array< Object > | m_AllTargetObjects |
| All potential targets found during most recent TargetSelection. | |
| protected ref array< typename > | m_TargetableObjects |
| Typenames of all directly/preferred targetable objects (1st Pass + 2nd Pass) | |
| protected ref array< typename > | m_NonAlignableObjects |
| Typenames of objects that can be targeted, but are not a priority (3rd Pass) | |
| protected ref array< string > | m_BlacklistedDamageZones |
| List of blacklisted damage zone names (cannot use indices due to the possible changes when p3d components are recalculated) | |
| protected DayZPlayerImplement | m_DZPlayer |
| Parent. | |
| protected InventoryItem | m_Weapon |
| Weapons - cache. | |
| protected int | m_WeaponMode |
| WeaponMode used during most recent Update. | |
| protected float | m_WeaponRange |
| WeaponRange used during most recent Update. | |
| protected bool | m_ForceUntargetable |
| Misc - cache. | |
| protected bool | m_SprintAttack |
| If most recent attack was a sprint attack. | |
| protected bool | m_WasHit |
| If most recent attack was. | |
| protected vector | m_RayStart |
| Start position of most recent HitZoneSelectionRaycast. | |
| protected vector | m_RayEnd |
| End position of most recent HitZoneSelectionRaycast. | |
| protected vector | m_RayEndShort |
| DEPRECATED: "HitZoneSelection". | |
| protected EMeleeHitType | m_HitType |
| Hit type of the most recent attack. | |
| protected int | m_HitZoneIdx |
| Hit result - cache. | |
| protected int | m_FinisherType |
| protected string | m_HitZoneName |
| Most recent target HitZone name. | |
| protected vector | m_HitPositionWS |
| Most recent target position. | |
| private int | m_DebugForcedFinisherType |
| enum EMeleeHitType |
References m_NonAlignableObjects, and m_TargetableObjects.
Referenced by TargetSelection().
| void CheckMeleeItem | ( | ) |
References GetWeaponMode(), and m_Weapon.
| void DayZPlayerImplementMeleeCombat | ( | DayZPlayerImplement | player | ) |
References Init().
Referenced by DayZPlayer::DayZPlayerImplement().
References Math::Lerp(), m_DebugForcedFinisherType, m_DZPlayer, and Math::Round().
Referenced by TrySelectFinisherType().
| protected float GetAngle | ( | ) |
References m_SprintAttack, TARGETING_ANGLE_NORMAL, and TARGETING_ANGLE_SPRINT.
Referenced by TargetSelection().
| int GetFinisherType | ( | ) |
References m_FinisherType.
Referenced by TargetSelection().
| vector GetHitPos | ( | ) |
References m_HitPositionWS.
| EMeleeHitType GetHitType | ( | ) |
References m_HitType.
| int GetHitZoneIdx | ( | ) |
component idx
References m_HitZoneIdx.
| protected float GetRange | ( | ) |
References m_WeaponRange, and RANGE_EXTENDER_NORMAL.
Referenced by HitZoneSelectionRaycast(), and TargetSelection().
| EntityAI GetTargetEntity | ( | ) |
References m_TargetObject.
Referenced by Update().
| int GetWeaponMode | ( | ) |
References m_WeaponMode.
Referenced by CheckMeleeItem(), and HitZoneSelection().
| protected float GetWeaponRange | ( | InventoryItem | weapon, |
| int | weaponMode | ||
| ) |
References m_DZPlayer.
Referenced by HitZoneSelection(), and Reset().
| protected void HitZoneSelection | ( | ) |
DEPRECATED.
make sure we are in range of the current weapon;
2d only
just for building and transports (big objects)
if no object in cone, set this object from raycast for these special cases
References DEFAULT_HIT_ZONE, vector::Distance(), CGame::GetCurrentCameraDirection(), GetGame(), GetWeaponMode(), GetWeaponRange(), m_DZPlayer, m_HitPositionWS, m_HitZoneIdx, m_HitZoneName, m_NonAlignableObjects, m_RayEnd, m_RayEndShort, m_RayStart, m_TargetObject, m_Weapon, DayZPhysics::RaycastRV(), TARGETING_RAY_DIST, TARGETING_RAY_DIST_SHORT, and TARGETING_RAY_RADIUS.
| protected bool HitZoneSelectionRaycast | ( | out vector | hitPos, |
| out int | hitZone, | ||
| out Object | target, | ||
| bool | useCamera | ||
| ) |
Prevents targeting of objects behind player
Opponent is inside car - targeting range is shorter in that case
References vector::DistanceSq(), vector::Dot(), CGame::GetCurrentCameraDirection(), GetGame(), GetRange(), m_DZPlayer, m_ForceUntargetable, m_RayEnd, m_RayStart, DayZPhysics::RaycastRV(), Math::SqrFloat(), and vector::Zero.
Referenced by HitZoneSelectionRaycastHelper().
| protected bool HitZoneSelectionRaycastHelper | ( | out vector | hitPos, |
| out int | hitZone, | ||
| out Object | target | ||
| ) |
References HitZoneSelectionRaycast().
Referenced by TargetSelection().
| void Init | ( | DayZPlayerImplement | player | ) |
| protected void InternalResetTarget | ( | ) |
References m_HitPositionWS, m_HitZoneIdx, m_HitZoneName, m_TargetObject, SetFinisherType(), and vector::Zero.
Referenced by ResetTarget(), and TargetSelection().
References Math::Acos(), vector::AnglesToVector(), Class::CastTo(), vector::Dot(), vector::Normalize(), Math::RAD2DEG, and Vector().
Referenced by TrySelectFinisherType().
DEPRECATED - New function in MeleeTargeting.
not possible to trace when this happens (zero length raycast)
References vector::Distance(), m_DZPlayer, and DayZPhysics::RayCastBullet().
| void Reset | ( | InventoryItem | weapon, |
| EMeleeHitType | hitMask, | ||
| bool | wasHitEvent = false |
||
| ) |
References GetWeaponRange(), m_AllTargetObjects, m_HitType, m_SprintAttack, m_TargetType, m_WasHit, m_Weapon, m_WeaponMode, m_WeaponRange, and SelectWeaponMode().
| void ResetTarget | ( | ) |
References InternalResetTarget(), m_HitPositionWS, m_HitZoneIdx, m_HitZoneName, and m_TargetObject.
| protected int SelectWeaponMode | ( | InventoryItem | weapon | ) |
| void SetFinisherType | ( | int | pFinisherType | ) |
References m_FinisherType.
Referenced by InternalResetTarget(), and Update().
| void SetHitPos | ( | vector | pHitPos | ) |
References m_HitPositionWS.
| void SetHitZoneIdx | ( | int | pHitZone | ) |
References m_HitZoneIdx.
References m_HitPositionWS, m_HitZoneIdx, m_HitZoneName, and m_TargetObject.
Referenced by TargetSelection().
| void SetTargetObject | ( | Object | pTarget | ) |
References m_TargetObject.
| protected void TargetSelection | ( | ) |
References CanObjectBeTargeted(), vector::DistanceSq(), GetAngle(), GetFinisherType(), GetRange(), MeleeTargetData::HitComponent, MeleeTargetData::HitPos, HitZoneSelectionRaycastHelper(), InternalResetTarget(), m_AllTargetObjects, m_BlacklistedDamageZones, m_DZPlayer, m_ForceUntargetable, m_HitZoneName, m_MeleeTargeting, m_TargetableObjects, m_TargetObject, m_WasHit, MeleeTargetSettings(), MeleeTargetData::Obj, SetTarget(), Math::SqrFloat(), TARGETING_MAX_HEIGHT, TARGETING_MIN_HEIGHT, and TARGETING_RAY_RADIUS_EX.
Referenced by Update().
| protected int TrySelectFinisherType | ( | InventoryItem | weapon, |
| EntityAI | target | ||
| ) |
General condition for finisher attacks.
| weapon | Weapon used in the attack |
| target | Target entity |
int - type of finisher (-1 == no finisher) perform only for finisher suitable weapons
check if attacker is in right pos and angle against victim
Check if the infected is aware of the player
prone checks
firearm
References DetermineSpecificFinisherType(), IsEntityBehindEntityInAngle(), m_DebugForcedFinisherType, m_DZPlayer, m_HitType, m_WasHit, and vector::Zero.
Referenced by Update().
| void Update | ( | InventoryItem | weapon, |
| EMeleeHitType | hitMask, | ||
| bool | wasHitEvent = false |
||
| ) |
Store target into input packet
References ScriptInputUserData::CanStoreInputUserData(), GetGame(), GetTargetEntity(), INPUT_UDT_MELEE_TARGET, m_FinisherType, m_HitPositionWS, m_HitZoneIdx, m_TargetObject, Reset(), ScriptInputUserData::Send(), SetFinisherType(), TargetSelection(), TrySelectFinisherType(), and Serializer::Write().
| void ~DayZPlayerImplementMeleeCombat | ( | ) |
| protected const string DEFAULT_HIT_ZONE = "Torso" |
DEPRECATED: "HitZoneSelection".
Referenced by HitZoneSelection().
All potential targets found during most recent TargetSelection.
Referenced by DayZInfected::ChaseAttackLogic(), DayZInfected::FightAttackLogic(), DayZInfected::Init(), Init(), Reset(), and TargetSelection().
List of blacklisted damage zone names (cannot use indices due to the possible changes when p3d components are recalculated)
Referenced by Init(), and TargetSelection().
| private int m_DebugForcedFinisherType |
Referenced by DetermineSpecificFinisherType(), Init(), and TrySelectFinisherType().
| protected DayZPlayerImplement m_DZPlayer |
Parent.
Player executing the melee
Referenced by DetermineSpecificFinisherType(), GetWeaponRange(), HitZoneSelection(), HitZoneSelectionRaycast(), Init(), IsObstructed(), TargetSelection(), and TrySelectFinisherType().
| protected int m_FinisherType |
Referenced by GetFinisherType(), Init(), SetFinisherType(), and Update().
| protected bool m_ForceUntargetable |
Misc - cache.
Forcing current target as untargetable
Referenced by HitZoneSelectionRaycast(), and TargetSelection().
| protected vector m_HitPositionWS |
Most recent target position.
Referenced by GetHitPos(), HitZoneSelection(), Init(), InternalResetTarget(), ResetTarget(), SetHitPos(), SetTarget(), and Update().
| protected EMeleeHitType m_HitType |
Hit type of the most recent attack.
Referenced by DamageHands(), EvaluateHit_Common(), GetCurrentHitType(), GetHitType(), HandleComboHit(), HandleHitEvent(), HandleInitialFirearmMelee(), HandleInitialMeleeErc(), HandleProneKick(), HandleSprintAttack(), Init(), Reset(), SelectWeaponMode(), and TrySelectFinisherType().
| protected int m_HitZoneIdx |
Hit result - cache.
Most recent target HitZone index
Referenced by GetHitZoneIdx(), HitZoneSelection(), Init(), InternalResetTarget(), ResetTarget(), SetHitZoneIdx(), SetTarget(), and Update().
| protected string m_HitZoneName |
Most recent target HitZone name.
Referenced by HitZoneSelection(), Init(), InternalResetTarget(), ResetTarget(), SetTarget(), and TargetSelection().
| protected ref MeleeTargeting m_MeleeTargeting |
Target selecting "component".
Contains logic for Second Pass
Referenced by Init(), and TargetSelection().
Typenames of objects that can be targeted, but are not a priority (3rd Pass)
Referenced by CanObjectBeTargeted(), HitZoneSelection(), and Init().
| protected vector m_RayEnd |
End position of most recent HitZoneSelectionRaycast.
Referenced by HitZoneSelection(), and HitZoneSelectionRaycast().
| protected vector m_RayEndShort |
DEPRECATED: "HitZoneSelection".
Referenced by HitZoneSelection().
| protected vector m_RayStart |
Start position of most recent HitZoneSelectionRaycast.
Referenced by HitZoneSelection(), and HitZoneSelectionRaycast().
| protected bool m_SprintAttack |
If most recent attack was a sprint attack.
Referenced by GetAngle(), Init(), and Reset().
Typenames of all directly/preferred targetable objects (1st Pass + 2nd Pass)
Referenced by CanObjectBeTargeted(), DayZInfected::ChaseAttackLogic(), DayZInfected::FightAttackLogic(), DayZInfected::Init(), Init(), and TargetSelection().
| protected Object m_TargetObject |
Targets - types.
Main target found during most recent TargetSelection
Referenced by ScriptedWidgetEventHandler::GetOnScreenPosition(), GetTargetEntity(), HitZoneSelection(), Init(), InternalResetTarget(), ResetTarget(), ScriptedWidgetEventHandler::SetTarget(), SetTarget(), SetTargetObject(), TargetSelection(), ScriptedWidgetEventHandler::Update(), and Update().
| protected EMeleeTargetType m_TargetType |
| protected bool m_WasHit |
If most recent attack was.
Referenced by Init(), Reset(), TargetSelection(), and TrySelectFinisherType().
| protected InventoryItem m_Weapon |
Weapons - cache.
Weapon used during most recent Update
Referenced by CheckMeleeItem(), ScriptedWidgetEventHandler::GetCrosshairPosition(), HitZoneSelection(), ScriptedWidgetEventHandler::ProjectedCrosshair(), and Reset().
| protected int m_WeaponMode |
WeaponMode used during most recent Update.
Referenced by GetWeaponMode(), and Reset().
| protected float m_WeaponRange |
WeaponRange used during most recent Update.
Referenced by GetRange(), and Reset().
| protected const float RANGE_EXTENDER_NORMAL = 0.65 |
General range extension.
Referenced by GetRange().
| protected const float RANGE_EXTENDER_SPRINT = 1.35 |
General range extension while in sprint.
| enum EMeleeHitType TARGETING_ANGLE_NORMAL = 30.0 |
| protected const float TARGETING_ANGLE_SPRINT = 15.0 |
Second Pass: Half angle of cone during sprint.
Referenced by GetAngle().
| protected const float TARGETING_MAX_HEIGHT = 2.0 |
Second Pass: How high the cone goes in meters from player position.
Referenced by TargetSelection().
| protected const float TARGETING_MIN_HEIGHT = -2.0 |
Second Pass: How deep the cone goes in meters from player position.
Referenced by TargetSelection().
| protected const float TARGETING_RAY_DIST = 5.0 |
DEPRECATED: "HitZoneSelection".
Referenced by HitZoneSelection().
| protected const float TARGETING_RAY_DIST_SHORT = 2.0 |
DEPRECATED: "HitZoneSelection".
Referenced by HitZoneSelection().
| protected const float TARGETING_RAY_RADIUS = 0.25 |
DEPRECATED: "HitZoneSelection".
Referenced by HitZoneSelection().
| protected const float TARGETING_RAY_RADIUS_EX = 0.5 |
Second Pass: Max distance from ray projected from player looking direction.
Referenced by TargetSelection().