254 if (
item &&
item.GetHierarchyRootPlayer())
288 return weapon.GetMeleeMode();
290 return weapon.GetMeleeHeavyMode();
292 return weapon.GetMeleeSprintMode();
389 MeleeTargetData targetData =
m_MeleeTargeting.GetMeleeTargetEx(
new MeleeTargetSettings(pos,
dist * 0.75,
angle,
TARGETING_MIN_HEIGHT,
TARGETING_MAX_HEIGHT,
rayStart, dir,
TARGETING_RAY_RADIUS_EX,
m_DZPlayer,
m_TargetableObjects),
m_AllTargetObjects,
m_BlacklistedDamageZones);
480 if (!
weapon || !
weapon.GetValidFinishers() ||
weapon.GetValidFinishers().Count() == 0)
540 dir =
GetGame().GetCurrentCameraDirection();
555 if (
DayZPhysics.
RaycastRV(
m_RayStart,
m_RayEnd,
hitPos,
hitNormal,
hitZone,
hitObjects,
null,
player,
false,
false,
ObjIntersectIFire) &&
hitObjects.Count() > 0)
601 if (!
DayZPhysics.
RaycastRV(
m_RayStart,
m_RayEndShort,
m_HitPositionWS,
hitNormal,
m_HitZoneIdx,
hitObjects,
null,
player,
false,
false,
ObjIntersectIFire) && !
DayZPhysics.
RaycastRV(
m_RayStart,
m_RayEnd,
m_HitPositionWS,
hitNormal,
m_HitZoneIdx,
hitObjects,
null,
player,
false,
false,
ObjIntersectIFire,
TARGETING_RAY_RADIUS))
float GetWeaponRange(InventoryItem weapon, int weaponMode)
bool m_SprintAttack
If most recent attack was a sprint attack.
void HitZoneSelection()
DEPRECATED.
vector m_RayEndShort
DEPRECATED: "HitZoneSelection".
int GetHitZoneIdx()
component idx
void SetTarget(Object obj, vector hitPos, int hitZone)
const float TARGETING_MIN_HEIGHT
Second Pass: How deep the cone goes in meters from player position.
const float TARGETING_RAY_DIST_SHORT
DEPRECATED: "HitZoneSelection".
bool IsEntityBehindEntityInAngle(EntityAI source, EntityAI target, float angle)
int m_WeaponMode
WeaponMode used during most recent Update.
bool m_WasHit
If most recent attack was.
ref array< string > m_BlacklistedDamageZones
List of blacklisted damage zone names (cannot use indices due to the possible changes when p3d compon...
bool HitZoneSelectionRaycast(out vector hitPos, out int hitZone, out Object target, bool useCamera)
const float RANGE_EXTENDER_SPRINT
General range extension while in sprint.
void InternalResetTarget()
void SetHitPos(vector pHitPos)
const float TARGETING_MAX_HEIGHT
Second Pass: How high the cone goes in meters from player position.
const float TARGETING_RAY_DIST
DEPRECATED: "HitZoneSelection".
EntityAI GetTargetEntity()
ref MeleeTargeting m_MeleeTargeting
Target selecting "component".
bool m_ForceUntargetable
Misc - cache.
ref array< Object > m_AllTargetObjects
All potential targets found during most recent TargetSelection.
void ~DayZPlayerImplementMeleeCombat()
DayZPlayerImplement m_DZPlayer
Parent.
ref array< typename > m_NonAlignableObjects
Typenames of objects that can be targeted, but are not a priority (3rd Pass)
vector m_RayStart
Start position of most recent HitZoneSelectionRaycast.
void DayZPlayerImplementMeleeCombat(DayZPlayerImplement player)
Object m_TargetObject
Targets - types.
EMeleeHitType GetHitType()
void SetHitZoneIdx(int pHitZone)
int SelectWeaponMode(InventoryItem weapon)
vector m_HitPositionWS
Most recent target position.
bool HitZoneSelectionRaycastHelper(out vector hitPos, out int hitZone, out Object target)
int m_DebugForcedFinisherType
float m_WeaponRange
WeaponRange used during most recent Update.
void SetTargetObject(Object pTarget)
const float RANGE_EXTENDER_NORMAL
General range extension.
const float TARGETING_ANGLE_SPRINT
Second Pass: Half angle of cone during sprint.
EMeleeHitType m_HitType
Hit type of the most recent attack.
const float TARGETING_RAY_RADIUS_EX
Second Pass: Max distance from ray projected from player looking direction.
ref array< typename > m_TargetableObjects
Typenames of all directly/preferred targetable objects (1st Pass + 2nd Pass)
const string DEFAULT_HIT_ZONE
DEPRECATED: "HitZoneSelection".
EMeleeTargetType m_TargetType
DEPRECATED: Was added but never used..?
int m_HitZoneIdx
Hit result - cache.
enum EMeleeHitType TARGETING_ANGLE_NORMAL
Target selection settings.
bool CanObjectBeTargeted(Object obj, bool checkNonAligneAble=false)
string m_HitZoneName
Most recent target HitZone name.
void SetFinisherType(int pFinisherType)
int DetermineSpecificFinisherType(ItemBase weapon)
int TrySelectFinisherType(InventoryItem weapon, EntityAI target)
General condition for finisher attacks.
bool IsObstructed(Object object)
DEPRECATED - New function in MeleeTargeting.
InventoryItem m_Weapon
Weapons - cache.
vector m_RayEnd
End position of most recent HitZoneSelectionRaycast.
const float TARGETING_RAY_RADIUS
DEPRECATED: "HitZoneSelection".
ref array< typename > TargetableObjects void MeleeTargetSettings(vector coneOrigin, float coneLength, float coneHalfAngle, float coneMinHeight, float coneMaxHeight, vector rayStart, vector dir, float maxDist, EntityAI pToIgnore, array< typename > targetableObjects)
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
Super root of all classes in Enforce script.
static proto bool RaycastRV(vector begPos, vector endPos, out vector contactPos, out vector contactDir, out int contactComponent, set< Object > results=NULL, Object with=NULL, Object ignore=NULL, bool sorted=false, bool ground_only=false, int iType=ObjIntersectView, float radius=0.0, CollisionFlags flags=CollisionFlags.NEARESTCONTACT)
Raycasts world by given parameters.
static proto bool RayCastBullet(vector begPos, vector endPos, PhxInteractionLayers layerMask, Object ignoreObj, out Object hitObject, out vector hitPosition, out vector hitNormal, out float hitFraction)
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static array< Shape > DrawCone(vector pos, float lenght, float halfAngle, float offsetAngle, int color=0xFFFFFFFF, int flags=0)
static void RemoveShape(out Shape shape)
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
script counterpart to engine's class Weapon
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
static proto native void End()
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto native void Text(string label)
const float AI_MAX_BLOCKABLE_ANGLE
const float PVP_MAX_BLOCKABLE_ANGLE
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float SqrFloat(float f)
Returns squared value.
static const float PI_HALF
static proto float Acos(float c)
Returns angle in radians from cosinus.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Atan2(float y, float x)
Returns angle in radians from tangent.
static const float RAD2DEG
static const float DEG2RAD