Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIShootStaticArtillery.c
Go to the documentation of this file.
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);
17
18 if (!ammoEntity || !artilleryEntity)
19 return ENodeResult.FAIL;
20
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 = {
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};
proto external Managed FindComponent(typename typeName)
proto bool GetVariableIn(string name, out void val)
static override bool VisibleInPalette()
static override string GetOnHoverDescription()
override array< string > GetVariablesIn()
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
override bool CanBePerformedScript(IEntity user)
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
override bool CanBeShownScript(IEntity user)
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385