Add penalties for wrong safe/lockbox code

As per
6f072982c3 (diff-2b5340930b14ce1ae29d38ebc575c75a)
This commit is contained in:
oiad
2018-05-26 21:42:50 +12:00
parent efc57840d2
commit c3cbca144e
6 changed files with 39 additions and 21 deletions

View File

@@ -1,3 +1,5 @@
[NEW] Time between unlocking safes/lockboxes after a failed code will be exponentially higher, see configVariables.sqf\DZE_lockablesHarderPenalty @oiad
[FIXED] Some more occurrences of zero_building interiors misaligned or at the wrong terrain height (eaaedf2, 048caa5)
[FIXED] Player could switch into gunner's seat of ArmoredSUV while the hatch was being closed (e89eebc) #2009 @TheFirstNoob
[FIXED] POI fires were still spawning when POI was off and town generator was on (2855997)

View File

@@ -5,13 +5,17 @@ dayz_actionInProgress = true;
dayz_selectedVault = _this select 3;
dayz_combination = "";
if(!isNull dayz_selectedVault) then {
if (dayz_lastCodeFail > diag_tickTime) exitWith {
dayz_actionInProgress = false;
format [localize "STR_EPOCH_PLAYER_19_WAIT",round(dayz_lastCodeFail - diag_tickTime)] call dayz_rollingMessages;
};
if (!isNull dayz_selectedVault) then {
if ((typeOf dayz_selectedVault) == "VaultStorageLocked" || (typeOf dayz_selectedVault) == "VaultStorage") then {
_ok = createdialog "SafeKeyPad";
_ok = createDialog "SafeKeyPad";
} else {
_ok = createdialog "KeypadUI";
_ok = createDialog "KeypadUI";
};
};

View File

@@ -6,15 +6,14 @@
*/
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;
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_21" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_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 _displayEye) then {_display = _displayEye; _doorMethod = "Eye";};
if (!isNull _displayCombo) then {_display = _displayCombo; _doorMethod = "Combo";};
if (!isNull dayz_selectedDoor) then {
_obj = dayz_selectedDoor;
@@ -41,7 +40,8 @@ if (!isNull dayz_selectedDoor) then {
};
if (isNil "dayz_UnlockTime") then {dayz_UnlockTime = 5;};
if (DZE_doorManagementHarderPenalty && {(diag_tickTime - dayz_lastCodeFail) > 120}) then {dayz_UnlockTime = 5;};
if (DZE_doorManagementHarderPenalty && {((diag_tickTime - dayz_lastCodeFail) + dayz_unlockTime / 2) > 120}) then {dayz_UnlockTime = 5;};
if (DZE_Lock_Door == _objectCharacterID) then {
[player,"combo_unlock",0,false] call dayz_zombieSpeak;
@@ -60,13 +60,13 @@ if (!isNull dayz_selectedDoor) then {
};
dayz_UnlockTime = 5;
dayz_lastCodeFail = 0;
PVDZE_handleSafeGear = [player,_obj,5,if (_doorMethod == "EYE") then {"EYESCAN"} else {DZE_Lock_Door}];
publicVariableServer "PVDZE_handleSafeGear";
} else {
PVDZE_handleSafeGear = [player,_obj,6,if (_doorMethod == "EYE") then {"EYESCAN"} else {DZE_Lock_Door}];
publicVariableServer "PVDZE_handleSafeGear";
DZE_Lock_Door = "";
[player,"combo_locked",0,false] call dayz_zombieSpeak;
[player,20,true,(getPosATL player)] spawn player_alertZombies;
@@ -90,4 +90,4 @@ if (!isNull dayz_selectedDoor) then {
} else {
_display closeDisplay 2;
};
DZE_DYN_UnlockDoorInprogress = nil;
dayz_actionInProgress = false;

View File

@@ -24,7 +24,6 @@ if !(_objType in DZE_LockedStorage) exitWith {
_playerNear = _obj call dze_isnearest_player;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_20" call dayz_rollingMessages;};
// Silently exit if object no longer exists
if (isNull _obj || !(alive _obj)) exitWith { dayz_actionInProgress = false; };
_unlockedClass = getText (configFile >> "CfgVehicles" >> _objType >> "unlockedClass");
@@ -34,25 +33,37 @@ _ownerID = _obj getVariable["CharacterID","0"];
_ComboMatch = (_ownerID == dayz_combination);
if (DZE_permanentPlot) then {_ownerID = _obj getVariable["ownerPUID","0"];};
if (isNil "dayz_UnlockTime") then {dayz_UnlockTime = 5;};
if (DZE_lockablesHarderPenalty && {((diag_tickTime - dayz_lastCodeFail) + dayz_unlockTime / 2) > 120}) then {dayz_UnlockTime = 5;};
if (_ComboMatch || (_ownerID == dayz_playerUID)) then {
(findDisplay 106) closeDisplay 0; // Close gear
(findDisplay 106) closeDisplay 0;
dze_waiting = nil;
dayz_UnlockTime = 5;
dayz_lastCodeFail = 0;
[_unlockedClass,objNull] call fn_waitForObject;
PVDZE_handleSafeGear = [player,_obj,0];
publicVariableServer "PVDZE_handleSafeGear";
//wait for response from server to verify safe was logged before proceeding
waitUntil {!isNil "dze_waiting"};
format[localize "STR_BLD_UNLOCKED",_text] call dayz_rollingMessages;
} else {
PVDZE_handleSafeGear = [player,_obj,3,dayz_combination];
publicVariableServer "PVDZE_handleSafeGear";
[player,"repair",0,false] call dayz_zombieSpeak;
[player,25,true,(getPosATL player)] spawn player_alertZombies;
format[localize "STR_BLD_WRONG_COMBO",_text] call dayz_rollingMessages;
if (DZE_lockablesHarderPenalty) 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;
};
s_player_unlockvault = -1;
dayz_actionInProgress = false;

View File

@@ -33,6 +33,7 @@ DZE_salvageLocked = true; //Enable or disable salvaging of locked vehicles, usef
DZE_DisabledChannels = [(localize "str_channel_side"),(localize "str_channel_global"),(localize "str_channel_command")]; //List of disabled voice channels. Other channels are: "str_channel_group","str_channel_direct","str_channel_vehicle"
DZE_NutritionDivisor = [1, 1, 1, 1]; //array of DIVISORS that regulate the rate of [calories, thirst, hunger, temperature] use when "working" (keep in mind that temperature raises with actions) - min values 0.1 - Larger values slow the effect, smaller values accelerate it
DZE_ZombieSpeed = [0,0]; //Default agro speed is 6 per zombie config, set array elements 0 and 1 the same for non-variable speed, set to 0 to disable. array format = [min, max]; Ex: [2, 6]; results in a range of speed between 2 and 6 (2 is the old DZE_slowZombies hard-coded speed)
DZE_lockablesHarderPenalty = true; // Enforce an exponential wait on attempts between unlocking a safe/lockbox from a failed code.
// SafeZone
DZE_SafeZoneZombieLoot = false; // Enable spawning of Zombies and loot in positions listed in DZE_SafeZonePosArray?

View File

@@ -16,7 +16,7 @@
5 closeDisplay !"'closeDisplay'" !"closeDisplay 0" !"closeDisplay 2" !"if (!isNil \"closeDisplay\") then {"
1 compile !"ca\\communityconfiguration" !"ca\\Data\\" !"ca\\missions" !"ca\\modules" !"ca\\ui\\" !"ca\\Warfare2\\" !"scriptName \"Functions\\systems\\fn_inv" !"scriptName \"MP\\data\\script" !"code = compile preprocessFileLineNumbers (BIS_PathMPscriptCommands" !"t = missionConfigFile >> \"onMinimapScript" !="_this call (call compile GetText (configFile >> \"CfgAmmo\" >> _amm >> \"muzzleEffect\"));" !"z\\addons\\dayz_code\\" !"_menu ctrlSetEventHandler [\"ButtonClick\",_compile];\n};\n_pos set [3" !"{ _x set [1, compile (_x select 1)]; }" !"silver_1oz_b);\n\n{ \nif (!isNil {call compile" !"Var = compile format[\"epoch_death_board_record_"
5 createAgent !="_agent = createAgent [_type, _position, [], _radius, \"CAN_COLLIDE\"];" !="_agent = if (_type == \"Pastor\") then {createAgent [_type, _Pos, [], 0, \"NONE\"]} else {createAgent [_type, _Pos, [], 0, \"FORM\"]};" !="_dog = createAgent [_type, _Pos, [], 0, \"NONE\"];"
5 createDialog !="_region = createDialog \"RscDisplaySpawnSelecter\";" !="_gender = createDialog 'RscDisplayGenderSelect';" !="_dialog = createDialog \"bloodTest\";" !="createDialog 'RscDisplayCraftingMenu';" !="createDialog \"DAYZ_PADLOCK\";" !"createDialog 'horde_journal_" !"Z_ResetContainer = true;\ncreateDialog \"AdvancedTrading\";" !"createDialog \"DoorManagement\";\ncall DoorNearbyHumans;" !="createDialog \"ComboLockUI\";" !"createdialog \"PlotManagement\";\ncall PlotNearbyHumans;" !"_trader_data = (_this select 3);\n\n_dialog = createdialog \"TraderDialog\";" !"_ok = createdialog \"KeypadUI\";" !"EpochDeathBoardLoad = {\ncreatedialog \"EpochDeathBoardDialog\";" !="if(DZE_doorManagement) then {createdialog \"DoorAccess\";} else {createdialog \"ComboLockUI\";};" !"\ndisableSerialization;\ncreateDialog \"DZ_GroupDialog\";"
5 createDialog !="_region = createDialog \"RscDisplaySpawnSelecter\";" !="_gender = createDialog 'RscDisplayGenderSelect';" !="_dialog = createDialog \"bloodTest\";" !="createDialog 'RscDisplayCraftingMenu';" !="createDialog \"DAYZ_PADLOCK\";" !"createDialog 'horde_journal_" !"Z_ResetContainer = true;\ncreateDialog \"AdvancedTrading\";" !"createDialog \"DoorManagement\";\ncall DoorNearbyHumans;" !="createDialog \"ComboLockUI\";" !"createdialog \"PlotManagement\";\ncall PlotNearbyHumans;" !"_trader_data = (_this select 3);\n\n_dialog = createdialog \"TraderDialog\";" !"_ok = createDialog \"KeypadUI\";" !"EpochDeathBoardLoad = {\ncreatedialog \"EpochDeathBoardDialog\";" !="if(DZE_doorManagement) then {createdialog \"DoorAccess\";} else {createdialog \"ComboLockUI\";};" !"\ndisableSerialization;\ncreateDialog \"DZ_GroupDialog\";"
5 createDisplay
5 createMarker !"\"createMarkerLocal\"," !"rcreateMarkerLocal" !"if (isnil 'BIS_GITA_fnc_createMarkers' || false) then {" !"_marker = createMarkerLocal [format[\"groupMember"
5 createUnit !="_newUnit = _group createUnit [_class,respawn_west_original,[],0,\"NONE\"];" !="BIS_MPF_logic = BIS_MPF_dummygroup createUnit [\"Logic\", [1000,10,0], [], 0, \"NONE\"];"