DayZ
1.24
Loading...
Searching...
No Matches
CCTMan.c
Go to the documentation of this file.
1
class
CCTMan
:
CCTBase
2
{
3
protected
float
m_MaximalActionDistanceSq
;
4
protected
bool
m_MustBeAlive
;
5
6
void
CCTMan
(
float
maximal_target_distance
=
UAMaxDistances
.
DEFAULT
,
bool
must_be_alive
=
true
)
7
{
8
m_MaximalActionDistanceSq
=
maximal_target_distance
*
maximal_target_distance
;
9
m_MustBeAlive
=
must_be_alive
;
10
}
11
12
override
bool
Can
(
PlayerBase
player
, ActionTarget
target
)
13
{
14
if
(!
target
)
15
return
false
;
16
17
Object
targetObject
=
target
.GetObject();
18
if
(!
player
|| !
targetObject
||
targetObject
==
player
|| !
targetObject
.IsMan() || !
player
.IsFacingTarget(
targetObject
) || (
m_MustBeAlive
&&
targetObject
.IsDamageDestroyed()))
19
return
false
;
20
21
return
(
vector
.
DistanceSq
(
targetObject
.GetPosition(),
player
.GetPosition()) <=
m_MaximalActionDistanceSq
);
22
}
23
};
CCTBase
Definition
CCTBase.c:2
CCTMan
Definition
CCTMan.c:2
CCTMan::m_MustBeAlive
bool m_MustBeAlive
Definition
CCTMan.c:4
CCTMan::m_MaximalActionDistanceSq
float m_MaximalActionDistanceSq
Definition
CCTMan.c:3
CCTMan::CCTMan
void CCTMan(float maximal_target_distance=UAMaxDistances.DEFAULT, bool must_be_alive=true)
Definition
CCTMan.c:6
CCTMan::Can
override bool Can(PlayerBase player, ActionTarget target)
Definition
CCTMan.c:12
Object
Definition
ObjectTyped.c:2
Param3
Definition
EntityAI.c:95
PlayerBase
Definition
PlayerBaseClient.c:2
UAMaxDistances
Definition
ActionConstants.c:105
UAMaxDistances::DEFAULT
const float DEFAULT
Definition
ActionConstants.c:107
vector
Definition
EnConvert.c:106
vector::DistanceSq
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
scripts
4_World
Classes
UserActionsComponent
TargetConditionsComponents
CCTMan.c
Generated by
1.10.0