Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AIDangerReaction_Explosion.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_AIDangerReaction_Explosion
:
SCR_AIDangerReaction
3
{
4
private
static
const
float
EXPLOSION_OBSERVE_DISTANCE = 220;
// Maximal distance from explosion to trigger observe behavior
5
6
//------------------------------------------------------------------------------------------------
7
override
bool
PerformReaction(notnull SCR_AIUtilityComponent utility, notnull
SCR_AIThreatSystem
threatSystem,
AIDangerEvent
dangerEvent,
int
dangerEventCount)
8
{
9
IEntity
ownerEntity = utility.m_OwnerEntity;
10
11
if
(!ownerEntity)
12
return
false
;
13
14
vector
position
= dangerEvent.GetPosition();
15
float
distance
=
vector
.Distance(ownerEntity.
GetOrigin
(),
position
);
16
17
if
(
distance
>
SCR_AIThreatSystem
.EXPLOSION_MAX_DISTANCE)
18
return
false
;
19
20
// Ignore if friendly
21
IEntity
instigatorRoot = dangerEvent.GetObject();
22
if
(instigatorRoot)
23
{
24
instigatorRoot = instigatorRoot.
GetRootParent
();
25
bool
isMilitary = utility.IsMilitary();
26
SCR_ChimeraAIAgent
agent =
SCR_ChimeraAIAgent
.Cast(utility.GetOwner());
27
if
(isMilitary && (!agent || !agent.
IsPerceivedEnemy
(instigatorRoot)))
28
return
false
;
29
}
30
31
// Increase threat level
32
threatSystem.ThreatExplosion(
distance
);
33
utility.m_SectorThreatFilter.OnExplosion(
position
);
34
35
return
true
;
36
}
37
};
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
distance
float distance
Definition
SCR_DestructibleTreeV2.c:29
position
vector position
Definition
SCR_DestructibleTreeV2.c:30
AIDangerEvent
Event which gets broadcasted from danger-causing places to AI.
Definition
AIDangerEvent.c:14
IEntity
Definition
IEntity.c:13
IEntity::GetOrigin
proto external vector GetOrigin()
IEntity::GetRootParent
proto external IEntity GetRootParent()
SCR_AIDangerReaction_Explosion
Definition
SCR_AIDangerReaction_Explosion.c:3
SCR_AIDangerReaction
Definition
SCR_AIDangerReaction.c:5
SCR_AIThreatSystem
Definition
SCR_AIThreatSystem.c:18
SCR_ChimeraAIAgent
Definition
SCR_ChimeraAIAgent.c:6
SCR_ChimeraAIAgent::IsPerceivedEnemy
bool IsPerceivedEnemy(IEntity entity)
Checks if this agent perceives the entity as enemy.
Definition
SCR_ChimeraAIAgent.c:177
vector
Definition
vector.c:13
scripts
Game
AI
Reaction
Danger
SCR_AIDangerReaction_Explosion.c
Generated by
1.17.0