-
Notifications
You must be signed in to change notification settings - Fork 750
Expand file tree
/
Copy pathfnc_attackProfile_BEAM.sqf
More file actions
42 lines (36 loc) · 1.32 KB
/
fnc_attackProfile_BEAM.sqf
File metadata and controls
42 lines (36 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "..\script_component.hpp"
/*
* Author: tcvm
* Attack profile: Beam guided. Exact same as wire-guided, except no wire cutting
*
* Arguments:
* 0: Seeker Target PosASL <ARRAY>
* 1: Guidance Arg Array <ARRAY>
* 2: Attack Profile State <ARRAY>
*
* Return Value:
* Missile Aim PosASL <ARRAY>
*
* Example:
* [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_BEAM;
*
* Public: No
*/
params ["_seekerTargetPos", "_args", "_attackProfileStateParams"];
_args params ["_firedEH", "", "", "", "", "_targetData"];
_firedEH params ["_shooter","","","","","","_projectile"];
_attackProfileStateParams params ["_maxCorrectableDistance", "_wireCut", "_lastInput", "_crosshairOffset", "_seekerMaxRangeSqr", "_seekerMinRangeSqr", "_wireCutSource", "_distanceAheadOfMissile"];
private _projectilePos = getPosASL _projectile;
private _shooterPos = getPosASL _shooter;
private _distanceToProjectile = _shooterPos vectorDistanceSqr _projectilePos;
if ((_distanceToProjectile > _seekerMaxRangeSqr) || { _wireCut }) exitWith {
// wire snap, random direction
if !(_wireCut) then {
_attackProfileStateParams set [1, true];
};
_lastInput
};
private _final = _seekerTargetPos vectorAdd _crosshairOffset;
_attackProfileStateParams set [2, _final];
_targetData set [0, _projectilePos vectorFromTo _final];
_final