Medical Engine - Increase lethality of aircraft explosions (#7304)

* Medical Engine - Increase lethality of aircraft explosions

* Update addons/medical_engine/XEH_postInit.sqf

Co-Authored-By: jonpas <jonpas33@gmail.com>
This commit is contained in:
PabstMirror 2019-12-17 10:01:17 -06:00 committed by GitHub
parent b874a1f618
commit 1fb989d332
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,3 +48,17 @@
[_unit, true] call FUNC(setUnconsciousAnim);
};
}] call CBA_fnc_addClassEventHandler;
// Guarantee aircraft crashes are more lethal
["Air", "Killed", {
params ["_vehicle", "_killer"];
TRACE_3("air killed",_vehicle,typeOf _vehicle,velocity _vehicle);
if ((getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "destrType")) == "") exitWith {};
if (unitIsUAV _vehicle) exitWith {};
private _lethality = linearConversion [0, 25, (vectorMagnitude velocity _vehicle), 0.5, 1];
TRACE_2("air crash",_lethality,crew _vehicle);
{
[QEGVAR(medical,woundReceived), [_x, "Head", _lethality, _killer, "#vehiclecrash", [HITPOINT_INDEX_HEAD,1]], _x] call CBA_fnc_targetEvent;
} forEach (crew _vehicle);
}, true, ["ParachuteBase"]] call CBA_fnc_addClassEventHandler;