mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Updated Breaking to support Metal Gates.
Vanilla development commit:
bf16f402f6
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
private ["_brokein","_isOk","_hasSledgeHammer","_gps","_vars","_hasToolbox","_hasCrowbar","_limit","_proceed","_counter",
|
||||
"_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate"];
|
||||
|
||||
_target = _this select 3;
|
||||
_pos = getPos _target;
|
||||
_isGate = (typeOf cursorTarget) in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"];
|
||||
_isWoodenGate = (typeOf cursorTarget) in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"];
|
||||
_isMetalGate = (typeOf cursorTarget) in ["MetalGate_2","MetalGate_3","MetalGate_4"];
|
||||
_limit = 2 + round(random 3);
|
||||
|
||||
_hasSledgeHammer = "ItemSledge" in items player;
|
||||
@@ -85,15 +87,21 @@ while {_isOk} do {
|
||||
if(_finished) then {
|
||||
//Add to Counter
|
||||
_counter = _counter + 1;
|
||||
|
||||
|
||||
//start chance to gain access.
|
||||
if ([0.01] call fn_chance) then {
|
||||
//stop loop
|
||||
_isOk = false;
|
||||
//Set Done var
|
||||
_proceed = true;
|
||||
if (_isGate) then {
|
||||
if (_isMetalGate) then {
|
||||
//start chance to gain access.
|
||||
if ([0.02] call fn_chance) then {
|
||||
_isOk = false;
|
||||
_proceed = true;
|
||||
_brokein = true;
|
||||
_target setVariable ["isOpen", "1", true];
|
||||
};
|
||||
};
|
||||
|
||||
if (_isWoodenGate) then {
|
||||
if ([0.06] call fn_chance) then {
|
||||
_isOk = false;
|
||||
_proceed = true;
|
||||
_brokein = true;
|
||||
_target setVariable ["isOpen", "1", true];
|
||||
};
|
||||
@@ -106,12 +114,14 @@ while {_isOk} do {
|
||||
player removeWeapon "ItemSledge";
|
||||
player addMagazine "ItemSledgeHandle";
|
||||
player addMagazine "ItemSledgeHead";
|
||||
|
||||
localize "STR_BLD_BREAKIN_BROKEN_SLEDGE" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
if ([0.04] call fn_chance) then {
|
||||
player removeWeapon "ItemCrowbar";
|
||||
player addWeapon "ItemCrowbarBent";
|
||||
|
||||
localize "STR_BLD_BREAKIN_BENT_CROWBAR" call dayz_rollingMessages;
|
||||
};
|
||||
};
|
||||
@@ -136,6 +146,7 @@ if (!_proceed) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
|
||||
localize "STR_BLD_BREAKIN_CANCELLED" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
@@ -146,6 +157,7 @@ if (!_proceed) then {
|
||||
if (_proceed and !_brokein) then {
|
||||
localize "STR_BLD_BREAKIN_COMPLETE_FAIL" call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
//Completed and successful
|
||||
if (_proceed and _brokein) then {
|
||||
localize "STR_BLD_BREAKIN_COMPLETE" call dayz_rollingMessages;
|
||||
|
||||
Reference in New Issue
Block a user