mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Cleanup code #1320
This commit is contained in:
@@ -153,7 +153,7 @@ if(_IsNearPlot == 0) then {
|
|||||||
_nearestPole = _findNearestPole select 0;
|
_nearestPole = _findNearestPole select 0;
|
||||||
|
|
||||||
// Find owner
|
// Find owner
|
||||||
_ownerID = _nearestPole getVariable["CharacterID","0"];
|
_ownerID = _nearestPole getVariable ["CharacterID","0"];
|
||||||
|
|
||||||
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
|
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ _missing = "";
|
|||||||
_hasrequireditem = true;
|
_hasrequireditem = true;
|
||||||
{
|
{
|
||||||
_hastoolweapon = _x in weapons player;
|
_hastoolweapon = _x in weapons player;
|
||||||
if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); }
|
if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); };
|
||||||
} count _require;
|
} count _require;
|
||||||
|
|
||||||
_hasbuilditem = _this in magazines player;
|
_hasbuilditem = _this in magazines player;
|
||||||
|
|||||||
@@ -5,18 +5,19 @@ _caller = _this select 1;
|
|||||||
call fnc_usec_medic_removeActions;
|
call fnc_usec_medic_removeActions;
|
||||||
r_action = false;
|
r_action = false;
|
||||||
|
|
||||||
_callerID = _caller getVariable "CharacterID";
|
_callerID = _caller getVariable ["CharacterID", "0"];
|
||||||
_targetID = _target getVariable "CharacterID";
|
_targetID = _target getVariable ["CharacterID", "0"];
|
||||||
|
if ((_callerID != 0) && (_callerID != 0)) then {
|
||||||
|
_friendlies = _caller getVariable ["friendlies", []];
|
||||||
|
_friendlies set [count _friendlies, _targetID];
|
||||||
|
_caller setVariable ["friendlies", _friendlies, true];
|
||||||
|
|
||||||
_friendlies = _caller getVariable ["friendlies", []];
|
_rfriendlies = _target getVariable ["friendlies", []];
|
||||||
_friendlies set [count _friendlies, _targetID];
|
|
||||||
_caller setVariable ["friendlies", _friendlies, true];
|
|
||||||
|
|
||||||
_rfriendlies = _target getVariable ["friendlies", []];
|
if !(_callerID in _rfriendlies) then {
|
||||||
|
titleText [(localize "STR_EPOCH_ACTIONS_8"), "PLAIN DOWN"]; //To Caller
|
||||||
if !(_callerID in _rfriendlies) then {
|
/* PVS/PVC - Skaronator */
|
||||||
titleText [(localize "STR_EPOCH_ACTIONS_8"), "PLAIN DOWN"]; //To Caller
|
PVDZE_send = [_target,"tagFriendly",[_target]]; //To Target
|
||||||
/* PVS/PVC - Skaronator */
|
publicVariableServer "PVDZE_send";
|
||||||
PVDZE_send = [_target,"tagFriendly",[_target]]; //To Target
|
};
|
||||||
publicVariableServer "PVDZE_send";
|
};
|
||||||
};
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
private ["_display","_ctrlBlood","_ctrlBleed","_bloodVal","_humanityName","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_charID","_rcharID","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_humanityTarget"];
|
private ["_display","_ctrlBlood","_ctrlBleed","_bloodVal","_humanityName","_ctrlFood","_ctrlThirst","_thirstVal","_foodVal","_ctrlTemp","_tempVal","_combatVal","_array","_ctrlEar","_ctrlEye","_ctrlCombat","_ctrlFracture","_visualText","_visual","_audibleText","_audible","_blood","_thirstLvl","_foodLvl","_tempImg","_thirst","_food","_temp","_bloodLvl","_tempLvl","_color","_string","_humanity","_size","_friendlies","_charID","_rcharID","_rfriendlies","_rfriendlyTo","_distance","_targetControl"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
_foodVal = 1 - (dayz_hunger / SleepFood);
|
_foodVal = 1 - (dayz_hunger / SleepFood);
|
||||||
@@ -6,7 +6,7 @@ _thirstVal = 1 - (dayz_thirst / SleepWater);
|
|||||||
_tempVal = 1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin)); // Normalise to [0,1]
|
_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 - dayz_combat; // May change later to be a range of red/green to loosely indicate 'time left in combat'
|
||||||
|
|
||||||
if (uiNamespace getVariable ['DZ_displayUI', 0] == 1) exitWith {
|
if (uiNamespace getVariable ["DZ_displayUI", 0] == 1) exitWith {
|
||||||
_array = [_foodVal,_thirstVal];
|
_array = [_foodVal,_thirstVal];
|
||||||
_array
|
_array
|
||||||
};
|
};
|
||||||
@@ -139,12 +139,11 @@ if (r_player_injured) then {
|
|||||||
/*
|
/*
|
||||||
Opt-in tag system with friend tagging
|
Opt-in tag system with friend tagging
|
||||||
*/
|
*/
|
||||||
_targetControl = _display displayCtrl 1199;
|
|
||||||
_string = "";
|
_string = "";
|
||||||
_humanityTarget = cursorTarget;
|
_humanityTarget = cursorTarget;
|
||||||
if (!isNull _humanityTarget && isPlayer _humanityTarget && alive _humanityTarget) then {
|
if (!isNull _humanityTarget && isPlayer _humanityTarget && alive _humanityTarget) then {
|
||||||
|
|
||||||
_distance = (player distance _humanityTarget);
|
_distance = player distance _humanityTarget;
|
||||||
|
|
||||||
if (_distance < DZE_HumanityTargetDistance) then {
|
if (_distance < DZE_HumanityTargetDistance) then {
|
||||||
|
|
||||||
@@ -157,24 +156,19 @@ if (!isNull _humanityTarget && isPlayer _humanityTarget && alive _humanityTarget
|
|||||||
_rcharID = _humanityTarget getVariable ["CharacterID", "0"];
|
_rcharID = _humanityTarget getVariable ["CharacterID", "0"];
|
||||||
_rfriendlies = _humanityTarget getVariable ["friendlies", []];
|
_rfriendlies = _humanityTarget getVariable ["friendlies", []];
|
||||||
_rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []];
|
_rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []];
|
||||||
|
|
||||||
if ((_rcharID in _friendlies) && (_charID in _rfriendlies)) then {
|
if ((_rcharID in _friendlies) && (_charID in _rfriendlies)) then {
|
||||||
|
|
||||||
if (!(_charID in _rfriendlyTo)) then {
|
if !(_charID in _rfriendlyTo) then {
|
||||||
|
|
||||||
// diag_log format["IS FRIENDLY: %1", _player];
|
// diag_log format["IS FRIENDLY: %1", _player];
|
||||||
_rfriendlyTo set [count _rfriendlyTo, _charID];
|
_rfriendlyTo set [count _rfriendlyTo, _charID];
|
||||||
_humanityTarget setVariable ["friendlyTo", _rfriendlyTo, true];
|
_humanityTarget setVariable ["friendlyTo", _rfriendlyTo, true];
|
||||||
|
|
||||||
// titleText [format[(localize "STR_EPOCH_ACTIONS_17"), (name _humanityTarget)], "PLAIN DOWN"];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// <br /><t %2 align='center' size='0.7'>Humanity: %3</t>
|
// <br /><t %2 align='center' size='0.7'>Humanity: %3</t>
|
||||||
|
|
||||||
_color = "color='#339933'";
|
_color = "color='#339933'";
|
||||||
_humanityName = if (alive _humanityTarget) then {name _humanityTarget; } else { "Dead Player";};
|
_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
|
||||||
_string = format["<t %2 align='center' size='%3'>%1</t>",_humanityName,_color,_size];
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -190,8 +184,7 @@ if (!isNull _humanityTarget && isPlayer _humanityTarget && alive _humanityTarget
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
if((_humanityTarget getVariable ["DZE_display_name", false]) || (DZE_ForceNameTagsInTrader && isInTraderCity)) then {
|
if((_humanityTarget getVariable ["DZE_display_name", false]) || (DZE_ForceNameTagsInTrader && isInTraderCity)) then {
|
||||||
_humanityName = if (alive _humanityTarget) then {name _humanityTarget; } else { "Dead Player";};
|
_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
|
||||||
_string = format["<t %2 align='center' size='%3'>%1</t>",_humanityName,_color,_size];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -199,6 +192,7 @@ if (!isNull _humanityTarget && isPlayer _humanityTarget && alive _humanityTarget
|
|||||||
|
|
||||||
// update gui if changed
|
// update gui if changed
|
||||||
if (dayz_humanitytarget != _string) then {
|
if (dayz_humanitytarget != _string) then {
|
||||||
|
_targetControl = _display displayCtrl 1199;
|
||||||
_targetControl ctrlSetStructuredText (parseText _string);
|
_targetControl ctrlSetStructuredText (parseText _string);
|
||||||
dayz_humanitytarget = _string;
|
dayz_humanitytarget = _string;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user