Merge pull request #1622 from acemod/huntirHitpoints

Added 'parachute' and 'camera' hitpoints to the HuntIR model:
This commit is contained in:
ulteq 2015-06-18 11:03:15 +02:00
commit c3fea42bce
7 changed files with 40 additions and 38 deletions

View File

@ -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;

View File

@ -3,7 +3,6 @@
ADDON = false;
PREP(cam);
PREP(handleDamage);
PREP(handleFired);
PREP(huntir);
PREP(huntirCompass);

Binary file not shown.

View File

@ -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;

View File

@ -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

View File

@ -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];
};

View File

@ -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";
};
};