4 protected static const string PORT_IN_COVER =
"InCover";
5 protected static const string PORT_EXPOSED_IN_COVER =
"ExposedInCover";
6 protected static const string PORT_AIM_AT_TARGET =
"AimAtTarget";
8 protected SCR_AICombatMoveState m_State;
11 [
Attribute(ENodeResult.SUCCESS.ToString(), UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(ENodeResult))]
12 protected ENodeResult m_eReturnValue;
16 protected bool m_bSetRequestState;
22 protected bool m_bSetRequestFailReason;
23 [
Attribute(
"0", UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(SCR_EAICombatMoveRequestFailReason))]
24 protected SCR_EAICombatMoveRequestFailReason m_eRequestFailReason;
28 protected bool m_bSetInCover;
30 protected bool m_bInCoverValue;
34 protected bool m_bSetExposedInCover;
36 protected bool m_bExposedInCoverValue;
40 protected bool m_bSetAimAtTarget;
44 protected bool m_bResetTimer;
48 protected bool m_bReleaseCoverLock;
51 override void OnInit(AIAgent owner)
53 SCR_AIUtilityComponent utilityComp = SCR_AIUtilityComponent.Cast(owner.FindComponent(SCR_AIUtilityComponent));
55 m_State = utilityComp.m_CombatMoveState;
59 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
62 return ENodeResult.FAIL;
66 if (!GetVariableIn(PORT_IN_COVER,
m_State.m_bInCover))
67 m_State.m_bInCover = m_bInCoverValue;
70 if (m_bSetExposedInCover)
72 if (!GetVariableIn(PORT_EXPOSED_IN_COVER,
m_State.m_bExposedInCover))
73 m_State.m_bExposedInCover = m_bExposedInCoverValue;
76 if (m_bSetAimAtTarget)
78 GetVariableIn(PORT_AIM_AT_TARGET,
m_State.m_bAimAtTarget);
81 if (m_bReleaseCoverLock)
86 return m_eReturnValue;
92 override bool VisibleInPalette() {
return true; }
94 override string GetNodeMiddleText()
96 array<string> strings = {
98 "m_bSetRequestFailReason",
100 "m_bSetExposedInCover",
102 "m_bReleaseCoverLock"
104 array<bool> values = {
106 m_bSetRequestFailReason,
108 m_bSetExposedInCover,
115 str = str +
string.Format(
"Node Result: %1",
typename.EnumToString(ENodeResult, m_eReturnValue));
116 for (
int i = 0; i < strings.Count(); i++)
122 str = str +
string.Format(
"%1: %2", strings[i], values[i]);
124 string varName, varValue;
127 varName =
"m_eRequestStateValue";
132 varName =
"m_eRequestFailReason";
133 varValue =
typename.EnumToString(SCR_EAICombatMoveRequestFailReason, m_eRequestFailReason);
137 varName =
"m_bInCoverValue";
138 varValue = m_bInCoverValue.ToString();
142 varName =
"m_bExposedInCoverValue";
143 varValue = m_bExposedInCoverValue.ToString();
146 if (!varName.IsEmpty() && !varValue.IsEmpty())
147 str = str +
string.Format(
"\n%1: %2", varName, varValue);
155 protected static ref TStringArray s_aVarsIn = {
157 PORT_EXPOSED_IN_COVER,
160 override TStringArray GetVariablesIn() {
return s_aVarsIn; }