ACE3/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf
PabstMirror bdeb347ea9
medical_damage - cleanup woundHandler naming (#8824)
* medical_damage - cleanup woundHandler naming

* woundsHandlerBase
2022-02-20 17:23:56 -06:00

29 lines
814 B
Plaintext

#include "script_component.hpp"
/*
* 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"];
TRACE_3("woundsHandlerVehicleCrash",_unit,_allDamages,_typeOfDamage);
// randomise all hit selections
private _newDamages = _allDamages apply {
[_x select 0, selectRandom ALL_BODY_PARTS, _x select 2];
};
TRACE_1("Vehicle crash handled, passing damage", _newDamages);
[_unit, _newDamages, _typeOfDamage] //return