2016-10-06 20:40:36 +00:00
|
|
|
|
|
|
|
#define ALL_BODY_PARTS ["head", "body", "leftarm", "rightarm", "leftleg", "rightleg"]
|
2018-07-18 18:13:25 +00:00
|
|
|
#define ALL_SELECTIONS ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]
|
|
|
|
#define ALL_HITPOINTS ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]
|
2016-10-06 20:40:36 +00:00
|
|
|
|
2018-07-29 20:19:04 +00:00
|
|
|
// Damage threshold above which fatal organ damage can occur
|
|
|
|
#define HEAD_DAMAGE_THRESHOLD 1
|
|
|
|
#define ORGAN_DAMAGE_THRESHOLD 0.6
|
|
|
|
|
|
|
|
// Chance to hit heart based on ratio of 70kg (approx. 70L) body to 70mL stroke volume of heart
|
|
|
|
// Assuming torso is 50% of the body volume (35L)
|
|
|
|
#define HEART_HIT_CHANCE 0.05
|
|
|
|
|
2017-06-15 19:35:33 +00:00
|
|
|
#define MEDICAL_ACTION_DISTANCE 1.75
|
|
|
|
|
2016-10-06 20:40:36 +00:00
|
|
|
// 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)
|
|
|
|
|
|
|
|
// scale received pain to 0-2 level to select type of scream
|
|
|
|
// below 0.33: 0, from 0.34 to 0.66: 1, more than 0.67: 2
|
|
|
|
#define PAIN_TO_MOAN(pain) (floor (3 * pain) min 2)
|
|
|
|
|
|
|
|
#define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default})
|
|
|
|
#define GET_STRING(config,default) (if (isText (config)) then {getText (config)} else {default})
|
|
|
|
#define GET_ARRAY(config,default) (if (isArray (config)) then {getArray (config)} else {default})
|
2016-10-10 15:30:42 +00:00
|
|
|
|
2016-12-09 11:57:27 +00:00
|
|
|
#define DEFAULT_HEART_RATE 80
|
2018-05-23 09:52:47 +00:00
|
|
|
#define DEFAULT_PERIPH_RES 100
|
2016-12-09 11:57:27 +00:00
|
|
|
|
2016-10-10 15:30:42 +00:00
|
|
|
// --- blood
|
2016-10-10 16:22:46 +00:00
|
|
|
// 0.077 l/kg * 80kg = 6.16l
|
2016-10-10 15:30:42 +00:00
|
|
|
#define DEFAULT_BLOOD_VOLUME 6.0 // in liters
|
|
|
|
|
2016-12-05 20:34:20 +00:00
|
|
|
#define BLOOD_VOLUME_CLASS_1_HEMORRHAGE 6.000 // lost less than 15% blood, Class I Hemorrhage
|
|
|
|
#define BLOOD_VOLUME_CLASS_2_HEMORRHAGE 5.100 // lost more than 15% blood, Class II Hemorrhage
|
|
|
|
#define BLOOD_VOLUME_CLASS_3_HEMORRHAGE 4.200 // lost more than 30% blood, Class III Hemorrhage
|
|
|
|
#define BLOOD_VOLUME_CLASS_4_HEMORRHAGE 3.600 // lost more than 40% blood, Class IV Hemorrhage
|
2018-07-25 10:40:37 +00:00
|
|
|
#define BLOOD_VOLUME_FATAL 3.0 // Lost more than 50% blood, Unrecoverable
|
2016-10-10 16:20:58 +00:00
|
|
|
|
2016-10-11 17:44:20 +00:00
|
|
|
// IV Change per second calculation:
|
2016-12-05 20:34:20 +00:00
|
|
|
// 250 ml should take 60 seconds to fill. 250 ml / 60 s ~ 4.1667 ml/s.
|
|
|
|
#define IV_CHANGE_PER_SECOND 4.1667 // in milliliters per second
|
2016-10-12 19:59:32 +00:00
|
|
|
|
2016-12-05 20:34:20 +00:00
|
|
|
// Minimum amount of damage required for penetrating wounds (also minDamage for velocity wounds)
|
|
|
|
#define PENETRATION_THRESHOLD 0.35
|
2016-10-12 19:59:32 +00:00
|
|
|
|
2016-12-05 20:34:20 +00:00
|
|
|
// To be replaced by a proper blood pressure calculation
|
|
|
|
#define BLOOD_LOSS_KNOCK_OUT_THRESHOLD 0.5 // 50% of cardiac output
|
2016-10-20 11:46:28 +00:00
|
|
|
|
|
|
|
// --- pain
|
2016-12-05 20:34:20 +00:00
|
|
|
#define PAIN_UNCONSCIOUS 0.5
|
2016-10-20 11:46:28 +00:00
|
|
|
|
2016-12-15 11:58:06 +00:00
|
|
|
// Pain fade out time (time it takes until pain is guaranteed to be completly gone)
|
|
|
|
#define PAIN_FADE_TIME 900
|
|
|
|
|
|
|
|
// Only relevant when advanced medication is disabled
|
|
|
|
// Morphine pain suppression fade out time (time it takes until pain suppression is guaranteed to be completly gone)
|
|
|
|
#define PAIN_SUPPRESSION_FADE_TIME 1800
|
2016-12-05 20:34:20 +00:00
|
|
|
|
|
|
|
// Chance to wake up when vitals are stable (checked once every SPONTANEOUS_WAKE_UP_INTERVAL seconds)
|
2016-12-06 09:58:43 +00:00
|
|
|
#define SPONTANEOUS_WAKE_UP_INTERVAL 15
|
2016-12-08 10:38:43 +00:00
|
|
|
|
|
|
|
// Minimum leg damage required for limping
|
|
|
|
#define LIMPING_DAMAGE_THRESHOLD 0.30
|
|
|
|
|
|
|
|
// Minimum body part damage required for blood effect on uniform
|
|
|
|
#define VISUAL_BODY_DAMAGE_THRESHOLD 0.35
|
2017-04-27 17:05:21 +00:00
|
|
|
|
2018-07-25 08:35:04 +00:00
|
|
|
// Empty wound data, used for some default return values
|
|
|
|
// [ID, classID, bodypartIndex, amountOf, bloodloss, damage, category]
|
|
|
|
#define EMPTY_WOUND [-1, -1, -1, 0, 0, 0, 0]
|
|
|
|
|
|
|
|
// Base time to bandage each wound category
|
|
|
|
#define BANDAGE_TIME_S 4
|
|
|
|
#define BANDAGE_TIME_M 6
|
|
|
|
#define BANDAGE_TIME_L 8
|
|
|
|
#define BANDAGE_TIME_MOD_MEDIC -2
|
|
|
|
#define BANDAGE_TIME_MOD_SELF 4
|
2018-05-11 14:28:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
// - Unit Variables ----------------------------------------------------
|
|
|
|
// These variables get stored in object space and used across components
|
|
|
|
// Defined here for easy consistency with GETVAR/SETVAR (also a list for reference)
|
|
|
|
#define VAR_BLOOD_PRESS QEGVAR(medical,bloodPressure)
|
2018-05-11 15:11:01 +00:00
|
|
|
#define VAR_BLOOD_VOL QEGVAR(medical,bloodVolume)
|
2018-05-22 17:06:28 +00:00
|
|
|
#define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest)
|
2018-05-11 15:11:01 +00:00
|
|
|
#define VAR_HEART_RATE QEGVAR(medical,heartRate)
|
|
|
|
#define VAR_PAIN QEGVAR(medical,pain)
|
|
|
|
#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress)
|
2018-05-23 09:52:47 +00:00
|
|
|
#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance)
|
2018-05-22 16:21:24 +00:00
|
|
|
#define VAR_UNCON "ACE_isUnconscious"
|
2018-05-11 15:11:01 +00:00
|
|
|
// These variables track gradual adjustments (from medication, etc.)
|
|
|
|
#define VAR_HEART_RATE_ADJ QEGVAR(medical,heartRateAdjustments)
|
|
|
|
#define VAR_PAIN_SUPP_ADJ QEGVAR(medical,painSuppressAdjustments)
|
2018-05-23 09:52:47 +00:00
|
|
|
#define VAR_PERIPH_RES_ADJ QEGVAR(medical,peripheralResistanceAdjustments)
|
2018-05-22 17:25:07 +00:00
|
|
|
// These variables track the current state of status values above
|
|
|
|
#define VAR_HEMORRHAGE QEGVAR(medical,hemorrhage)
|
|
|
|
#define VAR_IN_PAIN QEGVAR(medical,inPain)
|
|
|
|
#define VAR_IS_BLEEDING QEGVAR(medical,isBleeding)
|
2018-05-11 14:28:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
// - Unit Functions ---------------------------------------------------
|
|
|
|
// Retrieval macros for common unit values
|
|
|
|
// Defined for easy consistency and speed
|
2018-07-15 11:01:26 +00:00
|
|
|
#define GET_BLOOD_VOLUME(unit) (unit getVariable [VAR_BLOOD_VOL,DEFAULT_BLOOD_VOLUME])
|
|
|
|
#define GET_HEART_RATE(unit) (unit getVariable [VAR_HEART_RATE,DEFAULT_HEART_RATE])
|
|
|
|
#define GET_HEMORRHAGE(unit) (unit getVariable [VAR_HEMORRHAGE,0])
|
|
|
|
#define GET_PAIN(unit) (unit getVariable [VAR_PAIN,0])
|
|
|
|
#define GET_PAIN_SUPPRESS(unit) (unit getVariable [VAR_PAIN_SUPP,0])
|
|
|
|
#define IN_CRDC_ARRST(unit) (unit getVariable [VAR_CRDC_ARRST,false])
|
|
|
|
#define IS_BLEEDING(unit) (unit getVariable [VAR_IS_BLEEDING,false])
|
|
|
|
#define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN,false])
|
|
|
|
#define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON,false])
|
2018-05-11 14:28:25 +00:00
|
|
|
|
|
|
|
// The following function calls are defined here just for consistency
|
|
|
|
#define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(medical_status,getBloodLoss))
|
|
|
|
#define GET_BLOOD_PRESSURE(unit) ([unit] call EFUNC(medical_status,getBloodPressure))
|
|
|
|
|
|
|
|
// Derivative unit values commonly used
|
|
|
|
#define GET_PAIN_PERCEIVED(unit) (0 max (GET_PAIN(unit) - GET_PAIN_SUPPRESS(unit)) min 1)
|