mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
73a7dbdc1e
- Add stackable wound handler system for easy 3rd party extensibility and overriding of default wound handler. - Change mapping from wound type -> damage types, to damage type -> wound types. Improves the semantics and makes configuration easier to reason about. - Allow damage types to influence wound properties (bleed, size, etc.) with configurable variance parameters. - Allow configuration of wound type variance per damage type. Enabling more logically driven variance for sensible but still varied end results. - Improve handling of non-selection-specific damage events. The wound handler now receives all incoming damages and may apply damage to multiple selections (previously only ever one) if the damage type is not configured to be selection specific (with new config property `selectionSpecific`). - Add debug script for testing explosion damage events at varied ranges. - Add custom fire wound handler.
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Glowbal, commy2
|
|
* Handles the wounds received event by triggering any needed blood creation.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Body Part (not used) <STRING>
|
|
* 2: Damage <NUMBER>
|
|
* 3: Shooter <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [player, "Body", 0.5, badGuy] call ace_medical_blood_fnc_handleWoundReceived
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit", "_allDamages", "_shooter"];
|
|
(_allDamages select 0) params ["_damage", ""];
|
|
|
|
// Don't bleed when players only and a non-player unit is wounded
|
|
if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {};
|
|
|
|
// Don't bleed on the ground if in a vehicle
|
|
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {};
|
|
|
|
private _bulletDir = if (isNull _shooter) then {
|
|
random 360 // Cannot calculate the direction properly, pick a random direction
|
|
} else {
|
|
_shooter getDir _unit // Calculate the bullet direction
|
|
};
|
|
|
|
[QGVAR(spurt), [_unit, _bulletDir, _damage min 1]] call CBA_fnc_serverEvent;
|