2016-09-11 18:46:35 +00:00
|
|
|
/*
|
|
|
|
* Author: Sickboy
|
|
|
|
* Spurt blood on the ground
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: unit <OBJECT>
|
|
|
|
* 1: direction <NUMBER>
|
|
|
|
* 2: damage <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2016-09-19 09:19:16 +00:00
|
|
|
* [UNIT, random 360, 1] call ace_medical_blood_fnc_spurt
|
2016-09-11 18:46:35 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
#define MAXIMUM_DROPS 4
|
|
|
|
#define DISTANCE_BETWEEN_DROPS 0.20
|
|
|
|
#define OFFSET 0.25
|
|
|
|
|
|
|
|
params ["_unit", "_dir", "_damage"];
|
2016-10-20 17:43:52 +00:00
|
|
|
_damage = _damage min 1;
|
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;
|
|
|
|
private _pos = _unit getPos [_offset, _dir];
|
2016-10-02 16:35:40 +00:00
|
|
|
|
2016-09-19 13:08:38 +00:00
|
|
|
["blooddrop_2", _pos, _dir] 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);
|
2016-10-02 16:35:40 +00:00
|
|
|
TRACE_2("spurt blood",_dropAmount,_damage);
|
|
|
|
|
2016-09-19 11:26:32 +00:00
|
|
|
if (_dropAmount > 1) then {
|
|
|
|
for "_i" from 2 to _dropAmount do {
|
2016-09-19 13:38:03 +00:00
|
|
|
_pos = _pos getPos [_distanceBetweenDrops, _dir];
|
2016-09-19 13:08:38 +00:00
|
|
|
["blooddrop_1", _pos, _dir] call FUNC(createBlood);
|
2016-09-11 18:46:35 +00:00
|
|
|
};
|
|
|
|
};
|