diff --git a/dayz_code/actions/player_drink.sqf b/dayz_code/actions/player_drink.sqf index 04facfacb..5bc58fa66 100644 --- a/dayz_code/actions/player_drink.sqf +++ b/dayz_code/actions/player_drink.sqf @@ -6,6 +6,8 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]}; if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]}; +if (dayz_thirst == 0) exitWith {cutText ["I am not thirsty", "PLAIN DOWN"]}; + _item = _this; _hasdrinkitem = _this in magazines player; diff --git a/dayz_code/actions/player_eat.sqf b/dayz_code/actions/player_eat.sqf index b2da30690..35e61d1d7 100644 --- a/dayz_code/actions/player_eat.sqf +++ b/dayz_code/actions/player_eat.sqf @@ -6,6 +6,8 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]}; if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]}; +if (dayz_hunger == 0) exitWith {cutText ["I am not hungry", "PLAIN DOWN"]}; + _item = _this; _hasfoodmag = _this in magazines player; @@ -19,6 +21,8 @@ player playActionNow "PutDown"; player removeMagazine _item; sleep 1; +_regen = round(random _regen); + r_player_blood = r_player_blood + _regen; if (r_player_blood > r_player_bloodTotal) then { r_player_blood = r_player_bloodTotal; diff --git a/dayz_code/actions/player_tagFriendly.sqf b/dayz_code/actions/player_tagFriendly.sqf new file mode 100644 index 000000000..e46ac493f --- /dev/null +++ b/dayz_code/actions/player_tagFriendly.sqf @@ -0,0 +1,22 @@ +private["_target", "_caller", "_action", "_callerID", "_targetID", "_friendlies", "_rfriendlies"]; +_target = _this select 0; +_caller = _this select 1; +_action = _this select 2; + +_caller removeAction _action; + +_callerID = _caller getVariable "characterID"; +_targetID = _target getVariable "characterID"; + +_friendlies = _caller getVariable ["friendlies", []]; +_friendlies set [count _friendlies, _targetID]; +_caller setVariable ["friendlies", _friendlies, true]; + +_rfriendlies = _target getVariable ["friendlies", []]; + +if (!(_callerID in _rfriendlies)) then { + // caller + titleText [format["You have tagged %1 as friendly. Waiting for %2 to accept that.",(name _target),(name _target)]]; + // target + [_caller,_target,"loc",rTITLETEXT,format["%1 wants to tag you as friendly. To accept, tag %2 as friendly.", (name _caller),(name _caller)],"PLAIN DOWN"] call RE; +}; diff --git a/dayz_code/cfgVehicles.hpp b/dayz_code/cfgVehicles.hpp index 95a738c80..c25611d9c 100644 --- a/dayz_code/cfgVehicles.hpp +++ b/dayz_code/cfgVehicles.hpp @@ -542,7 +542,7 @@ class Citizen1; // External class reference icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa"; mapSize = 2; model = "\ca\weapons_e\AmmoBoxes\backpack_us_assault.p3d"; - transportMaxWeapons = 2; + transportMaxWeapons = 1; transportMaxMagazines = 12; }; @@ -554,7 +554,7 @@ class Citizen1; // External class reference icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa"; mapsize = 2; model = "\ca\weapons_e\AmmoBoxes\backpack_acr_small.p3d"; - transportMaxWeapons = 2; + transportMaxWeapons = 0; transportMaxMagazines = 12; }; @@ -602,7 +602,7 @@ class Citizen1; // External class reference icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa"; mapsize = 2; model = "\ca\weapons_e\AmmoBoxes\backpack_acr.p3d"; - transportMaxWeapons = 6; + transportMaxWeapons = 4; transportMaxMagazines = 24; }; diff --git a/dayz_code/compile/building_spawnZombies.sqf b/dayz_code/compile/building_spawnZombies.sqf index 49f97fb8c..692839d5b 100644 --- a/dayz_code/compile/building_spawnZombies.sqf +++ b/dayz_code/compile/building_spawnZombies.sqf @@ -52,7 +52,7 @@ if (_canLoot) then { _nearBy = {alive _x} count nearestObjects [_iPos , ["zZombie_Base"],3] > 0; _nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0; - diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer)); + //diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer)); if (!_nearByPlayer and !_nearBy) then { [_iPos,_unitTypes] call zombie_generate; diff --git a/dayz_code/compile/fn_damageActions.sqf b/dayz_code/compile/fn_damageActions.sqf index cbc7255d0..355241146 100644 --- a/dayz_code/compile/fn_damageActions.sqf +++ b/dayz_code/compile/fn_damageActions.sqf @@ -4,7 +4,7 @@ scriptName "Functions\misc\fn_damageActions.sqf"; - Function - [] call fnc_usec_damageActions; ************************************************************/ -private["_menClose","_unit","_unconscious","_lowBlood","_injured","_inPain","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_action1","_action2","_action","_vehClose","_hasVehicle","_vehicle","_inVehicle","_crew","_unconscious_crew","_patients"]; +private["_menClose","_unit","_unconscious","_lowBlood","_injured","_inPain","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_action1","_action2","_action","_vehClose","_hasVehicle","_vehicle","_inVehicle","_crew","_unconscious_crew","_patients","_charID","_friendlies"]; _menClose = cursorTarget; _hasPatient = alive _menClose; @@ -50,6 +50,8 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco _inPain = _unit getVariable ["USEC_inPain", false]; _legsBroke = _unit getVariable ["hit_legs", 0] >= 1; _armsBroke = _unit getVariable ["hit_hands", 0] >= 1; + _charID = _unit getVariable ["characterID", "0"]; + _friendlies = player getVariable ["friendlies", []]; _hasBandage = "ItemBandage" in magazines player; _hasEpi = "ItemEpinephrine" in magazines player; _hasMorphine = "ItemMorphine" in magazines player; @@ -177,6 +179,13 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco r_player_actions set [count r_player_actions,_action]; }; }; + + if ((isPlayer _unit) and !(_charID in _friendlies)) then { + r_action = true; + _action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", "_target != player"]; + r_player_actions set [count r_player_actions,_action]; + }; + if (r_action) then { r_action_targets = r_action_targets + [_unit]; }; diff --git a/dayz_code/compile/player_alertZombies.sqf b/dayz_code/compile/player_alertZombies.sqf index 331c6d01b..db31714f7 100644 --- a/dayz_code/compile/player_alertZombies.sqf +++ b/dayz_code/compile/player_alertZombies.sqf @@ -4,7 +4,7 @@ _unit = _this select 0; _distance = _this select 1; _doRun = _this select 2; _pos = _this select 3; -_listTalk = _pos nearEntities ["zZombie_Base",_distance * 3]; +_listTalk = _pos nearEntities ["zZombie_Base",_distance * 2]; //hint str(_listTalk); diff --git a/dayz_code/compile/player_death.sqf b/dayz_code/compile/player_death.sqf index db2d8a451..42d1b1bee 100644 --- a/dayz_code/compile/player_death.sqf +++ b/dayz_code/compile/player_death.sqf @@ -84,6 +84,7 @@ terminate dayz_gui; terminate dayz_zedCheck; terminate dayz_locationCheck; terminate dayz_combatCheck; +terminate dayz_friendliesCheck; //Reset (just in case) //deleteVehicle dayz_playerTrigger; diff --git a/dayz_code/compile/player_friendliesCheck.sqf b/dayz_code/compile/player_friendliesCheck.sqf new file mode 100644 index 000000000..daf57749e --- /dev/null +++ b/dayz_code/compile/player_friendliesCheck.sqf @@ -0,0 +1,42 @@ +private["_charID", "_friendlies", "_rcharID", "_rfriendlyTo", "_tag", "_player", "_newTagList"]; +_charID = player getVariable ["characterID", "0"]; +_friendlies = player getVariable ["friendlies", []]; +_tagList = player getVariable ["tagList", []]; + +// create tags +{ + if (isPlayer _x) then { + _rcharID = _x getVariable ["characterID", "0"]; + _rfriendlies = _x getVariable ["friendlies", []]; + _rfriendlyTo = _x getVariable ["friendlyTo", []]; + if ((_rcharID in _friendlies) and (_charID in _rfriendlies)) then { + if (!(_charID in _rfriendlyTo)) then { + _position = [0,0,0]; + _tag = "Sign_sphere10cm_EP1" createVehicleLocal _position; + _tag attachTo [_x,[0,0,2]]; + _tag setVariable ["belongsTo", _rcharID]; + _rfriendlyTo set [count _rfriendlyTo, _charID]; + _x setVariable ["friendlyTo", _rfriendlyTo]; + _tagList set [count _tagList, [_x, _tag]]; + player setVariable ["tagList", _tagList]; + titleText [format["You and %1 are now tagged as friendlies.", (name _x)], "PLAIN DOWN"]; + }; + }; + }; +} forEach playableUnits; + +// keep track of tags created +_newTagList = []; +{ + _player = _x select 0; + _tag = _x select 1; + + // friendly player disconnected + if (!(isPlayer _player)) then { + deleteVehicle _tag; + } else { + _newTagList set [count _newTagList, [_player, _tag]]; + }; +} forEach _tagList; + +player setVariable ["tagList", _newTagList]; \ No newline at end of file diff --git a/dayz_code/compile/player_humanityMorph.sqf b/dayz_code/compile/player_humanityMorph.sqf index ea993cd60..453489fc0 100644 --- a/dayz_code/compile/player_humanityMorph.sqf +++ b/dayz_code/compile/player_humanityMorph.sqf @@ -1,4 +1,4 @@ -private["_updates","_playerUID","_charID","_humanity","_worldspace","_model"]; +private["_updates","_playerUID","_charID","_humanity","_worldspace","_model","_friendlies"]; _playerUID = _this select 0; _charID = _this select 1; _model = _this select 2; @@ -23,6 +23,8 @@ _zombieKills = player getVariable ["zombieKills",0]; _headShots = player getVariable ["headShots",0]; _humanKills = player getVariable ["humanKills",0]; _banditKills = player getVariable ["banditKills",0]; +_friendlies = player getVariable ["friendlies",[]]; +_tagList = player getVariable ["tagList",[]]; //Switch _model call player_switchModel; @@ -72,6 +74,8 @@ player setVariable["humanKills",_humanKills,true]; player setVariable["banditKills",_banditKills,true]; player setVariable["characterID",_charID,true]; player setVariable["worldspace",_worldspace,true]; +player setVariable["friendlies",_friendlies,true]; +player setVariable["tagList",_tagList,true]; dayzPlayerMorph = [_charID,player,_playerUID,[_zombieKills,_headShots,_humanKills,_banditKills],_humanity]; publicVariable "dayzPlayerMorph"; diff --git a/dayz_code/compile/player_spawnCheck.sqf b/dayz_code/compile/player_spawnCheck.sqf index a06364a77..6480d6e62 100644 --- a/dayz_code/compile/player_spawnCheck.sqf +++ b/dayz_code/compile/player_spawnCheck.sqf @@ -9,13 +9,12 @@ _maxWildZombies = 3; _age = -1; _nearbyBuildings = []; _radius = 200; -_maxZombies = 20; +_maxZombies = 10; diag_log ("Type: " +str(_type)); //diag_log("SPAWN CHECKING: Starting"); - _radius = 200; _locationstypes = ["NameCityCapital","NameCity","NameVillage"]; _nearestCity = nearestLocations [getPos player, _locationstypes, _radius]; _townname = text (_nearestCity select 0); diff --git a/dayz_code/compile/player_zombieCheck.sqf b/dayz_code/compile/player_zombieCheck.sqf index 338216165..07a7d6780 100644 --- a/dayz_code/compile/player_zombieCheck.sqf +++ b/dayz_code/compile/player_zombieCheck.sqf @@ -30,7 +30,8 @@ _multiplier = 1; _entHeight = (getPosATL _x) select 2; _delta = _pHeight - _entHeight; if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then { - [_x, _type] spawn player_zombieAttack; + zedattack = [_x, _type] spawn player_zombieAttack; + waitUntil {scriptDone zedattack}; _x setVariable["lastAttack",time]; }; _attacked = true; @@ -46,12 +47,12 @@ _multiplier = 1; //Noise Activation _targets = _group getVariable ["targets",[]]; if (!(_refObj in _targets)) then { - if (_dist < (DAYZ_disAudial * _multiplier)) then { - if ((DAYZ_disAudial * _multiplier) > 80) then { + if (_dist < DAYZ_disAudial) then { + if (DAYZ_disAudial > 80) then { _targets set [count _targets, driver _refObj]; _group setVariable ["targets",_targets,true]; } else { - _chance = [_x,_dist,(DAYZ_disAudial * _multiplier)] call dayz_losChance; + _chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance; //diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance)); if ((random 1) < _chance) then { _cantSee = [_x,_refObj] call dayz_losCheck; @@ -59,7 +60,7 @@ _multiplier = 1; _targets set [count _targets, driver _refObj]; _group setVariable ["targets",_targets,true]; } else { - if (_dist < ((DAYZ_disAudial * _multiplier) / 2)) then { + if (_dist < (DAYZ_disAudial / 2)) then { _targets set [count _targets, driver _refObj]; _group setVariable ["targets",_targets,true]; }; @@ -71,8 +72,8 @@ _multiplier = 1; //Sight Activation _targets = _group getVariable ["targets",[]]; if (!(_refObj in _targets)) then { - if (_dist < (DAYZ_disVisual * _multiplier)) then { - _chance = [_x,_dist,(DAYZ_disVisual * _multiplier)] call dayz_losChance; + if (_dist < DAYZ_disVisual) then { + _chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance; //diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance)); if ((random 1) < _chance) then { //diag_log ("Chance Detection"); diff --git a/dayz_code/compile/zombie_generate.sqf b/dayz_code/compile/zombie_generate.sqf index fa1bc57d8..bf02fc606 100644 --- a/dayz_code/compile/zombie_generate.sqf +++ b/dayz_code/compile/zombie_generate.sqf @@ -49,13 +49,7 @@ if (random 1 > 0.7) then { //_agent setVariable["host",player,true]; -if (!_doLoiter) then { - _agent setPosATL _position; - _agent setDir round(random 180); - if (_nearByPlayer) then { - deleteVehicle _agent; - }; -} else { +if (_doLoiter) then { if (_nearByPlayer) then { _attempt = 0; while {_nearByPlayer} do { diff --git a/dayz_code/config.cpp b/dayz_code/config.cpp index 2a76ae798..51c0cb757 100644 --- a/dayz_code/config.cpp +++ b/dayz_code/config.cpp @@ -33,7 +33,7 @@ class CfgMods hidePicture = 0; hideName = 0; action = "http://www.dayzmod.com"; - version = "1.7.5.M1D7"; + version = "1.7.5.M1D9"; hiveVersion = 0.96; //0.93 }; }; diff --git a/dayz_code/init/compiles.sqf b/dayz_code/init/compiles.sqf index ff1088459..07cbe0307 100644 --- a/dayz_code/init/compiles.sqf +++ b/dayz_code/init/compiles.sqf @@ -50,6 +50,7 @@ if (!isDedicated) then { player_throwObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_throwObject.sqf"; player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf"; player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf"; + player_friendliesCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_friendliesCheck.sqf"; //Objects object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf"; diff --git a/dayz_code/rscTitles.hpp b/dayz_code/rscTitles.hpp index 5f18dee32..c5aed2f1f 100644 --- a/dayz_code/rscTitles.hpp +++ b/dayz_code/rscTitles.hpp @@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay class DAYZ_Version : CA_Version { idc = -1; - text = "DayZ 1.7.5.M1D7"; + text = "DayZ 1.7.5.M1D9"; y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)"; }; class CA_TitleMainMenu; diff --git a/dayz_code/system/player_monitor.fsm b/dayz_code/system/player_monitor.fsm index 03a9778d7..3181394b6 100644 --- a/dayz_code/system/player_monitor.fsm +++ b/dayz_code/system/player_monitor.fsm @@ -1114,6 +1114,12 @@ class FSM " sleep 2;" \n " };" \n "};" \n + "dayz_friendliesCheck = [] spawn {" \n + " while {true} do {" \n + " call player_friendliesCheck;" \n + " sleep 2;" \n + " };" \n + "};" \n "// TODO: questionably" \n "{ _x call fnc_vehicleEventHandler; } forEach vehicles;" \n "" \n diff --git a/dayz_code/system/zombie_agent.fsm b/dayz_code/system/zombie_agent.fsm index 81602e9c2..1e85f2b66 100644 --- a/dayz_code/system/zombie_agent.fsm +++ b/dayz_code/system/zombie_agent.fsm @@ -99,8 +99,8 @@ link51[] = {39,22}; link52[] = {40,28}; link53[] = {41,5}; link54[] = {42,1}; -globals[] = {25.000000,1,0,0,0,640,480,1,101,6316128,1,-671.713867,363.212036,624.148865,-248.208023,713,601,1}; -window[] = {2,-1,-1,-32000,-32000,777,66,1274,66,3,730}; +globals[] = {25.000000,1,0,0,0,640,480,1,101,6316128,1,-671.713867,363.212036,746.075562,-126.281273,713,601,1}; +window[] = {2,-1,-1,-1,-1,777,66,1274,66,3,730}; *//*%FSM*/ class FSM { @@ -349,7 +349,7 @@ class FSM "};" \n "" \n "" \n - "if (_agent distance player <= 100) then {" \n + "if (_agent distance player > 15) then {" \n " _cantSee = [_agent,_target] call dayz_losCheck;" \n "};" \n "" \n diff --git a/dayz_server/compile/server_playerSetup.sqf b/dayz_server/compile/server_playerSetup.sqf index 3ceb8c99c..806abb54c 100644 --- a/dayz_server/compile/server_playerSetup.sqf +++ b/dayz_server/compile/server_playerSetup.sqf @@ -1,4 +1,4 @@ -private["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state","_doLoop","_key","_primary","_medical","_stats","_humanity","_lastinstance","_randomSpot","_position","_debug","_distance","_hit","_fractures","_score","_findSpot","_mkr","_counter","_isNear","_isZero","_pos","_isIsland","_w","_clientID"]; +private["_characterID","_playerObj","_playerID","_dummy","_worldspace","_state","_doLoop","_key","_primary","_medical","_stats","_humanity","_lastinstance","_randomSpot","_position","_debug","_distance","_hit","_fractures","_score","_findSpot","_mkr","_counter","_isNear","_isZero","_pos","_isIsland","_w","_clientID","_friendlies"]; //Wait for HIVE to be free //diag_log ("SETUP: attempted with " + str(_this)); @@ -56,6 +56,7 @@ _state = _primary select 3; _worldspace = _primary select 4; _humanity = _primary select 5; _lastinstance = _primary select 6; +_friendlies = []; //Set position _randomSpot = false; @@ -237,6 +238,7 @@ _playerObj setVariable["humanity_CHK",_humanity]; //_playerObj setVariable["worldspace",_worldspace,true]; //_playerObj setVariable["state",_state,true]; _playerObj setVariable["lastPos",getPosATL _playerObj]; +_playerObj setVariable["friendlies",_friendlies]; dayzPlayerLogin2 = [_worldspace,_state]; _clientID = owner _playerObj; diff --git a/dayz_server/compile/server_updateObject.sqf b/dayz_server/compile/server_updateObject.sqf index ae4e87803..4ac883e66 100644 --- a/dayz_server/compile/server_updateObject.sqf +++ b/dayz_server/compile/server_updateObject.sqf @@ -158,6 +158,6 @@ switch (_type) do { call _object_killed; }; case "repair": { - call _object_repair; + call _object_damage; }; }; \ No newline at end of file diff --git a/dayz_server/init/server_functions.sqf b/dayz_server/init/server_functions.sqf index 2553f141d..09c4468ee 100644 --- a/dayz_server/init/server_functions.sqf +++ b/dayz_server/init/server_functions.sqf @@ -315,10 +315,10 @@ spawn_roadblocks = { //_isRoad = isOnRoad _position; - //_marker = createMarker [str(_position) , _position]; - //_marker setMarkerShape "ICON"; - //_marker setMarkerType "DOT"; - //_marker setMarkerText "ON"; + _marker = createMarker [str(_position) , _position]; + _marker setMarkerShape "ICON"; + _marker setMarkerType "DOT"; + _marker setMarkerText "ON"; waitUntil{!isNil "BIS_fnc_selectRandom"};