From 604cd122d325eee9e370364797b08c00b7bdf130 Mon Sep 17 00:00:00 2001 From: ulteq Date: Fri, 12 Jun 2015 13:54:52 +0200 Subject: [PATCH] Experiment --- .../functions/fnc_handleDamage_caching.sqf | 18 +++++++++++++----- .../functions/fnc_handleDamage_wounds.sqf | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 042d9c702b..7bea992828 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -53,14 +53,22 @@ if (((velocity _unit) select 2 < -5) && {(vehicle _unit == _unit)}) then { _projectile = "falling"; _this set [4, "falling"]; }; -if (_unit getVariable [QGVAR(isFalling), false] && {!(_selectionName in ["", "leg_l", "leg_r"])}) exitWith {0}; if (_unit getVariable [QGVAR(isFalling), false]) then { - if (_selectionName == "") then { - _selectionName = ["leg_l", "leg_r"] select (floor(random 2)); + if !(_selectionName in ["", "leg_l", "leg_r"]) then { + if (_selectionName == "body") then { + _newDamage = _newDamage * 0.1; + } else { + _newDamage = _newDamage * 0.5; + }; + } else { + if (_selectionName == "") then { + _selectionName = ["leg_l", "leg_r"] select (floor(random 2)); + _this set [1, _selectionName]; + }; + _newDamage = _newDamage * 0.7; }; - _this set [1, _selectionName]; - _newDamage = _newDamage * 0.7; }; +diag_log format["[handleDamage_caching] Projectile: %1; Velocity: %2 m/s; SelectionName: %3; newDamage: %4", _projectile, (velocity _unit) select 2, _selectionName, _newDamage]; // Finished with the current frame, reset variables // Note: sometimes handleDamage spans over 2 or even 3 frames. diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 70eeb74f9d..e0a0d984ff 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -28,6 +28,7 @@ _typeOfDamage = _this select 4; _openWounds = _unit getvariable[QGVAR(openWounds), []]; _woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1]; +diag_log format ["HandleDamageWounds,%1,%2,%3,%4", _selectionName, _damage, _typeOfDamage, _woundID]; _extensionOutput = "ace_medical" callExtension format ["HandleDamageWounds,%1,%2,%3,%4", _selectionName, _damage, _typeOfDamage, _woundID]; _painToAdd = 0;