From e628588602f733478bd3c13d4bd3f0a2935f542f Mon Sep 17 00:00:00 2001 From: He-Man Date: Thu, 4 Apr 2019 21:44:54 +0200 Subject: [PATCH] Unconscious Timer --- .../compile/event_handlers/EPOCH_HandleDamage.sqf | 1 + Sources/epoch_code/compile/setup/masterLoop/Event1.sqf | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf b/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf index 89eaabb6..0a241583 100644 --- a/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf +++ b/Sources/epoch_code/compile/event_handlers/EPOCH_HandleDamage.sqf @@ -57,6 +57,7 @@ if !(_source isEqualTo _unit) then { if !(lifeState _unit == "INCAPACITATED") then { EPOCH_HandleDamageTimeOut = diag_ticktime + 1; _unit setUnconscious true; + EPOCH_UnconsciousTime = diag_ticktime + 60 + (random 120); }; }; }; diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf index a8693d8b..921e6f5b 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event1.sqf @@ -427,6 +427,13 @@ if (cameraview isequalto "GROUP") then { vehicle player switchCamera "Internal"; }; +if (lifeState player == "INCAPACITATED") then { + if ((missionnamespace getvariable ["EPOCH_UnconsciousTime",diag_ticktime]) < diag_ticktime) then { + player setUnconscious false; + player playMoveNow 'AmovPercMstpSnonWnonDnon'; + }; +}; + // force update if (EPOCH_forceUpdateNow) then { _forceUpdate = false;