3 protected const static string WEAPON_COMPONENT_PORT =
"WeaponComponent";
4 protected const static string MUZZLE_ID_PORT =
"MuzzleId";
5 protected const static string LOW_AMMO_PORT =
"LowAmmo";
7 protected SCR_AICombatComponent m_CombatComp;
9 protected static ref TStringArray s_aVarsIn = {WEAPON_COMPONENT_PORT, MUZZLE_ID_PORT};
10 override TStringArray GetVariablesIn() {
return s_aVarsIn; }
12 protected static ref TStringArray s_aVarsOut = {LOW_AMMO_PORT};
13 override TStringArray GetVariablesOut() {
return s_aVarsOut; }
16 override void OnInit(AIAgent owner)
18 IEntity controlled = owner.GetControlledEntity();
21 m_CombatComp = SCR_AICombatComponent.Cast(controlled.FindComponent(SCR_AICombatComponent));
25 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
34 GetVariableIn(WEAPON_COMPONENT_PORT, weaponComp);
35 GetVariableIn(MUZZLE_ID_PORT, muzzleId);
37 if (weaponComp && muzzleId != -1)
39 lowAmmo = m_CombatComp.EvaluateLowAmmo(weaponComp, muzzleId);
42 SetVariableOut(LOW_AMMO_PORT, lowAmmo);
43 return ENodeResult.SUCCESS;
47 override bool VisibleInPalette() {
return true; }