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_AICheckLowAmmo.c
Go to the documentation of this file.
1
class
SCR_AICheckLowAmmo
:
AITaskScripted
2
{
3
protected
const
static
string
WEAPON_COMPONENT_PORT
=
"WeaponComponent"
;
4
protected
const
static
string
MUZZLE_ID_PORT
=
"MuzzleId"
;
5
protected
const
static
string
LOW_AMMO_PORT
=
"LowAmmo"
;
6
7
protected
SCR_AICombatComponent
m_CombatComp
;
8
9
protected
static
ref
TStringArray
s_aVarsIn
= {
WEAPON_COMPONENT_PORT
,
MUZZLE_ID_PORT
};
10
override
TStringArray
GetVariablesIn
() {
return
s_aVarsIn
; }
11
12
protected
static
ref
TStringArray
s_aVarsOut
= {
LOW_AMMO_PORT
};
13
override
TStringArray
GetVariablesOut
() {
return
s_aVarsOut
; }
14
15
//-------------------------------------------------------------------------------
16
override
void
OnInit
(AIAgent owner)
17
{
18
IEntity
controlled = owner.GetControlledEntity();
19
if
(!controlled)
20
return
;
21
m_CombatComp
= SCR_AICombatComponent.Cast(controlled.
FindComponent
(SCR_AICombatComponent));
22
}
23
24
//-------------------------------------------------------------------------------
25
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
26
{
27
BaseWeaponComponent
weaponComp;
28
int
muzzleId;
29
30
// Output
31
bool
lowAmmo =
false
;
32
33
GetVariableIn
(
WEAPON_COMPONENT_PORT
, weaponComp);
34
GetVariableIn
(
MUZZLE_ID_PORT
, muzzleId);
35
36
if
(weaponComp && muzzleId != -1)
37
{
38
lowAmmo =
m_CombatComp
.EvaluateLowAmmo(weaponComp, muzzleId);
39
}
40
41
SetVariableOut
(
LOW_AMMO_PORT
, lowAmmo);
42
return
ENodeResult
.SUCCESS;
43
}
44
45
//-------------------------------------------------------------------------------
46
static
override
bool
VisibleInPalette
() {
return
true
; }
47
}
AITaskScripted
Definition
AITaskScripted.c:13
BaseWeaponComponent
Definition
BaseWeaponComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Node::SetVariableOut
proto void SetVariableOut(string name, void val)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AICheckLowAmmo
Definition
SCR_AICheckLowAmmo.c:2
SCR_AICheckLowAmmo::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AICheckLowAmmo.c:25
SCR_AICheckLowAmmo::WEAPON_COMPONENT_PORT
static const string WEAPON_COMPONENT_PORT
Definition
SCR_AICheckLowAmmo.c:3
SCR_AICheckLowAmmo::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AICheckLowAmmo.c:46
SCR_AICheckLowAmmo::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AICheckLowAmmo.c:10
SCR_AICheckLowAmmo::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AICheckLowAmmo.c:12
SCR_AICheckLowAmmo::LOW_AMMO_PORT
static const string LOW_AMMO_PORT
Definition
SCR_AICheckLowAmmo.c:5
SCR_AICheckLowAmmo::OnInit
override void OnInit(AIAgent owner)
Definition
SCR_AICheckLowAmmo.c:16
SCR_AICheckLowAmmo::GetVariablesOut
override TStringArray GetVariablesOut()
Definition
SCR_AICheckLowAmmo.c:13
SCR_AICheckLowAmmo::MUZZLE_ID_PORT
static const string MUZZLE_ID_PORT
Definition
SCR_AICheckLowAmmo.c:4
SCR_AICheckLowAmmo::m_CombatComp
SCR_AICombatComponent m_CombatComp
Definition
SCR_AICheckLowAmmo.c:7
SCR_AICheckLowAmmo::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AICheckLowAmmo.c:9
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Weapons
SCR_AICheckLowAmmo.c
Generated by
1.17.0