mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Hunger/Thirst Faiting cooldown of 45s
This commit is contained in:
parent
b9a361fd39
commit
de9c29d869
@ -6,6 +6,8 @@ if !(hasInterface) exitWith {};
|
||||
// Exit if not enabled
|
||||
if (!XGVAR(enabled)) exitWith {};
|
||||
|
||||
XGVAR(lastUnconEvent) = 0;
|
||||
|
||||
// Add Advanced Fatigue duty factor
|
||||
if (XGVAR(affectAdvancedFatigue) && {missionNamespace getVariable [QEGVAR(advanced_fatigue,enabled), false]}) then {
|
||||
[QUOTE(ADDON), {
|
||||
|
@ -27,12 +27,14 @@ if ((_thirst > 99.9 || {_hunger > 99.9}) && {random 1 < 0.5}) exitWith {
|
||||
// Exit if unit is not awake, below are animation based consequences
|
||||
if !(_player call EFUNC(common,isAwake)) exitWith {};
|
||||
|
||||
// Set unit unconscious (chance based on how high thirst/hunger are)
|
||||
// Set unit unconscious with 45s cooldown (chance based on how high thirst/hunger are)
|
||||
if (
|
||||
GETEGVAR(medical,enabled,false) &&
|
||||
{(CBA_missionTime - XGVAR(lastUnconEvent)) > 45} &&
|
||||
{(_thirst > 85 || {_hunger > 85}) && {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}}
|
||||
) exitWith {
|
||||
[_player, true, 5, true] call EFUNC(medical,setUnconscious);
|
||||
XGVAR(lastUnconEvent) = CBA_missionTime;
|
||||
};
|
||||
|
||||
// Make unit fall if moving fast
|
||||
|
Loading…
Reference in New Issue
Block a user