add DZE_DamageBeforeMaint default now 0.09 instead of 0.1

Also exit with message if no maintainable objects are found
This commit is contained in:
[VB]AWOL
2014-02-03 08:38:39 -06:00
parent 9524e3a110
commit 9876b42b0a
5 changed files with 30 additions and 5 deletions

View File

@@ -18,7 +18,7 @@ _objects = nearestObjects [_target, _objectClasses, _range];
//filter to only those that have 10% damage //filter to only those that have 10% damage
_objects_filtered = []; _objects_filtered = [];
{ {
if (damage _x >= 0.1) then { if (damage _x >= DZE_DamageBeforeMaint) then {
_objects_filtered set [count _objects_filtered, _x]; _objects_filtered set [count _objects_filtered, _x];
}; };
} forEach _objects; } forEach _objects;
@@ -26,6 +26,14 @@ _objects = _objects_filtered;
// TODO dynamic requirements based on used building parts? // TODO dynamic requirements based on used building parts?
_count = count _objects; _count = count _objects;
if (_count == 0) exitWith {
cutText [format[(localize "STR_EPOCH_ACTIONS_22"), _count], "PLAIN DOWN"];
DZE_ActionInProgress = false;
s_player_maintain_area = -1;
s_player_maintain_area_preview = -1;
};
_requirements = []; _requirements = [];
switch true do { switch true do {
case (_count <= 20): {_requirements = [["ItemGoldBar10oz",2]]}; case (_count <= 20): {_requirements = [["ItemGoldBar10oz",2]]};
@@ -39,9 +47,12 @@ switch true do {
case (_count > 700): {_requirements = [["ItemBriefcase100oz",7]]}; case (_count > 700): {_requirements = [["ItemBriefcase100oz",7]]};
}; };
_option = _this select 3; _option = _this select 3;
switch _option do { switch _option do {
case "maintain": { case "maintain": {
_missing = ""; _missing = "";
_missingQty = 0; _missingQty = 0;
_proceed = true; _proceed = true;

View File

@@ -650,7 +650,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
}; };
// inplace maintenance tool // inplace maintenance tool
if((_cursorTarget isKindOf "ModularItems" or _cursorTarget isKindOf "DZE_Housebase" or _typeOfCursorTarget in DZE_ExtraMaintain) and (damage _cursorTarget >= 0.1)) then { if((_cursorTarget isKindOf "ModularItems" or _cursorTarget isKindOf "DZE_Housebase" or _typeOfCursorTarget in DZE_ExtraMaintain) and (damage _cursorTarget >= DZE_DamageBeforeMaint)) then {
if ((s_player_lastTarget select 2) != _cursorTarget) then { if ((s_player_lastTarget select 2) != _cursorTarget) then {
if (s_player_maint_build > 0) then { if (s_player_maint_build > 0) then {
player removeAction s_player_maint_build; player removeAction s_player_maint_build;

View File

@@ -495,6 +495,10 @@ if(isNil "DZE_LootSpawnTimer") then {
if(isNil "DZE_HeliLift") then { if(isNil "DZE_HeliLift") then {
DZE_HeliLift = true; DZE_HeliLift = true;
}; };
if(isNil "DZE_DamageBeforeMaint") then {
DZE_DamageBeforeMaint = 0.09;
};
// needed on server // needed on server
if(isNil "DZE_PlotPole") then { if(isNil "DZE_PlotPole") then {

View File

@@ -6646,7 +6646,17 @@
<French>Le démontage de la construction ne rendra pas de composants.</French> <French>Le démontage de la construction ne rendra pas de composants.</French>
<Czech>Demontáž budovy nevrátí žádné její komponenty.</Czech> <Czech>Demontáž budovy nevrátí žádné její komponenty.</Czech>
</Key> </Key>
<Key ID="STR_EPOCH_BULK_NAME"> <Key ID="STR_EPOCH_ACTIONS_22">
<Original>%1 building parts in range.</Original>
<English>%1 building parts in range.</English>
<!-- <German></German> -->
<Russian>В радиусе %1 частей зданий.</Russian>
<!-- <Spanish></Spanish> -->
<Dutch></Dutch>
<French>%1 constructions à portée.</French>
<Czech>%1 částí staveb v okruhu.</Czech>
</Key>
<Key ID="STR_EPOCH_BULK_NAME">
<Original>Supply Crate</Original> <Original>Supply Crate</Original>
<English>Supply Crate</English> <English>Supply Crate</English>
<German>Versorgungskiste</German> <German>Versorgungskiste</German>

View File

@@ -11,7 +11,7 @@ _targetObj = _this select 2;
if (_option == 1) then { if (_option == 1) then {
_objects = nearestObjects [_targetObj, DZE_maintainClasses, DZE_maintainRange]; _objects = nearestObjects [_targetObj, DZE_maintainClasses, DZE_maintainRange];
{ {
if (damage _x >= 0.1) then { if (damage _x >= DZE_DamageBeforeMaint) then {
_objectID = _x getVariable ["ObjectID","0"]; _objectID = _x getVariable ["ObjectID","0"];
if (_objectID == "0") then { if (_objectID == "0") then {
_objectUID = _x getVariable ["ObjectUID","0"]; _objectUID = _x getVariable ["ObjectUID","0"];
@@ -31,7 +31,7 @@ if (_option == 1) then {
diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", name _player, count _objects, position _player]; diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", name _player, count _objects, position _player];
}; };
if (_option == 2) then { if (_option == 2) then {
if (damage _targetObj >= 0.1) then { if (damage _targetObj >= DZE_DamageBeforeMaint) then {
_objectID = _targetObj getVariable ["ObjectID","0"]; _objectID = _targetObj getVariable ["ObjectID","0"];
if (_objectID == "0") then { if (_objectID == "0") then {
_objectUID = _targetObj getVariable ["ObjectUID","0"]; _objectUID = _targetObj getVariable ["ObjectUID","0"];