2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2022-02-17 20:03:12 +00:00
|
|
|
/*
|
|
|
|
* Author: Pterolatypus
|
|
|
|
* Custom wound handler for vehicle crashes, sends damage to a random hitpoint
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit That Was Hit <OBJECT>
|
|
|
|
* 1: Damage done to each body part <ARRAY>
|
|
|
|
* 2: Type of the damage done <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, [[0.5, "#structural", 1.5]], "vehicleCrash"] call ace_medical_damage_fnc_woundsHandlerVehicleCrash
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
params ["_unit", "_allDamages", "_typeOfDamage"];
|
2022-02-20 23:23:56 +00:00
|
|
|
TRACE_3("woundsHandlerVehicleCrash",_unit,_allDamages,_typeOfDamage);
|
2022-02-17 20:03:12 +00:00
|
|
|
|
|
|
|
// randomise all hit selections
|
|
|
|
private _newDamages = _allDamages apply {
|
|
|
|
[_x select 0, selectRandom ALL_BODY_PARTS, _x select 2];
|
|
|
|
};
|
|
|
|
|
2024-02-05 17:04:24 +00:00
|
|
|
TRACE_1("Vehicle crash handled, passing damage",_newDamages);
|
2022-02-17 20:03:12 +00:00
|
|
|
[_unit, _newDamages, _typeOfDamage] //return
|