Add medic anim function with proper interrupt

Closes #1386

Vanilla commits
applied:
f99a3deced
731b957e8e

Removed
two unused files and a few variables made redundant by actionInProgress
This commit is contained in:
ebayShopper
2017-06-06 15:24:59 -04:00
parent 36b67affee
commit 48858b2e6c
61 changed files with 507 additions and 1341 deletions

View File

@@ -1,6 +1,5 @@
private ["_item","_type","_hasHarvested","_knifeArray","_PlayerNear","_isListed","_activeKnife","_text","_dis","_sfx","_qty","_string","_isZombie","_humanity"];
private ["_item","_type","_hasHarvested","_knifeArray","_PlayerNear","_isListed","_activeKnife","_text","_dis","_sfx","_qty","_string","_isZombie","_humanity","_finished"];
_isZombie = _this isKindOf "zZombie_base";
if (dayz_actionInProgress) exitWith {
localize "str_player_actionslimit" call dayz_rollingMessages;
};
@@ -8,6 +7,7 @@ dayz_actionInProgress = true;
_item = _this;
_type = typeOf _item;
_isZombie = _type isKindOf "zZombie_base";
_hasHarvested = _item getVariable["meatHarvested",false];
_knifeArray = [];
@@ -39,11 +39,13 @@ if ((count _knifeArray > 0) and !_hasHarvested) then {
_isListed = isClass (configFile >> "CfgSurvival" >> "Meat" >> _type);
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
player playActionNow "Medic";
_dis=10;
_sfx = "gut";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
@@ -64,7 +66,6 @@ if ((count _knifeArray > 0) and !_hasHarvested) then {
["knives",0.2] call fn_dynamicTool;
uiSleep 6;
if (_isZombie) then {
// Reduce humanity for gutting zeds
_humanity = player getVariable ["humanity",0];