Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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 
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 = {
55  };
56  override TStringArray GetVariablesIn()
57  {
58  return s_aVarsIn;
59  }
60 
61  override bool VisibleInPalette() { return true; }
62 }
SCR_AICombatMoveRequestBase
Definition: SCR_AICombatMoveRequest.c:37
SCR_AIEndProcessCombatMoveRequest
Definition: SCR_AIEndProcessCombatMoveRequest.c:5
PORT_REQUEST
SCR_AISetCombatMoveRequestState PORT_REQUEST
m_State
private EEditableEntityState m_State
Definition: SCR_BaseEntitiesEditorUIEffect.c:3
SCR_EAICombatMoveRequestState
SCR_EAICombatMoveRequestState
Definition: SCR_AICombatMoveState.c:1