mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 20:13:13 +03:00
Humanity fix for shooting player zeds and bandits
Prevents loss of humanity from shooting player zombies and bandits. Adds a cap to humanity loss per shot depending on the players murders, where the cap is zero. This preventing the shooter from getting positive humanity, which could be exploited to farm humanity using 2 players.
This commit is contained in:
@@ -5,7 +5,7 @@ scriptName "Functions\misc\fn_damageHandler.sqf";
|
|||||||
- Function
|
- Function
|
||||||
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
|
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
|
||||||
************************************************************/
|
************************************************************/
|
||||||
private ["_unit","_humanityHit","_myKills","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_isCardiac","_isHeadHit","_isMinor","_scale","_canHitFree","_rndPain","_rndInfection","_hitInfection","_lowBlood","_isPZombie","_source","_ammo","_unitIsPlayer"];
|
private ["_unit","_humanityHit","_myKills","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_isCardiac","_isHeadHit","_isMinor","_scale","_canHitFree","_rndPain","_rndInfection","_hitInfection","_lowBlood","_isPZombie","_source","_ammo","_unitIsPlayer","_isBandit"];
|
||||||
_unit = _this select 0;
|
_unit = _this select 0;
|
||||||
_hit = _this select 1;
|
_hit = _this select 1;
|
||||||
_damage = _this select 2;
|
_damage = _this select 2;
|
||||||
@@ -59,18 +59,23 @@ if (_unitIsPlayer) then {
|
|||||||
_source setVariable["startcombattimer",1];
|
_source setVariable["startcombattimer",1];
|
||||||
};
|
};
|
||||||
_canHitFree = player getVariable ["freeTarget",false];
|
_canHitFree = player getVariable ["freeTarget",false];
|
||||||
|
_isBandit = (player getVariable["humanity",0]) <= -5000;
|
||||||
|
_isPZombie = player isKindOf "PZombie_VB";
|
||||||
|
|
||||||
if (!_canHitFree) then {
|
if (!_canHitFree and !_isBandit and !_isPZombie) then {
|
||||||
_myKills = 200 - (((player getVariable ["humanKills",0]) / 30) * 100);
|
|
||||||
//Process Morality Hit
|
//Process Morality Hit
|
||||||
_humanityHit = -(_myKills * _damage);
|
_myKills = 0 max (1 - (player getVariable ["humanKills",0]) / 5);
|
||||||
|
_humanityHit = -100 * _myKills * _damage;
|
||||||
|
|
||||||
//["PVDZE_plr_HumanityChange",[_source,_humanityHit,30]] call broadcastRpcCallAll;
|
//["PVDZE_plr_HumanityChange",[_source,_humanityHit,30]] call broadcastRpcCallAll;
|
||||||
|
if (_humanityHit != 0) then {
|
||||||
PVDZE_plr_HumanityChange = [_source,_humanityHit,30];
|
PVDZE_plr_HumanityChange = [_source,_humanityHit,30];
|
||||||
publicVariable "PVDZE_plr_HumanityChange";
|
publicVariable "PVDZE_plr_HumanityChange";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
//PVP Damage
|
//PVP Damage
|
||||||
_scale = 200;
|
_scale = 200;
|
||||||
|
|||||||
Reference in New Issue
Block a user