mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-09 01:32:53 +03:00
1.7.5.M1D9 + tag friend system from
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
42
dayz_code/compile/player_friendliesCheck.sqf
Normal file
42
dayz_code/compile/player_friendliesCheck.sqf
Normal file
@@ -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];
|
||||
@@ -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";
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user