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",
|
private ["_brokein","_isOk","_hasSledgeHammer","_gps","_vars","_hasToolbox","_hasCrowbar","_limit","_proceed","_counter",
|
||||||
"_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate"];
|
"_dis","_sfx","_roll","_animState","_started","_finished","_isMedic","_isGate"];
|
||||||
|
|
||||||
_target = _this select 3;
|
_target = _this select 3;
|
||||||
_pos = getPos _target;
|
_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);
|
_limit = 2 + round(random 3);
|
||||||
|
|
||||||
_hasSledgeHammer = "ItemSledge" in items player;
|
_hasSledgeHammer = "ItemSledge" in items player;
|
||||||
@@ -86,14 +88,20 @@ while {_isOk} do {
|
|||||||
//Add to Counter
|
//Add to Counter
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
|
|
||||||
|
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];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
//start chance to gain access.
|
if (_isWoodenGate) then {
|
||||||
if ([0.01] call fn_chance) then {
|
if ([0.06] call fn_chance) then {
|
||||||
//stop loop
|
_isOk = false;
|
||||||
_isOk = false;
|
_proceed = true;
|
||||||
//Set Done var
|
|
||||||
_proceed = true;
|
|
||||||
if (_isGate) then {
|
|
||||||
_brokein = true;
|
_brokein = true;
|
||||||
_target setVariable ["isOpen", "1", true];
|
_target setVariable ["isOpen", "1", true];
|
||||||
};
|
};
|
||||||
@@ -106,12 +114,14 @@ while {_isOk} do {
|
|||||||
player removeWeapon "ItemSledge";
|
player removeWeapon "ItemSledge";
|
||||||
player addMagazine "ItemSledgeHandle";
|
player addMagazine "ItemSledgeHandle";
|
||||||
player addMagazine "ItemSledgeHead";
|
player addMagazine "ItemSledgeHead";
|
||||||
|
|
||||||
localize "STR_BLD_BREAKIN_BROKEN_SLEDGE" call dayz_rollingMessages;
|
localize "STR_BLD_BREAKIN_BROKEN_SLEDGE" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
if ([0.04] call fn_chance) then {
|
if ([0.04] call fn_chance) then {
|
||||||
player removeWeapon "ItemCrowbar";
|
player removeWeapon "ItemCrowbar";
|
||||||
player addWeapon "ItemCrowbarBent";
|
player addWeapon "ItemCrowbarBent";
|
||||||
|
|
||||||
localize "STR_BLD_BREAKIN_BENT_CROWBAR" call dayz_rollingMessages;
|
localize "STR_BLD_BREAKIN_BENT_CROWBAR" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -136,6 +146,7 @@ if (!_proceed) then {
|
|||||||
[objNull, player, rSwitchMove,""] call RE;
|
[objNull, player, rSwitchMove,""] call RE;
|
||||||
player playActionNow "stop";
|
player playActionNow "stop";
|
||||||
};
|
};
|
||||||
|
|
||||||
localize "STR_BLD_BREAKIN_CANCELLED" call dayz_rollingMessages;
|
localize "STR_BLD_BREAKIN_CANCELLED" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -146,6 +157,7 @@ if (!_proceed) then {
|
|||||||
if (_proceed and !_brokein) then {
|
if (_proceed and !_brokein) then {
|
||||||
localize "STR_BLD_BREAKIN_COMPLETE_FAIL" call dayz_rollingMessages;
|
localize "STR_BLD_BREAKIN_COMPLETE_FAIL" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
//Completed and successful
|
//Completed and successful
|
||||||
if (_proceed and _brokein) then {
|
if (_proceed and _brokein) then {
|
||||||
localize "STR_BLD_BREAKIN_COMPLETE" call dayz_rollingMessages;
|
localize "STR_BLD_BREAKIN_COMPLETE" call dayz_rollingMessages;
|
||||||
|
|||||||
Reference in New Issue
Block a user