Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDecoCombatAllowance.c
Go to the documentation of this file.
1 class SCR_AIDecoCombatAllowance : DecoratorScripted
2 {
3  [Attribute("2", UIWidgets.ComboBox, "Combat action to test:", "", ParamEnumArray.FromEnum(EAICombatActions) )]
4  private EAICombatActions m_eCombatActions;
5 
6  protected SCR_AICombatComponent m_CombatComponent;
7 
8  override void OnInit(AIAgent owner)
9  {
10  IEntity entity = owner.GetControlledEntity();
11  if (!entity)
12  {
13  NodeError(this, owner, "Must be run on agent that has an entity!");
14  return;
15  }
16  m_CombatComponent = SCR_AICombatComponent.Cast(entity.FindComponent(SCR_AICombatComponent));
17  }
18 
19  protected override bool TestFunction(AIAgent owner)
20  {
21  if (!m_CombatComponent)
22  return false;
23 
24  return m_CombatComponent.IsActionAllowed(m_eCombatActions);
25  }
26 
27  protected override bool VisibleInPalette()
28  {
29  return true;
30  }
31 
32  protected override string GetOnHoverDescription()
33  {
34  return "Decorator that tests allowed type of combat";
35  }
36 
37  override string GetNodeMiddleText()
38  {
39  return "Test " + typename.EnumToString(EAICombatActions,m_eCombatActions);
40  };
41 };
NodeError
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition: NodeError.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
m_CombatComponent
SCR_AICombatComponent m_CombatComponent
Definition: SCR_AIUtilityComponent.c:12
SCR_AIDecoCombatAllowance
Definition: SCR_AIDecoCombatAllowance.c:1