diff --git a/addons/huntir/CfgVehicles.hpp b/addons/huntir/CfgVehicles.hpp index 27994afe964..bc8ed4fc83e 100644 --- a/addons/huntir/CfgVehicles.hpp +++ b/addons/huntir/CfgVehicles.hpp @@ -19,16 +19,45 @@ class CfgVehicles { class Parachute_02_base_F; class ACE_HuntIR: Parachute_02_base_F { - scope = 1; + author = ECSTRING(common,ACETeam); + castDriverShadow = 0; destrType = "DestructDefault"; displayName = "HuntIR"; model = PATHTOF(data\huntir.p3d); - castDriverShadow = 0; - soundEnviron[] = {"z\ace\addons\apl\sounds\padak_let", 0.316228, 1, 80}; + scope = 1; soundCrash[] = {"", db-30, 1 }; + soundEnviron[] = {"z\ace\addons\apl\sounds\padak_let", 0.316228, 1, 80}; soundLandCrash[] = {"", db-30, 1 }; soundWaterCrash[] = {"", db10, 1 }; - mapSize = 0; + class HitPoints { + class HitEngine { + armor = 0; + material = -1; + name = ""; + visual = ""; + radius = 0; + passThrough = 0; + explosionShielding = 0; + }; + class HitParachute { + armor = 0.0001; + material = -1; + name = "parachute"; + visual = ""; + radius = 0.2; + passThrough = 1; + explosionShielding = 0; + }; + class HitCamera { + armor = 0.001; + material = -1; + name = "camera"; + visual = ""; + radius = 0.025; + passThrough = 1; + explosionShielding = 1; + }; + }; }; class Item_Base_F; diff --git a/addons/huntir/XEH_preInit.sqf b/addons/huntir/XEH_preInit.sqf index 77370305717..0ae45c15404 100644 --- a/addons/huntir/XEH_preInit.sqf +++ b/addons/huntir/XEH_preInit.sqf @@ -3,7 +3,6 @@ ADDON = false; PREP(cam); -PREP(handleDamage); PREP(handleFired); PREP(huntir); PREP(huntirCompass); diff --git a/addons/huntir/data/huntir.p3d b/addons/huntir/data/huntir.p3d index e9b91474168..a1c5b94e992 100644 Binary files a/addons/huntir/data/huntir.p3d and b/addons/huntir/data/huntir.p3d differ diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 64bf9e37b82..264c0c74b69 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -65,12 +65,12 @@ GVAR(no_cams) sort true; [{ GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; { - if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {damage _x < 0.5}) then { + if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then { GVAR(no_cams) pushBack _x; }; } forEach GVAR(nearHuntIRs); { - if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {damage _x >= 0.5}) then { + if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then { GVAR(no_cams) deleteAt _forEachIndex; if (_forEachIndex < GVAR(cur_cam)) then { GVAR(cur_cam) = GVAR(cur_cam) - 1; diff --git a/addons/huntir/functions/fnc_handleDamage.sqf b/addons/huntir/functions/fnc_handleDamage.sqf deleted file mode 100644 index 34772d8a66c..00000000000 --- a/addons/huntir/functions/fnc_handleDamage.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: Ruthberg - * - * Handles huntir damage - * - * Arguments: - * 0: huntir - * 1: selectionName - * 2: damage - * 3: source - * 4: projectile - * - * Return Value: - * Nothing - * - * Return value: - * None - */ -#include "script_component.hpp" - -PARAMS_5(_huntir,_selectionName,_damage,_source,_projectile); - -systemChat format["Selection: %1; Damage: %2", _selectionName, _damage]; - -_damage diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf index 447d5a44351..23c7df04f0a 100644 --- a/addons/huntir/functions/fnc_handleFired.sqf +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -32,17 +32,16 @@ if (_ammo != "F_HuntIR") exitWith {}; _huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"]; _huntir setPosATL _position; _huntir setVariable [QGVAR(startTime), ACE_time, true]; - // TODO: Edit the .p3d to allow doing the following _huntir getHit "camera"; _huntir getHit "parachute"; - //_huntir addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; [{ EXPLODE_1_PVT(_this select 0,_huntir); if (isNull _huntir) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - if (damage _huntir > 0) then { - private ["_velocity"]; + private ["_parachuteDamage", "_velocity"]; + _parachuteDamage = _huntir getHitPointDamage "HitParachute"; + if (_parachuteDamage > 0) then { _velocity = velocity _huntir; - _velocity set [2, -1 min -20 * sqrt(damage _huntir)]; + _velocity set [2, -1 min -20 * sqrt(_parachuteDamage)]; _huntir setVelocity _velocity; _huntir setVectorUp [0, 0, 1]; }; diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index 585a49a6acc..f8aed938802 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -61,7 +61,7 @@ createDialog "ace_huntir_cam_dialog_off"; if (_elapsedTime > 10) then { GVAR(state) = "noGDS"; }; - if (_elapsedTime > 5 && {count _nearestHuntIRs > 0}) then { + if (_elapsedTime > 5 && {{_x getHitPointDamage "HitCamera" < 0.25} count _nearestHuntIRs > 0}) then { GVAR(state) = "connecting"; }; };