2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-09-11 18:46:35 +00:00
|
|
|
/*
|
|
|
|
* Author: Sickboy
|
2019-06-28 16:50:11 +00:00
|
|
|
* Spurts blood on the ground based on the direction and damage.
|
2016-09-11 18:46:35 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2019-06-28 16:50:11 +00:00
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Direction <NUMBER>
|
|
|
|
* 2: Damage <NUMBER>
|
2016-09-11 18:46:35 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2019-06-28 16:50:11 +00:00
|
|
|
* [player, random 360, 1] call ace_medical_blood_fnc_spurt
|
2016-09-11 18:46:35 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define MAXIMUM_DROPS 4
|
|
|
|
#define DISTANCE_BETWEEN_DROPS 0.20
|
|
|
|
#define OFFSET 0.25
|
|
|
|
|
2019-06-28 16:50:11 +00:00
|
|
|
params ["_unit", "_direction", "_damage"];
|
2016-09-11 18:46:35 +00:00
|
|
|
|
|
|
|
private _distanceBetweenDrops = DISTANCE_BETWEEN_DROPS * _damage;
|
2016-09-19 11:26:32 +00:00
|
|
|
private _offset = OFFSET + _distanceBetweenDrops;
|
2019-06-28 16:50:11 +00:00
|
|
|
private _position = _unit getPos [_offset, _direction];
|
2016-10-02 16:35:40 +00:00
|
|
|
|
2023-02-01 11:03:44 +00:00
|
|
|
["blooddrop_2", _position, _unit] call FUNC(createBlood);
|
2016-09-11 18:46:35 +00:00
|
|
|
|
2016-09-19 11:26:32 +00:00
|
|
|
private _dropAmount = ceil (MAXIMUM_DROPS * _damage);
|
2019-06-28 16:50:11 +00:00
|
|
|
TRACE_2("Spurting blood",_dropAmount,_damage);
|
2016-10-02 16:35:40 +00:00
|
|
|
|
2016-09-19 11:26:32 +00:00
|
|
|
if (_dropAmount > 1) then {
|
|
|
|
for "_i" from 2 to _dropAmount do {
|
2019-06-28 16:50:11 +00:00
|
|
|
_position = _position getPos [_distanceBetweenDrops, _direction];
|
2023-02-01 11:03:44 +00:00
|
|
|
["blooddrop_1", _position, _unit] call FUNC(createBlood);
|
2016-09-11 18:46:35 +00:00
|
|
|
};
|
|
|
|
};
|