Skip to content
14 changes: 7 additions & 7 deletions addons/main/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ if (GVAR(aceMedicalLoaded)) then {
_unit setVariable [QGVAR(bleedoutKillTime), _recovered, true];
};
_unit setVariable [QGVAR(holdLimiter), false, true];
}, _unit, 3] call CBA_fnc_waitAndExecute;
}, _unit, 3] call CBA_fnc_waitAndExecute;
};
}] call CBA_fnc_addEventHandler;
};
Expand Down Expand Up @@ -360,7 +360,7 @@ if !(GVAR(aceMedicalLoaded)) then {
{}, [], [0,0,0], 5,[false,true,false,false,false]
] call ace_interact_menu_fnc_createAction;
["CAManBase", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;

if (GVAR(bleedoutStop) > 0) then {
private _action = ["apsPreventBleed", LLSTRING(pressureWound), "\a3\ui_f\data\IGUI\Cfg\Cursors\unitBleeding_ca.paa",
{
Expand All @@ -377,12 +377,12 @@ if !(GVAR(aceMedicalLoaded)) then {
};
};
_target setVariable [QGVAR(isHold), true, true];
_target setVariable [QGVAR(holdingUnit), _player, true];
_target setVariable [QGVAR(holdingUnit), _player, true];

[21.5, [_target,_player], { // complete
params ["_args"];
_args params ["_target", "_caller"];
if (isNull objectParent _caller) then {
if (isNull objectParent _caller) then {
private _anim = ["amovpknlmstpsloww[wpn]dnon", "amovppnemstpsrasw[wpn]dnon"] select (_caller getVariable [QGVAR(wasProne), false]);
private _wpn = ["non", "rfl", "lnr", "pst"] param [["", primaryWeapon _caller, secondaryWeapon _caller, handgunWeapon _caller] find currentWeapon _caller, "non"];
_anim = [_anim, "[wpn]", _wpn] call CBA_fnc_replace;
Expand All @@ -393,14 +393,14 @@ if !(GVAR(aceMedicalLoaded)) then {
}, {// fail
params ["_args"];
_args params ["_target", "_caller"];
if (isNull objectParent _caller) then {
if (isNull objectParent _caller) then {
private _anim = ["amovpknlmstpsloww[wpn]dnon", "amovppnemstpsrasw[wpn]dnon"] select (_caller getVariable [QGVAR(wasProne), false]);
private _wpn = ["non", "rfl", "lnr", "pst"] param [["", primaryWeapon _caller, secondaryWeapon _caller, handgunWeapon _caller] find currentWeapon _caller, "non"];
_anim = [_anim, "[wpn]", _wpn] call CBA_fnc_replace;
[QGVAR(switchMove), [_caller, _anim]] call CBA_fnc_globalEvent;
};
_target setVariable [QGVAR(isHold), nil, true];
_target setVariable [QGVAR(holdingUnit), nil, true];
_target setVariable [QGVAR(holdingUnit), nil, true];
}, format [LLSTRING(pressureUnit), name _target], // title
{ // pfh
params ["_args"];
Expand Down
4 changes: 4 additions & 0 deletions addons/main/functions/fnc_setUnconscious.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ if (_set) then {
};
GVAR(bleedOutTimeMalus) = GVAR(bleedOutTimeMalus) + GVAR(bleedoutTimeSubtraction);
_restBleedout = (GVAR(bleedoutTime) - GVAR(bleedOutTimeMalus)) max GVAR(minBleedoutTime);

// For coeff == 1, 1 second regenerated per duration of bleedout timer. coeff == 0 is no regeneration.
private _regen = round(sqrt(2*GVAR(bleedoutRegenCoeff)*(cba_missionTime - _downTime) + _restBleedout^2) - _restBleedout);
_restBleedout = (_restBleedout + _regen) min GVAR(bleedoutTime);
};
_unit setVariable [QGVAR(bleedoutKillTime), _downTime + _restBleedout, true];
} else {
Expand Down
13 changes: 13 additions & 0 deletions addons/main/initSettings.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,19 @@ _category = [_header, LLSTRING(subCategoryGeneral)];
}
] call CBA_fnc_addSetting;

[
QGVAR(bleedoutRegenCoeff),
"SLIDER",
[LLSTRING(bleedoutRegenCoeff), LLSTRING(bleedoutRegenCoeff_desc)],
_category,
[0.0, 10, 0.0, 1],
true,
{
params ["_value"];
GVAR(bleedoutRegenCoeff) = (parseNumber (_value toFixed 1));
}
] call CBA_fnc_addSetting;

[
QGVAR(medicReviveTime),
"SLIDER",
Expand Down
6 changes: 6 additions & 0 deletions addons/main/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@
<Key ID="STR_diw_armor_plates_main_pressureUnit">
<English>Preventing %1 from bleeding out, keep holding the button!</English>
</Key>
<Key ID="STR_diw_armor_plates_main_bleedoutRegenCoeff">
<English>Bleedout timer recovery coefficient</English>
</Key>
<Key ID="STR_diw_armor_plates_main_bleedoutRegenCoeff_desc">
<English>Speed of bleedout timer recovery. Zero is disabled, higher is faster. Approximately how many seconds recovered per bleedout timer duration. (default: 0).</English>
</Key>
<Key ID="STR_diw_armor_plates_main_medicReviveTime">
<English>Medic revive time</English>
<Polish>Czas leczenia przez medyka</Polish>
Expand Down