mirror of
https://github.com/acemod/ACE3.git
synced 2025-07-25 04:42:48 +00:00
Made the HuntIR camera destroyable:
* Shooting the parachute will increase its damage * The falling speed now increases with damage * Damaged cameras won't be able to transmit video * The HuntIR spawn positions now really depends on the grenade trajectory
This commit is contained in:
@ -20,6 +20,7 @@ class CfgVehicles {
|
|||||||
class Parachute_02_base_F;
|
class Parachute_02_base_F;
|
||||||
class ACE_HuntIR: Parachute_02_base_F {
|
class ACE_HuntIR: Parachute_02_base_F {
|
||||||
scope = 1;
|
scope = 1;
|
||||||
|
destrType = "DestructDefault";
|
||||||
displayName = "HuntIR";
|
displayName = "HuntIR";
|
||||||
model = PATHTOF(data\huntir.p3d);
|
model = PATHTOF(data\huntir.p3d);
|
||||||
castDriverShadow = 0;
|
castDriverShadow = 0;
|
||||||
|
@ -65,12 +65,12 @@ GVAR(no_cams) sort true;
|
|||||||
[{
|
[{
|
||||||
GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
|
GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
|
||||||
{
|
{
|
||||||
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))}) then {
|
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {damage _x < 0.5}) then {
|
||||||
GVAR(no_cams) pushBack _x;
|
GVAR(no_cams) pushBack _x;
|
||||||
};
|
};
|
||||||
} forEach GVAR(nearHuntIRs);
|
} forEach GVAR(nearHuntIRs);
|
||||||
{
|
{
|
||||||
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))}) then {
|
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {damage _x >= 0.5}) then {
|
||||||
GVAR(no_cams) deleteAt _forEachIndex;
|
GVAR(no_cams) deleteAt _forEachIndex;
|
||||||
if (_forEachIndex < GVAR(cur_cam)) then {
|
if (_forEachIndex < GVAR(cur_cam)) then {
|
||||||
GVAR(cur_cam) = GVAR(cur_cam) - 1;
|
GVAR(cur_cam) = GVAR(cur_cam) - 1;
|
||||||
|
@ -23,24 +23,25 @@ PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
|||||||
|
|
||||||
if (_ammo != "F_HuntIR") exitWith {};
|
if (_ammo != "F_HuntIR") exitWith {};
|
||||||
|
|
||||||
private ["_dir", "_pos", "_dirDegree", "_b", "_a", "_y", "_x"];
|
|
||||||
_dir = ACE_player weaponDirection _weapon;
|
|
||||||
_pos = getPosATL ACE_player;
|
|
||||||
|
|
||||||
_dirDegree = (_dir select 0) atan2 (_dir select 1);
|
|
||||||
_b = 500 / (tan((asin(_dir select 2)) + 10));
|
|
||||||
_a = _b * sin(_dirDegree);
|
|
||||||
_b = _a / tan(_dirDegree);
|
|
||||||
_x = (_pos select 0) + _a;
|
|
||||||
_y = (_pos select 1) + _b;
|
|
||||||
|
|
||||||
[{
|
[{
|
||||||
PARAMS_3(_projectile,_x,_y);
|
PARAMS_1(_projectile);
|
||||||
"ACE_HuntIR_Propell" createVehicle (getPosATL _projectile);
|
"ACE_HuntIR_Propell" createVehicle (getPosATL _projectile);
|
||||||
[{
|
[{
|
||||||
PARAMS_3(_x,_y,_z);
|
PARAMS_1(_position);
|
||||||
private ["_huntir"];
|
private ["_huntir"];
|
||||||
_huntir = createVehicle ["ACE_HuntIR", [_x, _y, _z], [], 0, "FLY"];
|
_huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"];
|
||||||
_huntir setPosATL [_x, _y, _z];
|
_huntir setPosATL _position;
|
||||||
}, [_x, _y, ((getPosATL _projectile) select 2) + 400], 5, 0] call EFUNC(common,waitAndExecute);
|
[{
|
||||||
}, [_projectile, _x, _y], 5, 0] call EFUNC(common,waitAndExecute);
|
EXPLODE_1_PVT(_this select 0,_huntir);
|
||||||
|
private ["_deltaT"];
|
||||||
|
if (isNull _huntir) exitWith {
|
||||||
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
|
};
|
||||||
|
if (damage _huntir > 0) then {
|
||||||
|
_deltaT = ACE_time - (_huntir getVariable [QGVAR(lastTime), ACE_time]);
|
||||||
|
_huntir setVelocity (velocity _huntir vectorAdd [0, 0, -9.8066 * (damage _huntir) * _deltaT]);
|
||||||
|
_huntir setVariable [QGVAR(lastTime), ACE_time];
|
||||||
|
};
|
||||||
|
}, 0.1, [_huntir]] call CBA_fnc_addPerFrameHandler;
|
||||||
|
}, [getPosATL _projectile vectorAdd [0, 0, 400]], 5, 0] call EFUNC(common,waitAndExecute);
|
||||||
|
}, [_projectile], 5, 0] call EFUNC(common,waitAndExecute);
|
||||||
|
Reference in New Issue
Block a user