8 static const float CLOSE_RANGE_COMBAT_DIST = 40.0;
11 static vector CalculateMoveDirection(SCR_EAICombatMoveDirection eDirection, vector myPos, vector movePos)
14 if (eDirection == SCR_EAICombatMoveDirection.ANYWHERE)
17 float bearing = Math.RandomFloat(0, Math.PI2);
18 vector dirOut = Vector(Math.Cos(bearing), 0, Math.Sin(bearing));
21 else if (eDirection == SCR_EAICombatMoveDirection.CUSTOM_POS)
23 vector dirToTarget = vector.Direction(myPos, movePos);
24 dirToTarget.Normalize();
30 vector dirToTarget = vector.Direction(myPos, movePos);
31 dirToTarget.Normalize();
32 vector dirSideways = (dirToTarget * Vector(0, 1, 0));
36 case SCR_EAICombatMoveDirection.FORWARD:
return dirToTarget;
37 case SCR_EAICombatMoveDirection.BACKWARD:
return -dirToTarget;
38 case SCR_EAICombatMoveDirection.RIGHT:
return -dirSideways;
39 case SCR_EAICombatMoveDirection.LEFT:
return dirSideways;