4 ref SCR_BTParam<vector> m_vTargetPosition =
new SCR_BTParam<vector>(
SCR_AIActionTask.TARGETPOSITION_PORT);
5 ref SCR_BTParam<EWeaponType> e_WeaponType =
new SCR_BTParam<EWeaponType>(
SCR_AIActionTask.WEAPON_TYPE_PORT);
6 ref SCR_BTParam<float> m_fDelay =
new SCR_BTParam<float>(
SCR_AIActionTask.DELAY_PORT);
13 ref array<ref Shape> m_aDbgShapes = {};
15 private static vector CHARACTER_HEIGHT_OFFSET = {0, 1.6, 0};
19 m_vTargetPosition.Init(
this,
position);
20 e_WeaponType.Init(
this, weaponType);
25 m_World = utility.m_OwnerEntity.GetWorld();
26 m_fStartTime =
m_World.GetWorldTime() + delay;
29 m_sBehaviorTree =
"{3187CAE77AAF1A35}AI/BehaviorTrees/Chimera/Soldier/ThrowGrenadeTo.bt";
30 SetPriority(priority);
35 if (DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_AI_SHOW_SMOKE_COVER_POSITIONS))
36 DrawPositionDebug(
false);
41 override float CustomEvaluate()
50 override void OnActionSelected()
52 m_Utility.m_AIInfo.SetAIState(EUnitAIState.BUSY);
56 if (DiagMenu.GetBool(
SCR_DebugMenuID.DEBUGUI_AI_SHOW_SMOKE_COVER_POSITIONS))
57 DrawPositionDebug(
true);
62 override void OnActionCompleted()
64 super.OnActionCompleted();
65 m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
73 override void OnActionFailed()
75 super.OnActionFailed();
76 m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
84 override string GetActionDebugInfo()
86 return this.ToString() +
" throwing grenade to " + m_vTargetPosition.ValueToString();
90 void DrawPositionDebug(
bool selected)
92 int shapeColor = Color.RED;
94 shapeColor = Color.GREEN;
96 m_aDbgShapes.Insert(Shape.CreateCylinder(Color.WHITE, ShapeFlags.DEFAULT, m_vTargetPosition.m_Value, 0.3, 100));
97 m_aDbgShapes.Insert(Shape.CreateSphere(shapeColor, ShapeFlags.DEFAULT, m_vTargetPosition.m_Value, 0.6));