3 protected static const string PORT_MUZZLE_ID =
"MuzzleId";
6 override ENodeResult EOnTaskSimulate(AIAgent owner,
float dt)
8 if (!m_WeaponMgrComp || !m_ControlComp || !m_InventoryMgr)
9 return ENodeResult.FAIL;
12 GetVariableIn(PORT_MUZZLE_ID, newMuzzleId);
13 if (newMuzzleId == -1)
16 AddDebugMessage(
"Skipped muzzle switch, no muzzle was provided");
18 return ENodeResult.SUCCESS;
21 BaseCompartmentSlot compartmentSlot = m_CompartmentAccessComp.GetCompartment();
26 int currentMuzzleId = SCR_AIWeaponHandling.GetCurrentMuzzleId(m_WeaponMgrComp);
27 if (currentMuzzleId == newMuzzleId || compartmentSlot)
30 AddDebugMessage(
"Muzzle switch completed");
32 return ENodeResult.SUCCESS;
36 AddDebugMessage(
string.Format(
"Start Muzzle Switch: %1", newMuzzleId));
38 SCR_AIWeaponHandling.StartMuzzleSwitch(m_ControlComp, newMuzzleId);
40 return ENodeResult.RUNNING;
44 protected static ref TStringArray s_aVarsIn = {PORT_MUZZLE_ID};
45 override TStringArray GetVariablesIn() {
return s_aVarsIn; }
47 override bool VisibleInPalette() {
return true; }