mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Unconscious cleanup
This commit is contained in:
@@ -1,14 +1,12 @@
|
|||||||
private ["_nul","_timeout","_isOnDeck","_isInLocation","_inVehicle","_bloodLow","_isHospital","_totalTimeout","_display","_ctrl1","_ctrl1Pos"];
|
private ["_totalTimeout","_timeout","_bloodLow","_display","_ctrl1","_ctrl1Pos"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
if ((!r_player_handler1) && (r_handlerCount == 0)) then {
|
if ((!r_player_handler1) && (r_handlerCount == 0)) then {
|
||||||
//Unconscious Meter
|
|
||||||
_totalTimeout = r_player_timeout;
|
_totalTimeout = r_player_timeout;
|
||||||
if (_totalTimeout == 0) then { _totalTimeout = 1; }; //Fix for zero divisor
|
if (_totalTimeout == 0) then { _totalTimeout = 1; };
|
||||||
4 cutRsc ["playerStatusWaiting", "PLAIN",0];
|
4 cutRsc ["playerStatusWaiting", "PLAIN",0];
|
||||||
_display = uiNamespace getVariable 'DAYZ_GUI_waiting';
|
_display = uiNamespace getVariable 'DAYZ_GUI_waiting';
|
||||||
_ctrl1 = _display displayCtrl 1400;
|
_ctrl1 = _display displayCtrl 1400;
|
||||||
_ctrl1Pos = ctrlPosition _ctrl1;
|
_ctrl1Pos = ctrlPosition _ctrl1;
|
||||||
|
|
||||||
_timeout = 0;
|
_timeout = 0;
|
||||||
r_handlerCount = r_handlerCount + 1;
|
r_handlerCount = r_handlerCount + 1;
|
||||||
r_player_handler1 = true;
|
r_player_handler1 = true;
|
||||||
@@ -17,27 +15,16 @@ if ((!r_player_handler1) && (r_handlerCount == 0)) then {
|
|||||||
"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0;
|
"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0;
|
||||||
0 fadeSound 0.05;
|
0 fadeSound 0.05;
|
||||||
disableUserInput true;
|
disableUserInput true;
|
||||||
//waitUntil{USEC_MotherInbox == ""};
|
|
||||||
//["MED001",0,"Unconscious"] call fnc_usec_recordEventClient;
|
|
||||||
//diag_log "CLIENT: Unconscious...";
|
|
||||||
while {(r_player_unconscious)} do {
|
while {(r_player_unconscious)} do {
|
||||||
_ctrl1 ctrlSetPosition [(_ctrl1Pos select 0),(_ctrl1Pos select 1),(_ctrl1Pos select 2),((0.136829 * safezoneH) * (1 -(r_player_timeout / _totalTimeout)))];
|
_ctrl1 ctrlSetPosition [(_ctrl1Pos select 0),(_ctrl1Pos select 1),(_ctrl1Pos select 2),((0.136829 * safezoneH) * (1 -(r_player_timeout / _totalTimeout)))];
|
||||||
_ctrl1 ctrlCommit 1;
|
_ctrl1 ctrlCommit 1;
|
||||||
playSound "heartbeat_1";
|
playSound "heartbeat_1";
|
||||||
sleep 1;
|
sleep 1;
|
||||||
_isOnDeck = false; //getPos player in LHA_Deck;
|
|
||||||
_isInLocation = false; //getPos player in LHA_Location;
|
|
||||||
_inVehicle = (vehicle player != player);
|
|
||||||
_bloodLow = ((r_player_blood/r_player_bloodTotal) < 0.5);
|
_bloodLow = ((r_player_blood/r_player_bloodTotal) < 0.5);
|
||||||
if ((surfaceIsWater (getPosASL player)) && !_isOnDeck && !_inVehicle) then {
|
|
||||||
player setpos [(getPosASL player select 0),(getPosASL player select 1),0.3];
|
|
||||||
};
|
|
||||||
|
|
||||||
if(_timeout == 0) then {
|
if(_timeout == 0) then {
|
||||||
if (!r_player_dead && !_bloodLow && r_player_injured) then {
|
if (!r_player_dead && !_bloodLow && r_player_injured) then {
|
||||||
_timeout = 10;
|
_timeout = 10;
|
||||||
//_animType = (USEC_WoundAnim select (floor(random (count USEC_WoundAnim))));
|
|
||||||
//player playActionNow _anim;
|
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_timeout = _timeout - 1;
|
_timeout = _timeout - 1;
|
||||||
@@ -50,50 +37,6 @@ if ((!r_player_handler1) && (r_handlerCount == 0)) then {
|
|||||||
_nul = [] spawn fnc_usec_recoverUncons;
|
_nul = [] spawn fnc_usec_recoverUncons;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//Check if near field hospital
|
|
||||||
_isHospital = false; //(count( nearestObjects [player, ["USMC_WarfareBFieldhHospital"], 8]) > 0);
|
|
||||||
if (_isHospital || _isOnDeck || _isInLocation) then {
|
|
||||||
|
|
||||||
waitUntil {!(player getVariable ["NORRN_unit_dragged", false])};
|
|
||||||
|
|
||||||
cutText[localize "str_medical_healing", "PLAIN", 2];
|
|
||||||
sleep 5;
|
|
||||||
|
|
||||||
r_player_inpain = false;
|
|
||||||
r_player_dead = false;
|
|
||||||
r_player_injured = false;
|
|
||||||
r_player_cardiac = false;
|
|
||||||
|
|
||||||
//Give Blood
|
|
||||||
r_player_blood = r_player_bloodTotal;
|
|
||||||
player setVariable["USEC_lowBlood",false,true];
|
|
||||||
|
|
||||||
//Self Healing
|
|
||||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
|
|
||||||
player setVariable ["hit_legs",0,false];
|
|
||||||
player setVariable ["hit_hands",0,false];
|
|
||||||
player setVariable["medForceUpdate",true];
|
|
||||||
|
|
||||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
|
|
||||||
player setVariable["medForceUpdate",true];
|
|
||||||
|
|
||||||
/* REMOVED USE THAT ABOVE
|
|
||||||
usecMorphine = [player,player];
|
|
||||||
publicVariable "usecMorphine";
|
|
||||||
|
|
||||||
usecBandage = [player,player];
|
|
||||||
publicVariable "usecBandage";
|
|
||||||
*/
|
|
||||||
|
|
||||||
player setVariable ["USEC_inPain", false, true];
|
|
||||||
player setdamage 0;
|
|
||||||
{player setVariable[_x,false,true];} count USEC_woundHit;
|
|
||||||
player setVariable ["USEC_injured",false,true];
|
|
||||||
|
|
||||||
sleep 1;
|
|
||||||
r_player_handler = false;
|
|
||||||
_nul = [] spawn fnc_usec_recoverUncons;
|
|
||||||
};
|
|
||||||
if (!(player getVariable ["NORRN_unconscious", true])) then {
|
if (!(player getVariable ["NORRN_unconscious", true])) then {
|
||||||
_nul = [] spawn fnc_usec_recoverUncons;
|
_nul = [] spawn fnc_usec_recoverUncons;
|
||||||
};
|
};
|
||||||
@@ -102,10 +45,7 @@ if ((!r_player_handler1) && (r_handlerCount == 0)) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
4 cutRsc ["default", "PLAIN",1];
|
4 cutRsc ["default", "PLAIN",1];
|
||||||
//diag_log "CLIENT: Conscious...";
|
|
||||||
disableUserInput false;
|
disableUserInput false;
|
||||||
//waitUntil{USEC_MotherInbox == ""};
|
|
||||||
//["MED001",0,"Conscious"] call fnc_usec_recordEventClient;
|
|
||||||
if (!r_player_injured && ((r_player_blood/r_player_bloodTotal) >= 0.5)) then {
|
if (!r_player_injured && ((r_player_blood/r_player_bloodTotal) >= 0.5)) then {
|
||||||
10 fadeSound 1;
|
10 fadeSound 1;
|
||||||
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
|
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
|
||||||
|
|||||||
Reference in New Issue
Block a user