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_AIShootStaticArtillery.c
Go to the documentation of this file.
1
class
SCR_AIShootStaticArtillery
:
AITaskScripted
2
{
3
// Inputs
4
protected
static
const
string
PORT_ARTILLERY_ENTITY
=
"ArtilleryEntity"
;
5
protected
static
const
string
PORT_AMMO_ENTITY
=
"AmmoEntity"
;
6
7
//------------------------------------------------------------------------------------------------
8
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
9
{
10
IEntity
myEntity = owner.GetControlledEntity();
11
if
(!myEntity)
12
return
ENodeResult
.FAIL;
13
14
IEntity
ammoEntity, artilleryEntity;
15
GetVariableIn
(
PORT_ARTILLERY_ENTITY
, artilleryEntity);
16
GetVariableIn
(
PORT_AMMO_ENTITY
, ammoEntity);
17
18
if
(!ammoEntity || !artilleryEntity)
19
return
ENodeResult
.FAIL;
20
21
ActionsManagerComponent
actionsManager =
ActionsManagerComponent
.Cast(artilleryEntity.
FindComponent
(
ActionsManagerComponent
));
22
if
(!actionsManager)
23
return
ENodeResult
.FAIL;
24
25
array<BaseUserAction> acts = {};
26
actionsManager.GetActionsList(acts);
27
28
foreach
(
BaseUserAction
act : acts)
29
{
30
SCR_MortarShootAction
shootAction =
SCR_MortarShootAction
.Cast(act);
31
32
if
(!shootAction)
33
continue
;
34
35
bool
canBeShown = shootAction.
CanBeShownScript
(myEntity);
36
bool
canBePerformed = shootAction.
CanBePerformedScript
(myEntity);
37
38
if
(canBeShown && canBePerformed)
39
{
40
shootAction.
PerformAction
(ammoEntity, myEntity);
41
return
ENodeResult
.SUCCESS;
42
}
43
}
44
45
return
ENodeResult
.FAIL;
46
};
47
//------------------------------------------------------------------------------------------------
48
protected
static
ref
TStringArray
s_aVarsIn
= {
49
PORT_ARTILLERY_ENTITY
,
50
PORT_AMMO_ENTITY
51
};
52
override
array<string>
GetVariablesIn
()
53
{
54
return
s_aVarsIn
;
55
}
56
//------------------------------------------------------------------------------------------------
57
override
static
string
GetOnHoverDescription
()
58
{
59
return
"Use the provided mortar shell entity on mortar entity. Used for firing the mortar."
;
60
}
61
protected
static
override
bool
VisibleInPalette
(){
return
true
; }
62
};
AITaskScripted
Definition
AITaskScripted.c:13
ActionsManagerComponent
Definition
ActionsManagerComponent.c:6
BaseUserAction
Definition
BaseUserAction.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AIShootStaticArtillery
Definition
SCR_AIShootStaticArtillery.c:2
SCR_AIShootStaticArtillery::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIShootStaticArtillery.c:61
SCR_AIShootStaticArtillery::PORT_AMMO_ENTITY
static const string PORT_AMMO_ENTITY
Definition
SCR_AIShootStaticArtillery.c:5
SCR_AIShootStaticArtillery::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIShootStaticArtillery.c:57
SCR_AIShootStaticArtillery::GetVariablesIn
override array< string > GetVariablesIn()
Definition
SCR_AIShootStaticArtillery.c:52
SCR_AIShootStaticArtillery::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIShootStaticArtillery.c:48
SCR_AIShootStaticArtillery::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIShootStaticArtillery.c:8
SCR_AIShootStaticArtillery::PORT_ARTILLERY_ENTITY
static const string PORT_ARTILLERY_ENTITY
Definition
SCR_AIShootStaticArtillery.c:4
SCR_MortarShootAction
Definition
SCR_MortarShootAction.c:2
SCR_MortarShootAction::CanBePerformedScript
override bool CanBePerformedScript(IEntity user)
Definition
SCR_MortarShootAction.c:51
SCR_MortarShootAction::PerformAction
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
Definition
SCR_MortarShootAction.c:93
SCR_MortarShootAction::CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition
SCR_MortarShootAction.c:30
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Weapons
SCR_AIShootStaticArtillery.c
Generated by
1.17.0