Update Humanity System

This updates the humanity system. It removes the OpenTarget from Dayz Mod which is not needed for Epoch and more confusing as it helps to understand why a player gets a humanity drop or not.

The new system gives players always humanity.

Survivor killed Survivor = Negative Humanity
Survivor killed Bandit = Positive Humanity
Survivor killed Hero = Negative Humanity

Hero killed Bandit = Positive Humanity
Hero killed Hero = Negative Humanity
Hero killed Survivor = Negative Humanity

Bandit killed Bandit = Negative Humanity
Bandit killed Hero = Negative Humanity
Bandit killed Survivor = Negative Humanity

The values are strict and have no longer a complicated calculation based on a kill counter.

This change needs more testing in the beta state of this update.
This commit is contained in:
A Man
2020-04-03 12:23:53 +02:00
parent b94d107a49
commit f68bbda0a3
8 changed files with 97 additions and 145 deletions

View File

@@ -1,4 +1,4 @@
private["_body","_name","_method","_methodStr","_message","_killingBlow"]; private["_body","_name","_method","_methodStr","_message","_killingBlow","_ConfirmedHumanKills","_ConfirmedBanditKills"];
_body = _this select 3; _body = _this select 3;
_name = _body getVariable["bodyName","unknown"]; _name = _body getVariable["bodyName","unknown"];
@@ -8,28 +8,28 @@ _killingBlow = _body getVariable ["KillingBlow",[objNull,false]];
/* /*
Setup by player_death Setup by player_death
[Object,Punished]; [Object,Punished];
_killer = _killingBlow select 0; //Killer _killer = _killingBlow select 0; //Killer
_Punished = _killingBlow select 1; //False = HumanKill, True = BanditKill _Punished = _killingBlow select 1; //False = HumanKill, True = BanditKill
*/ */
// "His/Her name was %1, it appears he/she died from %2" // "His/Her name was %1, it appears he/she died from %2"
_message = if (_body isKindOf "SurvivorW2_DZ") then {"str_player_studybody_female"} else {"str_player_studybody"}; _message = ["str_player_studybody","str_player_studybody_female"] select (_body isKindOf "SurvivorW2_DZ");
format[localize _message,_name,_methodStr] call dayz_rollingMessages; format[localize _message,_name,_methodStr] call dayz_rollingMessages;
//Body hasnt already been Studied lets set the confimed Kills system. //Body hasnt already been Studied lets set the confimed Kills system.
if !(_body getVariable ["BodyStudied",false]) then { if !(_body getVariable ["BodyStudied",false]) then {
if (!isNull (_killingBlow select 0)) then { if (!isNull (_killingBlow select 0)) then {
if (!(_killingBlow select 1)) then { if (_killingBlow select 1) then {
_ConfirmedHumanKills = (_killingBlow select 0) getVariable ["ConfirmedHumanKills",0]; _ConfirmedHumanKills = (_killingBlow select 0) getVariable ["ConfirmedHumanKills",0];
(_killingBlow select 0) setVariable ["ConfirmedHumanKills",(_ConfirmedHumanKills + 1),true]; (_killingBlow select 0) setVariable ["ConfirmedHumanKills",(_ConfirmedHumanKills + 1),true];
} else { } else {
_ConfirmedBanditKills = (_killingBlow select 0) getVariable ["ConfirmedBanditKills",0]; _ConfirmedBanditKills = (_killingBlow select 0) getVariable ["ConfirmedBanditKills",0];
(_killingBlow select 0) setVariable ["ConfirmedBanditKills",(_ConfirmedBanditKills + 1),true]; (_killingBlow select 0) setVariable ["ConfirmedBanditKills",(_ConfirmedBanditKills + 1),true];
}; };
//Set the body as Studied for all. //Set the body as Studied for all.
_body setVariable ["BodyStudied",true,true]; _body setVariable ["BodyStudied",true,true];
}; };
}; };

View File

@@ -5,7 +5,8 @@ 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 ["_end","_unit","_hit","_damage","_unconscious","_source","_ammo","_isMinor","_isHeadHit","_isPlayer","_isBandit","_punishment","_humanityHit","_myKills","_wpst","_sourceDist","_sourceWeap","_scale","_type","_rndPain","_hitPain","_wound","_isHit","_isbleeding","_rndBleed","_hitBleed","_isInjured","_lowBlood","_isCardiac","_chance","_falling","_model","_isZombieHit","_sourceType","_sourceVehicleType","_isMan","_isVehicle","_isLocal","_inVehicle","_vehicleArray","_isPZombie","_isScratched","_rndBleedChance"]; private ["_end","_unit","_hit","_damage","_unconscious","_source","_ammo","_isMinor","_isHeadHit","_isPlayer","_wpst","_sourceDist","_sourceWeap","_scale","_type","_rndPain","_hitPain","_wound","_isHit","_isbleeding","_rndBleed","_hitBleed","_isInjured","_lowBlood","_isCardiac","_chance","_falling","_model","_isZombieHit","_sourceType","_sourceVehicleType","_isMan","_isVehicle","_isLocal","_inVehicle","_vehicleArray","_isPZombie","_rndBleedChance"];
_unit = _this select 0; _unit = _this select 0;
_hit = _this select 1; _hit = _this select 1;
_damage = _this select 2; _damage = _this select 2;
@@ -23,7 +24,7 @@ _isHeadHit = (_hit == "head_hit");
_isZombieHit = _ammo == "zombie"; _isZombieHit = _ammo == "zombie";
_isLocal = local _source; _isLocal = local _source;
_falling = (((_hit == "legs") AND {(_source==_unit)}) AND {((_ammo=="") AND {(Dayz_freefall select 1 > 3)})}); _falling = (((_hit == "legs") && {(_source==_unit)}) && {((_ammo=="") && {(Dayz_freefall select 1 > 3)})});
//Simple hack to help with a few issues from direct damage to physics based damage. ***until 2.0*** //Simple hack to help with a few issues from direct damage to physics based damage. ***until 2.0***
//If a vehicle is moving faster than 15 lets register some kind of direct damage rather than relying on indirect/physics damage. //If a vehicle is moving faster than 15 lets register some kind of direct damage rather than relying on indirect/physics damage.
@@ -37,7 +38,7 @@ _falling = (((_hit == "legs") AND {(_source==_unit)}) AND {((_ammo=="") AND {(Da
_ammo = "RunOver"; _ammo = "RunOver";
} else { } else {
{ {
if ((speed _x > 10 or (speed _x < -8)) && {typeOf _x != "ParachuteWest"}) exitWith { if ((speed _x > 10 || (speed _x < -8)) && {typeOf _x != "ParachuteWest"}) exitWith {
dayz_hitByTime = diag_tickTime; dayz_hitByTime = diag_tickTime;
_ammo = "RunOver"; _ammo = "RunOver";
}; };
@@ -90,60 +91,13 @@ if (_unit == player) then {
_unit setVariable["inCombat",true,true]; _unit setVariable["inCombat",true,true];
}; };
if (_hit == "" && {_ammo != "Crash"}) exitWith //Ignore none part dmg. Exit after processing humanity hit. Don't punish driver for damaging passenger in crash if (r_player_timeout == 0 && {!_inVehicle}) then {
{
if (!_isLocal && {_isPlayer} && {alive player} && {!_isPZombie}) then //Do not punish for shooting a player zombie
{
_isBandit = (player getVariable["humanity",0]) <= -5000;
//_isBandit = (_model in ["Bandit1_DZ","BanditW1_DZ"]);
//if player is not free to shoot at inform server that _source shot at player
if (!_isBandit && {!(player getVariable ["OpenTarget",false])}) then
{
PVDZ_send = [(effectiveCommander vehicle _source),"OpenTarget",[]];
publicVariableServer "PVDZ_send";
};
// Due to server errors or desync killing someone in a bandit skin with >-2000 humanity CAN occur.
// Attacker should not be punished for killing a Bandit skin under any circumstances.
// To prevent this we check for Bandit Skin.
// - Accidental Murder - \\ When wearing the garb of a non-civilian you are taking your life in your own hands
// Attackers humanity should not be punished for killing a survivor who has shrouded his identity in military garb.
_punishment = (_isBandit or {player getVariable ["OpenTarget",false]});
_humanityHit = 0;
if (!_punishment && {(dayz_lastHumanityChange + 3) < diag_tickTime}) then {
dayz_lastHumanityChange = diag_tickTime;
_myKills = 200 - ((player getVariable ["humanKills",0]) * 3.3);
// how many non bandit players have I (the shot/damaged player) killed?
// punish my killer 200 for shooting a surivor
// but subtract 50 for each survivor I've murdered
_humanityHit = -(_myKills * _damage);
if (_humanityHit < -800) then {
_humanityHit = -800;
};
// In the case of outrageous damage (crashes, explosions, desync repeated headshots); cap the limit on humanity lost.
[(effectiveCommander vehicle _source),_humanityHit] spawn {
private ["_source","_humanityHit"];
_source = _this select 0;
_humanityHit = _this select 1;
PVDZ_send = [_source,"Humanity",[_humanityHit,30]];
publicVariableServer "PVDZ_send";
};
};
};
};
if (r_player_timeout == 0 && !_inVehicle) then {
if (_ammo == "tranquiliser_bolt") then { if (_ammo == "tranquiliser_bolt") then {
r_player_timeout = 20 + round(random 60); r_player_timeout = 20 + round(random 60);
[_unit] spawn { _unit spawn {
private "_unit"; private "_unit";
_unit = _this select 0; _unit = _this;
localize "str_player_tranquilized" call dayz_rollingMessages; localize "str_player_tranquilized" call dayz_rollingMessages;
[_unit,0.01] call fnc_usec_damageUnconscious; [_unit,0.01] call fnc_usec_damageUnconscious;
_unit setVariable ["NORRN_unconscious", true, true]; _unit setVariable ["NORRN_unconscious", true, true];
@@ -154,10 +108,10 @@ if (_unit == player) then {
//Melee knockout system //Melee knockout system
if ((_isHeadHit) && {_ammo in ["Crowbar_Swing_Ammo","Bat_Swing_Ammo","Sledge_Swing_Ammo"]}) then { if ((_isHeadHit) && {_ammo in ["Crowbar_Swing_Ammo","Bat_Swing_Ammo","Sledge_Swing_Ammo"]}) then {
r_player_timeout = 20 + round(random 60); r_player_timeout = 20 + round(random 60);
[_unit] spawn { _unit spawn {
private "_unit"; private "_unit";
_unit = _this select 0; _unit = _this;
localize "str_actions_medical_knocked_out" call dayz_rollingMessages; localize "str_actions_medical_knocked_out" call dayz_rollingMessages;
[_unit,0.01] call fnc_usec_damageUnconscious; [_unit,0.01] call fnc_usec_damageUnconscious;
_unit setVariable ["NORRN_unconscious", true, true]; _unit setVariable ["NORRN_unconscious", true, true];
@@ -170,7 +124,7 @@ if (_unit == player) then {
_isVehicle = ({_sourceVehicleType isKindOf _x} count ["LandVehicle","Air","Ship"] > 0); _isVehicle = ({_sourceVehicleType isKindOf _x} count ["LandVehicle","Air","Ship"] > 0);
//Log to server. Useful for detecting damage and ammo cheats. //Log to server. Useful for detecting damage and ammo cheats.
if (!_isLocal && {!_isZombieHit} && {_isMan or _isVehicle} && {diag_ticktime-(_source getVariable["lastloghit",0]) > 2}) then { if (!_isLocal && {!_isZombieHit} && {_isMan || _isVehicle} && {diag_ticktime-(_source getVariable["lastloghit",0]) > 2}) then {
_wpst = weaponState _source; _wpst = weaponState _source;
_source setVariable ["lastloghit",diag_ticktime]; _source setVariable ["lastloghit",diag_ticktime];
_sourceDist = round(_unit distance _source); _sourceDist = round(_unit distance _source);
@@ -196,7 +150,7 @@ if (_unit == player) then {
if (_ammo == "RunOver") exitwith {"runover"}; if (_ammo == "RunOver") exitwith {"runover"};
if (_ammo == "Dragged") exitwith {"eject"}; if (_ammo == "Dragged") exitwith {"eject"};
if (_ammo in MeleeAmmo) exitwith {"melee"}; if (_ammo in MeleeAmmo) exitwith {"melee"};
if (!_isLocal && {(_isMan && !(currentWeapon _source in ["","Throw"])) or _isVehicle}) exitwith {"shot"}; if (!_isLocal && {(_isMan && {!(currentWeapon _source in ["","Throw"])}) || _isVehicle}) exitwith {"shot"};
"none"; "none";
}; };
if (dayz_lastDamageSource != "none") then {dayz_lastDamageTime = diag_tickTime;}; if (dayz_lastDamageSource != "none") then {dayz_lastDamageTime = diag_tickTime;};
@@ -208,7 +162,7 @@ if (_hit == "" && {_ammo != "Crash"}) exitWith { 0 };
//Ammo Type Setup //Ammo Type Setup
_type = call { _type = call {
if ({_ammo isKindOf _x} count ["Grenade","ShellBase","TimeBombCore","BombCore","MissileCore","RocketCore","FuelExplosion","GrenadeBase"] > 0) exitwith { 1 }; if ({_ammo isKindOf _x} count ["Grenade","ShellBase","TimeBombCore","BombCore","MissileCore","RocketCore","FuelExplosion","GrenadeBase"] > 0) exitwith { 1 };
if ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")) exitwith { 2 }; if ((_ammo isKindof "B_127x107_Ball") || (_ammo isKindof "B_127x99_Ball")) exitwith { 2 };
if (_isZombieHit) exitwith { 3 }; if (_isZombieHit) exitwith { 3 };
if (_ammo == "RunOver") exitwith { 4 }; if (_ammo == "RunOver") exitwith { 4 };
if (_ammo == "Dragged") exitwith { 5 }; if (_ammo == "Dragged") exitwith { 5 };
@@ -235,7 +189,7 @@ if (_damage > 0.4) then {
//End body part scale //End body part scale
//??????????? //???????????
if (!(player == _source) && {_isPlayer or (_isMan && {!_isZombieHit})}) then { //Scale shots from AI units the same as shots from players if (!(player == _source) && {_isPlayer || (_isMan && {!_isZombieHit})}) then { //Scale shots from AI units the same as shots from players
dayz_sourceBleeding = _source; //Used in player_death dayz_sourceBleeding = _source; //Used in player_death
_scale = _scale + 800; _scale = _scale + 800;
if (_isHeadHit) then { if (_isHeadHit) then {
@@ -254,7 +208,9 @@ if (_damage > 0.4) then {
//Bullet types //Bullet types
if (_type == 2) exitwith {_scale = _scale + 150}; if (_type == 2) exitwith {_scale = _scale + 150};
//Zombies //Zombies
if (_type == 3) exitwith {_scale = getNumber (configFile >> "CfgVehicles" >> _sourceType >> "damageScale"); if (dayz_DamageMultiplier > 1) then {_scale = _scale * dayz_DamageMultiplier;};}; if (_type == 3) exitwith {_scale = getNumber (configFile >> "CfgVehicles" >> _sourceType >> "damageScale");
if (dayz_DamageMultiplier > 1) then {_scale = _scale * dayz_DamageMultiplier;};
};
//RunOver //RunOver
if (_type == 4) exitwith {_scale = 10}; //Based on 12k blood for run over with SUV at 70km/h if (_type == 4) exitwith {_scale = 10}; //Based on 12k blood for run over with SUV at 70km/h
//Dragged //Dragged
@@ -287,7 +243,6 @@ if (_damage > 0.4) then {
_isHit = _unit getVariable["hit_"+_wound,false]; _isHit = _unit getVariable["hit_"+_wound,false];
_isbleeding = false; _isbleeding = false;
_isScratched = false;
_rndBleed = floor(random 100); _rndBleed = floor(random 100);
_rndBleedChance = getNumber (configFile >> "CfgVehicles" >> _sourceType >> "BleedChance"); _rndBleedChance = getNumber (configFile >> "CfgVehicles" >> _sourceType >> "BleedChance");
@@ -312,7 +267,7 @@ if (_damage > 0.4) then {
if (!_isInjured) then { if (!_isInjured) then {
_unit setVariable["USEC_injured",true,true]; _unit setVariable["USEC_injured",true,true];
if ((_unit == player) and (!_isZombieHit)) then { if ((_unit == player) && {!_isZombieHit}) then {
dayz_sourceBleeding = _source; dayz_sourceBleeding = _source;
}; };
}; };
@@ -342,7 +297,7 @@ if (_damage > 0.4) then {
}; };
}; };
} else { } else {
if (!_isHit && !_isPZombie) then { if (!_isHit && {!_isPZombie}) then {
//Create Wound //Create Wound
_unit setVariable["hit_"+_wound,true,true]; _unit setVariable["hit_"+_wound,true,true];
@@ -384,11 +339,10 @@ if (_hit in USEC_MinorWounds) then {
_gravity = 9.81 min (2*(Dayz_freefall select 1)/((0.00001 + (Dayz_freefall select 2))^2)); _gravity = 9.81 min (2*(Dayz_freefall select 1)/((0.00001 + (Dayz_freefall select 2))^2));
_nrj2 = _gravity * (Dayz_freefall select 1); _nrj2 = _gravity * (Dayz_freefall select 1);
if (random(_nrj2 / (5 * 9.81)) > 0.5) then { // freefall from 5m => 1/2 chance to get hit legs registered if (random(_nrj2 / (5 * 9.81)) > 0.5) then { // freefall from 5m => 1/2 chance to get hit legs registered
diag_log[__FILE__, "Legs damage registered from freefall, damage:",_damage,"gravity:", _gravity, diag_log[__FILE__, "Legs damage registered from freefall, damage:",_damage,"gravity:", _gravity,"height:", (Dayz_freefall select 1), "blood loss", (_nrj2 * 25) ];
"height:", (Dayz_freefall select 1), "blood loss", (_nrj2 * 25) ]; [_unit,_hit,_damage] call object_processHit;
[_unit,_hit,_damage] call object_processHit;
} else { } else {
[_unit,"arms",(_damage / 6)] call object_processHit; // prevent broken arms due to arma bugs [_unit,"arms",(_damage / 6)] call object_processHit; // prevent broken arms due to arma bugs
}; };
if (_nrj2 > 30) then { if (_nrj2 > 30) then {
(3 min (_nrj2/100)) call fnc_usec_bulletHit; // red flash (3 min (_nrj2/100)) call fnc_usec_bulletHit; // red flash

View File

@@ -1,7 +1,7 @@
if (deathHandled) exitWith {}; if (deathHandled) exitWith {};
deathHandled = true; deathHandled = true;
private ["_ammo","_body","_distance","_infected","_killed","_playerID","_sourceName","_sourceWeapon","_sourceVehicleType","_isBandit","_punishment","_humanityHit","_myKills","_kills","_killsV","_display","_myGroup","_camera","_deathPos","_animState","_animStateArray","_animCheck","_source","_method","_realSource","_sourceID"]; private ["_humankill","_ammo","_body","_distance","_infected","_killed","_playerID","_sourceName","_sourceWeapon","_sourceVehicleType","_humanityBody","_humanitySource","_humanityHit","_kills","_killsV","_display","_myGroup","_camera","_deathPos","_animState","_animStateArray","_animCheck","_source","_method","_realSource","_sourceID"];
// Get reference to player object before respawn into new unit (respawnDelay=0 in description.ext) // Get reference to player object before respawn into new unit (respawnDelay=0 in description.ext)
if (typeName (_this select 0) == "ARRAY") then { if (typeName (_this select 0) == "ARRAY") then {
@@ -64,11 +64,11 @@ if (!isNull _source) then {
_sourceVehicleType = typeOf (vehicle _source); _sourceVehicleType = typeOf (vehicle _source);
_sourceWeapon = currentWeapon _source; _sourceWeapon = currentWeapon _source;
_sourceWeapon = switch true do { _sourceWeapon = call {
case (_ammo in ["PipeBomb","Mine","MineE"]): {_ammo}; if (_ammo in ["PipeBomb","Mine","MineE"]) exitwith {_ammo};
case ({_sourceVehicleType isKindOf _x} count ["LandVehicle","Air","Ship"] > 0): {_sourceVehicleType}; if ({_sourceVehicleType isKindOf _x} count ["LandVehicle","Air","Ship"] > 0) exitwith {_sourceVehicleType};
case (_sourceWeapon == "Throw"): {(weaponState _source) select 3}; if (_sourceWeapon == "Throw") exitwith {(weaponState _source) select 3};
default {_sourceWeapon}; _sourceWeapon;
}; };
if (alive _source) then { if (alive _source) then {
@@ -92,33 +92,72 @@ _body setVariable ["deathType", if (_method == "suicide") then {"shot"} else {_m
if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) then { //If corpse is a player zombie do not give killer a human or bandit kill if (!local _source && {isPlayer _source} && {!(_body isKindOf "PZombie_VB")}) then { //If corpse is a player zombie do not give killer a human or bandit kill
//Values like humanity which were setVariabled onto player before death remain on corpse. //Values like humanity which were setVariabled onto player before death remain on corpse.
_isBandit = (_body getVariable["humanity",0]) <= -2000; _humankill = false;
//_isBandit = (typeOf _body in ["Bandit1_DZ","BanditW1_DZ"]);
//if you are a bandit or start first - player will not recieve humanity drop
_punishment = (_isBandit or {_body getVariable ["OpenTarget",false]});
_humanityHit = 0; _humanityHit = 0;
_humanityBody = _body getVariable["humanity",0];
_realSource = effectiveCommander vehicle _source; _realSource = effectiveCommander vehicle _source;
_humanitySource = _realSource getVariable ["humanity",0];
if (!_punishment) then { call {
//I'm "not guilty" - kill me and be punished if (_humanitySource <= -2000) exitwith {//Killer is Bandit
_myKills = (_body getVariable ["humanKills",0]) * 33.3; call {
// how many non bandit players have I (the dead player) killed? if (_humanityBody <= -2000) exitwith {//Body is Bandit
// punish my killer 2000 for shooting a surivor _killsV = _realSource getVariable ["banditKills",0];
// but subtract 500 for each survivor I've murdered _realSource setVariable ["banditKills",(_killsV + 1),true];
_humanityHit = -(2000 - _myKills); _humanityHit = -250;
_kills = _realSource getVariable ["humanKills",0]; };
_realSource setVariable ["humanKills",(_kills + 1),true];
PVDZ_send = [_realSource,"Humanity",[_humanityHit,300]]; _kills = _realSource getVariable ["humanKills",0];
publicVariableServer "PVDZ_send"; _realSource setVariable ["humanKills",(_kills + 1),true];
} else { _humankill = true;
//i'm "guilty" - kill me as bandit
_killsV = _realSource getVariable ["banditKills",0]; if (_humanityBody >= 5000) exitwith {//Body is Hero
_realSource setVariable ["banditKills",(_killsV + 1),true]; _humanityHit = -1000;
};
_humanityHit = -500; //Body is Survivor
};
};
if (_humanitySource >= 5000) exitwith {//Killer is Hero
call {
if (_humanityBody <= -2000) exitwith {//Body is Bandit
_killsV = _realSource getVariable ["banditKills",0];
_realSource setVariable ["banditKills",(_killsV + 1),true];
_humanityHit = 1000;
};
_kills = _realSource getVariable ["humanKills",0];
_realSource setVariable ["humanKills",(_kills + 1),true];
_humankill = true;
if (_humanityBody >= 5000) exitwith {//Body is Hero
_humanityHit = -1000;
};
_humanityHit = -500; //Body is Survivor
};
};
call {//Killer is Survivor
if (_humanityBody <= -2000) exitwith {//Body is Bandit
_killsV = _realSource getVariable ["banditKills",0];
_realSource setVariable ["banditKills",(_killsV + 1),true];
_humanityHit = 500;
};
_kills = _realSource getVariable ["humanKills",0];
_realSource setVariable ["humanKills",(_kills + 1),true];
_humankill = true;
if (_humanityBody >= 5000) exitwith {//Body is Hero
_humanityHit = -500;
};
_humanityHit = -250; //Body is Survivor
};
}; };
PVDZ_send = [_realSource,"Humanity",[_humanityHit]];
publicVariableServer "PVDZ_send";
//Setup for study bodys. //Setup for study bodys.
_body setVariable ["KillingBlow",[_realSource,_punishment],true]; _body setVariable ["KillingBlow",[_realSource,_humankill],true];
}; };
disableSerialization; disableSerialization;

View File

@@ -1,32 +1,9 @@
private ["_change","_wait","_humanity"]; private ["_change","_humanity"];
/* /*
Set humanity chanages and sets freeTarget(openTarget) Set humanity chanages
*/ */
_change = _this select 0; _change = _this;
_wait = _this select 1;
_humanity = (player getVariable["humanity",0]) + _change; _humanity = (player getVariable["humanity",0]) + _change;
player setVariable["humanity",_humanity,true]; player setVariable["humanity",_humanity,true];
if (_change < 0) then { //non-bandit player can be "punished" in next "_wait" seconds w/o loosing humanity
if ((_humanity > -2000) and (_wait > 0)) then {
player setVariable ["FTcounter",((player getVariable ["FTcounter",0]) + _wait)];
[_wait] spawn {
private ["_endtime","_wait"];
_wait = _this select 0;
_endTime = diag_tickTime + _wait;
waitUntil { uiSleep 1; diag_tickTime > _endTime };
player setVariable ["FTcounter",((player getVariable ["FTcounter",0]) - _wait)];
if ((player getVariable ["FTcounter",0]) <= 0) then {
player setVariable ["FTcounter",0];
};
};
};
};
/*
Should block damageHandler running humanityCheck(Skin change check), allow all other humanity events to run humanityCheck(Skin change check)
*/
//if ((_wait == 0) and (vehicle player == player)) then { [_humanity] call player_humanityCheck; };
//Humanity morphing disabled on Epoch to avoid loss of purchased clothing

View File

@@ -256,7 +256,6 @@ if (!isDedicated) then {
"PVCDZ_hlt_PainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller}; "PVCDZ_hlt_PainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
"PVCDZ_hlt_AntiB" addPublicVariableEventHandler {(_this select 1) call player_medAntiBiotics}; "PVCDZ_hlt_AntiB" addPublicVariableEventHandler {(_this select 1) call player_medAntiBiotics};
"PVCDZ_hlt_Wipe" addPublicVariableEventHandler {(_this select 1) call player_medABWipe}; "PVCDZ_hlt_Wipe" addPublicVariableEventHandler {(_this select 1) call player_medABWipe};
"PVCDZ_OpenTarget_Reset" addPublicVariableEventHandler { OpenTarget_Time = diag_tickTime; }; //reset OpenTarget timer
"PVCDZ_plr_Legs" addPublicVariableEventHandler { "PVCDZ_plr_Legs" addPublicVariableEventHandler {
_entity = (_this select 1) select 0; _entity = (_this select 1) select 0;

View File

@@ -42,7 +42,6 @@ call { // Custom DayZ preset variables are also located in the mission init file
if (isNil "dayz_spawnCrashSite_clutterCutter") then {dayz_spawnCrashSite_clutterCutter = 0;}; if (isNil "dayz_spawnCrashSite_clutterCutter") then {dayz_spawnCrashSite_clutterCutter = 0;};
if (isNil "dayz_spawnInfectedSite_clutterCutter") then {dayz_spawnInfectedSite_clutterCutter = 0;}; if (isNil "dayz_spawnInfectedSite_clutterCutter") then {dayz_spawnInfectedSite_clutterCutter = 0;};
if (isNil "dayz_bleedingeffect") then {dayz_bleedingeffect = 2;}; if (isNil "dayz_bleedingeffect") then {dayz_bleedingeffect = 2;};
if (isNil "dayz_OpenTarget_TimerTicks") then {dayz_OpenTarget_TimerTicks = 60 * 10;};
if (isNil "dayz_temperature_override") then {dayz_temperature_override = true;}; if (isNil "dayz_temperature_override") then {dayz_temperature_override = true;};
if (isNil "dayz_nutritionValuesSystem") then {dayz_nutritionValuesSystem = false;}; if (isNil "dayz_nutritionValuesSystem") then {dayz_nutritionValuesSystem = false;};
if (isNil "dayz_classicBloodBagSystem") then {dayz_classicBloodBagSystem = false;}; if (isNil "dayz_classicBloodBagSystem") then {dayz_classicBloodBagSystem = false;};
@@ -56,7 +55,6 @@ call { // Custom DayZ preset variables are also located in the mission init file
dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass
dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
dayz_bleedingeffect = 2; //1= blood on the ground, 2= partical effect, 3 = both. dayz_bleedingeffect = 2; //1= blood on the ground, 2= partical effect, 3 = both.
dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
dayz_temperature_override = true; // Set to true to disable all temperature changes. dayz_temperature_override = true; // Set to true to disable all temperature changes.
dayz_nutritionValuesSystem = false; //Enables nutrition system dayz_nutritionValuesSystem = false; //Enables nutrition system
dayz_classicBloodBagSystem = true; //Enables one type of bloodbag dayz_classicBloodBagSystem = true; //Enables one type of bloodbag
@@ -70,7 +68,6 @@ call { // Custom DayZ preset variables are also located in the mission init file
dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass
dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both. dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
dayz_OpenTarget_TimerTicks = 60 * 25; //how long can a player be freely attacked for after attacking someone unprovoked.
dayz_temperature_override = false; // Set to true to disable all temperature changes. dayz_temperature_override = false; // Set to true to disable all temperature changes.
dayz_nutritionValuesSystem = true; //Enables nutrition system dayz_nutritionValuesSystem = true; //Enables nutrition system
dayz_classicBloodBagSystem = false; //Enables one type of bloodbag dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
@@ -84,7 +81,6 @@ call { // Custom DayZ preset variables are also located in the mission init file
dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass dayz_spawnCrashSite_clutterCutter = 0; // heli crash options 0 = loot hidden in grass, 1 = loot lifted and 2 = no grass
dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass dayz_spawnInfectedSite_clutterCutter = 0; // infected base spawn... 0: loot hidden in grass, 1: loot lifted, 2: no grass
dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both. dayz_bleedingeffect = 3; //1= blood on the ground, 2= partical effect, 3 = both.
dayz_OpenTarget_TimerTicks = 60 * 10; //how long can a player be freely attacked for after attacking someone unprovoked.
dayz_temperature_override = false; // Set to true to disable all temperature changes. dayz_temperature_override = false; // Set to true to disable all temperature changes.
dayz_nutritionValuesSystem = true; //Enables nutrition system dayz_nutritionValuesSystem = true; //Enables nutrition system
dayz_classicBloodBagSystem = false; //Enables one type of bloodbag dayz_classicBloodBagSystem = false; //Enables one type of bloodbag
@@ -310,7 +306,6 @@ if (!isDedicated) then {
a_player_boil = false; a_player_boil = false;
// General Variables // General Variables
OpenTarget_Time = 0;
dayz_actionInProgress = false; dayz_actionInProgress = false;
dayz_DisplayGenderSelect = true; dayz_DisplayGenderSelect = true;
carryClick = false; carryClick = false;

View File

@@ -59,12 +59,6 @@ while {1 == 1} do {
dayz_areaAffect = _size; dayz_areaAffect = _size;
//reset OpenTarget variable if the timer has run out.
if (OpenTarget_Time > 0 && {diag_tickTime - OpenTarget_Time >= dayz_OpenTarget_TimerTicks}) then
{
player setVariable ["OpenTarget",false,true];
};
if ((diag_tickTime - _timer150) > 60) then { if ((diag_tickTime - _timer150) > 60) then {
//Digest Food. //Digest Food.
if (r_player_foodstack > 0) then { r_player_foodstack = r_player_foodstack - 1; }; if (r_player_foodstack > 0) then { r_player_foodstack = r_player_foodstack - 1; };

View File

@@ -67,7 +67,7 @@ call {
}; };
if (_variable == "Humanity") exitWith { if (_variable == "Humanity") exitWith {
PVCDZ_plr_Humanity = _arraytosend; PVCDZ_plr_Humanity = _arraytosend select 0;
_owner publicVariableClient "PVCDZ_plr_Humanity"; _owner publicVariableClient "PVCDZ_plr_Humanity";
//diag_log ("Humanity" +str(PVCDZ_plr_Humanity)); //diag_log ("Humanity" +str(PVCDZ_plr_Humanity));
}; };
@@ -118,12 +118,6 @@ call {
_owner publicVariableClient "PVCDZ_plr_Legs"; _owner publicVariableClient "PVCDZ_plr_Legs";
}; };
if (_variable == "OpenTarget") exitWith {
_unit setVariable ["OpenTarget",true,true];
PVCDZ_OpenTarget_Reset = true;
_owner publicVariableClient "PVCDZ_OpenTarget_Reset";
};
if (_variable == "tagFriendly") exitWith { if (_variable == "tagFriendly") exitWith {
PVDZE_plr_FriendRQ = _arraytosend; PVDZE_plr_FriendRQ = _arraytosend;
_owner publicVariableClient "PVDZE_plr_FriendRQ"; _owner publicVariableClient "PVDZE_plr_FriendRQ";