mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Removed deprecated returnDamage parameters
This commit is contained in:
parent
1ef262c119
commit
038ed5f23e
@ -24,7 +24,6 @@ _damage = _this select 2;
|
||||
_shooter = _this select 3;
|
||||
_projectile = _this select 4;
|
||||
|
||||
|
||||
if !(local _unit) exitWith {nil};
|
||||
|
||||
if !([_unit] call FUNC(hasMedicalEnabled)) exitwith {};
|
||||
@ -40,11 +39,11 @@ if !(_selection in (_hitSelections + [""])) exitWith {0};
|
||||
|
||||
_damageReturn = _damage;
|
||||
if (GVAR(level) == 1) then {
|
||||
_damageReturn = (_this + [_damageReturn]) call FUNC(handleDamage_basic);
|
||||
_damageReturn = _this call FUNC(handleDamage_basic);
|
||||
};
|
||||
|
||||
if (GVAR(level) >= 2) then {
|
||||
[_unit, _selection, _damage, _source, _projectile, _damageReturn] call FUNC(handleDamage_caching);
|
||||
[_unit, _selection, _damage, _source, _projectile] call FUNC(handleDamage_caching);
|
||||
|
||||
if (_damageReturn > 0.9) then {
|
||||
|
||||
|
@ -25,7 +25,6 @@ _selectionName = _this select 1;
|
||||
_amountOfDamage = _this select 2;
|
||||
_sourceOfDamage = _this select 3;
|
||||
_typeOfProjectile = _this select 4;
|
||||
_returnDamage = _this select 5;
|
||||
|
||||
// Most likely taking exessive fire damage. Lets exit.
|
||||
if (isNull _sourceOfDamage && (_selectionName == "head" || isBurning _unit) && _typeOfProjectile == "" && vehicle _unit == _unit) exitwith {
|
||||
@ -63,4 +62,4 @@ if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then {
|
||||
};
|
||||
};
|
||||
|
||||
_returnDamage;
|
||||
_amountOfDamage;
|
||||
|
@ -24,15 +24,13 @@
|
||||
#define ARMDAMAGETRESHOLD2 1.7
|
||||
#define UNCONSCIOUSNESSTRESHOLD 0.7
|
||||
|
||||
private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_damageReturn"];
|
||||
private ["_unit", "_selectionName", "_damage", "_shooter", "_projectile", "_damage"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_selectionName = _this select 1;
|
||||
_damage = _this select 2;
|
||||
_shooter = _this select 3;
|
||||
_projectile = _this select 4;
|
||||
_damageReturn = _this select 5;
|
||||
|
||||
|
||||
// This is a new hit, reset variables.
|
||||
// Note: sometimes handleDamage spans over 2 or even 3 frames.
|
||||
@ -50,12 +48,12 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo), -3]) + 2) then {
|
||||
_hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"];
|
||||
_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
|
||||
|
||||
_newDamage = _damageReturn - (damage _unit);
|
||||
_newDamage = _damage - (damage _unit);
|
||||
if (_selectionName in _hitSelections) then {
|
||||
_newDamage = _damageReturn - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selectionName)));
|
||||
_newDamage = _damage - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selectionName)));
|
||||
};
|
||||
|
||||
_damageReturn = _damageReturn - _newDamage;
|
||||
_damage = _damage - _newDamage;
|
||||
|
||||
|
||||
// Exclude falling damage to everything other than legs and reduce it overall.
|
||||
@ -129,19 +127,19 @@ if (_selectionName == "") then {
|
||||
|
||||
|
||||
if (_selectionName == "") then {
|
||||
_damageReturn = _damageReturn + (_unit getVariable QGVAR(structDamage));
|
||||
_damage = _damage + (_unit getVariable QGVAR(structDamage));
|
||||
} else {
|
||||
_damageReturn = _damageReturn + _newDamage;
|
||||
_damage = _damage + _newDamage;
|
||||
};
|
||||
|
||||
|
||||
// Leg Damage
|
||||
_legdamage = (_unit getHitPointDamage "HitLeftLeg") + (_unit getHitPointDamage "HitRightLeg");
|
||||
if (_selectionName == "leg_l") then {
|
||||
_legdamage = _damageReturn + (_unit getHitPointDamage "HitRightLeg");
|
||||
_legdamage = _damage + (_unit getHitPointDamage "HitRightLeg");
|
||||
};
|
||||
if (_selectionName == "leg_r") then {
|
||||
_legdamage = (_unit getHitPointDamage "HitLeftLeg") + _damageReturn;
|
||||
_legdamage = (_unit getHitPointDamage "HitLeftLeg") + _damage;
|
||||
};
|
||||
|
||||
if (_legdamage >= LEGDAMAGETRESHOLD1) then {
|
||||
@ -155,10 +153,10 @@ if (_legdamage >= LEGDAMAGETRESHOLD1) then {
|
||||
// Arm Damage
|
||||
_armdamage = (_unit getHitPointDamage "HitLeftArm") + (_unit getHitPointDamage "HitRightArm");
|
||||
if (_selectionName == "hand_l") then {
|
||||
_armdamage = _damageReturn + (_unit getHitPointDamage "HitRightArm");
|
||||
_armdamage = _damage + (_unit getHitPointDamage "HitRightArm");
|
||||
};
|
||||
if (_selectionName == "hand_r") then {
|
||||
_armdamage = (_unit getHitPointDamage "HitLeftArm") + _damageReturn;
|
||||
_armdamage = (_unit getHitPointDamage "HitLeftArm") + _damage;
|
||||
};
|
||||
|
||||
if (_armdamage >= ARMDAMAGETRESHOLD1) then {
|
||||
@ -179,15 +177,15 @@ if (_selectionName == "") then {
|
||||
|
||||
// Unconsciousness
|
||||
if (_selectionName == "" and
|
||||
_damageReturn >= UNCONSCIOUSNESSTRESHOLD and
|
||||
_damageReturn < 1 and
|
||||
_damage >= UNCONSCIOUSNESSTRESHOLD and
|
||||
_damage < 1 and
|
||||
!(_unit getVariable ["ACE_isUnconscious", False]
|
||||
)) then {
|
||||
if (_unit getVariable [QGVAR(allowUnconscious), ([_unit] call EFUNC(common,isPlayer)) or random 1 > 0.3]) then {
|
||||
[_unit, true] call FUNC(setUnconscious);
|
||||
} else {
|
||||
_damageReturn = 1;
|
||||
_damage = 1;
|
||||
};
|
||||
};
|
||||
|
||||
_damageReturn
|
||||
_damage
|
||||
|
@ -24,7 +24,6 @@ _selectionName = _this select 1;
|
||||
_damage = _this select 2;
|
||||
_source = _this select 3;
|
||||
_projectile = _this select 4;
|
||||
_returnDamage = _this select 5;
|
||||
|
||||
_hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"];
|
||||
_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
|
||||
@ -128,14 +127,14 @@ if (_selectionName != "") then {
|
||||
_cache_projectiles pushBack _projectile;
|
||||
_cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName));
|
||||
_cache_damages pushBack _newDamage;
|
||||
_cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile, _returnDamage];
|
||||
_cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile];
|
||||
};
|
||||
} else {
|
||||
// This is an unhandled projectile
|
||||
_cache_projectiles pushBack _projectile;
|
||||
_cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName));
|
||||
_cache_damages pushBack _newDamage;
|
||||
_cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile, _returnDamage];
|
||||
_cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile];
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user