Add damage threshold to basic

This commit is contained in:
KoffeinFlummi 2015-04-22 23:50:37 +02:00
parent d10f4d543d
commit 84e1937515

View File

@ -24,13 +24,20 @@
#define ARMDAMAGETRESHOLD2 1.7
#define UNCONSCIOUSNESSTRESHOLD 0.7
private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_damage"];
private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_threshold"];
_unit = _this select 0;
_selectionName = _this select 1;
_damage = _this select 2;
_shooter = _this select 3;
_projectile = _this select 4;
_unit = _this select 0;
_selectionName = _this select 1;
_damage = _this select 2;
_shooter = _this select 3;
_projectile = _this select 4;
// Apply damage treshold / coefficient
_threshold = [
_unit getVariable [QGVAR(damageThreshold), GVAR(AIDamageThreshold)],
_unit getVariable [QGVAR(damageThreshold), GVAR(playerDamageThreshold)]
] select ([_unit] call EFUNC(common,isPlayer));
_damage = _damage * (1 / _threshold);
// This is a new hit, reset variables.
// Note: sometimes handleDamage spans over 2 or even 3 frames.