Finish Medical and Sleep to UiSleep

This commit is contained in:
icomrade
2016-03-05 22:34:09 -05:00
parent eadb3566c4
commit 68da397c52
87 changed files with 1320 additions and 1056 deletions

View File

@@ -1,10 +1,10 @@
// bleed.sqf
private ["_started","_finished","_animState","_isMedic","_id","_unit","_display"];
disableserialization;
private ["_started","_finished","_animState","_isMedic","_id","_unit","_item"];
_unit = (_this select 3) select 0;
_item = (_this select 3) select 1;
player removeMagazine _item;
closedialog 0;
call fnc_usec_medic_removeActions;
r_action = false;
@@ -14,21 +14,20 @@ if (vehicle player == player) then {
player playActionNow "Medic";
};
[1,1] call dayz_HungerThirst;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
[player,"bandage",0,false] call dayz_zombieSpeak;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -40,39 +39,27 @@ while {r_doLoop} do {
r_doLoop = false;
_finished = true;
};
uiSleep 0.1;
uisleep 0.1;
};
r_doLoop = false;
if (_finished) then {
_num_removed = ([player,"ItemBandage"] call BIS_fnc_invRemove);
if(_num_removed == 1) then {
if (vehicle player != player) then {
_display = findDisplay 106;
_display closeDisplay 0;
};
if ((_unit == player) || (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
} else {
/* PVS/PVC - Skaronator */
PVDZE_send = [_unit,"Bandage",[_unit,player]];
publicVariableServer "PVDZE_send";
[player,20] call player_humanityChange;
if ((_unit == player) or (vehicle player != player)) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
if (_item=="ItemSepsisBandage") then {
r_player_Sepsis = [false, 0];
player setVariable ["USEC_Sepsis", false, true];
player setVariable ["sepsisStarted", nil];
};
{_unit setVariable[_x,false,true];} count USEC_typeOfWounds;
_unit setVariable ["USEC_injured",false,true];
} else {
PVDZE_send = [_unit,"Bandage",[_unit,player]];
publicVariableServer "PVDZE_send";
[player,20] call player_humanityChange;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
player addMagazine _item;
};