Add ability to disable iron dome (disabled by default)

This commit is contained in:
Bailey Danyluk 2022-06-02 20:11:35 -06:00
parent 0531abb76d
commit 5a55d2d257
8 changed files with 30 additions and 5 deletions

View File

@ -38,7 +38,7 @@ private _heightAboveLaunch = (_projectilePos select 2) - (_launchPos select 2);
// Add height depending on distance for compensate
private _returnTargetPos = _seekerTargetPos;
if (_returnTargetPos isEqualTo [0, 0, 0]) then {
_initialDistanceToTarget = 8000;
private _initialDistanceToTarget = 8000;
_returnTargetPos = _launchPos vectorAdd (_launchDir vectorMultiply _initialDistanceToTarget);
};
@ -109,6 +109,7 @@ switch (_attackStage) do {
};
// missile guidance defines this variable in doAttackProfile
//IGNORE_PRIVATE_WARNING ["_attackProfileName"];
_attackProfileName = ["na", "hellfire - LAUNCH", "hellfire - SEEK CRUISE", "hellfire - ATTACK CRUISE", "hellfire - TERMINAL"] select _attackStage;
TRACE_1("Adjusted target position", _returnTargetPos);

View File

@ -9,3 +9,9 @@ class Extended_PreInit_EventHandlers {
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit));
};
};

View File

@ -0,0 +1,7 @@
#include "script_component.hpp"
if (isServer && { GVAR(enable) }) then {
[LINKFUNC(projectileTrackerPFH)] call CBA_fnc_addPerFrameHandler;
[LINKFUNC(proximityFusePFH)] call CBA_fnc_addPerFrameHandler;
};

View File

@ -31,9 +31,6 @@ if (isServer) then {
GVAR(interceptors) pushBack [_interceptor, _target, getPosASLVisual _interceptor, _interceptor distance _target];
[GVAR(toBeShot), _target] call CBA_fnc_hashRem;
}] call CBA_fnc_addEventHandler;
[LINKFUNC(projectileTrackerPFH)] call CBA_fnc_addPerFrameHandler;
[LINKFUNC(proximityFusePFH)] call CBA_fnc_addPerFrameHandler;
};
[QGVAR(registerLaunchers), {

View File

@ -1,3 +1,13 @@
[
QGVAR(enable), "CHECKBOX",
[ELSTRING(common,Enabled), LSTRING(enable_description)],
LSTRING(category),
false, // default value
true, // isGlobal
{[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)},
true // Needs mission restart
] call CBA_fnc_addSetting;
[
QGVAR(targetRecycleTime), "SLIDER",
[LSTRING(targetRecycleTime_setting), LSTRING(targetRecycleTime_description)],

View File

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="ACE">
<Package name="IRON_DOME">
<Key ID="STR_ACE_IRON_DOME_enable_description">
<English>Enable the Iron Dome system</English>
</Key>
<Key ID="STR_ACE_IRON_DOME_category">
<English>ACE Iron Dome</English>
</Key>

View File

@ -48,6 +48,7 @@ _targetData set [2, (_projectilePos vectorDistance _missilePosProjected)];
if (GVAR(debug_drawGuidanceInfo)) then {
private _projectilePitch = ((vectorDir _projectile) call CBA_fnc_vect2polar) select 2;
//IGNORE_PRIVATE_WARNING ["_attackProfileName"];
_attackProfileName = format ["JDAM [Pitch - %1 Impact Pitch - %2]", _projectilePitch, _impactAngle];
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _missilePosProjected, 0.75, 0.75, 0, "P", 1, 0.025, "TahomaB"];
private _desiredAngle = _lineDir vectorMultiply 5000;

View File

@ -27,7 +27,7 @@ if (_correctionDistance == 0) then {
};
private _navigationParams = [
_p, _i, _d,
_p, 0, _d,
0,
0,
_correctionDistance