Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIDecoHasRole.c
Go to the documentation of this file.
1 class SCR_AIDecoHasRole : DecoratorScripted
2 {
3  [Attribute("0", UIWidgets.ComboBox, "Role to find:", "", ParamEnumArray.FromEnum(EUnitRole) )]
4  private EUnitRole m_eUnitRole;
5 
6  //-------------------------------------------------------------------
7  protected override bool TestFunction(AIAgent owner)
8  {
9  SCR_ChimeraAIAgent chimeraAgent = SCR_ChimeraAIAgent.Cast(owner);
10  if (!chimeraAgent)
11  SCR_AgentMustChimera(this, owner);
12  if (!chimeraAgent.m_InfoComponent)
13  NodeError(this, owner, "Agent does not have info component!");
14  return chimeraAgent.m_InfoComponent.HasRole(m_eUnitRole);
15  }
16 
17  //-------------------------------------------------------------------
18  protected override bool VisibleInPalette()
19  {
20  return true;
21  }
22 
23  //-------------------------------------------------------------------
24  protected override string GetOnHoverDescription()
25  {
26  return "Decorator that tests if character has requested role";
27  }
28 
29  //-------------------------------------------------------------------
30  override string GetNodeMiddleText()
31  {
32  return "Test " + typename.EnumToString(EUnitRole,m_eUnitRole);
33  };
34 };
SCR_AgentMustChimera
ENodeResult SCR_AgentMustChimera(Node node, AIAgent owner)
Definition: NodeError.c:21
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.
SCR_ChimeraAIAgent
Definition: SCR_ChimeraAIAgent.c:5
SCR_AIDecoHasRole
Definition: SCR_AIDecoHasRole.c:1