Update confirmed kills system

Vanilla commits applied:

347105c036

e6b6814f51

1009828d8e
This commit is contained in:
ebaydayz
2016-10-15 15:08:48 -04:00
parent 81aed28f87
commit 7ddee142b0
3 changed files with 29 additions and 12 deletions

View File

@@ -1,22 +1,38 @@
private["_body","_name","_method","_methodStr","_message"]; private["_body","_name","_method","_methodStr","_message","_killingBlow","_BodyStudied"];
_body = _this select 3; _body = _this select 3;
_name = _body getVariable["bodyName","unknown"]; _name = _body getVariable["bodyName","unknown"];
_method = _body getVariable["deathType","unknown"]; _method = _body getVariable["deathType","unknown"];
_methodStr = localize format ["str_death_%1",_method]; _methodStr = localize format ["str_death_%1",_method];
_killingBlow = _body getVariable ["KillingBlow",objNull]; _killingBlow = _body getVariable ["KillingBlow",[objNull,0]];
/*
Setup by player_death
[Object,Punished];
_killer = _killingBlow select 0; //Killer
_Punished = _killingBlow select 1; //False = HumanKill, True = BanditKill
*/
//Has the body already been Studied?
_BodyStudied = _body getVariable ["BodyStudied",objNull];
// "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 = if (_body isKindOf "SurvivorW2_DZ") then {"str_player_studybody_female"} else {"str_player_studybody"};
format[localize _message,_name,_methodStr] call dayz_rollingMessages; format[localize _message,_name,_methodStr] call dayz_rollingMessages;
if (!(isNull _killingBlow) AND {(isPlayer _killingBlow)}) then { //Body hasnt already been Studied lets set the confimed Kills system.
if (typeName _killingBlow == "OBJECT") then { if (isNull _BodyStudied) then {
_ConfirmedHumanKills = _killingBlow getVariable ["ConfirmedHumanKills",0]; if (!(isNull (_killingBlow select 0)) AND {(isPlayer (_killingBlow select 0))}) then {
_killingBlow setVariable ["ConfirmedHumanKills",(_ConfirmedHumanKills + 1),true]; if (!(_killingBlow select 1)) then {
} else { _ConfirmedHumanKills = (_killingBlow select 0) getVariable ["ConfirmedHumanKills",0];
_ConfirmedBanditKills = _killingBlow getVariable ["ConfirmedBanditKills",0]; (_killingBlow select 0) setVariable ["ConfirmedHumanKills",(_ConfirmedHumanKills + 1),true];
_killingBlow setVariable ["ConfirmedBanditKills",(_ConfirmedBanditKills + 1),true]; } else {
_ConfirmedBanditKills = (_killingBlow select 0) getVariable ["ConfirmedBanditKills",0];
(_killingBlow select 0) setVariable ["ConfirmedBanditKills",(_ConfirmedBanditKills + 1),true];
};
//Set the body as Studied for all.
_body setVariable ["BodyStudied",_body];
}; };
}; };

View File

@@ -109,7 +109,7 @@ if (_unit == player) then {
if (!_punishment && {(dayz_lastHumanityChange + 3) < diag_tickTime}) then { if (!_punishment && {(dayz_lastHumanityChange + 3) < diag_tickTime}) then {
dayz_lastHumanityChange = diag_tickTime; dayz_lastHumanityChange = diag_tickTime;
_myKills = 200 - (((player getVariable ["humanKills",0]) / 3) * 150); _myKills = 200 - ((player getVariable ["humanKills",0]) * 3.3);
// how many non bandit players have I (the shot/damaged player) killed? // how many non bandit players have I (the shot/damaged player) killed?
// punish my killer 200 for shooting a surivor // punish my killer 200 for shooting a surivor
// but subtract 50 for each survivor I've murdered // but subtract 50 for each survivor I've murdered

View File

@@ -90,7 +90,7 @@ if (count _array > 0) then {
if (!_punishment) then { if (!_punishment) then {
//I'm "not guilty" - kill me and be punished //I'm "not guilty" - kill me and be punished
_myKills = ((player getVariable ["humanKills",0]) / 3) * 1500; _myKills = (player getVariable ["humanKills",0]) * 33.3;
// how many non bandit players have I (the dead player) killed? // how many non bandit players have I (the dead player) killed?
// punish my killer 2000 for shooting a surivor // punish my killer 2000 for shooting a surivor
// but subtract 500 for each survivor I've murdered // but subtract 500 for each survivor I've murdered
@@ -104,8 +104,9 @@ if (count _array > 0) then {
_killsV = _source getVariable ["banditKills",0]; _killsV = _source getVariable ["banditKills",0];
_source setVariable ["banditKills",(_killsV + 1),true]; _source setVariable ["banditKills",(_killsV + 1),true];
}; };
//Setup for study bodys. //Setup for study bodys.
_body setVariable ["KillingBlow",_source,true]; _body setVariable ["KillingBlow",[_source,_punishment],true];
}; };
_body setVariable ["deathType",_method,true]; _body setVariable ["deathType",_method,true];
}; };