Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIDangerReaction_UnsafeArea.c
Go to the documentation of this file.
3{
4 override bool PerformReaction(notnull SCR_AIUtilityComponent utility, notnull SCR_AIThreatSystem threatSystem, AIDangerEvent dangerEvent, int dangerEventCount)
5 {
6 SCR_AIDangerEvent_UnsafeArea unsafeAreaEvent = SCR_AIDangerEvent_UnsafeArea.Cast(dangerEvent);
7 if (!unsafeAreaEvent)
8 return false;
9
10 vector unsafePos = unsafeAreaEvent.GetPosition();
11 float unsafeRadius = unsafeAreaEvent.GetRadius();
12 float distance = vector.Distance(unsafePos, utility.GetOrigin());
13
14 if (distance > unsafeRadius)
15 return false;
16
17 float distanceToMove = (unsafeRadius - distance) * -1;
18
19 SCR_AIMoveFromUnsafeAreaBehavior moveBehavior = new SCR_AIMoveFromUnsafeAreaBehavior(utility, null, unsafePos, null, distanceToMove);
20 utility.AddAction(moveBehavior);
21
22 return true;
23 }
24};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_AIMoveFromUnsafeAreaBehavior(SCR_AIUtilityComponent utility, SCR_AIActivityBase groupActivity, vector dangerPos, IEntity dangerEntity, float distance)
float distance
Event which gets broadcasted from danger-causing places to AI.