mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
parent
9441b548be
commit
5c9dfd7dc5
@ -26,8 +26,8 @@ private ["_damageThreshold", "_damageBodyPart", "_chanceFatal"];
|
|||||||
params ["_unit", "_part", ["_withDamage", 0]];
|
params ["_unit", "_part", ["_withDamage", 0]];
|
||||||
|
|
||||||
if (!alive _unit) exitWith {true};
|
if (!alive _unit) exitWith {true};
|
||||||
if (_part < 0 || _part > 5) exitWith {false};
|
|
||||||
if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitWith { true };
|
if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitWith { true };
|
||||||
|
if (_part < 0 || _part > 5) exitWith {false};
|
||||||
|
|
||||||
// Find the correct Damage threshold for unit.
|
// Find the correct Damage threshold for unit.
|
||||||
_damageThreshold = [1,1,1];
|
_damageThreshold = [1,1,1];
|
||||||
|
@ -26,6 +26,8 @@ if !(local _unit) exitWith {
|
|||||||
nil
|
nil
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// if (alive _unit) then {diag_log text format ["HD: %1", _this];};
|
||||||
|
|
||||||
private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"];
|
private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"];
|
||||||
|
|
||||||
// bug, assumed fixed, @todo excessive testing, if nothing happens remove
|
// bug, assumed fixed, @todo excessive testing, if nothing happens remove
|
||||||
@ -78,14 +80,14 @@ _minLethalDamage = if (_typeIndex >= 0) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private _vehicle = vehicle _unit;
|
private _vehicle = vehicle _unit;
|
||||||
|
private _effectiveSelectionName = _selection;
|
||||||
if ((_vehicle != _unit) && {!(_vehicle isKindOf "StaticWeapon")} && {_shooter in [objNull, driver _vehicle, _vehicle]} && {_projectile == ""} && {_selection == ""}) then {
|
if ((_vehicle != _unit) && {!(_vehicle isKindOf "StaticWeapon")} && {_shooter in [objNull, driver _vehicle, _vehicle]} && {_projectile == ""} && {_selection == ""}) then {
|
||||||
if (GVAR(enableVehicleCrashes)) then {
|
if (GVAR(enableVehicleCrashes)) then {
|
||||||
_selection = _this select 1; //pull random selection from HDC
|
_effectiveSelectionName = _this select 1; //pull random selection from HDC
|
||||||
TRACE_1("Veh Crash",_selection);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then {
|
if ((_minLethalDamage <= _newDamage) && {[_unit, [_effectiveSelectionName] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then {
|
||||||
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith {
|
if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith {
|
||||||
_damageReturn = 0.9;
|
_damageReturn = 0.9;
|
||||||
};
|
};
|
||||||
@ -101,13 +103,8 @@ if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectio
|
|||||||
[_unit] call FUNC(addToInjuredCollection);
|
[_unit] call FUNC(addToInjuredCollection);
|
||||||
|
|
||||||
if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith {
|
if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith {
|
||||||
if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then {
|
private _delayedUnconsicous = false;
|
||||||
[_unit] call EFUNC(common,unloadPerson);
|
if (_vehicle != _unit and {damage _vehicle >= 1}) then {
|
||||||
};
|
|
||||||
|
|
||||||
private "_delayedUnconsicous";
|
|
||||||
_delayedUnconsicous = false;
|
|
||||||
if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then {
|
|
||||||
[_unit] call EFUNC(common,unloadPerson);
|
[_unit] call EFUNC(common,unloadPerson);
|
||||||
_delayedUnconsicous = true;
|
_delayedUnconsicous = true;
|
||||||
};
|
};
|
||||||
@ -120,7 +117,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW
|
|||||||
if (_delayedUnconsicous) then {
|
if (_delayedUnconsicous) then {
|
||||||
[{
|
[{
|
||||||
[_this select 0, true] call FUNC(setUnconscious);
|
[_this select 0, true] call FUNC(setUnconscious);
|
||||||
}, [_unit], 0.7, 0] call EFUNC(common,waitAndExecute);
|
}, [_unit], 0.7] call EFUNC(common,waitAndExecute);
|
||||||
} else {
|
} else {
|
||||||
[{
|
[{
|
||||||
[_this select 0, true] call FUNC(setUnconscious);
|
[_this select 0, true] call FUNC(setUnconscious);
|
||||||
|
@ -33,7 +33,6 @@ private _vehicle = vehicle _unit;
|
|||||||
if ((_vehicle != _unit) && {!(_vehicle isKindOf "StaticWeapon")} && {_source in [objNull, driver _vehicle, _vehicle]} && {_projectile == ""} && {_selectionName == ""}) then {
|
if ((_vehicle != _unit) && {!(_vehicle isKindOf "StaticWeapon")} && {_source in [objNull, driver _vehicle, _vehicle]} && {_projectile == ""} && {_selectionName == ""}) then {
|
||||||
if (GVAR(enableVehicleCrashes)) then {
|
if (GVAR(enableVehicleCrashes)) then {
|
||||||
_selectionName = _hitSelections select (floor(random(count _hitSelections)));
|
_selectionName = _hitSelections select (floor(random(count _hitSelections)));
|
||||||
TRACE_1("Veh Crash",_selectionName);
|
|
||||||
_projectile = "vehiclecrash";
|
_projectile = "vehiclecrash";
|
||||||
_this set [1, _selectionName];
|
_this set [1, _selectionName];
|
||||||
_this set [4, _projectile];
|
_this set [4, _projectile];
|
||||||
|
@ -47,6 +47,12 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal ==
|
|||||||
_args params ["_unit"];
|
_args params ["_unit"];
|
||||||
_startTime = _unit getVariable [QGVAR(reviveStartTime), 0];
|
_startTime = _unit getVariable [QGVAR(reviveStartTime), 0];
|
||||||
|
|
||||||
|
//If we are in reivie state in a blown up vehicle, try to unload so that people can access the body
|
||||||
|
if ((alive _unit) && {(vehicle _unit) != _unit} && {!alive (vehicle _unit)}) then {
|
||||||
|
TRACE_2("Unloading", _unit, vehicle _unit);
|
||||||
|
[_unit] call EFUNC(common,unloadPerson);
|
||||||
|
};
|
||||||
|
|
||||||
if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitwith {
|
if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitwith {
|
||||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||||
_unit setVariable [QGVAR(inReviveState), nil, true];
|
_unit setVariable [QGVAR(inReviveState), nil, true];
|
||||||
|
Loading…
Reference in New Issue
Block a user