Update combattimeout from time to diag_tickTime

Also organized change log
This commit is contained in:
ebaydayz
2016-04-12 21:04:17 -04:00
parent 27d57283a0
commit 652ca51c2c
12 changed files with 113 additions and 112 deletions

View File

@@ -1,3 +1,5 @@
// If parameters were passed redirect to vanilla player_build (Epoch items don't pass anything)
if (!isNil "_this" && {typeName _this == "ARRAY"} && {count _this > 0}) exitWith {_this spawn player_buildVanilla;};
private ["_classname","_classnametmp","_require","_text","_ghost","_lockable","_requireplot","_isAllowedUnderGround","_offset","_isPole","_isLandFireDZ","_hasRequired","_hasrequireditem","_reason","_buildObject","_location1","_object","_objectHelper","_position","_controls","_cancel","_dir","_cnt","_pos","_distance","_buildables","_onLadder","_vehicle","_inVehicle","_abort","_needNear","_isNear","_needText","_findNearestPoles","_findNearestPole","_IsNearPlot","_canBuildOnPlot","_nearestPole","_ownerID","_friendlies","_missing","_checkMag","_enableGhost","_helperColor","_canDo","_objHDiff","_isOk","_zheightchanged","_zheightdirection","_rotate","_location2","_lastDir","_objectHelperDir","_objectHelperPos","_tmpbuilt","_limit","_proceed","_counter","_dis","_sfx","_started","_finished","_animState","_isMedic","_num_removed","_combinationDisplay","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display"];
//Check if building already in progress, exit if so.
@@ -33,7 +35,7 @@ closeDialog 1;
if (dayz_isSwimming) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26","PLAIN DOWN"];};
if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_42","PLAIN DOWN"];};
if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21","PLAIN DOWN"];};
if (player getVariable["combattimeout", 0] >= time) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_43","PLAIN DOWN"];};
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_43","PLAIN DOWN"];};
DZE_buildItem = _this; //This is a magazine! It's global to allow access to it from outside functions
@@ -391,7 +393,7 @@ if (_hasrequireditem) then {
deleteVehicle _objectHelper;
};
if (player getVariable["combattimeout", 0] >= time) exitWith {
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {
_isOk = false;
_cancel = true;
_reason = (localize "str_epoch_player_43");
@@ -487,7 +489,7 @@ if (_hasrequireditem) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
if (r_interrupt || (player getVariable["combattimeout",0] >= diag_tickTime)) then {
r_doLoop = false;
};
if (DZE_cancelBuilding) exitWith {

View File

@@ -100,7 +100,7 @@ while {_isOk} do {
r_doLoop = false;
_finished = true;
};
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
if (r_interrupt or (player getVariable["combattimeout",0] >= diag_tickTime)) then {
r_doLoop = false;
_finished = false;
};

View File

@@ -1,5 +1,5 @@
// If parameters were passed redirect to vanilla player_build (Epoch items don't pass anything)
if ((!isNil "_this") && {typeName _this == "ARRAY"} && {count _this > 0}) exitWith {_this spawn player_buildVanilla;};
if (!isNil "_this" && {typeName _this == "ARRAY"} && {count _this > 0}) exitWith {_this spawn player_buildVanilla;};
/*
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
@@ -40,7 +40,7 @@ closeDialog 1;
if (_isWater) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"];};
if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_42","PLAIN DOWN"];};
if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"];};
if (player getVariable["combattimeout", 0] >= time) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_43","PLAIN DOWN"];};
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_43","PLAIN DOWN"];};
_item = _this;
@@ -349,7 +349,7 @@ if (_hasrequireditem) then {
deleteVehicle _object;
};
if (player getVariable["combattimeout", 0] >= time) exitWith {
if (player getVariable["combattimeout",0] >= diag_tickTime) exitWith {
_isOk = false;
_cancel = true;
_reason = (localize "str_epoch_player_43");
@@ -435,7 +435,7 @@ if (_hasrequireditem) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
if (r_interrupt || (player getVariable["combattimeout",0] >= diag_tickTime)) then {
r_doLoop = false;
};
if (DZE_cancelBuilding) exitWith {

View File

@@ -13,7 +13,6 @@ _distance = round(_audible * 10 * _caliber);
dayz_disAudial = _distance;
dayz_firedCooldown = time;
if (toLower DZE_UI != "vanilla") then {dayz_combat = 1;};
if (_ammo isKindOf "Melee") exitWith {
// Added Nutrition-Factor for work

View File

@@ -21,15 +21,13 @@ if (uiNamespace getVariable ["DZ_displayUI", 0] == 1) exitWith {
_array
};
if(dayz_combat == 1) then {
_combattimeout = player getVariable["combattimeout",0];
_timeleft = _combattimeout - time;
_combatVal = 0;
_combattimeout = player getVariable["combattimeout",0];
if (_combattimeout > 0) then {
_timeleft = _combattimeout - diag_tickTime;
_combatVal = (_timeleft/30);
} else {
_combatVal = 0;
};
_audible = (dayz_disAudial / 50);
_visual = (dayz_disVisual / 100);
_bloodVal = r_player_blood / r_player_bloodTotal;

View File

@@ -15,7 +15,12 @@ disableSerialization;
_foodVal = 1 - (dayz_hunger / SleepFood);
_thirstVal = 1 - (dayz_thirst / SleepWater);
_tempVal = 1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin)); // Normalise to [0,1]
_combatVal = 1 - dayz_combat; // May change later to be a range of red/green to loosely indicate 'time left in combat'
_combatVal = 1;
_combattimeout = player getVariable["combattimeout",0];
if (_combattimeout > 0) then {
_timeleft = _combattimeout - diag_tickTime;
_combatVal = (30 - _timeleft) / 100;
};
if (uiNamespace getVariable ["DZ_displayUI", 0] == 1) exitWith {
_array = [_foodVal,_thirstVal];

View File

@@ -24,13 +24,5 @@ class ItemDesertTent
{
weight = 5;
};
class StashSmall
{
weight = 4;
};
class StashMedium
{
weight = 5;
};
//lockbox weight is in cfgMagazines

View File

@@ -678,7 +678,6 @@ if (!isDedicated) then {
if (isNil "DZE_requireplot") then {DZE_requireplot = 1;};
if (isNil "DZE_StaticConstructionCount") then {DZE_StaticConstructionCount = 0;};
autoRunActive = 0;
dayz_combat = 0;
DZE_ActionInProgress = false;
DZE_AntiWallCounter = 0;
DZE_myHaloVehicle = objNull;

View File

@@ -363,11 +363,11 @@ while {1 == 1} do {
_startcombattimer = player getVariable["startcombattimer", 0];
if (_startcombattimer == 1 || _PlayerNearby) then {
player setVariable["combattimeout", diag_tickTime + 30, false];
player setVariable["combattimeout", diag_tickTime + 30, true]; // Global used to punish combat log in server_onPlayerDisconnect
player setVariable["startcombattimer", 0, false];
} else {
if (_ZedsNearby) then {
player setVariable["combattimeout", diag_tickTime + 10, false];
player setVariable["combattimeout", diag_tickTime + 10, true]; // Global used to punish combat log in server_onPlayerDisconnect
player setVariable["startcombattimer", 0, false];
};
};
@@ -375,23 +375,24 @@ while {1 == 1} do {
if (toLower DZE_UI != "vanilla") then {
_combattimeout = player getVariable["combattimeout",0];
if (_combattimeout > 0) then {
_timeleft = _combattimeout - time;
_timeleft = _combattimeout - diag_tickTime;
if (_timeleft > 0) then {
//hintSilent format["In Combat: %1",round(_timeleft)];
} else {
//hintSilent "Not in Combat";
player setVariable["combattimeout", 0, true];
dayz_combat = 0;
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
if (!isNil "_combatdisplay") then {
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
};
};
} else {
//hintSilent "Not in Combat";
dayz_combat = 0;
_combatdisplay = uiNamespace getVariable 'DAYZ_GUI_display';
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
if (!isNil "_combatdisplay") then {
_combatcontrol = _combatdisplay displayCtrl 1307;
_combatcontrol ctrlShow true;
};
};
};