ACE3/addons/frag/functions/fnc_fired.sqf

59 lines
1.6 KiB
Plaintext
Raw Normal View History

#include "script_component.hpp"
private ["_enabled", "_gun", "_type", "_round", "_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"];
if (!GVAR(enabled)) exitWith {};
_gun = _this select 0;
_type = _this select 4;
_round = _this select 6;
_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled));
if(_enabled < 1) exitWith {};
if(_round in GVAR(blackList)) exitWith {
GVAR(blackList) = GVAR(blackList) - [_round];
};
_doFragTrack = false;
2015-04-20 20:48:11 +00:00
if(_gun == ACE_player) then {
_doFragTrack = true;
} else {
2015-04-20 20:48:11 +00:00
if((gunner _gun) == ACE_player) then {
_doFragTrack = true;
} else {
if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then {
_doFragTrack = true;
};
};
};
2015-03-22 04:22:16 +00:00
_doSpall = false;
if(_doSpall) then {
if(GVAR(spallIsTrackingCount) <= 0) then {
GVAR(spallHPData) = [];
};
if(GVAR(spallIsTrackingCount) > 5) then {
2015-04-20 20:48:11 +00:00
// ACE_player sideChat "LIMT!";
_doSpall = false;
} else {
GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1;
};
};
2015-04-20 20:48:11 +00:00
// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)];
2015-04-20 21:38:50 +00:00
#ifdef DEBUG_MODE_FULL
2015-04-20 20:48:11 +00:00
[ACE_player, _round, [1,0,0,1]] call FUNC(addTrack);
2015-04-20 21:38:50 +00:00
#endif
if(_doFragTrack && alive _round) then {
GVAR(trackedObjects) pushBack _round;
_spallTrack = [];
_spallTrackID = [];
[DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, ACE_time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler;
if(_doSpall) then {
[_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack);
};
2015-04-20 20:48:11 +00:00
// ACE_player sideChat "WTF2";
};