make units scream when they're hit

This commit is contained in:
commy2 2016-09-27 21:21:44 +02:00
parent a913054b57
commit 20d00d7cd9
7 changed files with 17 additions and 8 deletions

View File

@ -2,7 +2,7 @@
#define COMPONENT_BEAUTIFIED Medical Core
#include "\z\ace\addons\main\script_mod.hpp"
#define DEBUG_MODE_FULL
//#define DEBUG_MODE_FULL
#define DISABLE_COMPILE_CACHE
#define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS

View File

@ -2,7 +2,7 @@
#define COMPONENT_BEAUTIFIED Medical Blood
#include "\z\ace\addons\main\script_mod.hpp"
#define DEBUG_ENABLED_MEDICAL_BLOOD
//#define DEBUG_ENABLED_MEDICAL_BLOOD
#define DISABLE_COMPILE_CACHE
#define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS

View File

@ -72,4 +72,6 @@ if (count _woundsCreated > 0) then {
private _painLevel = _unit getVariable [QEGVAR(medical,pain), 0];
_unit setVariable [QEGVAR(medical,pain), _painLevel + _painToAdd];
[_unit, "hit", PAIN_TO_SCREAM(_painToAdd)] call EFUNC(medical_engine,playInjuredSound);
TRACE_6("exit",_unit, _painLevel, _painToAdd, _unit getVariable QEGVAR(medical,pain), _unit getVariable QEGVAR(medical,openWounds),_woundsCreated);

View File

@ -136,4 +136,6 @@ if (count _woundsCreated > 0) then {
private _painLevel = _unit getVariable [QGVAR(pain), 0];
_unit setVariable [QGVAR(pain), _painLevel + _painToAdd];
[_unit, "hit", PAIN_TO_SCREAM(_painToAdd)] call EFUNC(medical_engine,playInjuredSound);
TRACE_6("exit",_unit, _painLevel, _painToAdd, _unit getVariable QGVAR(pain), _unit getVariable QGVAR(openWounds),_woundsCreated);

View File

@ -2,9 +2,9 @@
#define COMPONENT_BEAUTIFIED Medical Damage
#include "\z\ace\addons\main\script_mod.hpp"
//#define DEBUG_MODE_FULL
//#define DISABLE_COMPILE_CACHE
//#define CBA_DEBUG_SYNCHRONOUS
#define DEBUG_MODE_FULL
#define DISABLE_COMPILE_CACHE
#define CBA_DEBUG_SYNCHRONOUS
//#define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_MEDICAL_DAMAGE
@ -22,3 +22,7 @@
#define GET_ARRAY(config,default) (if (isArray (config)) then {getArray (config)} else {default})
#define ALL_BODY_PARTS ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"]
// scale received pain to 0-2 level to select type of scream
// below 0.25: 0, from 0.25 to 0.5: 1, more than 0.5: 2
#define PAIN_TO_SCREAM(pain) (floor (4 * pain) min 2)

View File

@ -21,6 +21,7 @@
#define TIME_OUT 1
params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]]];
TRACE_3("",_unit,_type,_severity);
if (!local _unit) exitWith {
ACE_LOGERROR("Unit not local or null");

View File

@ -2,9 +2,9 @@
#define COMPONENT_BEAUTIFIED Medical (Engine)
#include "\z\ace\addons\main\script_mod.hpp"
//#define DEBUG_MODE_FULL
//#define DISABLE_COMPILE_CACHE
//#define CBA_DEBUG_SYNCHRONOUS
#define DEBUG_MODE_FULL
#define DISABLE_COMPILE_CACHE
#define CBA_DEBUG_SYNCHRONOUS
//#define ENABLE_PERFORMANCE_COUNTERS
#ifdef DEBUG_ENABLED_MEDICAL_ENGINE