mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-10 02:02:54 +03:00
1.7.5.M1D15 remove unused files
This commit is contained in:
@@ -1,140 +0,0 @@
|
||||
/***********************************************************
|
||||
most of the code is taken from fn_damageHandler.sqf
|
||||
PROCESS DAMAGE TO A BOT
|
||||
- Function
|
||||
- [unit, selectionName, damage, source, projectile] call disco_damageHandler;
|
||||
************************************************************/
|
||||
private["_unit","_hit","_damage","_unconscious","_source","_ammo","_type","_isMinor","_isHeadHit","_inVehicle","_isPlayer",
|
||||
"_humanityHit","_myKills","_characterID","_player_blood","_method"];
|
||||
_unit = _this select 0;
|
||||
_hit = _this select 1;
|
||||
_damage = _this select 2;
|
||||
_unconscious = _unit getVariable ["NORRN_unconscious", false];
|
||||
_source = _this select 3;
|
||||
_ammo = _this select 4;
|
||||
_type = [_damage,_ammo] call fnc_usec_damageType;
|
||||
_isMinor = (_hit in USEC_MinorWounds);
|
||||
_isHeadHit = (_hit == "head_hit");
|
||||
_inVehicle = (vehicle _unit != _unit);
|
||||
_isPlayer = (isPlayer _source);
|
||||
_humanityHit = 0;
|
||||
_myKills = 0;
|
||||
_characterID = _unit getVariable["CharacterID","0"];
|
||||
_player_blood = _unit getVariable["USEC_BloodQty",12000];
|
||||
_method = "";
|
||||
|
||||
private["_strH","_dam","_total","_totalDmg"];
|
||||
_strH = "hit_" + (_hit);
|
||||
_dam = _unit getVariable [_strH,0];
|
||||
if ( _dam > 1 ) then { _dam = 1 };
|
||||
// total damage for part
|
||||
_total = _dam + _damage;
|
||||
_unit setVariable [_strH,_total,true];
|
||||
|
||||
if (_characterID == "0") exitWith
|
||||
{
|
||||
diag_log "DEBUG: disco_damageHandler: CharacterID is 0";
|
||||
};
|
||||
|
||||
// calculate damage for all parts
|
||||
_totalDmg = 0;
|
||||
{
|
||||
_strH = "hit_" + _x;
|
||||
_dam = _unit getVariable[_strH,0];
|
||||
_totalDmg = _totalDmg + _dam;
|
||||
} forEach USEC_woundHit;
|
||||
|
||||
private["_scale"];
|
||||
//PVP Damage
|
||||
_scale = 200;
|
||||
if (_total > 0.4) then {
|
||||
// maybe need to tune _scale value, 850 as in original
|
||||
_scale = _scale + 850;
|
||||
if (_isHeadHit) then {
|
||||
_scale = _scale + 500;
|
||||
};
|
||||
// seems need different scale for type 1,2
|
||||
switch (_type) do {
|
||||
case 1: {_scale = _scale + 200};
|
||||
case 2: {_scale = _scale + 200};
|
||||
};
|
||||
//Cause blood loss
|
||||
_player_blood = _player_blood - (_total * _scale);
|
||||
};
|
||||
|
||||
//Record Damage to Minor parts (legs, arms)
|
||||
if ( (_hit == "legs") && (_total == 1) ) then { _unit setVariable ["hit_legs",1,true]; };
|
||||
if ( (_hit == "hands") && (_total == 1) ) then { _unit setVariable ["hit_hands",1,true]; };
|
||||
|
||||
private["_wound","_isHit","_rndPain","_isInjured","_rndInfection","_rndPain","_hitPain","_inPain","_hitInfection"];
|
||||
// common damage first
|
||||
if (_totalDmg > 4) then {
|
||||
if ( _type == 0 ) then {
|
||||
// TODO: add appropriate _method and message when study
|
||||
_method = "unknown";
|
||||
};
|
||||
if ( _type == 1 ) then {
|
||||
//TODO: add message when study
|
||||
_method = "explosion";
|
||||
};
|
||||
if ( _type == 2 ) then {
|
||||
//serious ballistic damage
|
||||
_method = "shotheavy";
|
||||
};
|
||||
};
|
||||
if ((_total > 1) and _isHeadHit) then {
|
||||
// head hit
|
||||
_method = "shothead";
|
||||
};
|
||||
if ( _player_blood < 50 ) then {
|
||||
// blood loss
|
||||
_method = "bleed";
|
||||
};
|
||||
if ( _method !="" ) then {
|
||||
// process death
|
||||
[_unit,_source,_method] spawn disco_playerDeath;
|
||||
} else {
|
||||
// still alive?
|
||||
if (_total > 0.4) then { //0.25
|
||||
/* BLEEDING */
|
||||
_wound = _hit call fnc_usec_damageGetWound;
|
||||
_isHit = _unit getVariable[_wound,false];
|
||||
// diag_log format["DEBUG: wound:%1 [%2]",_wound,_isHit];
|
||||
_rndPain = (random 10);
|
||||
_rndInfection = (random 1000);
|
||||
_hitPain = (_rndPain < _total);
|
||||
if (_isHeadHit or _hitPain) then {
|
||||
_hitPain = true;
|
||||
};
|
||||
_hitInfection = (_rndInfection < 1);
|
||||
if (_isHit) then {
|
||||
//Make hit worse
|
||||
_player_blood = _player_blood - 50;
|
||||
};
|
||||
if (_hitInfection) then {
|
||||
//Set Infection if not already
|
||||
_unit setVariable["USEC_infected",true,true];
|
||||
|
||||
};
|
||||
if (_hitPain) then {
|
||||
//Set Pain if not already
|
||||
_unit setVariable["USEC_inPain",true,true];
|
||||
};
|
||||
};
|
||||
private["_isInjured"];
|
||||
if(!_isHit) then {
|
||||
//Create Wound
|
||||
// diag_log format["DEBUG: spawn bleed %1",_wound];
|
||||
_unit setVariable[_wound,true,true];
|
||||
[_unit,_wound,_hit] spawn fnc_usec_damageBleed;
|
||||
usecBleed = [_unit,_wound,_hit];
|
||||
publicVariable "usecBleed";
|
||||
//Set Injured if not already
|
||||
_isInjured = _unit getVariable["USEC_injured",false];
|
||||
if (!_isInjured) then {
|
||||
_unit setVariable["USEC_injured",true,true];
|
||||
};
|
||||
};
|
||||
|
||||
_unit setVariable["USEC_BloodQty",_player_blood,true];
|
||||
};
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
[_object,_source,_method] spawn disco_playerDeath;
|
||||
*/
|
||||
private["_object","_source","_method","_key","_playerID","_characterID","_playerName","_isDead"];
|
||||
_object = _this select 0;
|
||||
_source = _this select 1;
|
||||
_method = _this select 2;
|
||||
_playerID = _object getVariable["playerID","0"]; //playerUID
|
||||
_characterID = _object getVariable["characterID","0"]; //characterID
|
||||
_playerName = _object getVariable["bodyName","unknown"];
|
||||
_isDead = _object getVariable["USEC_isDead",false];
|
||||
_humanity = 0;
|
||||
_wait = 0;
|
||||
|
||||
_object removeAllEventHandlers "HandleDamage";
|
||||
|
||||
if (!_isDead) then {
|
||||
_id = [_characterID,0,_object,_playerID,_playerName,_source,_method] spawn server_playerDied;
|
||||
_object setDamage 1;
|
||||
_object setVariable["USEC_isDead",true,true];
|
||||
dayzFlies = _object;
|
||||
publicVariable "dayzFlies";
|
||||
_id = [_object,50,true,getPosATL _object] spawn player_alertZombies;
|
||||
|
||||
private["_canHitFree","_isBandit","_myKills","_humanity","_killsH","_wait","_killsB"];
|
||||
if (!isNull _source) then {
|
||||
if (_source != _object) then {
|
||||
_canHitFree = _object getVariable ["freeTarget",false];
|
||||
_isBandit = (typeOf _object) == "Bandit1_DZ";
|
||||
_myKills = ((_object getVariable ["humanKills",0]) / 30) * 1000;
|
||||
if (!_canHitFree and !_isBandit) then {
|
||||
//Process Morality Hit
|
||||
_humanity = -(2000 - _myKills);
|
||||
_killsH = _source getVariable ["humanKills",0];
|
||||
_source setVariable ["humanKills",(_killsH + 1),true];
|
||||
_wait = 300;
|
||||
} else {
|
||||
//Process Morality Hit
|
||||
//_humanity = _myKills * 100;
|
||||
_killsB = _source getVariable ["banditKills",0];
|
||||
_source setVariable ["banditKills",(_killsB + 1),true];
|
||||
_wait = 0;
|
||||
};
|
||||
if (_humanity < 0) then {
|
||||
_wait = 0;
|
||||
};
|
||||
if (!_canHitFree and !_isBandit) then {
|
||||
dayzHumanity = [_source,_humanity,_wait];
|
||||
publicVariable "dayzHumanity";
|
||||
};
|
||||
};
|
||||
};
|
||||
_object setVariable ["deathType",_method,true];
|
||||
};
|
||||
@@ -1,218 +0,0 @@
|
||||
/*
|
||||
[_object,_playerID,_characterID,_penalty] spawn disco_playerMorph;
|
||||
*/
|
||||
private["_object","_playerID","_characterID","_playerName","_model","_position","_dir","_currentAnim","_penalty"];
|
||||
_object = _this select 0;
|
||||
// TODO: check
|
||||
_playerID = _this select 1; //playerUID
|
||||
_characterID = _this select 2; //characterID
|
||||
|
||||
_penalty = _this select 3;
|
||||
_playerName = _object getVariable["bodyName","unknown"]; //name _object;
|
||||
_model = typeOf _object;
|
||||
_position = getPosATL _object;
|
||||
_dir = getDir _object;
|
||||
_currentAnim = animationState _object;
|
||||
|
||||
_object removeAllEventHandlers "FiredNear";
|
||||
_object removeAllEventHandlers "HandleDamage";
|
||||
_object removeAllEventHandlers "Killed";
|
||||
_object removeAllEventHandlers "Fired";
|
||||
|
||||
private["_updates","_humanity","_legs","_arms","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_banditKills","_temp"];
|
||||
// TODO: check
|
||||
_updates = _object getVariable["updatePlayer",[false,false,false,false,false]];
|
||||
_updates set [0,true];
|
||||
_object setVariable["updatePlayer",_updates,true];
|
||||
|
||||
_humanity = _object getVariable["humanity",0];
|
||||
_temp = round(_object getVariable ["temperature",100]);
|
||||
_worldspace = [round(_dir),_position];
|
||||
_zombieKills = _object getVariable ["zombieKills",0];
|
||||
_headShots = _object getVariable ["headShots",0];
|
||||
_humanKills = _object getVariable ["humanKills",0];
|
||||
_banditKills = _object getVariable ["banditKills",0];
|
||||
_medical = _object call player_sumMedical;
|
||||
_messing = _object getVariable ["messing",[0,0]];
|
||||
|
||||
//BackUp Weapons and Mags
|
||||
private ["_weapons","_magazines","_primweapon","_secweapon"];
|
||||
_weapons = weapons _object;
|
||||
_magazines = magazines _object;
|
||||
_primweapon = primaryWeapon _object;
|
||||
_secweapon = secondaryWeapon _object;
|
||||
|
||||
//Checks
|
||||
if(!(_primweapon in _weapons) && _primweapon != "") then {
|
||||
_weapons = _weapons + [_primweapon];
|
||||
};
|
||||
|
||||
if(!(_secweapon in _weapons) && _secweapon != "") then {
|
||||
_weapons = _weapons + [_secweapon];
|
||||
};
|
||||
|
||||
if(count _magazines == 0) then {
|
||||
_magazines = magazines _object;
|
||||
};
|
||||
|
||||
//BackUp Backpack
|
||||
private ["_newBackpackType","_backpackWpn","_backpackMag"];
|
||||
_newBackpackType = typeOf (unitBackpack _object);
|
||||
if(_newBackpackType != "") then {
|
||||
_backpackWpn = getWeaponCargo unitBackpack _object;
|
||||
_backpackMag = getMagazineCargo unitBackpack _object;
|
||||
};
|
||||
|
||||
//Get Muzzle
|
||||
private ["_currentWpn","_muzzles"];
|
||||
_currentWpn = "";
|
||||
_muzzles = getArray(configFile >> "cfgWeapons" >> _currentWpn >> "muzzles");
|
||||
if (count _muzzles > 1) then {
|
||||
_currentWpn = currentMuzzle _object;
|
||||
};
|
||||
|
||||
private ["_primary"];
|
||||
_doLoop = 0;
|
||||
while {_doLoop < 5} do {
|
||||
_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
|
||||
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
|
||||
if (count _primary > 0) then {
|
||||
if ((_primary select 0) != "ERROR") then {
|
||||
_doLoop = 9;
|
||||
};
|
||||
};
|
||||
_doLoop = _doLoop + 1;
|
||||
};
|
||||
private ["_group","_newUnit"];
|
||||
// get ammo from DB
|
||||
_magazines = (_primary select 4) select 1;
|
||||
|
||||
//Create New Character
|
||||
_group = createGroup civilian;
|
||||
_newUnit = _group createUnit [_model,[0,0,0],[],0,"NONE"];
|
||||
sleep 0.1;
|
||||
|
||||
//Clear New Character
|
||||
{_newUnit removeMagazine _x;} forEach (magazines _newUnit);
|
||||
removeAllWeapons _newUnit;
|
||||
|
||||
//Equip New Charactar
|
||||
{ _newUnit addMagazine _x } forEach _magazines;
|
||||
{ _newUnit addWeapon _x } forEach _weapons;
|
||||
if(_primweapon != (primaryWeapon _newUnit)) then { _newUnit addWeapon _primweapon };
|
||||
if(_secweapon != (secondaryWeapon _newUnit) && _secweapon != "") then { _newUnit addWeapon _secweapon };
|
||||
|
||||
//Add and Fill BackPack
|
||||
private["_newBackpack","_countr","_backpackmagTypes","_backpackmagQtys"];
|
||||
if (!isNil "_newBackpackType") then {
|
||||
if (_newBackpackType != "") then {
|
||||
_newUnit addBackpack _newBackpackType;
|
||||
_newBackpack = unitBackpack _newUnit;
|
||||
//Fill backpack contents
|
||||
//Weapons
|
||||
_backpackWpnTypes = [];
|
||||
_backpackWpnQtys = [];
|
||||
if (count _backpackWpn > 0) then {
|
||||
_backpackWpnTypes = _backpackWpn select 0;
|
||||
_backpackWpnQtys = _backpackWpn select 1;
|
||||
};
|
||||
_countr = 0;
|
||||
{
|
||||
_newBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
|
||||
_countr = _countr + 1;
|
||||
} forEach _backpackWpnTypes;
|
||||
//magazines
|
||||
_backpackmagTypes = [];
|
||||
_backpackmagQtys = [];
|
||||
if (count _backpackmag > 0) then {
|
||||
_backpackmagTypes = _backpackMag select 0;
|
||||
_backpackmagQtys = _backpackMag select 1;
|
||||
};
|
||||
_countr = 0;
|
||||
{
|
||||
_newBackpack addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)];
|
||||
_countr = _countr + 1;
|
||||
} forEach _backpackmagTypes;
|
||||
};
|
||||
};
|
||||
//set medical values
|
||||
private["_fractures"];
|
||||
if (count _medical > 0) then {
|
||||
_newUnit setVariable["USEC_isDead",(_medical select 0),true];
|
||||
_newUnit setVariable["NORRN_unconscious", (_medical select 1), true];
|
||||
_newUnit setVariable["USEC_infected",(_medical select 2),true];
|
||||
_newUnit setVariable["USEC_injured",(_medical select 3),true];
|
||||
_newUnit setVariable["USEC_inPain",(_medical select 4),true];
|
||||
_newUnit setVariable["USEC_isCardiac",(_medical select 5),true];
|
||||
_newUnit setVariable["USEC_lowBlood",(_medical select 6),true];
|
||||
_newUnit setVariable["USEC_BloodQty",(_medical select 7),true];
|
||||
_newUnit setVariable["unconsciousTime",(_medical select 10),true];
|
||||
//Add Wounds
|
||||
{
|
||||
_newUnit setVariable[_x,true,true];
|
||||
[_newUnit,_x,0] spawn fnc_usec_damageBleed;
|
||||
usecBleed = [_newUnit,_x,0];
|
||||
publicVariable "usecBleed";
|
||||
} forEach (_medical select 8);
|
||||
//Add fractures
|
||||
_fractures = (_medical select 9);
|
||||
_newUnit setVariable ["hit_legs",(_fractures select 0),true];
|
||||
_newUnit setVariable ["hit_hands",(_fractures select 1),true];
|
||||
} else {
|
||||
//Reset Fractures
|
||||
_newUnit setVariable ["hit_legs",0,true];
|
||||
_newUnit setVariable ["hit_hands",0,true];
|
||||
_newUnit setVariable ["USEC_injured",false,true];
|
||||
_newUnit setVariable ["USEC_inPain",false,true];
|
||||
};
|
||||
//General Stats
|
||||
_newUnit setVariable["characterID",_characterID,true];
|
||||
_newUnit setVariable["worldspace",_worldspace,true];
|
||||
_newUnit setVariable["bodyName",_playerName,true];
|
||||
//_newUnit setVariable["playerID",_playerID,true];
|
||||
_newUnit setVariable["temperature",_temp,true];
|
||||
_newUnit setVariable["messing",_messing,true];
|
||||
|
||||
//Move to position
|
||||
_newUnit allowDamage true;
|
||||
deleteVehicle _object;
|
||||
deleteGroup (group _object);
|
||||
_newUnit setDir _dir;
|
||||
_newUnit setPosATL _position;
|
||||
_newUnit playActionNow "Die";
|
||||
_newUnit disableConversation true;
|
||||
_newUnit setCaptive false;
|
||||
// _newUnit disableAi "ANIM";
|
||||
|
||||
// äëÿ ÷åãî ýòî äåëàåòñÿ?
|
||||
//_newUnit addWeapon "Loot";
|
||||
//_newUnit addWeapon "Flare";
|
||||
botPlayers = botPlayers + [_playerID];
|
||||
private["_mydamage_eh1"];
|
||||
_mydamage_eh1 = _newUnit addeventhandler ["HandleDamage",{ _this call disco_damageHandler;0 }];
|
||||
|
||||
diag_log format["DEBUG: Player %1 [%2] added to botPlayers: %3",_playerName,_playerID,botPlayers];
|
||||
|
||||
private["_doLoop","_isDead"];
|
||||
_isDead = _newUnit getVariable["USEC_isDead",false];
|
||||
_doLoop = 0;
|
||||
while { _doLoop < _penalty && !_isDead } do {
|
||||
_isDead = _newUnit getVariable["USEC_isDead",false];
|
||||
_doLoop = _doLoop + 1;
|
||||
sleep 1;
|
||||
};
|
||||
_newUnit removeAllEventHandlers "handleDamage";
|
||||
|
||||
if (!_isDead) then {
|
||||
private["_playerBackp"];
|
||||
_medical = _newUnit call player_sumMedical;
|
||||
_newBackpack = unitBackpack _newUnit;
|
||||
_playerBackp = [typeOf _newBackpack,getWeaponCargo _newBackpack,getMagazineCargo _newBackpack];
|
||||
// _group = group _newUnit;
|
||||
deleteVehicle _newUnit;
|
||||
deleteGroup _group;
|
||||
//Send to HIVE backpack and medical only
|
||||
[_characterID,_worldspace,[],_playerBackp,_medical,[],""] call server_characterSync;
|
||||
};
|
||||
botPlayers = botPlayers - [_playerID];
|
||||
diag_log format["DEBUG: Player %1 [%2] removed from botPlayers: %3",_playerName,_playerID,botPlayers];
|
||||
@@ -1,33 +0,0 @@
|
||||
private["_type","_mUID","_deposit","_key","_result","_outcome","_balance","_uid"];
|
||||
//[UID,_deposit,]
|
||||
_mUID = _this select 0;
|
||||
_deposit = _this select 1;
|
||||
_type = _this select 2;
|
||||
_player = _this select 3;
|
||||
|
||||
|
||||
//GET DB ID
|
||||
_key = format["CHILD:111:%1:%2:%3:",_mUID,_deposit,_type];
|
||||
|
||||
diag_log ("HIVE: WRITE: "+ str(_key));
|
||||
|
||||
_result = [_key] call server_hiveReadWrite;
|
||||
|
||||
_outcome = _result select 0;
|
||||
|
||||
if (_outcome == "PASS") then {
|
||||
|
||||
_msg = _result select 1;
|
||||
_balance = _result select 2;
|
||||
|
||||
diag_log("BANK: Action msg:" + str(_msg) + " Balance:" + str(_player));
|
||||
|
||||
_clientID = owner _player;
|
||||
|
||||
dayzBankBalance = _balance;
|
||||
_clientID publicVariableClient "dayzBankBalance";
|
||||
|
||||
diag_log ("PUBLISH BANK: Deposit " + str(_clientID) + " with " + str(_deposit));
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user