From 6f072982c3adb3655c214bae1a2f0b01e3e24e4a Mon Sep 17 00:00:00 2001 From: oiad Date: Wed, 4 Jan 2017 10:39:05 +1300 Subject: [PATCH] Add harder penalties for wrong combination on doors, More spelling mistakes. (#1847) * More spelling mistakes Further to commit: https://github.com/oiad/DayZ-Epoch/commit/0e938ba8f36b2631b98da1bdbfd3d6d578432110 * Add harder penalties for wrong combination on doors This adds a variable (DZE_doorManagementHarderPenalty) to make attempts at code breaking doors harder. This will exponentially increment the time between attempts or if you set it to false will make it 5 seconds between attempts. Unlike the original (that was useless TBH) this will actually lock out the combo lock UI until the timer is set. Will reset completely after 120 seconds. * Add German translations * Resolve merge conflict * Resolve merge conflict --- .../doorManagement/player_enterCode.sqf | 9 ++- SQF/dayz_code/actions/player_destroyTent.sqf | 10 +-- SQF/dayz_code/compile/player_unlockDoor.sqf | 64 ++++++++----------- SQF/dayz_code/configVariables.sqf | 1 + SQF/dayz_code/init/variables.sqf | 1 + SQF/dayz_code/stringtable.xml | 10 ++- 6 files changed, 45 insertions(+), 50 deletions(-) diff --git a/SQF/dayz_code/actions/doorManagement/player_enterCode.sqf b/SQF/dayz_code/actions/doorManagement/player_enterCode.sqf index ad9deb8f8..194c3fc85 100644 --- a/SQF/dayz_code/actions/doorManagement/player_enterCode.sqf +++ b/SQF/dayz_code/actions/doorManagement/player_enterCode.sqf @@ -1,14 +1,17 @@ private "_display"; -// Close DoorAccess _display = findDisplay 61144; _display closeDisplay 2; + +if (dayz_lastCodeFail > diag_tickTime) exitWith { + format [localize "STR_EPOCH_PLAYER_19_WAIT",round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages; +}; + if (DZE_doorManagementAllowManualCode) then { - //DZE_Lock_Door != (this getvariable['CharacterID','0']); DZE_topCombo = 0; DZE_midCombo = 0; DZE_botCombo = 0; createDialog "ComboLockUI"; } else { localize "STR_EPOCH_DOORACCESS_NOMANUAL" call dayz_rollingMessages; -}; +}; \ No newline at end of file diff --git a/SQF/dayz_code/actions/player_destroyTent.sqf b/SQF/dayz_code/actions/player_destroyTent.sqf index 10310c983..f1e0b6d07 100644 --- a/SQF/dayz_code/actions/player_destroyTent.sqf +++ b/SQF/dayz_code/actions/player_destroyTent.sqf @@ -34,12 +34,12 @@ player playActionNow "Medic"; player removeAction s_player_destroytent; s_player_destroytent = -1; -//Make sure you can only destory once -_alreadyDestorying = _obj getVariable["alreadyDestorying",0]; +//Make sure you can only destroy once +_alreadyDestroying = _obj getVariable["alreadyDestroying",0]; -if (_alreadyDestorying == 1) exitWith {localize "str_TentAlreadyLit" call dayz_rollingMessages;}; +if (_alreadyDestroying == 1) exitWith {localize "str_TentAlreadyLit" call dayz_rollingMessages;}; -_obj setVariable["alreadyDestorying",1]; +_obj setVariable["alreadyDestroying",1]; //Jerry can system ** Needs redoing //Select random can from array @@ -86,4 +86,4 @@ publicVariable "PVDZ_obj_Fire"; _obj inflame true; //_obj spawn player_fireMonitor; -localize "str_success_tent_destoryed" call dayz_rollingMessages; \ No newline at end of file +localize "str_success_tent_destroyed" call dayz_rollingMessages; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_unlockDoor.sqf b/SQF/dayz_code/compile/player_unlockDoor.sqf index 42b79a39a..9ba42e1e4 100644 --- a/SQF/dayz_code/compile/player_unlockDoor.sqf +++ b/SQF/dayz_code/compile/player_unlockDoor.sqf @@ -4,40 +4,29 @@ Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. Modified for Zupa's DoorManagement. */ -private ["_display","_obj","_objectCharacterID","_hasAccess"]; +private ["_display","_displayCombo","_displayEye","_doorMethod","_hasAccess","_notNearestPlayer","_obj","_objectCharacterID"]; if (!isNil "DZE_DYN_UnlockDoorInprogress") exitWith {localize "str_epoch_player_21" call dayz_rollingMessages;}; DZE_DYN_UnlockDoorInprogress = true; -// find display and check the door opening method -_doorMethod = ''; +_doorMethod = ""; _displayCombo = findDisplay 41144; _displayEye = findDisplay 61144; if(!isNull _displayEye) then {_display = _displayEye; _doorMethod = "Eye";}; if(!isNull _displayCombo) then {_display = _displayCombo; _doorMethod = "Combo";}; if (!isNull dayz_selectedDoor) then { - if (!isNil 'KeyCodeTryTimer') then { - if (diag_tickTime > KeyCodeTryTimer) then { - KeyCodeTry = nil; - KeyCodeTryTimer = nil; - }; - }; - - _obj = dayz_selectedDoor; // our target + _obj = dayz_selectedDoor; _notNearestPlayer = _obj call dze_isnearest_player; - + if (_notNearestPlayer) then { - // close display since another player is closer _display closeDisplay 2; localize "STR_EPOCH_ACTIONS_16" call dayz_rollingMessages; } else { - // get object combination _objectCharacterID = _obj getVariable ["CharacterID","0"]; - - if(DZE_doorManagement) then { - // Check player access + + if (DZE_doorManagement) then { _hasAccess = [player, _obj] call FNC_check_access; if ( (_hasAccess select 0) or // door owner @@ -50,53 +39,50 @@ if (!isNull dayz_selectedDoor) then { DZE_Lock_Door = dayz_selectedDoor getVariable['CharacterID','0']; }; }; - - - - // Check combination + + if (isNil "dayz_UnlockTime") then {dayz_UnlockTime = 5;}; + if (DZE_doorManagementHarderPenalty && {(diag_tickTime - dayz_lastCodeFail) > 120}) then {dayz_UnlockTime = 5;}; + if (DZE_Lock_Door == _objectCharacterID) then { [player,"combo_unlock",0,false] call dayz_zombieSpeak; - // close display _display closeDisplay 2; - // unlock if locked if (_obj animationPhase "Open_hinge" == 0) then { _obj animate ["Open_hinge", 1]; }; if (_obj animationPhase "Open_latch" == 0) then { _obj animate ["Open_latch", 1]; }; - - if(_doorMethod == "Eye") then { + + if (_doorMethod == "Eye") then { localize "STR_EPOCH_DOORACCESS_SUCCESS" call dayz_rollingMessages; }; - - KeyCodeTry = nil; + dayz_UnlockTime = 5; + dayz_lastCodeFail = 0; } else { ["Working",0,[100,15,10,0]] call dayz_NutritionSystem; DZE_Lock_Door = ""; [player,"combo_locked",0,false] call dayz_zombieSpeak; [player,20,true,(getPosATL player)] spawn player_alertZombies; - if (isNil 'KeyCodeTry') then {KeyCodeTry = 0;}; - KeyCodeTry = KeyCodeTry + 1; - - if (!isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;}; - if (KeyCodeTry >= ((round(random 4)) + 4)) then { - if (isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;}; - localize "str_epoch_player_19" call dayz_rollingMessages; - _display closeDisplay 2; - }; - - if(_doorMethod == "Eye") then { + if (_doorMethod == "Eye") then { localize "STR_EPOCH_DOORACCESS_FAILURE" call dayz_rollingMessages; _display closeDisplay 2; + } else { + if (DZE_doorManagementHarderPenalty) then { + dayz_lastCodeFail = (diag_tickTime + dayz_UnlockTime); + dayz_UnlockTime = dayz_UnlockTime * 2; + } else { + dayz_lastCodeFail = (diag_tickTime + dayz_UnlockTime); + }; + + format [localize "str_epoch_player_19",round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages; + _display closeDisplay 2; }; }; }; } else { - // close display since no target _display closeDisplay 2; }; DZE_DYN_UnlockDoorInprogress = nil; \ No newline at end of file diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index b153129a7..9f4803d26 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -95,6 +95,7 @@ DZE_doorManagementMustBeClose = false; //Players must be within 10m of door to b DZE_doorManagementAdmins = []; //Array of admin PlayerUIDs. UIDs in this list are able to access every door's management menu and open it. DZE_doorManagementAllowManualCode = true; //Allow unlocking doors by manually entering the combination. Setting false requires the use of eye scan for all doors. DZE_doorManagementMaxFriends = 10; //Max friends allowed on a door. There is no character limit in the inventory field of the database, but lower values limit the max global setVariable size to improve performance. +DZE_doorManagementHarderPenalty = true; //Enforce an exponential wait on attempts between unlocking a door from a failed code. // Group System dayz_groupSystem = true; // Enable group system diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 39bbef9b5..ed20f767d 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -716,4 +716,5 @@ if (!isDedicated) then { DZE_myVehicle = objNull; dayz_groupNameTags = true; dayz_minusDownTime = 0; + dayz_lastCodeFail = 0; }; diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index cdefc01d2..daf2d5a7b 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -6598,7 +6598,7 @@ Vous ne pouvez pas replier cette tente, elle ne vous appartient pas. Tento stan nemůžete zabalit, jelikož není váš. - + You have successfully destroyed a tent. Du hast das Zelt erfolgreich zerstört. Вы успешно уничтожили палатку. @@ -11279,13 +11279,17 @@ Musíte mít syrové maso - Wrong code entered too many times, wait 10 seconds - Es wurde zu oft der falsche Code eingetippt. Du musst nun 10 Sekunden warten + You entered the wrong code, wait %1 seconds. + Du hast einen falschen Code eingegeben, warte %1 Sekunden. Неправильный код введён слишком много раз, подождите 10 секунд Je hebt te vaak een foute code ingevoerd. 10 seconden geduld svp. Trop d'erreurs avec le code, patientez 10 secondes Mnohokrát jsi zadal špatný kód, musíš počkat 10 vteřin + + You must wait another %1 seconds before you can enter another code. + Du musst weitere %1 Sekunden warten, bevor du einen anderen Code eingeben kannst. + Cannot unlock while another player is nearby. Aufschließen nicht möglich, während ein anderer Spieler in der Nähe ist.