mirror of
https://github.com/acemod/ACE3.git
synced 2025-07-25 04:42:48 +00:00
Merge pull request #1622 from acemod/huntirHitpoints
Added 'parachute' and 'camera' hitpoints to the HuntIR model:
This commit is contained in:
@ -19,16 +19,45 @@ 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;
|
author = ECSTRING(common,ACETeam);
|
||||||
|
castDriverShadow = 0;
|
||||||
destrType = "DestructDefault";
|
destrType = "DestructDefault";
|
||||||
displayName = "HuntIR";
|
displayName = "HuntIR";
|
||||||
model = PATHTOF(data\huntir.p3d);
|
model = PATHTOF(data\huntir.p3d);
|
||||||
castDriverShadow = 0;
|
scope = 1;
|
||||||
soundEnviron[] = {"z\ace\addons\apl\sounds\padak_let", 0.316228, 1, 80};
|
|
||||||
soundCrash[] = {"", db-30, 1 };
|
soundCrash[] = {"", db-30, 1 };
|
||||||
|
soundEnviron[] = {"z\ace\addons\apl\sounds\padak_let", 0.316228, 1, 80};
|
||||||
soundLandCrash[] = {"", db-30, 1 };
|
soundLandCrash[] = {"", db-30, 1 };
|
||||||
soundWaterCrash[] = {"", db10, 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;
|
class Item_Base_F;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
ADDON = false;
|
ADDON = false;
|
||||||
|
|
||||||
PREP(cam);
|
PREP(cam);
|
||||||
PREP(handleDamage);
|
|
||||||
PREP(handleFired);
|
PREP(handleFired);
|
||||||
PREP(huntir);
|
PREP(huntir);
|
||||||
PREP(huntirCompass);
|
PREP(huntirCompass);
|
||||||
|
Binary file not shown.
@ -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))} && {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;
|
GVAR(no_cams) pushBack _x;
|
||||||
};
|
};
|
||||||
} forEach GVAR(nearHuntIRs);
|
} 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;
|
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;
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: Ruthberg
|
|
||||||
*
|
|
||||||
* Handles huntir damage
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* 0: huntir <OBJECT>
|
|
||||||
* 1: selectionName <STRING>
|
|
||||||
* 2: damage <NUMBER>
|
|
||||||
* 3: source <OBJECT>
|
|
||||||
* 4: projectile <STRING>
|
|
||||||
*
|
|
||||||
* 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
|
|
@ -32,17 +32,16 @@ if (_ammo != "F_HuntIR") exitWith {};
|
|||||||
_huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"];
|
_huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"];
|
||||||
_huntir setPosATL _position;
|
_huntir setPosATL _position;
|
||||||
_huntir setVariable [QGVAR(startTime), ACE_time, true];
|
_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);
|
EXPLODE_1_PVT(_this select 0,_huntir);
|
||||||
if (isNull _huntir) exitWith {
|
if (isNull _huntir) exitWith {
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
if (damage _huntir > 0) then {
|
private ["_parachuteDamage", "_velocity"];
|
||||||
private ["_velocity"];
|
_parachuteDamage = _huntir getHitPointDamage "HitParachute";
|
||||||
|
if (_parachuteDamage > 0) then {
|
||||||
_velocity = velocity _huntir;
|
_velocity = velocity _huntir;
|
||||||
_velocity set [2, -1 min -20 * sqrt(damage _huntir)];
|
_velocity set [2, -1 min -20 * sqrt(_parachuteDamage)];
|
||||||
_huntir setVelocity _velocity;
|
_huntir setVelocity _velocity;
|
||||||
_huntir setVectorUp [0, 0, 1];
|
_huntir setVectorUp [0, 0, 1];
|
||||||
};
|
};
|
||||||
|
@ -61,7 +61,7 @@ createDialog "ace_huntir_cam_dialog_off";
|
|||||||
if (_elapsedTime > 10) then {
|
if (_elapsedTime > 10) then {
|
||||||
GVAR(state) = "noGDS";
|
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";
|
GVAR(state) = "connecting";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user