This commit is contained in:
PabstMirror 2019-06-19 23:22:29 -05:00
parent 9d728f326c
commit dddb34a97d
6 changed files with 32 additions and 10 deletions

View File

@ -4,6 +4,10 @@ class CfgVehicles {
class CAManBase: Man { class CAManBase: Man {
// General // General
class HitPoints { class HitPoints {
// class HitNeck;
// class HitHead: HitNeck {
// depends = "HitFace max HitNeck max ACE_HDBracket";
// };
ADD_ACE_HITPOINTS(1,1); ADD_ACE_HITPOINTS(1,1);
}; };
}; };

View File

@ -17,6 +17,7 @@
#define HIT_STRUCTURAL QGVAR($#structural) #define HIT_STRUCTURAL QGVAR($#structural)
params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint"]; params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint"];
diag_log text format ["HD - %1 - %2", diag_frameno, _this];
// HD sometimes triggers for remote units - ignore. // HD sometimes triggers for remote units - ignore.
if !(local _unit) exitWith {nil}; if !(local _unit) exitWith {nil};
@ -137,7 +138,7 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith {
}; };
}; };
}; };
xxx = false;
// No wounds for minor damage // No wounds for minor damage
if (_receivedDamage > 1E-3) then { if (_receivedDamage > 1E-3) then {
[QEGVAR(medical,woundReceived), [_unit, _woundedHitPoint, _receivedDamage, _shooter, _ammo]] call CBA_fnc_localEvent; [QEGVAR(medical,woundReceived), [_unit, _woundedHitPoint, _receivedDamage, _shooter, _ammo]] call CBA_fnc_localEvent;
@ -154,7 +155,17 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith {
QGVAR($HitLeftArm),QGVAR($HitRightArm),QGVAR($HitLeftLeg),QGVAR($HitRightLeg) QGVAR($HitLeftArm),QGVAR($HitRightArm),QGVAR($HitLeftLeg),QGVAR($HitRightLeg)
]; ];
0 if (xxx) then {
xxx = nil;
systemChat "9";
// _unit setHit ["head", 1];
_unit setDamage [1, true];
5
} else {
xxx = nil;
systemChat "0";
0
};
}; };
// Drowning doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs // Drowning doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs

View File

@ -1,6 +1,6 @@
// #define DEBUG_MODE_FULL // #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS #define ENABLE_PERFORMANCE_COUNTERS
#define ALL_BODY_PARTS ["head", "body", "leftarm", "rightarm", "leftleg", "rightleg"] #define ALL_BODY_PARTS ["head", "body", "leftarm", "rightarm", "leftleg", "rightleg"]
#define ALL_SELECTIONS ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] #define ALL_SELECTIONS ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]

View File

@ -15,7 +15,7 @@
* Public: No * Public: No
*/ */
[{ // [{
params ["_unit"]; params ["_unit"];
// TODO: Probably also needs additional logic to deal with edge cases // TODO: Probably also needs additional logic to deal with edge cases
@ -25,4 +25,4 @@
private _deathReason = _unit getVariable [QGVAR(deathReason), nil]; private _deathReason = _unit getVariable [QGVAR(deathReason), nil];
[_unit, _deathReason] call EFUNC(medical_status,setDead); [_unit, _deathReason] call EFUNC(medical_status,setDead);
}, _this] call CBA_fnc_execNextFrame; // }, _this] call CBA_fnc_execNextFrame;

View File

@ -14,13 +14,20 @@
*/ */
params ["_unit", ["_reason", "unknown"]]; params ["_unit", ["_reason", "unknown"]];
TRACE_2("setDead",_unit,_reason);
// No heart rate or blood pressure to measure when dead // No heart rate or blood pressure to measure when dead
_unit setVariable [VAR_HEART_RATE, 0, true]; _unit setVariable [VAR_HEART_RATE, 0, true];
_unit setVariable [VAR_BLOOD_PRESS, [0, 0], true]; _unit setVariable [VAR_BLOOD_PRESS, [0, 0], true];
// Kill the unit without changing visual apperance // Kill the unit without changing visual apperance
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage); if (isNil "xxx") then {
TRACE_1("normal kill",_unit);
[_unit, 1] call EFUNC(medical_engine,setStructuralDamage);
} else {
TRACE_1("normal kill",_unit);
xxx = true;
};
private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull]; private _lastShooter = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull];
private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull]; private _lastInstigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull];

View File

@ -2,9 +2,9 @@
#define COMPONENT_BEAUTIFIED Medical Status #define COMPONENT_BEAUTIFIED Medical Status
#include "\z\ace\addons\main\script_mod.hpp" #include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS #define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_MEDICAL_STATUS #ifdef DEBUG_ENABLED_MEDICAL_STATUS
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL