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,5 +1,5 @@
private ["_brokein","_isOk","_hasSledgeHammer","_gps","_vars","_hasToolbox","_hasCrowbar","_limit","_proceed","_counter",
"_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate","_values"];
"_dis","_sfx","_roll","_finished","_isGate","_values"];
_target = _this select 3;
_pos = getPos _target;
@@ -51,40 +51,14 @@ while {_isOk} do {
uiSleep 1;
};
//Run animation
player playActionNow "Medic";
//Run SFX
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
//Setup Vars
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
//run animation loop
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
_finished = false;
};
uiSleep 0.1;
};
r_doLoop = false;
//Run animation loop
_finished = ["Medic",1] call fn_loopAction;
//Interrupt and end
if(!_finished) exitWith {
@@ -139,12 +113,6 @@ if (isnil "_proceed") exitwith {};
//Interrupted for some reason
if (!_proceed) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
localize "STR_BLD_BREAKIN_CANCELLED" call dayz_rollingMessages;
};