4 protected static const float BULLET_IMPACT_DISTANCE_MAX_SQ = 10*10;
6 override bool PerformReaction(notnull SCR_AIUtilityComponent utility, notnull
SCR_AIThreatSystem threatSystem, AIDangerEvent dangerEvent)
8 float distanceSq = vector.DistanceSq(utility.GetOrigin(), dangerEvent.GetPosition());
9 if (distanceSq > BULLET_IMPACT_DISTANCE_MAX_SQ)
12 IEntity shooter = dangerEvent.GetObject();
18 IEntity shooterRoot = shooter.GetRootParent();
19 if (!agent || !agent.IsEnemy(shooterRoot))
22 vector shooterPos = shooter.GetOrigin();
24 float distanceToShooter = vector.Distance(utility.GetOrigin(), shooterPos);
26 if (utility.m_CombatComponent.GetCurrentTarget() ==
null && distanceToShooter > SCR_AICombatComponent.LONG_RANGE_FIRE_DISTANCE && shooter)
32 threatSystem.ThreatBulletImpact(dangerEvent.GetCount());