ACE3/addons/medical_damage/functions/fnc_woundsHandlerVehiclecrash.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

29 lines
817 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