Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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
10
11 // Max threat value under which we will consider healing someone
12 protected const float MAX_THREAT_THRESHOLD = 0.002;
13
14 //---------------------------------------------------------------------------------------------------------------------------------
15 void SCR_AIMedicHealBehavior(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity, IEntity entityToHeal, bool allowHealMove, float priority = PRIORITY_BEHAVIOR_MEDIC_HEAL, float priorityLevel = PRIORITY_LEVEL_NORMAL)
16 {
17 m_EntityToHeal.Init(this, entityToHeal);
18 m_sBehaviorTree = "{990FE3889BBA5839}AI/BehaviorTrees/Chimera/Soldier/MedicHeal.bt";
19 SetPriority(priority);
20 m_fPriorityLevel.m_Value = priorityLevel;
21 m_bAllowLook = false;
22 }
23
24 //---------------------------------------------------------------------------------------------------------------------------------
25 override int GetCause()
26 {
27 return SCR_EAIBehaviorCause.GROUP_GOAL;
28 }
29
30 //---------------------------------------------------------------------------------------------------------------------------------
31 override void OnActionSelected()
32 {
33 m_Utility.m_AIInfo.SetAIState(EUnitAIState.BUSY);
34 }
35
36 //---------------------------------------------------------------------------------------------------------------------------------
37 override void OnActionCompleted()
38 {
39 super.OnActionCompleted();
40 m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
41
42#ifdef WORKBENCH
43 SCR_AIDebugVisualization.VisualizeMessage(m_Utility.m_OwnerEntity, "Unit healed", EAIDebugCategory.INFO, 5);
44#endif
45 }
46
47 //---------------------------------------------------------------------------------------------------------------------------------
48 override void OnActionFailed()
49 {
50 super.OnActionFailed();
51 m_Utility.m_AIInfo.SetAIState(EUnitAIState.AVAILABLE);
52
53#ifdef WORKBENCH
54 SCR_AIDebugVisualization.VisualizeMessage(m_Utility.m_OwnerEntity, "Failed heal", EAIDebugCategory.INFO, 5);
55#endif
56 }
57};
ref SCR_BTParam< float > m_fPriorityLevel
enum EAIActionFailReason PRIORITY_LEVEL_NORMAL
ResourceName m_sBehaviorTree
void SCR_AIActivityBase(SCR_AIGroupUtilityComponent utility, AIWaypoint relatedWaypoint)
enum SCR_EAIActivityCause m_Utility
void SCR_AIBehaviorBase(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity)
SCR_EAIBehaviorCause
bool m_bAllowLook
EAIDebugCategory
Definition SCR_AIWorld.c:12
static void VisualizeMessage(IEntity entity, string message, EAIDebugCategory category, float showTime, Color color=Color.White, float fontSize=16, bool ignoreCategory=false)
void SCR_AIMedicHealBehavior(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity, IEntity entityToHeal, bool allowHealMove, float priority=PRIORITY_BEHAVIOR_MEDIC_HEAL, float priorityLevel=PRIORITY_LEVEL_NORMAL)