mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 04:23:13 +03:00
0.81
This commit is contained in:
@@ -4,7 +4,7 @@ scriptName "Functions\misc\fn_damageHandler.sqf";
|
||||
- Function
|
||||
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
|
||||
************************************************************/
|
||||
private["_unit","_humanityHit","_myKills","_isBandit","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_inPain","_isDead","_isCardiac","_killerID","_evType","_recordable","_inVehicle","_isHeadHit","_isMinor","_scale","_canHitFree"];
|
||||
private["_unit","_humanityHit","_myKills","_isBandit","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_inPain","_isDead","_isCardiac","_killerID","_evType","_recordable","_isHeadHit","_isMinor","_scale","_canHitFree"];
|
||||
_unit = _this select 0;
|
||||
_hit = _this select 1;
|
||||
_damage = _this select 2;
|
||||
@@ -14,13 +14,12 @@ _ammo = _this select 4;
|
||||
_type = [_damage,_ammo] call fnc_usec_damageType;
|
||||
_isMinor = (_hit in USEC_MinorWounds);
|
||||
_isHeadHit = (_hit == "head_hit");
|
||||
_inVehicle = (vehicle _unit != _unit);
|
||||
_evType = "";
|
||||
_recordable = false;
|
||||
_isPlayer = (isPlayer _source);
|
||||
_humanityHit = 0;
|
||||
_myKills = 0;
|
||||
_sourceZombie = _source isKindOf "zZombie_base";
|
||||
_unitIsPlayer = _unit == player;
|
||||
|
||||
//Publish Damage
|
||||
//player sidechat format["Processed damage for %1",_unit];
|
||||
@@ -43,7 +42,7 @@ if (_isPlayer) then {
|
||||
};
|
||||
*/
|
||||
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
if (_hit == "") then {
|
||||
if ((_source != player) and _isPlayer) then {
|
||||
//Enable aggressor Actions
|
||||
@@ -81,7 +80,7 @@ if (_damage > 0.4) then {
|
||||
case 1: {_scale = _scale + 200};
|
||||
case 2: {_scale = _scale + 200};
|
||||
};
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
//Cause blood loss
|
||||
//Log Damage
|
||||
//diag_log ("DAMAGE: player hit by " + typeOf _source + " in " + _hit + " with " + _ammo + " for " + str(_damage) + " scaled " + str(_damage * _scale));
|
||||
@@ -106,13 +105,13 @@ if (_hit in USEC_MinorWounds) then {
|
||||
};
|
||||
|
||||
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
//incombat
|
||||
_unit setVariable["startcombattimer", 1, false];
|
||||
};
|
||||
|
||||
if (_damage > 0.1) then {
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
//shake the cam, frighten them!
|
||||
//player sidechat format["Processed bullet hit for %1 (should only be for me!)",_unit];
|
||||
1 call fnc_usec_bulletHit;
|
||||
@@ -127,7 +126,7 @@ if (_damage > 0.4) then { //0.25
|
||||
*/
|
||||
_wound = _hit call fnc_usec_damageGetWound;
|
||||
_isHit = _unit getVariable[_wound,false];
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
_rndPain = (random 10);
|
||||
_rndInfection = (random 500);
|
||||
_hitPain = (_rndPain < _damage);
|
||||
@@ -138,13 +137,13 @@ if (_damage > 0.4) then { //0.25
|
||||
//player sidechat format["HitPain: %1, HitInfection %2 (Damage: %3)",_rndPain,_rndInfection,_damage]; //r_player_infected
|
||||
if (_isHit) then {
|
||||
//Make hit worse
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
r_player_blood = r_player_blood - 50;
|
||||
};
|
||||
};
|
||||
if (_hitInfection) then {
|
||||
//Set Infection if not already
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
@@ -152,7 +151,7 @@ if (_damage > 0.4) then { //0.25
|
||||
};
|
||||
if (_hitPain) then {
|
||||
//Set Pain if not already
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
r_player_inpain = true;
|
||||
player setVariable["USEC_inPain",true,true];
|
||||
};
|
||||
@@ -172,7 +171,7 @@ if (_damage > 0.4) then { //0.25
|
||||
_isInjured = _unit getVariable["USEC_injured",false];
|
||||
if (!_isInjured) then {
|
||||
_unit setVariable["USEC_injured",true,true];
|
||||
if ((_unit == player) and (_ammo != "zombie")) then {
|
||||
if ((_unitIsPlayer) and (_ammo != "zombie")) then {
|
||||
dayz_sourceBleeding = _source;
|
||||
};
|
||||
};
|
||||
@@ -181,7 +180,7 @@ if (_damage > 0.4) then { //0.25
|
||||
if (!_lowBlood) then {
|
||||
_unit setVariable["USEC_lowBlood",true,true];
|
||||
};
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
r_player_injured = true;
|
||||
};
|
||||
};
|
||||
@@ -191,13 +190,13 @@ if (_type == 1) then {
|
||||
/*
|
||||
BALISTIC DAMAGE
|
||||
*/
|
||||
if ((_damage > 0.01) and (_unit == player)) then {
|
||||
if ((_damage > 0.01) and (_unitIsPlayer)) then {
|
||||
//affect the player
|
||||
[20,45] call fnc_usec_pitchWhine; //Visual , Sound
|
||||
};
|
||||
if (_damage > 4) then {
|
||||
//serious ballistic damage
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
_id = [_source,"explosion"] spawn player_death;
|
||||
};
|
||||
} else {
|
||||
@@ -216,7 +215,7 @@ if (_type == 2) then {
|
||||
*/
|
||||
if (_damage > 4) then {
|
||||
//serious ballistic damage
|
||||
if (_unit == player) then {
|
||||
if (_unitIsPlayer) then {
|
||||
_id = [_source,"shotheavy"] spawn player_death;
|
||||
};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user