mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
simplifying and fixing offset
This commit is contained in:
parent
bc3260c8fc
commit
70512db0e3
@ -22,11 +22,15 @@ if (GVAR(enabledFor) == 1 && {!isPlayer _unit || {_unit == ACE_player}}) exitWit
|
||||
private _lastTime = _unit getVariable [QGVAR(lastTime), -10];
|
||||
private _bloodLoss = (if (GVAR(useAceMedical)) then {([_unit] call EFUNC(medical,getBloodLoss)) * 2.5} else {getDammage _unit * 2}) min 6;
|
||||
|
||||
if (((CBA_missionTime - _lastTime) + _bloodLoss) >= (8 + random(2))) then {
|
||||
if ((CBA_missionTime - _lastTime) + _bloodLoss >= 8 + random 2) then {
|
||||
_unit setVariable [QGVAR(lastTime), CBA_missionTime];
|
||||
|
||||
private _position = getPosATL _unit;
|
||||
_position = _position apply {if (random 1 >= 0.5) then {_x -(random(0.2))} else {_x + (random(0.2))}};
|
||||
private _position = getPosASL _unit;
|
||||
_position = _position vectorAdd [
|
||||
random 0.4 - 0.2,
|
||||
random 0.4 - 0.2,
|
||||
0
|
||||
];
|
||||
_position set [2, 0];
|
||||
|
||||
private _bloodDrop = ["ACE_Blooddrop_1", "ACE_Blooddrop_2", "ACE_Blooddrop_3", "ACE_Blooddrop_4"] select (floor (_bloodLoss max 3));
|
||||
|
@ -24,24 +24,18 @@
|
||||
|
||||
params ["_unit", "_dir", "_damage"];
|
||||
|
||||
private _pos = getPosATL _unit;
|
||||
private _distanceBetweenDrops = DISTANCE_BETWEEN_DROPS * _damage;
|
||||
private _offSet = OFFSET + _distanceBetweenDrops;
|
||||
private _sinDir = sin _dir;
|
||||
private _cosDir = cos _dir;
|
||||
private _offset = OFFSET + _distanceBetweenDrops;
|
||||
private _pos = _unit getPos [_offset, _dir];
|
||||
["ACE_Blooddrop_2", _pos, _dir] call FUNC(createBlood);
|
||||
|
||||
_pos params ["_x", "_y"];
|
||||
|
||||
private _bloodPos = [_x + (_sinDir * _offSet), _y + (_cosDir * _offSet), 0];
|
||||
["ACE_Blooddrop_2", _bloodPos, _dir] call FUNC(createBlood);
|
||||
|
||||
if (ceil (MAXIMUM_DROPS * _damage) > 1) then {
|
||||
private _dropAmount = ceil (MAXIMUM_DROPS * _damage);
|
||||
if (_dropAmount > 1) then {
|
||||
private _sin = _sinDir * _distanceBetweenDrops;
|
||||
private _cos = _cosDir * _distanceBetweenDrops;
|
||||
|
||||
for "_i" from 2 to _c do {
|
||||
_bloodPos params ["_x", "_y"];
|
||||
_bloodPos = [_x + _sin, _y + _cos, 0];
|
||||
for "_i" from 2 to _dropAmount do {
|
||||
_pos = _bloodPos getPos [_offset, _dir];
|
||||
["ACE_Blooddrop_1", _bloodPos, _dir] call FUNC(createBlood);
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user