mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Update compiles - 2 more files to do
fn_selfActions.sqf player_updateGui.sqf
This commit is contained in:
@@ -1,93 +1,116 @@
|
||||
private ["_unit","_ammo","_audible","_distance","_listTalk","_weapon","_group","_targets","_i","_projectile","_id","_caliber"];
|
||||
private ["_projectile","_unit","_ammo"];
|
||||
|
||||
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_ammo = _this select 4;
|
||||
_projectile = _this select 6;
|
||||
_unit = _this select 0;
|
||||
//_weapon = _this select 1;
|
||||
_ammo = _this select 4;
|
||||
_projectile = _this select 6;
|
||||
|
||||
//Alert Nearby
|
||||
_audible = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire");
|
||||
_caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber");
|
||||
_distance = round(_audible * 20 * _caliber);
|
||||
_distance = round(_audible * 10 * _caliber);
|
||||
|
||||
dayz_disAudial = _distance;
|
||||
dayz_firedCooldown = time;
|
||||
// Color in the combat icon
|
||||
dayz_combat = 1;
|
||||
|
||||
if (_ammo isKindOf "Melee") exitWith {
|
||||
|
||||
if(!(_ammo isKindOf "Chainsaw_Swing_Ammo")) then {
|
||||
_unit playActionNow "GestureSwing";
|
||||
[1,1] call dayz_HungerThirst;
|
||||
["Working",0,[0,1,1,0]] call dayz_NutritionSystem;
|
||||
};
|
||||
|
||||
// harvest wood check
|
||||
_this call player_harvest;
|
||||
// Added Nutrition-Factor for work
|
||||
//[Type,Blood[Calories,Hunger,Thrist,Temp]
|
||||
//["Working",0,[0,1,1,0]] call dayz_NutritionSystem;
|
||||
//_unit playActionNow "GestureSwing";
|
||||
};
|
||||
|
||||
//Smoke Grenade
|
||||
if (_ammo isKindOf "SmokeShell") then {
|
||||
//Alert Zed's to smoke
|
||||
_i = 0;
|
||||
_projectile = nearestObject [_unit, _ammo];
|
||||
_listTalk = (getPosATL _projectile) nearEntities ["zZombie_Base",50];
|
||||
{
|
||||
_group = group _x;
|
||||
if (isNull group _x) then {
|
||||
_group = _x;
|
||||
if ((_ammo isKindOf "SmokeShell") or (_ammo isKindOf "GrenadeHandTimedWest") or (_ammo isKindOf "G_40mm_HE")) then {
|
||||
if (_ammo isKindOf "G_40mm_HE") then { dayz_disAudial = 30 };
|
||||
|
||||
[_unit,_ammo] spawn {
|
||||
private ["_pos","_group","_localtargets","_remotetargets"];
|
||||
_unit = _this select 0;
|
||||
_ammo = _this select 1;
|
||||
|
||||
_projectile = nearestObject [_unit, _ammo];
|
||||
_pos = getPosATL _projectile;
|
||||
|
||||
if (_ammo isKindOf "SmokeShell") then {
|
||||
while { ((getPosATL _projectile) select 2) >= 1 } do {
|
||||
_pos = getPosATL _projectile;
|
||||
sleep 0.01;
|
||||
};
|
||||
|
||||
_listTalk = _pos nearEntities ["zZombie_Base",50];
|
||||
|
||||
{
|
||||
_group = group _x;
|
||||
if (isNull group _x) then {
|
||||
_group = _x;
|
||||
};
|
||||
_isLocal = (local _x);
|
||||
_x reveal [_projectile,4];
|
||||
_localtargets = _group getVariable ["localtargets",[]];
|
||||
_remotetargets = _group getVariable ["remotetargets",[]];
|
||||
_targets = _localtargets + _remotetargets;
|
||||
if (!(_projectile in _targets)) then {
|
||||
switch (_isLocal) do {
|
||||
case false: {
|
||||
_remotetargets set [count _remotetargets,_projectile];
|
||||
_x setVariable ["remotetargets",_remotetargets,true];
|
||||
};
|
||||
case true: {
|
||||
_localtargets set [count _localtargets,_projectile];
|
||||
_x setVariable ["localtargets",_localtargets,false];
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach _listTalk;
|
||||
|
||||
} else {
|
||||
while { alive _projectile } do {
|
||||
_pos = getPosATL _projectile;
|
||||
sleep 0.01;
|
||||
};
|
||||
|
||||
_listTalk = _pos nearEntities ["zZombie_Base",50];
|
||||
|
||||
{
|
||||
_x setVariable ["myDest",_pos]; // removed networked var. targets should be enough
|
||||
} forEach _listTalk;
|
||||
};
|
||||
_x reveal [_projectile,4];
|
||||
_targets = _group getVariable ["targets",[]];
|
||||
if (!(_projectile in _targets)) then {
|
||||
_targets set [count _targets,_projectile];
|
||||
_group setVariable ["targets",_targets,true];
|
||||
};
|
||||
_i = _i + 1;
|
||||
} count _listTalk;
|
||||
};
|
||||
} else {
|
||||
[_unit,_distance,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
[_unit,_distance,true,(getPosATL player)] call player_alertZombies;
|
||||
|
||||
//Check if need to place arrow
|
||||
if (_ammo isKindOf "Bolt") then {
|
||||
_id = _this spawn player_crossbowBolt;
|
||||
[_this] spawn player_crossbowBolt;
|
||||
};
|
||||
if (_ammo isKindOf "GrenadeHand") then {
|
||||
|
||||
|
||||
if (_ammo isKindOf "ThrownObjects") then {
|
||||
_id = _this spawn player_throwObject;
|
||||
[_this] spawn player_throwObject;
|
||||
};
|
||||
if (_ammo isKindOf "RoadFlare") then {
|
||||
//hint str(_ammo);
|
||||
_projectile = nearestObject [_unit, "RoadFlare"];
|
||||
_id = [_projectile,0] spawn object_roadFlare;
|
||||
|
||||
/* PVS/PVC - Skaronator */
|
||||
_pos = getPosATL player;
|
||||
_inRange = _pos nearEntities ["CAManBase",1250];
|
||||
{
|
||||
if(isPlayer _x && _x != player) then {
|
||||
PVDZE_send = [_x,"RoadFlare",[_projectile,0]];
|
||||
publicVariableServer "PVDZE_send";
|
||||
};
|
||||
} count _inRange;
|
||||
|
||||
_id = _this spawn player_throwObject;
|
||||
[_projectile,0] spawn object_roadFlare;
|
||||
PVDZ_obj_RoadFlare = [_projectile,0];
|
||||
publicVariable "PVDZ_obj_RoadFlare";
|
||||
[_this] spawn player_throwObject;
|
||||
};
|
||||
if (_ammo isKindOf "ChemLight") then {
|
||||
_projectile = nearestObject [_unit, "ChemLight"];
|
||||
_id = [_projectile,1] spawn object_roadFlare;
|
||||
|
||||
/* PVS/PVC - Skaronator */
|
||||
_pos = getPosATL player;
|
||||
_inRange = _pos nearEntities ["CAManBase",1250];
|
||||
{
|
||||
if(isPlayer _x && _x != player) then {
|
||||
PVDZE_send = [_x,"RoadFlare",[_projectile,1]];
|
||||
publicVariableServer "PVDZE_send";
|
||||
}
|
||||
} count _inRange;
|
||||
|
||||
_id = _this spawn player_throwObject;
|
||||
[_projectile,1] spawn object_roadFlare;
|
||||
PVDZ_obj_RoadFlare = [_projectile,1];
|
||||
publicVariable "PVDZ_obj_RoadFlare";
|
||||
[_this] spawn player_throwObject;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user