Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AIMedicHealBehavior.c
Go to the documentation of this file.
1 // AI healing behaviour
2 // TODO: You have to handle situation, in which movement can be disabled (in AIConfig component)
4 {
5  SCR_AIConfigComponent m_Config;
6 
7  ref SCR_BTParam<IEntity> m_EntityToHeal = new SCR_BTParam<IEntity>(SCR_AIActionTask.ENTITY_PORT);
8 
9  ref SCR_AIMoveIndividuallyBehavior m_HealMove;
10 
11  // Max threat value under which we will consider healing someone
12  protected const float MAX_THREAT_THRESHOLD = 0.002;
13 
14  void SCR_AIMedicHealBehavior(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity, IEntity entityToHeal, bool allowHealMove, float priority = PRIORITY_BEHAVIOR_MEDIC_HEAL, float priorityLevel = PRIORITY_LEVEL_NORMAL)
15  {
16  m_EntityToHeal.Init(this, entityToHeal);
17  m_sBehaviorTree = "{990FE3889BBA5839}AI/BehaviorTrees/Chimera/Soldier/MedicHeal.bt";
18  SetPriority(priority);
19  m_fPriorityLevel.m_Value = priorityLevel;
20  m_bAllowLook = false;
21  }
22 
23  override void OnActionSelected()
24  {
25  m_Utility.m_AIInfo.SetAIState(EUnitAIState.BUSY);
26  }
27 
28  override void OnActionCompleted()
29  {
30  super.OnActionCompleted();
31  m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
32 
33 #ifdef WORKBENCH
34  SCR_AIDebugVisualization.VisualizeMessage(m_Utility.m_OwnerEntity, "Unit healed", EAIDebugCategory.INFO, 5);
35 #endif
36  }
37 
38  override void OnActionFailed()
39  {
40  super.OnActionFailed();
41  m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
42 
43 #ifdef WORKBENCH
44  SCR_AIDebugVisualization.VisualizeMessage(m_Utility.m_OwnerEntity, "Failed heal", EAIDebugCategory.INFO, 5);
45 #endif
46  }
47 };
SCR_AIDebugVisualization
Definition: SCR_AIDebugVisualization.c:9
m_fPriorityLevel
float m_fPriorityLevel
Definition: SendGoalMessage.c:3
SCR_AIActivityBase
Definition: SCR_AIActivity.c:1
EAIDebugCategory
EAIDebugCategory
Definition: SCR_AIWorld.c:11
SCR_AIMoveIndividuallyBehavior
Definition: SCR_AIMoveBehavior.c:30
SCR_AIMedicHealBehavior
Definition: SCR_AIMedicHealBehavior.c:3
SCR_AIActionTask
Definition: SCR_AIBehaviorTask.c:1
SCR_AIBehaviorBase
Definition: SCR_AIBehavior.c:1