mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
make units scream when they're hit
This commit is contained in:
parent
a913054b57
commit
20d00d7cd9
@ -2,7 +2,7 @@
|
|||||||
#define COMPONENT_BEAUTIFIED Medical Core
|
#define COMPONENT_BEAUTIFIED Medical Core
|
||||||
#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 CBA_DEBUG_SYNCHRONOUS
|
#define CBA_DEBUG_SYNCHRONOUS
|
||||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define COMPONENT_BEAUTIFIED Medical Blood
|
#define COMPONENT_BEAUTIFIED Medical Blood
|
||||||
#include "\z\ace\addons\main\script_mod.hpp"
|
#include "\z\ace\addons\main\script_mod.hpp"
|
||||||
|
|
||||||
#define DEBUG_ENABLED_MEDICAL_BLOOD
|
//#define DEBUG_ENABLED_MEDICAL_BLOOD
|
||||||
#define DISABLE_COMPILE_CACHE
|
#define DISABLE_COMPILE_CACHE
|
||||||
#define CBA_DEBUG_SYNCHRONOUS
|
#define CBA_DEBUG_SYNCHRONOUS
|
||||||
// #define ENABLE_PERFORMANCE_COUNTERS
|
// #define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
@ -72,4 +72,6 @@ if (count _woundsCreated > 0) then {
|
|||||||
private _painLevel = _unit getVariable [QEGVAR(medical,pain), 0];
|
private _painLevel = _unit getVariable [QEGVAR(medical,pain), 0];
|
||||||
_unit setVariable [QEGVAR(medical,pain), _painLevel + _painToAdd];
|
_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);
|
TRACE_6("exit",_unit, _painLevel, _painToAdd, _unit getVariable QEGVAR(medical,pain), _unit getVariable QEGVAR(medical,openWounds),_woundsCreated);
|
||||||
|
@ -136,4 +136,6 @@ if (count _woundsCreated > 0) then {
|
|||||||
private _painLevel = _unit getVariable [QGVAR(pain), 0];
|
private _painLevel = _unit getVariable [QGVAR(pain), 0];
|
||||||
_unit setVariable [QGVAR(pain), _painLevel + _painToAdd];
|
_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);
|
TRACE_6("exit",_unit, _painLevel, _painToAdd, _unit getVariable QGVAR(pain), _unit getVariable QGVAR(openWounds),_woundsCreated);
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#define COMPONENT_BEAUTIFIED Medical Damage
|
#define COMPONENT_BEAUTIFIED Medical Damage
|
||||||
#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 CBA_DEBUG_SYNCHRONOUS
|
#define CBA_DEBUG_SYNCHRONOUS
|
||||||
//#define ENABLE_PERFORMANCE_COUNTERS
|
//#define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED_MEDICAL_DAMAGE
|
#ifdef DEBUG_ENABLED_MEDICAL_DAMAGE
|
||||||
@ -22,3 +22,7 @@
|
|||||||
#define GET_ARRAY(config,default) (if (isArray (config)) then {getArray (config)} else {default})
|
#define GET_ARRAY(config,default) (if (isArray (config)) then {getArray (config)} else {default})
|
||||||
|
|
||||||
#define ALL_BODY_PARTS ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"]
|
#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)
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#define TIME_OUT 1
|
#define TIME_OUT 1
|
||||||
|
|
||||||
params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]]];
|
params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]]];
|
||||||
|
TRACE_3("",_unit,_type,_severity);
|
||||||
|
|
||||||
if (!local _unit) exitWith {
|
if (!local _unit) exitWith {
|
||||||
ACE_LOGERROR("Unit not local or null");
|
ACE_LOGERROR("Unit not local or null");
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#define COMPONENT_BEAUTIFIED Medical (Engine)
|
#define COMPONENT_BEAUTIFIED Medical (Engine)
|
||||||
#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 CBA_DEBUG_SYNCHRONOUS
|
#define CBA_DEBUG_SYNCHRONOUS
|
||||||
//#define ENABLE_PERFORMANCE_COUNTERS
|
//#define ENABLE_PERFORMANCE_COUNTERS
|
||||||
|
|
||||||
#ifdef DEBUG_ENABLED_MEDICAL_ENGINE
|
#ifdef DEBUG_ENABLED_MEDICAL_ENGINE
|
||||||
|
Loading…
Reference in New Issue
Block a user