mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 01:30:26 +03:00
1.0.2.37 DEV
This commit is contained in:
@@ -6,6 +6,8 @@ scriptName "Functions\misc\fn_damageActions.sqf";
|
||||
************************************************************/
|
||||
private ["_weaponName","_action","_turret","_weapons","_assignedRole","_action1","_action2","_x","_vehicle","_unit","_vehType","_displayName","_ammoQty","_ammoSerial","_weapon","_magTypes","_type","_typeVeh","_index","_inventory","_unitTo","_isEngineer","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_hasToolbox","_hasJerry","_hasJerryE","_hasWire","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose","_bag","_classbag","_isDisallowRefuel","_hasBarrel","_hasBarrelE"];
|
||||
|
||||
disableSerialization;
|
||||
|
||||
if (TradeInprogress) exitWith {}; // Do not allow if any script is running.
|
||||
|
||||
_menClose = cursorTarget;
|
||||
@@ -41,10 +43,10 @@ if (_inVehicle) then {
|
||||
r_player_lastSeat = [];
|
||||
};
|
||||
|
||||
if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unconscious and _isClose) then {
|
||||
if (!isNull _menClose and _hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unconscious and _isClose) then {
|
||||
_unit = cursorTarget;
|
||||
_isDisallowRefuel = typeOf _unit in ["M240Nest_DZ"];
|
||||
player reveal _unit;
|
||||
// player reveal _unit;
|
||||
_vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; //nearestObjects [player, ["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"], 5];
|
||||
_hasVehicle = ({alive _x} count _vehClose > 0);
|
||||
_unconscious = _unit getVariable ["NORRN_unconscious", false];
|
||||
|
||||
@@ -2,8 +2,7 @@ disableSerialization;
|
||||
_display = (_this select 0);
|
||||
_close = {locked _x} count (nearestObjects [player, ["AllVehicles"], 5]) > 0;
|
||||
|
||||
cutText ["Cannot access gear on a locked vehicle." , "PLAIN DOWN"];
|
||||
|
||||
if(_close) then {
|
||||
cutText ["Cannot access gear on a locked vehicle." , "PLAIN DOWN"];
|
||||
_display closeDisplay 1;
|
||||
};
|
||||
@@ -37,6 +37,11 @@ if (_canPickLight and !dayz_hasLight and !_isPZombie) then {
|
||||
s_player_removeflare = -1;
|
||||
};
|
||||
|
||||
if (s_player_showname < 0) then {
|
||||
s_player_showname = player addAction ["Display Name (Yes)", "\z\addons\dayz_code\actions\display_name.sqf",true, 5, true, false, "",""];
|
||||
s_player_showname1 = player addAction ["Display Name (No)", "\z\addons\dayz_code\actions\display_name.sqf",false, 5, true, false, "",""];
|
||||
};
|
||||
|
||||
if(_isPZombie) then {
|
||||
if (s_player_callzombies < 0) then {
|
||||
s_player_callzombies = player addAction ["Raise Horde", "\z\addons\dayz_code\actions\call_zombies.sqf",player, 5, true, false, "",""];
|
||||
|
||||
@@ -154,5 +154,73 @@ if(_humanity != dayz_lastHumanity) then {
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Opt-in tag system with friend tagging
|
||||
*/
|
||||
_targetControl = _display displayCtrl 1199;
|
||||
_string = "";
|
||||
_humanityTarget = cursorTarget;
|
||||
if (!isNull _humanityTarget and isPlayer _humanityTarget and alive _humanityTarget) then {
|
||||
|
||||
_distance = (player distance _humanityTarget);
|
||||
|
||||
if (_distance < DZE_HumanityTargetDistance) then {
|
||||
|
||||
_size = (1-(floor(_distance/5)*0.1)) max 0.1;
|
||||
|
||||
// Display name if player opt-in or if friend
|
||||
_friendlies = player getVariable ["friendlies", []];
|
||||
_charID = player getVariable ["CharacterID", "0"];
|
||||
|
||||
_rcharID = _humanityTarget getVariable ["CharacterID", "0"];
|
||||
_rfriendlies = _humanityTarget getVariable ["friendlies", []];
|
||||
_rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []];
|
||||
|
||||
if ((_rcharID in _friendlies) and (_charID in _rfriendlies)) then {
|
||||
|
||||
if (!(_charID in _rfriendlyTo)) then {
|
||||
|
||||
// diag_log format["IS FRIENDLY: %1", _player];
|
||||
_rfriendlyTo set [count _rfriendlyTo, _charID];
|
||||
_humanityTarget setVariable ["friendlyTo", _rfriendlyTo, true];
|
||||
titleText [format["You and %1 are now tagged as friendlies.", (name _humanityTarget)], "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
|
||||
// <br /><t %2 align='center' size='0.7'>Humanity: %3</t>
|
||||
|
||||
_color = "color='#339933'";
|
||||
_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
|
||||
|
||||
} else {
|
||||
|
||||
// Humanity checks
|
||||
_humanity = _humanityTarget getVariable ["humanity",0];
|
||||
|
||||
_color = "color='#ffffff'";
|
||||
if(_humanity < -5000) then {
|
||||
_color = "color='#ff0000'";
|
||||
} else {
|
||||
if(_humanity > 5000) then {
|
||||
_color = "color='#3333ff'";
|
||||
};
|
||||
};
|
||||
if(_humanityTarget getVariable ["DZE_display_name", false]) then {
|
||||
_string = format["<t %2 align='center' size='%3'>%1</t>",(name _humanityTarget),_color,_size];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// update gui if changed
|
||||
if (dayz_humanitytarget != _string) then {
|
||||
_targetControl ctrlSetStructuredText (parseText _string);
|
||||
dayz_humanitytarget = _string;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
_array = [_foodVal,_thirstVal];
|
||||
_array
|
||||
@@ -5,9 +5,13 @@ _vehicle = (vehicle player);
|
||||
|
||||
_targets = _unit getVariable ["targets",[]];
|
||||
|
||||
if (!dayz_zedsAttackVehicles and !(_vehicle in _targets)) exitWith {};
|
||||
if (!dayz_zedsAttackVehicles and !(_vehicle in _targets)) exitWith {
|
||||
//diag_log ("not attacking vehicle" + str(_vehicle));
|
||||
};
|
||||
|
||||
if ((speed _vehicle > 10)) exitWith {};
|
||||
if ((speed _vehicle > 10)) exitWith {
|
||||
//diag_log ("too fast abort attack" + str(_vehicle));
|
||||
};
|
||||
|
||||
//Do the attack
|
||||
if (r_player_unconscious && _vehicle == player && _type == "zombie") then {
|
||||
@@ -23,7 +27,14 @@ if (r_player_unconscious && _vehicle == player && _type == "zombie") then {
|
||||
};
|
||||
_dir = [_unit,player] call BIS_Fnc_dirTo;
|
||||
_unit setDir _dir;
|
||||
_unit playMove _move;
|
||||
|
||||
// _unit playMove _move;
|
||||
|
||||
if (local _unit) then {
|
||||
_unit switchMove _move;
|
||||
} else {
|
||||
[objNull, _unit, rSwitchMove, _move] call RE;
|
||||
};
|
||||
|
||||
//Wait
|
||||
sleep 0.3;
|
||||
|
||||
@@ -8,38 +8,46 @@ _attacked = false;
|
||||
_type = "zombie";
|
||||
|
||||
if (alive _x && _continue) then {
|
||||
|
||||
|
||||
|
||||
_dist = (_x distance _refObj);
|
||||
|
||||
_chance = 1;
|
||||
if ((_dist < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then {
|
||||
|
||||
|
||||
//diag_log ("within attack range: " + str(_x));
|
||||
|
||||
[_x,"attack",(_chance),true] call dayz_zombieSpeak;
|
||||
//perform an attack
|
||||
_last = _x getVariable["lastAttack",0];
|
||||
_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;
|
||||
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then
|
||||
{
|
||||
//diag_log ("perform attack: " + str(_x));
|
||||
[_x, _type] spawn player_zombieAttack;
|
||||
_x setVariable["lastAttack",time];
|
||||
};
|
||||
_attacked = true;
|
||||
} else {
|
||||
if (speed _x < 4) then {
|
||||
[_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
|
||||
//diag_log ("idle: " + str((_chance + 4)));
|
||||
} else {
|
||||
[_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
|
||||
//diag_log ("chase: " + str((_chance + 3)));
|
||||
};
|
||||
};
|
||||
//Noise Activation
|
||||
_targets = _x getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then {
|
||||
if (!(_refObj in _targets) and !isNull _refObj) then {
|
||||
if (_dist < DAYZ_disAudial) then {
|
||||
if (DAYZ_disAudial > 80) then {
|
||||
|
||||
_targets set [count _targets, (driver _refObj)];
|
||||
_x setVariable ["targets",_targets,true];
|
||||
//diag_log ("45: " + str(_targets));
|
||||
|
||||
} else {
|
||||
|
||||
@@ -48,12 +56,14 @@ _attacked = false;
|
||||
{
|
||||
_targets set [count _targets,(driver _refObj)];
|
||||
_x setVariable ["targets",_targets,true];
|
||||
//diag_log ("54: " + str(_targets));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_dist < (DAYZ_disAudial / 2)) then
|
||||
{
|
||||
_targets set [count _targets,(driver _refObj)];
|
||||
//diag_log ("61: " + str(_targets));
|
||||
_x setVariable ["targets",_targets,true];
|
||||
};
|
||||
};
|
||||
@@ -62,7 +72,7 @@ _attacked = false;
|
||||
};
|
||||
//Sight Activation
|
||||
_targets = _x getVariable ["targets",[]];
|
||||
if (!(_refObj in _targets)) then {
|
||||
if (!(_refObj in _targets) and !isNull _refObj) then {
|
||||
if (_dist < DAYZ_disVisual) then {
|
||||
|
||||
_tPos = (getPosASL _refObj);
|
||||
@@ -70,6 +80,7 @@ _attacked = false;
|
||||
//_eyeDir = _x call dayz_eyeDir;
|
||||
_eyeDir = direction _x;
|
||||
_inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
|
||||
//diag_log ("Angle Check: " + str(_inAngle));
|
||||
if (_inAngle) then {
|
||||
|
||||
//LOS check
|
||||
|
||||
Reference in New Issue
Block a user