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

@@ -11,8 +11,8 @@ dayz_actionInProgress = true;
private ["_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks","_object",
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_playerNear"];
"_sfx","_ownerID","_objectID","_objectUID","_dir","_weapons","_magazines","_backpacks","_object",
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector","_playerNear","_finished"];
_cursorTarget = _this select 3;
@@ -98,24 +98,17 @@ if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_l
//Does object have a upgrade option.
if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
//play animation
player playActionNow "Medic";
_dis = 20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
//Double check player did not drop required parts
if (!_finished or (isNull _cursorTarget) or ({!(_x in magazines player)} count _upgradeParts > 0)) exitWith {};
// Added Nutrition-Factor for work
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
//Upgrade
_alreadyupgrading = _cursorTarget getVariable["alreadyupgrading",0];
if (_alreadyupgrading == 1) exitWith { localize "str_upgradeInProgress" call dayz_rollingMessages; };
_cursorTarget setVariable["alreadyupgrading",1,true];
uiSleep 0.03;
//Get location and direction of old item
_dir = round getDir _cursorTarget;
@@ -134,9 +127,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_magazines = getMagazineCargo _cursorTarget;
_backpacks = getBackpackCargo _cursorTarget;
//replay animation
player playActionNow "Medic";
//remove old tent
PVDZ_obj_Destroy = [_objectID,_objectUID,player];
publicVariableServer "PVDZ_obj_Destroy";
@@ -190,8 +180,6 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_countr = _countr + 1;
} count _objWpnTypes;
uiSleep 3;
//publish new tent
if (DZE_permanentPlot) then {
_object setVariable ["ownerPUID",dayz_playerUID,true];