mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 09:32:02 +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,47 +1,25 @@
|
||||
private ["_started","_finished","_animState","_isMedic","_id","_unit","_item"];
|
||||
private ["_finished","_id","_unit","_item"];
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
_item = (_this select 3) select 1;
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
player removeMagazine _item;
|
||||
closedialog 0;
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
[player,"bandage",0,false] call dayz_zombieSpeak;
|
||||
|
||||
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;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
uiSleep 3;
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
uiSleep 0.1;
|
||||
if (vehicle player != player) then {
|
||||
uiSleep 3;
|
||||
_finished = true;
|
||||
} else {
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
if ((_unit == player) or (vehicle player != player)) then {
|
||||
@@ -58,8 +36,7 @@ if (_finished) then {
|
||||
[20,0] call player_humanityChange;
|
||||
};
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
player addMagazine _item;
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
@@ -1,46 +1,24 @@
|
||||
private ["_started","_finished","_animState","_isMedic","_id","_unit","_item","_humanityGain"];
|
||||
private ["_finished","_id","_unit","_item","_humanityGain"];
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
_item = (_this select 3) select 1;
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
player removeMagazine _item;
|
||||
|
||||
_unit setVariable ["hit_legs",0];
|
||||
_unit setVariable ["hit_hands",0];
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
} else {
|
||||
uiSleep 3;
|
||||
_finished = true;
|
||||
};
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
uiSleep 3;
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
uiSleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
_unit setVariable ["hit_legs",0];
|
||||
_unit setVariable ["hit_hands",0];
|
||||
|
||||
if (_unit == player) then {
|
||||
//give to player, Ie the player fixed himself
|
||||
|
||||
@@ -65,7 +43,6 @@ if (_finished) then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
} else {
|
||||
player addMagazine _item;
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
@@ -1,17 +1,18 @@
|
||||
// bleed.sqf
|
||||
private ["_finished","_isDead","_unit"];
|
||||
|
||||
_unit = (_this select 3) select 0;
|
||||
_isDead = _unit getVariable["USEC_isDead",false];
|
||||
call fnc_usec_medic_removeActions;
|
||||
player removeMagazine "ItemEpinephrine";
|
||||
|
||||
player playActionNow "Medic";
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
uiSleep 3;
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
|
||||
if (!_isDead) then {
|
||||
if (!_isDead && _finished && ("ItemEpinephrine" in magazines player)) then {
|
||||
player removeMagazine "ItemEpinephrine";
|
||||
_unit setVariable ["NORRN_unconscious", false, true];
|
||||
_unit setVariable ["USEC_isCardiac",false,true];
|
||||
uiSleep 5;
|
||||
|
||||
//give humanity
|
||||
[25,0] call player_humanityChange;
|
||||
@@ -20,4 +21,5 @@ if (!_isDead) then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
};
|
||||
|
||||
r_action = false;
|
||||
r_action = false;
|
||||
dayz_actionInProgress = false;
|
||||
@@ -1,47 +1,26 @@
|
||||
private ["_started","_finished","_animState","_isMedic","_id","_unit"];
|
||||
private ["_finished","_id","_unit"];
|
||||
_unit = (_this select 3) select 0;
|
||||
|
||||
player removeMagazine "ItemMorphine";
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
_unit setVariable ["hit_legs",0];
|
||||
_unit setVariable ["hit_hands",0];
|
||||
player removeMagazine "ItemMorphine";
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
} else {
|
||||
uiSleep 3;
|
||||
_finished = true;
|
||||
};
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
uiSleep 3;
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
uiSleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
if ((_unit == player) or (vehicle player != player)) then {
|
||||
_unit setVariable ["hit_legs",0];
|
||||
_unit setVariable ["hit_hands",0];
|
||||
|
||||
if ((_unit == player) or (vehicle player != player)) then {
|
||||
//Self Healing
|
||||
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
|
||||
} else {
|
||||
@@ -55,7 +34,6 @@ if ((_unit == player) or (vehicle player != player)) then {
|
||||
publicVariableServer "PVDZ_send";
|
||||
} else {
|
||||
player addMagazine "ItemMorphine";
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
@@ -1,42 +1,22 @@
|
||||
private ["_started","_finished","_animState","_isMedic","_id","_unit"];
|
||||
private ["_finished","_unit"];
|
||||
_unit = (_this select 3) select 0;
|
||||
|
||||
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
player removeMagazine "ItemAntibacterialWipe";
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
//not in a vehicle
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
[player,"bandage",0,false] call dayz_zombieSpeak;
|
||||
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;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
uiSleep 3;
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
uiSleep 0.1;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
_finished = ["Medic",1] call fn_loopAction;
|
||||
} else {
|
||||
uiSleep 3;
|
||||
_finished = true;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
//["PVCDZ_hlt_Bandage",[_unit,player]] call broadcastRpcCallAll;
|
||||
@@ -52,8 +32,7 @@ if (_finished) then {
|
||||
player setVariable ["sepsisStarted", nil];
|
||||
};
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
player addMagazine "ItemAntibacterialWipe";
|
||||
};
|
||||
};
|
||||
|
||||
dayz_actionInProgress = false;
|
||||
Reference in New Issue
Block a user