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_AIEndProcessCombatMoveRequest.c
Go to the documentation of this file.
1
/*
2
Logic which runs after all combat move requests
3
*/
4
5
class
SCR_AIEndProcessCombatMoveRequest
:
AITaskScripted
6
{
7
// Inputs
8
protected
static
const
string
PORT_REQUEST
=
"Request"
;
9
10
protected
SCR_AIUtilityComponent
m_Utility
;
11
protected
SCR_AICombatMoveState
m_State
;
12
13
//--------------------------------------------------------------------------------------------
14
override
void
OnInit
(AIAgent owner)
15
{
16
m_Utility
= SCR_AIUtilityComponent.Cast(owner.FindComponent(SCR_AIUtilityComponent));
17
if
(
m_Utility
)
18
m_State
=
m_Utility
.m_CombatMoveState;
19
}
20
21
//---------------------------------------------------------------------------
22
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
23
{
24
if
(!
m_State
)
25
return
ENodeResult
.FAIL;
26
27
SCR_AICombatMoveRequestBase
rq;
28
if
(!
GetVariableIn
(
PORT_REQUEST
, rq))
29
return
ENodeResult
.FAIL;
30
31
// Common logic for all request
32
m_State
.EnableAiming(rq.m_bAimAtTargetEnd);
33
34
// Invoke script invokers
35
if
(rq.m_eState ==
SCR_EAICombatMoveRequestState
.SUCCESS)
36
{
37
auto
invoker = rq.
GetOnCompleted
(
false
);
38
if
(invoker)
39
invoker.Invoke(
m_Utility
, rq);
40
}
41
else
if
(rq.m_eState ==
SCR_EAICombatMoveRequestState
.FAIL)
42
{
43
auto
invoker = rq.
GetOnFailed
(
false
);
44
if
(invoker)
45
invoker.Invoke(
m_Utility
, rq, rq.m_eFailReason);
46
}
47
48
return
ENodeResult
.SUCCESS;
49
}
50
51
52
//---------------------------------------------------------------------------
53
protected
static
ref
TStringArray
s_aVarsIn
= {
54
PORT_REQUEST
55
};
56
override
TStringArray
GetVariablesIn
()
57
{
58
return
s_aVarsIn
;
59
}
60
61
static
override
bool
VisibleInPalette
() {
return
true
; }
62
}
SCR_EAICombatMoveRequestState
SCR_EAICombatMoveRequestState
Definition
SCR_AICombatMoveState.c:2
AITaskScripted
Definition
AITaskScripted.c:13
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AICombatMoveRequestBase
Definition
SCR_AICombatMoveRequest.c:46
SCR_AICombatMoveRequestBase::GetOnCompleted
ScriptInvokerBase< SCR_AICombatMoveRequest_OnCompleted > GetOnCompleted(bool createInvoker=true)
Called on successful completion of request.
Definition
SCR_AICombatMoveRequest.c:65
SCR_AICombatMoveRequestBase::GetOnFailed
ScriptInvokerBase< SCR_AICombatMoveRequest_OnFailed > GetOnFailed(bool createInvoker=true)
Called on failure of request.
Definition
SCR_AICombatMoveRequest.c:73
SCR_AIEndProcessCombatMoveRequest
Definition
SCR_AIEndProcessCombatMoveRequest.c:6
SCR_AIEndProcessCombatMoveRequest::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIEndProcessCombatMoveRequest.c:53
SCR_AIEndProcessCombatMoveRequest::m_State
SCR_AICombatMoveState m_State
Definition
SCR_AIEndProcessCombatMoveRequest.c:11
SCR_AIEndProcessCombatMoveRequest::OnInit
override void OnInit(AIAgent owner)
Definition
SCR_AIEndProcessCombatMoveRequest.c:14
SCR_AIEndProcessCombatMoveRequest::m_Utility
SCR_AIUtilityComponent m_Utility
Definition
SCR_AIEndProcessCombatMoveRequest.c:10
SCR_AIEndProcessCombatMoveRequest::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIEndProcessCombatMoveRequest.c:22
SCR_AIEndProcessCombatMoveRequest::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIEndProcessCombatMoveRequest.c:56
SCR_AIEndProcessCombatMoveRequest::PORT_REQUEST
static const string PORT_REQUEST
Definition
SCR_AIEndProcessCombatMoveRequest.c:8
SCR_AIEndProcessCombatMoveRequest::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIEndProcessCombatMoveRequest.c:61
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
Movement
SCR_AIEndProcessCombatMoveRequest.c
Generated by
1.17.0