mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add damage threshold to basic
This commit is contained in:
parent
d10f4d543d
commit
84e1937515
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user