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,32 +1,9 @@
private ["_change","_wait","_humanity"];
private ["_change","_humanity"];
/*
Set humanity chanages and sets freeTarget(openTarget)
Set humanity chanages
*/
_change = _this select 0;
_wait = _this select 1;
_change = _this;
_humanity = (player getVariable["humanity",0]) + _change;
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