2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi
|
|
|
|
*
|
|
|
|
* Adjusts the direction of a shell.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* -> arguments of the FiredBIS EH
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*/
|
|
|
|
|
2015-01-12 10:02:44 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
private ["_unit", "_weaponType", "_ammoType", "_magazineType", "_round", "_FCSMagazines", "_FCSElevation", "_offset"];
|
|
|
|
|
|
|
|
_unit = _this select 0;
|
|
|
|
_weaponType = _this select 1;
|
|
|
|
_ammoType = _this select 4;
|
|
|
|
_magazineType = _this select 5;
|
|
|
|
_round = _this select 6;
|
|
|
|
|
2015-01-12 10:02:44 +00:00
|
|
|
_FCSMagazines = _unit getVariable QGVAR(Magazines);
|
|
|
|
_FCSElevation = _unit getVariable QGVAR(Elevation);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-12 10:02:44 +00:00
|
|
|
if (ACE_player != gunner _unit) exitWith {};
|
2015-01-11 16:42:31 +00:00
|
|
|
if !(_magazineType in _FCSMagazines) exitWith {};
|
|
|
|
|
|
|
|
// GET ELEVATION OFFSET OF CURRENT MAGAZINE
|
|
|
|
_offset = 0;
|
|
|
|
{
|
|
|
|
if (_x == _magazineType) exitWith {
|
|
|
|
_offset = _FCSElevation select _forEachIndex;
|
|
|
|
};
|
|
|
|
} forEach _FCSMagazines;
|
|
|
|
|
2015-01-12 10:02:44 +00:00
|
|
|
[_round, (_unit getVariable QGVAR(Azimuth)), _offset, 0] call EFUNC(core, changeProjectileDirection);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
// Air burst missile
|
2015-01-12 10:02:44 +00:00
|
|
|
// may need to get rewritten
|
|
|
|
if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "ACE_Airburst") == 1) then {
|
2015-01-11 16:42:31 +00:00
|
|
|
_this spawn {
|
|
|
|
_vehicle = _this select 0;
|
|
|
|
_projectile = _this select 6;
|
|
|
|
|
2015-01-12 10:02:44 +00:00
|
|
|
_distance = _vehicle getVariable [QGVAR(Distance), currentZeroing _vehicle];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if (_distance < 50) exitWith {};
|
|
|
|
if (_distance > 1500) exitWith {};
|
|
|
|
|
|
|
|
waitUntil {_projectile distance _vehicle > _distance || {!alive _projectile}};
|
|
|
|
if (!alive _projectile) exitWith {};
|
|
|
|
|
|
|
|
_position = getPosATL _projectile;
|
|
|
|
|
2015-01-12 10:02:44 +00:00
|
|
|
_subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
|
2015-01-11 16:42:31 +00:00
|
|
|
_subMunition setPosATL _position;
|
|
|
|
_subMunition setVelocity [0, 0, -10];
|
|
|
|
|
|
|
|
deleteVehicle _projectile;
|
|
|
|
};
|
|
|
|
};
|