mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-24 17:10:49 +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,9 +1,12 @@
|
||||
private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_dis","_fire","_tool","_itemPile","_posASL","_testSea"];
|
||||
private ["_item","_config","_exit","_text","_booleans","_worldspace","_dir","_location","_fire","_tool","_itemPile","_posASL","_testSea","_finished"];
|
||||
|
||||
_tool = _this;
|
||||
call gear_ui_init;
|
||||
closeDialog 0;
|
||||
|
||||
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
_item = "ItemLog";
|
||||
_itemPile = "PartWoodPile";
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
@@ -14,19 +17,25 @@ if (_tool == "PartWoodPile") then {
|
||||
_exit = true;
|
||||
{if (_x in DayZ_Ignitors) exitWith {_exit = false};} forEach (items player);
|
||||
};
|
||||
if (_exit) exitWith {(localize "str_fireplace_noMatches") call dayz_rollingMessages;};
|
||||
if (_exit) exitWith {
|
||||
localize "str_fireplace_noMatches" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
// item is missing or tools are missing
|
||||
if (!(_item in magazines player) && !(_itemPile in magazines player)) exitWith {
|
||||
//localize "str_player_22" call dayz_rollingMessages;
|
||||
(localize "str_player_22") call dayz_rollingMessages;
|
||||
localize "str_player_22" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
_booleans = []; //testonLadder, testSea, testPond, testBuilding, testSlope, testDistance
|
||||
_worldspace = ["Land_Fire_DZ", player, _booleans] call fn_niceSpot;
|
||||
|
||||
// player on ladder or in a vehicle
|
||||
if (_booleans select 0) exitWith { localize "str_player_21" call dayz_rollingMessages; };
|
||||
if (_booleans select 0) exitWith {
|
||||
localize "str_player_21" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
_testSea = true;
|
||||
_posASL = getPosASL player;
|
||||
@@ -37,9 +46,17 @@ if ((_booleans select 1) && _posASL select 2 > 2) then {
|
||||
};
|
||||
|
||||
// object would be in the water (pool or sea)
|
||||
if ((_booleans select 1 && _testSea) OR (_booleans select 2)) exitWith { localize "str_player_26" call dayz_rollingMessages; };
|
||||
if ((_booleans select 1 && _testSea) OR (_booleans select 2)) exitWith {
|
||||
localize "str_player_26" call dayz_rollingMessages;
|
||||
dayz_actionInProgress = false;
|
||||
};
|
||||
|
||||
if ((count _worldspace) == 2) then {
|
||||
[player,20,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
if (!_finished or (!(_item in magazines player) && !(_itemPile in magazines player))) exitWith {};
|
||||
|
||||
if (_item in magazines player) then {
|
||||
player removeMagazine _item;
|
||||
} else {
|
||||
@@ -48,19 +65,12 @@ if ((count _worldspace) == 2) then {
|
||||
_dir = _worldspace select 0;
|
||||
_location = _worldspace select 1;
|
||||
|
||||
player playActionNow "Medic";
|
||||
uiSleep 1;
|
||||
// fireplace location may not be in front of player (but in 99% time it should)
|
||||
player setDir _dir;
|
||||
player setPosATL (getPosATL player);
|
||||
|
||||
_dis=20;
|
||||
[player,_dis,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
// Added Nutrition-Factor for work
|
||||
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
|
||||
|
||||
uiSleep 5;
|
||||
|
||||
_fire = createVehicle ["Land_Fire_DZ", [0,0,0], [], 0, "CAN_COLLIDE"];
|
||||
_fire setDir _dir;
|
||||
@@ -82,4 +92,6 @@ if ((count _worldspace) == 2) then {
|
||||
localize "str_fireplace_01" call dayz_rollingMessages;
|
||||
} else {
|
||||
localize "str_fireplace_02" call dayz_rollingMessages;
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
Reference in New Issue
Block a user