mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Add medic anim function with proper interrupt
Closes #1386 Vanilla commits applied:f99a3deced731b957e8eRemoved two unused files and a few variables made redundant by actionInProgress
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
private ["_rawmeat","_cookedmeat","_meat","_meatcooked","_text","_qty","_dis","_sfx"];
|
||||
private ["_rawmeat","_cookedmeat","_meat","_meatcooked","_text","_qty","_dis","_sfx","_finished"];
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
//diag_log ("Cook Enabled");
|
||||
@@ -8,21 +8,24 @@ s_player_cook = -1;
|
||||
_rawmeat = Dayz_meatraw;
|
||||
_cookedmeat = Dayz_meatcooked;
|
||||
a_player_cooking = true;
|
||||
_finished = true;
|
||||
|
||||
{
|
||||
_meat = _x;
|
||||
_meatcooked = _cookedmeat select (_rawmeat find _meat);
|
||||
if (_meat in magazines player) then {
|
||||
_text = getText (configFile >> "CfgMagazines" >> _meatcooked >> "displayName");
|
||||
_qty = {_x == _meat} count magazines player;
|
||||
player playActionNow "Medic";
|
||||
|
||||
_dis=6;
|
||||
_sfx = "cook";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
uiSleep _qty;
|
||||
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (!_finished) exitWith {};
|
||||
|
||||
_qty = {_x == _meat} count magazines player;
|
||||
|
||||
for "_x" from 1 to _qty do {
|
||||
player removeMagazine _meat;
|
||||
player addMagazine _meatcooked;
|
||||
@@ -31,6 +34,8 @@ a_player_cooking = true;
|
||||
};
|
||||
format[localize "str_success_cooked",_qty,_text] call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
if (!_finished) exitWith {};
|
||||
} forEach _rawmeat;
|
||||
|
||||
a_player_cooking = false;
|
||||
|
||||
Reference in New Issue
Block a user