Update zombie alerting

- zombie will be triggered by chemlights only at night now
This commit is contained in:
A Man
2020-04-27 18:33:37 +02:00
parent 843a238cd7
commit 93ba732e84
4 changed files with 50 additions and 95 deletions

View File

@@ -1,4 +1,4 @@
private ["_unit","_distance","_doRun","_pos","_listTalk","_zombie"];
private ["_unit","_distance","_doRun","_pos","_listTalk","_zombie","_50","_localtargets","_remotetargets","_targets","_dis"];
_unit = _this select 0;
_distance = _this select 1;
@@ -6,43 +6,32 @@ _doRun = _this select 2;
_pos = _this select 3;
_listTalk = _pos nearEntities ["zZombie_Base",_distance];
_inVehicle = (vehicle _unit != _unit);
_isAir = vehicle player iskindof "Air";
_isLand = vehicle player iskindof "Land";
_isSea = vehicle player iskindof "Sea";
_speed = speed (vehicle _unit);
{
private["_localtargets","_remotetargets","_targets","_dis"];
_distance = _distance max floor(_distance*.9);
_dis = _x distance _unit;
_zombie = _x;
switch (true) do {
case (_dis < 51): {
call {
if (_dis < 51) exitwith {
if (_doRun) then {
_localtargets = _x getVariable ["localtargets",[]];
_remotetargets = _x getVariable ["remotetargets",[]];
_targets = _localtargets + _remotetargets;
if (!(_unit in _targets)) then {
switch (local _x) do {
case false: {
_remotetargets set [count _remotetargets,_unit];
_x setVariable ["remotetargets",_remotetargets,true];
};
case true: {
_localtargets set [count _localtargets,_unit];
_x setVariable ["localtargets",_localtargets,false];
};
if !(local _x) then {
_remotetargets set [count _remotetargets,_unit];
_x setVariable ["remotetargets",_remotetargets,true];
} else {
_localtargets set [count _localtargets,_unit];
_x setVariable ["localtargets",_localtargets,false];
};
};
} else {
_zombie setVariable ["myDest",_pos,true];
};
};
case ((_dis > 50) and (_dis <= 71)): {
if ((_dis > 50) && {_dis <= 71}) exitwith {
_50 = round(random 100);
if (_50 < 50) then {
if (_doRun) then {
@@ -50,15 +39,12 @@ private["_localtargets","_remotetargets","_targets","_dis"];
_remotetargets = _x getVariable ["remotetargets",[]];
_targets = _localtargets + _remotetargets;
if (!(_unit in _targets)) then {
switch (local _x) do {
case false: {
_remotetargets set [count _remotetargets,_unit];
_x setVariable ["remotetargets",_remotetargets,true];
};
case true: {
_localtargets set [count _localtargets,_unit];
_x setVariable ["localtargets",_localtargets,false];
};
if !(local _x) then {
_remotetargets set [count _remotetargets,_unit];
_x setVariable ["remotetargets",_remotetargets,true];
} else {
_localtargets set [count _localtargets,_unit];
_x setVariable ["localtargets",_localtargets,false];
};
};
} else {
@@ -68,31 +54,8 @@ private["_localtargets","_remotetargets","_targets","_dis"];
_zombie setVariable ["myDest",_pos,true];
};
};
case (_dis > 70): {
if (_dis > 70) exitwith {
_zombie setVariable ["myDest",_pos,true];
};
};
/*
_zombie = _x;
if (_doRun) then {
_localtargets = _x getVariable ["localtargets",[]];
_remotetargets = _x getVariable ["remotetargets",[]];
_targets = _localtargets + _remotetargets;
if (!(_unit in _targets)) then {
switch (local _x) do {
case false: {
_remotetargets set [count _remotetargets,_unit];
_x setVariable ["remotetargets",_remotetargets,true];
};
case true: {
_localtargets set [count _localtargets,_unit];
_x setVariable ["localtargets",_localtargets,false];
};
};
};
} else {
_zombie setVariable ["myDest",_pos,true];
};
*/
} forEach _listTalk;
} count _listTalk;