Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDeploySmoke.c
Go to the documentation of this file.
2{
3 SCR_AIGroupUtilityComponent m_GroupUtilityComponent;
4
5 static const int MAX_SMOKE_POSITION_COUNT = 3; // Max number of smoke grenades that can be thrown at one time to create smoke cover wall
6
7 //------------------------------------------------------------------------------------------------
8 static override bool VisibleInPalette() {return true;}
9
10 //------------------------------------------------------------------------------------------------
11 override void OnInit(AIAgent owner)
12 {
13 AIGroup group = AIGroup.Cast(owner);
14 if (group)
15 m_GroupUtilityComponent = SCR_AIGroupUtilityComponent.Cast(group.FindComponent(SCR_AIGroupUtilityComponent));
16 }
17
18 //------------------------------------------------------------------------------------------------
19 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
20 {
21 if (!m_GroupUtilityComponent || !m_GroupUtilityComponent.m_aInfoComponents)
22 return ENodeResult.FAIL;
23
24 SCR_AIActivityBase currentActivity = SCR_AIActivityBase.Cast(m_GroupUtilityComponent.GetCurrentAction());
25 if (!currentActivity)
26 return ENodeResult.FAIL;
27
28 // Find smoke cover feature in current activity
30 currentActivity.FindActivityFeature(SCR_AIActivitySmokeCoverFeature));
31
32 // Exit if smoke cover feature is not supported in current activity
33 if (!smokeCoverFeature)
34 return ENodeResult.FAIL;
35
36 if (smokeCoverFeature.ExecuteForActivity(currentActivity, MAX_SMOKE_POSITION_COUNT))
37 return ENodeResult.SUCCESS;
38
39 return ENodeResult.FAIL;
40 }
41
42 //------------------------------------------------------------------------------------------------
43 static override protected bool CanReturnRunning() { return false; }
44
45 //------------------------------------------------------------------------------------------------
46 protected static ref TStringArray s_aVarsOut = {};
48
49 //------------------------------------------------------------------------------------------------
50 protected static ref TStringArray s_aVarsIn = {};
51 override TStringArray GetVariablesIn() { return s_aVarsIn; }
52
53 //------------------------------------------------------------------------------------------------
54 protected static override string GetOnHoverDescription()
55 {
56 return "Getter returns group member available for specific role";
57 }
58}
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
bool VisibleInPalette()
bool ExecuteForActivity(SCR_AIActivityBase activity, int maxPositionCount=3)
override TStringArray GetVariablesIn()
static ref TStringArray s_aVarsIn
static ref TStringArray s_aVarsOut
override TStringArray GetVariablesOut()
static override string GetOnHoverDescription()
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385