Group sounds and zombie calls

dayz_zombieSpeak and player_alertZombies are called often together or should be. fnc_alertZombies groups them together and uses the given parameters. This streamlines and corrects the missing or incorrect calls from dayz_zombieSpeak or player_alertZombies.
This commit is contained in:
AirwavesMan
2020-09-12 01:30:45 +02:00
parent a456c948f5
commit 9ad86a84a3
35 changed files with 193 additions and 205 deletions

View File

@@ -1,4 +1,4 @@
private ["_mineChance","_item","_dis","_sfx","_breaking","_counter","_rocks","_findNearestRock","_objName","_countOut","_isOk","_proceed","_finished","_itemOut","_weapons"];
private ["_mineChance","_breaking","_counter","_rocks","_findNearestRock","_objName","_countOut","_isOk","_proceed","_finished","_itemOut","_weapons"];
_item = _this;
call gear_ui_init;
@@ -25,20 +25,17 @@ if (!isNull _findNearestRock) then {
_counter = 0;
_isOk = true;
_proceed = false;
//check chance before loop, for a maximum amount of 5 loops allowing 5 possiable chances
_mineChance = dayz_HarvestingChance call fn_chance;
while {_isOk} do {
_dis=20;
_sfx = "minestone";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
[player,(getPosATL player),20,"minestone"] spawn fnc_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
_weapons = weapons player;
_weapons set [count _weapons,dayz_onBack];
//Make sure player did not drop pickaxe
if (!_finished or !("MeleePickaxe" in _weapons or ("ItemPickaxe" in _weapons))) exitWith {
_isOk = false;
@@ -47,7 +44,7 @@ if (!isNull _findNearestRock) then {
if (_finished) then {
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
_breaking = false;
if (dayz_toolBreaking && _mineChance) then {
_breaking = true;
@@ -67,14 +64,14 @@ if (!isNull _findNearestRock) then {
player addWeapon "ItemPickaxeBroken";
};
};
_counter = _counter + 1;
_itemOut = "ItemStone";
//Drop Item to ground
[_itemOut,1,1] call fn_dropItem;
};
if ((_counter >= _countOut) || _breaking) exitWith {
if (_breaking) then {
localize "str_PickAxeHandleBreaks" call dayz_rollingMessages;
@@ -87,11 +84,11 @@ if (!isNull _findNearestRock) then {
format[localize "str_mining_progress", _counter,(_countOut - _counter)] call dayz_rollingMessages;
};
if (!_proceed) then {
if (!_proceed) then {
localize "str_mining_canceled" call dayz_rollingMessages;
};
} else {
localize "str_mining_no_rocks" call dayz_rollingMessages;
};
dayz_actionInProgress = false;
dayz_actionInProgress = false;