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

@@ -3,7 +3,7 @@
Usage: spawn player_harvestPlant;
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_isOk","_i","_objName","_started","_finished","_animState","_isMedic","_proceed","_itemOut","_countOut","_plant","_findNearestPlant","_index","_invResult","_text","_playerNear"];
private ["_isOk","_i","_objName","_finished","_proceed","_itemOut","_countOut","_plant","_findNearestPlant","_index","_invResult","_text","_playerNear"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_72" call dayz_rollingMessages;};
dayz_actionInProgress = true;
@@ -31,34 +31,11 @@ if (count _findNearestPlant >= 1) then {
_isOk = true;
_proceed = false;
while {_isOk} do {
player playActionNow "Medic";
[player,20,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
[player,"chopwood",0,false] call dayz_zombieSpeak;
};
if (r_interrupt) then {
r_doLoop = false;
};
[player,"chopwood",0,false] call dayz_zombieSpeak;
uiSleep 0.1;
_finished = ["Medic",1] call fn_loopAction;
};
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
@@ -103,11 +80,6 @@ if (count _findNearestPlant >= 1) then {
format[localize "str_epoch_player_143",_i,_text] call dayz_rollingMessages;
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "str_epoch_player_73" call dayz_rollingMessages;
};
} else {