Add better animation switch after EVR strom hit a player

This commit is contained in:
A Man
2022-05-02 09:46:10 +02:00
parent 143db3e1ef
commit 08558080c8

View File

@@ -422,9 +422,7 @@ fnc_evr = {
if (player hasWeapon _tool) then {
if (random 1 <= DZE_EVRDamageItemsChance) then {
player removeWeapon _tool;
if !(player hasWeapon (_x select 1)) then { // prevent duplicates
player addWeapon (_x select 1);
};
(_x select 1) call player_addDuplicateTool;
_items set [count _items, (getText(configFile >> "CfgWeapons" >> _tool >> "displayName"))];
};
};
@@ -441,8 +439,16 @@ fnc_evr = {
if (!_hasAPSI) then {
if (player == vehicle player) then {
uiSleep 10; // 10 second knockout.
player switchMove "";
[objNull, player, rSwitchMove, ""] call RE;
[nil, player, rSWITCHMOVE, "AmovPpneMstpSnonWnonDnon_healed"] call RE;
player SWITCHMOVE "AmovPpneMstpSnonWnonDnon_healed";
PVDZ_plr_SwitchMove = [player,"AmovPpneMstpSnonWnonDnon_healed"];
publicVariableServer "PVDZ_plr_SwitchMove"; //Needed to execute switchMove on server machine. rSwitchMove only executes on other clients
player playMoveNow "AmovPpneMstpSnonWnonDnon_healed";
if ({getNumber (configFile >> "CfgWeapons" >> _x >> "type") in [1,2]} count (weapons player) > 0) then {
//Prevent firing while weapon is still shown on back or holstered. AmovPpneMstpSnonWnonDnon_healed has disableWeapons=0 in config (should be 1)
waitUntil {uiSleep 1; !(animationState player in ["ainjppnemstpsnonwnondnon_rolltofront","amovppnemstpsnonwnondnon_healed","amovppnemstpsnonwnondnon"])};
};
};
} else {
cutRsc ["RscAPSI_End","PLAIN"];