@@ -27,16 +27,31 @@ if ((_thirst > 99.9 || {_hunger > 99.9}) && {random 1 < 0.5}) exitWith {
2727// Exit if unit is not awake, below are animation based consequences
2828if ! (_player call EFUNC(common,isAwake)) exitWith {};
2929
30- // Set unit unconscious (chance based on how high thirst/ hunger are)
30+ // Make unit moan from high hunger/thirst
3131if (
32- GETEGVAR(medical,enabled,false ) &&
33- {(_thirst > 85 || {_hunger > 85 }) && { random 1 < linearConversion [ 85 , 100 , _thirst max _hunger , 0.05 , 0.1 , true ]}}
34- ) exitWith {
35- if ( _player getVariable [QGVAR(nextUnconsciousTime), CBA_missionTime] > CBA_missionTime) exitWith {};
36-
37- _player setVariable [QGVAR(nextUnconsciousTime), CBA_missionTime + 15 ] ;
32+ GETEGVAR(medical,enabled,false ) &&
33+ {(_thirst > CONSEQ_THRESHOLD_LIGHT) || {_hunger > CONSEQ_THRESHOLD_LIGHT}} &&
34+ { random 1 < linearConversion [CONSEQ_THRESHOLD_LIGHT, 100 , ( _thirst max _hunger ), 0.05 , 0.2 , true ]}
35+ ) then {
36+ [ACE_Player, " moan " , round (linearConversion [CONSEQ_THRESHOLD_LIGHT, 90 , ( _thirst max _hunger ), 0 , 2 , true ])] call EFUNC(medical_feedback,playInjuredSound);
37+ } ;
3838
39- [_player , true , 5 , true ] call EFUNC(medical,setUnconscious);
39+ // Trigger high thirst/hunger consequence (chance based on how high thirst/hunger are)
40+ if (
41+ GETEGVAR(medical,enabled,false ) &&
42+ {(_thirst > CONSEQ_THRESHOLD_SEVERE || {_hunger > CONSEQ_THRESHOLD_SEVERE}) &&
43+ {random 1 < linearConversion [CONSEQ_THRESHOLD_SEVERE, 100 , _thirst max _hunger , 0.05 , 0.1 , true ]}}
44+ ) exitWith {
45+ if (XGVAR(nearDepletedConsequence) == 1 ) then { // Set unit unconscious with a 45s cooldown
46+ if (_player getVariable [QGVAR(nextUnconsciousTime), CBA_missionTime] >= CBA_missionTime) then {
47+ _player setVariable [QGVAR(nextUnconsciousTime), CBA_missionTime + 45 ];
48+ [_player , true , 5 , true ] call EFUNC(medical,setUnconscious);
49+ };
50+ } else { // Add pain
51+ if (ACE_Player getVariable [QEGVAR(medical,pain), 0 ] < 0.1 ) then {
52+ [ACE_Player, 0.1 ] call EFUNC(medical,adjustPainLevel);
53+ };
54+ };
4055};
4156
4257// Make unit fall if moving fast
0 commit comments