4 static const float REACTION_DIST_SQ = 3.5;
5 static const float MIN_DIST_RUN = 10.0;
6 static const float MAX_DIST_RUN = 15.0;
8 override bool PerformReaction(notnull SCR_AIUtilityComponent utility, notnull
SCR_AIThreatSystem threatSystem, AIDangerEvent dangerEvent)
10 if (dangerEvent.GetVictim() != utility.m_OwnerEntity)
14 vector shooterPos = dangerEvent.GetPosition();
17 vector myPos = dangerEvent.GetVictim().GetOrigin();
20 float distSq = vector.DistanceSq(myPos, shooterPos);
21 if (distSq >= REACTION_DIST_SQ)
25 utility.m_LookAction.LookAt(shooterPos, utility.m_LookAction.PRIO_DANGER_EVENT);
29 vector V = myPos - shooterPos;
33 float d = Math.RandomFloat(MIN_DIST_RUN,MAX_DIST_RUN);
43 behavior.m_Target.m_Value = myPos;
44 behavior.m_LookAt.m_Value = shooterPos;
46 utility.AddAction(behavior);