6 IEntity m_EntityToHeal;
8 SCR_AIInfoComponent m_AIInfo;
9 SCR_DamageManagerComponent m_DamageManager;
11 protected const float PRIORITY_DELAY_MIN_MS = 800.0;
12 protected const float PRIORITY_DELAY_MAX_MS = 1200.0;
14 protected const float MAX_TIME_TO_UNCON_HIGH_PRIORITY_S = 30;
16 protected float m_fTimeCreated_ms;
17 protected float m_fPriorityDelay_ms;
21 void SCR_AIHealBehavior(SCR_AIUtilityComponent utility,
SCR_AIActivityBase groupActivity, IEntity entityToHeal,
bool allowHealMove,
float priority = PRIORITY_BEHAVIOR_HEAL,
float priorityLevel = PRIORITY_LEVEL_NORMAL)
23 m_sBehaviorTree =
"AI/BehaviorTrees/Chimera/Soldier/Heal.bt";
24 m_EntityToHeal = entityToHeal;
25 SetPriority(priority);
27 m_fTimeCreated_ms =
GetGame().GetWorld().GetWorldTime();
28 m_fPriorityDelay_ms = Math.RandomFloat(PRIORITY_DELAY_MIN_MS, PRIORITY_DELAY_MAX_MS);
30 SCR_AIUtilityComponent aiUtilComp = SCR_AIUtilityComponent.Cast(utility);
34 IEntity owner = aiUtilComp.m_OwnerEntity;
37 m_DamageManager = SCR_DamageManagerComponent.Cast(owner.FindComponent(SCR_DamageManagerComponent));
42 override void OnActionCompleted()
44 super.OnActionCompleted();
50 override float CustomEvaluate()
52 if (!(
GetGame().GetWorld().GetWorldTime() - m_fTimeCreated_ms > m_fPriorityDelay_ms))
56 if (
m_AIInfo &&
m_AIInfo.GetBleedTimeToUnconscious() < MAX_TIME_TO_UNCON_HIGH_PRIORITY_S)
57 return PRIORITY_BEHAVIOR_HEAL_HIGH_PRIORITY;
59 if (m_Utility.m_ThreatSystem.GetThreatMeasureWithoutInjuryFactor() <
SCR_AIThreatSystem.VIGILANT_THRESHOLD)