mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
7a0a00ea09
* Use private * Fix wrong spacing * Fix wrong variable being used * Cleanup empty line after header * ace_common_fnc_getCountOfItem * Remove useless _return variable * Naming
41 lines
943 B
Plaintext
41 lines
943 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Sickboy
|
|
* Spurt blood on the ground
|
|
*
|
|
* Arguments:
|
|
* 0: unit <OBJECT>
|
|
* 1: direction <NUMBER>
|
|
* 2: damage <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [UNIT, random 360, 1] call ace_medical_blood_fnc_spurt
|
|
*
|
|
* Public: No
|
|
*/
|
|
#define MAXIMUM_DROPS 4
|
|
#define DISTANCE_BETWEEN_DROPS 0.20
|
|
#define OFFSET 0.25
|
|
|
|
params ["_unit", "_dir", "_damage"];
|
|
_damage = _damage min 1;
|
|
|
|
private _distanceBetweenDrops = DISTANCE_BETWEEN_DROPS * _damage;
|
|
private _offset = OFFSET + _distanceBetweenDrops;
|
|
private _pos = _unit getPos [_offset, _dir];
|
|
|
|
["blooddrop_2", _pos, _dir] call FUNC(createBlood);
|
|
|
|
private _dropAmount = ceil (MAXIMUM_DROPS * _damage);
|
|
TRACE_2("spurt blood",_dropAmount,_damage);
|
|
|
|
if (_dropAmount > 1) then {
|
|
for "_i" from 2 to _dropAmount do {
|
|
_pos = _pos getPos [_distanceBetweenDrops, _dir];
|
|
["blooddrop_1", _pos, _dir] call FUNC(createBlood);
|
|
};
|
|
};
|