Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDecoHasRole.c
Go to the documentation of this file.
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 static override bool VisibleInPalette()
19 {
20 return true;
21 }
22
23 //-------------------------------------------------------------------
24 protected static 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};
ENodeResult SCR_AgentMustChimera(Node node, AIAgent owner)
Definition NodeError.c:21
ENodeResult NodeError(Node node, AIAgent owner, string msg)
Error call to be used in scripted BT nodes.
Definition NodeError.c:3
override bool TestFunction(AIAgent owner)
static override string GetOnHoverDescription()
static override bool VisibleInPalette()
override string GetNodeMiddleText()
bool HasRole(EUnitRole role)
SCR_FieldOfViewSettings Attribute