From 44050df98b00e579e5b5a79c0d76d4d1138b4baa Mon Sep 17 00:00:00 2001 From: mharis001 <34453221+mharis001@users.noreply.github.com> Date: Mon, 3 Jun 2019 11:31:46 -0400 Subject: [PATCH] Medical Treatment - Modernize and Cleanup (#6933) * Modernize and cleanup medical_treatment * One line for each old public function * Fix litterCleanupDelay name * Improve adjustment calcs / wound blood loss / medications fix func descriptions Calc wound blood loss on events reorder includes so scritpmacroMed has global effect trivial optimization for getCardiacOutput Fix var Fix wounds not reopening (nil _category) Fix surgical kit inherting canBandage conditional debug hitpoints Update ACE_Medical_Treatment_Actions.hpp Use woundBleeding for IS_BLEEDING macro rework medication vars comments Reset var in init / fullHeal Update addons/medical_treatment/functions/fnc_onMedicationUsage.sqf Co-Authored-By: PabstMirror * Change wound data array Drop unique id and merge classId and category * Splinting and treatment and gui * Add arm fractures and aim effects * localizations and event * fix * fix merge for renamed files * Fixes and code review changes * Move medical logs clearing to treatment * More cleanup work * cleanup * Apply suggestions from code review Co-Authored-By: PabstMirror * formating, rename bone images * Fix args for setDead call in actionPlaceInBodyBag * Apply suggestions from code review Co-Authored-By: PabstMirror * disable calls to extension * Update fnc_onMedicationUsage.sqf * Medical - Skip unneeded setVars on initUnit (#6949) * Medical - Transfer state machine state on locality (#6950) * Medical - Transfer state machine state on locality * Fix feedback isUnconscious var * Exclude AI * Make UAV excludes consistant, formating * Update fnc_treatmentFullHealLocal.sqf * reset fractures on respawn * Fix merge * Add PAK time coefficient setting * Fix medication * Add ace_medical_replacementItems config array * checkItems performance improvement * Treatment - cap max animation speed (#6995) * Treatment - cap max animation speed and add lock to prevent AF from reseting anim * Update fnc_getBandageTime.sqf * Use local version of setAnimSpeedCoef * Revert "Use local version of setAnimSpeedCoef" This reverts commit 36c22a90473fd0670ab97f3a373e4ae08493ff52. * Move replacementItems compiling to preInit * Improve replacementItems compiling * Cleanup splint functions, use macros for fractures * Rename splintCondition to canSplint * Add cprCreatesPulse setting * Cleanup remaining functions * Capitalize stringtable entry names * getStitchTime function and fix treatment locations * Update addons/medical_treatment/functions/fnc_getHealTime.sqf Co-Authored-By: SilentSpike --- addons/advanced_fatigue/XEH_preInit.sqf | 1 + .../functions/fnc_handleEffects.sqf | 10 +- addons/common/stringtable.xml | 2 +- addons/medical/XEH_preInit.sqf | 41 +- addons/medical/dev/watchVariable.sqf | 5 +- .../medical/functions/fnc_setUnconscious.sqf | 3 +- addons/medical/initSettings.sqf | 2 +- addons/medical/script_component.hpp | 2 +- addons/medical/stringtable.xml | 17 +- .../functions/fnc_playTreatmentAnim.sqf | 2 +- addons/medical_blood/initSettings.sqf | 2 +- .../functions/fnc_woundsHandlerSQF.sqf | 4 +- addons/medical_damage/initSettings.sqf | 2 +- .../functions/fnc_updateDamageEffects.sqf | 2 +- .../medical_engine/script_macros_medical.hpp | 34 +- addons/medical_feedback/initSettings.sqf | 2 +- addons/medical_gui/CfgVehicles.hpp | 6 +- .../fnc_displayPatientInformation.sqf | 2 +- addons/medical_gui/functions/fnc_menuPFH.sqf | 4 +- .../functions/fnc_updateBodyImage.sqf | 13 +- .../functions/fnc_updateInjuryList.sqf | 12 +- .../functions/fnc_updateLogList.sqf | 4 +- addons/medical_gui/initSettings.sqf | 10 +- addons/medical_gui/script_component.hpp | 4 +- addons/medical_statemachine/initSettings.sqf | 2 +- .../medical_status/functions/fnc_initUnit.sqf | 9 +- addons/medical_status/initSettings.sqf | 2 +- .../ACE_Medical_Treatment.hpp | 10 +- .../ACE_Medical_Treatment_Actions.hpp | 219 +-- .../{CfgEden.hpp => Cfg3DEN.hpp} | 57 +- .../medical_treatment/CfgReplacementItems.hpp | 17 + addons/medical_treatment/CfgWeapons.hpp | 61 +- addons/medical_treatment/XEH_PREP.hpp | 99 +- addons/medical_treatment/XEH_postInit.sqf | 50 +- addons/medical_treatment/XEH_preInit.sqf | 24 + addons/medical_treatment/config.cpp | 3 +- .../fnc_actionCheckBloodPressure.sqf | 21 - .../fnc_actionCheckBloodPressureLocal.sqf | 57 - .../functions/fnc_actionCheckPulse.sqf | 21 - .../functions/fnc_actionCheckPulseLocal.sqf | 54 - .../functions/fnc_actionCheckResponse.sqf | 26 - .../functions/fnc_actionDiagnose.sqf | 45 - .../functions/fnc_actionLoadUnit.sqf | 42 - .../functions/fnc_actionPlaceInBodyBag.sqf | 51 - .../functions/fnc_actionUnloadUnit.sqf | 26 - .../functions/fnc_addLoadPatientActions.sqf | 8 +- .../functions/fnc_addToLog.sqf | 47 +- .../functions/fnc_addToTriageCard.sqf | 41 +- .../functions/fnc_bandage.sqf | 25 + ...tBandageLocal.sqf => fnc_bandageLocal.sqf} | 33 +- .../functions/fnc_bodyCleanupLoop.sqf | 16 +- .../fnc_canAccessMedicalEquipment.sqf | 28 - .../functions/fnc_canBandage.sqf | 16 +- .../functions/fnc_canCPR.sqf | 21 + ..._splintCondition.sqf => fnc_canSplint.sqf} | 15 +- .../functions/fnc_canStitch.sqf | 6 +- .../functions/fnc_canTreat.sqf | 135 +- .../functions/fnc_canTreatCached.sqf | 17 +- .../functions/fnc_checkBloodPressure.sqf | 22 + .../functions/fnc_checkBloodPressureLocal.sqf | 57 + .../functions/fnc_checkItems.sqf | 53 +- .../functions/fnc_checkPulse.sqf | 22 + .../functions/fnc_checkPulseLocal.sqf | 53 + .../functions/fnc_checkResponse.sqf | 24 + .../medical_treatment/functions/fnc_cpr.sqf | 27 + .../functions/fnc_cprFailure.sqf | 28 + .../functions/fnc_cprLocal.sqf | 25 + .../functions/fnc_cprProgress.sqf | 29 + .../functions/fnc_cprStart.sqf | 29 + .../functions/fnc_createLitter.sqf | 70 + .../functions/fnc_createLitterServer.sqf | 57 + .../functions/fnc_diagnose.sqf | 49 + .../functions/fnc_findMostEffectiveWound.sqf | 4 +- .../functions/fnc_fullHeal.sqf | 23 + .../functions/fnc_fullHealLocal.sqf | 84 ++ .../functions/fnc_getBandageTime.sqf | 15 +- .../functions/fnc_getHealTime.sqf | 29 + .../functions/fnc_getStitchTime.sqf | 23 + .../functions/fnc_getTriageStatus.sqf | 10 +- .../functions/fnc_hasItem.sqf | 39 +- .../functions/fnc_hasItems.sqf | 36 - .../functions/fnc_hasTourniquetAppliedTo.sqf | 10 +- .../functions/fnc_healTime.sqf | 32 - .../functions/fnc_isInMedicalFacility.sqf | 56 +- .../functions/fnc_isInMedicalVehicle.sqf | 11 +- .../functions/fnc_isMedic.sqf | 17 +- .../functions/fnc_isMedicalVehicle.sqf | 8 +- .../medical_treatment/functions/fnc_ivBag.sqf | 28 + .../functions/fnc_ivBagLocal.sqf | 38 + .../functions/fnc_litterCleanupLoop.sqf | 35 +- .../functions/fnc_litterCreate.sqf | 98 -- .../functions/fnc_litterHandleCreate.sqf | 68 - .../functions/fnc_loadUnit.sqf | 40 + .../functions/fnc_medication.sqf | 28 + .../functions/fnc_medicationLocal.sqf | 78 ++ .../functions/fnc_onMedicationUsage.sqf | 6 +- .../functions/fnc_placeInBodyBag.sqf | 48 + .../functions/fnc_removeBody.sqf | 35 + .../functions/fnc_serverRemoveBody.sqf | 33 - .../functions/fnc_splint.sqf | 16 +- .../functions/fnc_splintLocal.sqf | 27 +- .../functions/fnc_surgicalKitProgress.sqf | 49 + .../functions/fnc_tourniquet.sqf | 33 + .../functions/fnc_tourniquetLocal.sqf | 28 + .../functions/fnc_tourniquetRemove.sqf | 59 + .../functions/fnc_treatment.sqf | 205 +-- .../functions/fnc_treatmentBandage.sqf | 26 - .../functions/fnc_treatmentCPR.sqf | 30 - .../functions/fnc_treatmentCPRLocal.sqf | 25 - .../functions/fnc_treatmentCPR_failure.sqf | 22 - .../functions/fnc_treatmentCPR_progress.sqf | 28 - .../functions/fnc_treatmentCPR_start.sqf | 23 - .../functions/fnc_treatmentFailure.sqf | 50 + .../functions/fnc_treatmentFullHeal.sqf | 26 - .../functions/fnc_treatmentFullHealLocal.sqf | 76 - .../functions/fnc_treatmentIV.sqf | 31 - .../functions/fnc_treatmentIVLocal.sqf | 48 - .../functions/fnc_treatmentMedication.sqf | 34 - .../fnc_treatmentMedicationLocal.sqf | 87 -- .../functions/fnc_treatmentSuccess.sqf | 51 + .../fnc_treatmentSurgicalKit_onProgress.sqf | 49 - .../functions/fnc_treatmentTourniquet.sqf | 40 - .../fnc_treatmentTourniquetLocal.sqf | 28 - .../fnc_treatmentTourniquetRemove.sqf | 56 - .../functions/fnc_treatment_failure.sqf | 56 - .../functions/fnc_treatment_success.sqf | 71 - .../functions/fnc_unloadUnit.sqf | 29 + .../functions/fnc_useItem.sqf | 47 +- .../functions/fnc_useItems.sqf | 50 - addons/medical_treatment/initSettings.sqf | 281 ++-- addons/medical_treatment/script_component.hpp | 38 +- addons/medical_treatment/stringtable.xml | 1225 +++++++---------- .../adenosine_x_ca.paa => adenosine_ca.paa} | Bin .../atropine_x_ca.paa => atropine_ca.paa} | Bin .../bloodiv_x_ca.paa => bloodiv_ca.paa} | Bin .../bodybag_x_ca.paa => bodybag_ca.paa} | Bin ...bandage_x_ca.paa => elasticbandage_ca.paa} | Bin ...pinephrine_x_ca.paa => epinephrine_ca.paa} | Bin ...dressing_x_ca.paa => fielddressing_ca.paa} | Bin .../morphine_x_ca.paa => morphine_ca.paa} | Bin ...bandage_x_ca.paa => packingbandage_ca.paa} | Bin ...d_kit_x_ca.paa => personal_aid_kit_ca.paa} | Bin .../plasmaiv_x_ca.paa => plasmaiv_ca.paa} | Bin .../quickclot_x_ca.paa => quickclot_ca.paa} | Bin .../salineiv_x_ca.paa => salineiv_ca.paa} | Bin ...urgicalkit_x_ca.paa => surgicalkit_ca.paa} | Bin .../tourniquet_x_ca.paa => tourniquet_ca.paa} | Bin 147 files changed, 2705 insertions(+), 3206 deletions(-) rename addons/medical_treatment/{CfgEden.hpp => Cfg3DEN.hpp} (60%) create mode 100644 addons/medical_treatment/CfgReplacementItems.hpp delete mode 100644 addons/medical_treatment/functions/fnc_actionCheckBloodPressure.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionCheckPulse.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionCheckResponse.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionDiagnose.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionLoadUnit.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf delete mode 100644 addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf create mode 100644 addons/medical_treatment/functions/fnc_bandage.sqf rename addons/medical_treatment/functions/{fnc_treatmentBandageLocal.sqf => fnc_bandageLocal.sqf} (52%) delete mode 100644 addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf create mode 100644 addons/medical_treatment/functions/fnc_canCPR.sqf rename addons/medical_treatment/functions/{fnc_splintCondition.sqf => fnc_canSplint.sqf} (52%) create mode 100644 addons/medical_treatment/functions/fnc_checkBloodPressure.sqf create mode 100644 addons/medical_treatment/functions/fnc_checkBloodPressureLocal.sqf create mode 100644 addons/medical_treatment/functions/fnc_checkPulse.sqf create mode 100644 addons/medical_treatment/functions/fnc_checkPulseLocal.sqf create mode 100644 addons/medical_treatment/functions/fnc_checkResponse.sqf create mode 100644 addons/medical_treatment/functions/fnc_cpr.sqf create mode 100644 addons/medical_treatment/functions/fnc_cprFailure.sqf create mode 100644 addons/medical_treatment/functions/fnc_cprLocal.sqf create mode 100644 addons/medical_treatment/functions/fnc_cprProgress.sqf create mode 100644 addons/medical_treatment/functions/fnc_cprStart.sqf create mode 100644 addons/medical_treatment/functions/fnc_createLitter.sqf create mode 100644 addons/medical_treatment/functions/fnc_createLitterServer.sqf create mode 100644 addons/medical_treatment/functions/fnc_diagnose.sqf create mode 100644 addons/medical_treatment/functions/fnc_fullHeal.sqf create mode 100644 addons/medical_treatment/functions/fnc_fullHealLocal.sqf create mode 100644 addons/medical_treatment/functions/fnc_getHealTime.sqf create mode 100644 addons/medical_treatment/functions/fnc_getStitchTime.sqf delete mode 100644 addons/medical_treatment/functions/fnc_hasItems.sqf delete mode 100644 addons/medical_treatment/functions/fnc_healTime.sqf create mode 100644 addons/medical_treatment/functions/fnc_ivBag.sqf create mode 100644 addons/medical_treatment/functions/fnc_ivBagLocal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_litterCreate.sqf delete mode 100644 addons/medical_treatment/functions/fnc_litterHandleCreate.sqf create mode 100644 addons/medical_treatment/functions/fnc_loadUnit.sqf create mode 100644 addons/medical_treatment/functions/fnc_medication.sqf create mode 100644 addons/medical_treatment/functions/fnc_medicationLocal.sqf create mode 100644 addons/medical_treatment/functions/fnc_placeInBodyBag.sqf create mode 100644 addons/medical_treatment/functions/fnc_removeBody.sqf delete mode 100644 addons/medical_treatment/functions/fnc_serverRemoveBody.sqf create mode 100644 addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf create mode 100644 addons/medical_treatment/functions/fnc_tourniquet.sqf create mode 100644 addons/medical_treatment/functions/fnc_tourniquetLocal.sqf create mode 100644 addons/medical_treatment/functions/fnc_tourniquetRemove.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentBandage.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentCPR.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentCPRLocal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentCPR_failure.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentCPR_start.sqf create mode 100644 addons/medical_treatment/functions/fnc_treatmentFailure.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentFullHeal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentIV.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentIVLocal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentMedication.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf create mode 100644 addons/medical_treatment/functions/fnc_treatmentSuccess.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentTourniquet.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentTourniquetLocal.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatmentTourniquetRemove.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatment_failure.sqf delete mode 100644 addons/medical_treatment/functions/fnc_treatment_success.sqf create mode 100644 addons/medical_treatment/functions/fnc_unloadUnit.sqf delete mode 100644 addons/medical_treatment/functions/fnc_useItems.sqf rename addons/medical_treatment/ui/{items/adenosine_x_ca.paa => adenosine_ca.paa} (100%) rename addons/medical_treatment/ui/{items/atropine_x_ca.paa => atropine_ca.paa} (100%) rename addons/medical_treatment/ui/{items/bloodiv_x_ca.paa => bloodiv_ca.paa} (100%) rename addons/medical_treatment/ui/{items/bodybag_x_ca.paa => bodybag_ca.paa} (100%) rename addons/medical_treatment/ui/{items/elasticbandage_x_ca.paa => elasticbandage_ca.paa} (100%) rename addons/medical_treatment/ui/{items/epinephrine_x_ca.paa => epinephrine_ca.paa} (100%) rename addons/medical_treatment/ui/{items/fielddressing_x_ca.paa => fielddressing_ca.paa} (100%) rename addons/medical_treatment/ui/{items/morphine_x_ca.paa => morphine_ca.paa} (100%) rename addons/medical_treatment/ui/{items/packingbandage_x_ca.paa => packingbandage_ca.paa} (100%) rename addons/medical_treatment/ui/{items/personal_aid_kit_x_ca.paa => personal_aid_kit_ca.paa} (100%) rename addons/medical_treatment/ui/{items/plasmaiv_x_ca.paa => plasmaiv_ca.paa} (100%) rename addons/medical_treatment/ui/{items/quickclot_x_ca.paa => quickclot_ca.paa} (100%) rename addons/medical_treatment/ui/{items/salineiv_x_ca.paa => salineiv_ca.paa} (100%) rename addons/medical_treatment/ui/{items/surgicalkit_x_ca.paa => surgicalkit_ca.paa} (100%) rename addons/medical_treatment/ui/{items/tourniquet_x_ca.paa => tourniquet_ca.paa} (100%) diff --git a/addons/advanced_fatigue/XEH_preInit.sqf b/addons/advanced_fatigue/XEH_preInit.sqf index 1cb60db9173..12f007ccf66 100644 --- a/addons/advanced_fatigue/XEH_preInit.sqf +++ b/addons/advanced_fatigue/XEH_preInit.sqf @@ -10,5 +10,6 @@ PREP_RECOMPILE_END; GVAR(staminaBarWidth) = 10 * (((safezoneW / safezoneH) min 1.2) / 40); GVAR(dutyList) = [[], []]; +GVAR(setAnimExclusions) = []; ADDON = true; diff --git a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf index 1283d865558..fbbb6852171 100644 --- a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf +++ b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf @@ -58,8 +58,9 @@ if (GVAR(ppeBlackoutLast) == 1) then { // - Physical effects --------------------------------------------------------- if (GVAR(isSwimming)) exitWith { - _unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true]; - + if (GVAR(setAnimExclusions) isEqualTo []) then { + _unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true]; + }; if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then { [_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); } else { @@ -69,7 +70,10 @@ if (GVAR(isSwimming)) exitWith { }; }; if ((getAnimSpeedCoef _unit) != 1) then { - _unit setAnimSpeedCoef 1; + if (GVAR(setAnimExclusions) isEqualTo []) then { + TRACE_1("reset",getAnimSpeedCoef _unit); + _unit setAnimSpeedCoef 1; + }; }; if (_overexhausted) then { diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 7aac0722a9e..2c4b3aecfd8 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1036,7 +1036,7 @@ 기본 - Medical vehicles + Medical Vehicles В медицинском транспорте Pojazdy medyczne Vehiculos médicos diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index aac77adab91..2ebebbbd3df 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -11,7 +11,44 @@ PREP_RECOMPILE_END; // Add warning for old functions that were technically public, Remove at 3.14.0 { missionNamespace setVariable [_x, compileFinal format ['diag_log text "ACE Medical WARNING: Formerly public function [%1] has no effect in medical rewrite."; nil', _x]]; -} forEach ["ace_medical_fnc_actionPlaceInBodyBag","ace_medical_fnc_actionRemoveTourniquet","ace_medical_fnc_addHeartRateAdjustment","ace_medical_fnc_addToLog","ace_medical_fnc_addToTriageCard -","ace_medical_fnc_addUnconsciousCondition","ace_medical_fnc_addVitalLoop","ace_medical_fnc_canAccessMedicalEquipment","ace_medical_fnc_canTreat","ace_medical_fnc_displayTriageCard","ace_medical_fnc_dropDownTriageCard","ace_medical_fnc_getTriageStatus","ace_medical_fnc_getUnconsciousCondition","ace_medical_fnc_hasItem","ace_medical_fnc_hasItems","ace_medical_fnc_hasTourniquetAppliedTo","ace_medical_fnc_isInMedicalFacility","ace_medical_fnc_isInMedicalVehicle","ace_medical_fnc_isMedic","ace_medical_fnc_isMedicalVehicle","ace_medical_fnc_itemCheck","ace_medical_fnc_selectionNameToNumber","ace_medical_fnc_setCardiacArrest","ace_medical_fnc_setDead","ace_medical_fnc_setHitPointDamage","ace_medical_fnc_showBloodEffect","ace_medical_fnc_treatment","ace_medical_fnc_treatmentAdvanced_bandage","ace_medical_fnc_treatmentAdvanced_CPR","ace_medical_fnc_treatmentAdvanced_CPRLocal","ace_medical_fnc_treatmentAdvanced_medication","ace_medical_fnc_treatmentAdvanced_medicationLocal","ace_medical_fnc_treatmentIV","ace_medical_fnc_treatmentIVLocal","ace_medical_fnc_unconsciousPFH","ace_medical_fnc_useItem","ace_medical_fnc_useItems"]; +} forEach [ + QFUNC(actionPlaceInBodyBag), + QFUNC(actionRemoveTourniquet), + QFUNC(addHeartRateAdjustment), + QFUNC(addToLog), + QFUNC(addToTriageCard), + QFUNC(addUnconsciousCondition), + QFUNC(addVitalLoop), + QFUNC(canAccessMedicalEquipment), + QFUNC(canTreat), + QFUNC(displayTriageCard), + QFUNC(dropDownTriageCard), + QFUNC(getTriageStatus), + QFUNC(getUnconsciousCondition), + QFUNC(hasItem), + QFUNC(hasItems), + QFUNC(hasTourniquetAppliedTo), + QFUNC(isInMedicalFacility), + QFUNC(isInMedicalVehicle), + QFUNC(isMedic), + QFUNC(isMedicalVehicle), + QFUNC(itemCheck), + QFUNC(selectionNameToNumber), + QFUNC(setCardiacArrest), + QFUNC(setDead), + QFUNC(setHitPointDamage), + QFUNC(showBloodEffect), + QFUNC(treatment), + QFUNC(treatmentAdvanced_bandage), + QFUNC(treatmentAdvanced_CPR), + QFUNC(treatmentAdvanced_CPRLocal), + QFUNC(treatmentAdvanced_medication), + QFUNC(treatmentAdvanced_medicationLocal), + QFUNC(treatmentIV), + QFUNC(treatmentIVLocal), + QFUNC(unconsciousPFH), + QFUNC(useItem), + QFUNC(useItems) +]; ADDON = true; diff --git a/addons/medical/dev/watchVariable.sqf b/addons/medical/dev/watchVariable.sqf index dc97952e0c0..5fc0b1a065f 100644 --- a/addons/medical/dev/watchVariable.sqf +++ b/addons/medical/dev/watchVariable.sqf @@ -60,7 +60,7 @@ _return pushBack format ["Hitpoints: [HHed:%1] [HBod: %2]", (_unit getHitPointDamage "HitHead") toFixed 2, (_unit getHitPointDamage "HitBody") toFixed 2]; _return pushBack format ["[HHnd:%1] [HLeg: %2] %3", (_unit getHitPointDamage "HitHands") toFixed 2, (_unit getHitPointDamage "HitLegs") toFixed 2, _limping]; - private _fractures = _unit getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]]; + private _fractures = GET_FRACTURES(_unit); private _canSprint = if (isSprintAllowed _unit) then {""} else {"[Sprint Blocked]"}; _return pushBack format ["Fractures: %1 %2", _fractures, _canSprint]; @@ -75,7 +75,7 @@ _return pushBack format ["%1 [Time On: %2]", ALL_SELECTIONS select _tPartNum, (CBA_missionTime - _x) toFixed 1]; }; { - _x params ["", "_medClassname", "_medPartNum"]; + _x params ["_medPartNum", "_medClassname"]; if (_medPartNum == _tPartNum) then { _return pushBack format [" - Occluded Med: %1", _medClassname]; }; @@ -154,4 +154,3 @@ // Return: _return joinString "
" }, [40]] call EFUNC(common,watchVariable); - diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 618432a5fcd..a073c9e9ebd 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -2,7 +2,6 @@ /* * Author: Glowbal * Sets a unit in the unconscious state. - * For Public Use * * Arguments: * 0: The unit that will be put in an unconscious state @@ -17,7 +16,7 @@ * [bob, true] call ace_medical_fnc_setUnconscious; * [player, true, 5, true] call ace_medical_fnc_setUnconscious; * - * Public: yes + * Public: Yes */ // only run this after the settings are initialized diff --git a/addons/medical/initSettings.sqf b/addons/medical/initSettings.sqf index f1eb85bc92d..4fc473949fa 100644 --- a/addons/medical/initSettings.sqf +++ b/addons/medical/initSettings.sqf @@ -1,6 +1,6 @@ // CBA Settings [ADDON: ace_medical]: -private _categoryArray = [LELSTRING(medical,Category_DisplayName), "?"]; +private _categoryArray = [LELSTRING(medical,Category), "?"]; // todo: Check the description is still accurate [ diff --git a/addons/medical/script_component.hpp b/addons/medical/script_component.hpp index 1abe1433931..44bdee2faad 100644 --- a/addons/medical/script_component.hpp +++ b/addons/medical/script_component.hpp @@ -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 ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index a976b622c73..17b60f1703b 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,7 +1,7 @@ - + ACE Medical ACE: медицина ACE Opcje medyczne @@ -440,21 +440,6 @@ 设定当距离超过%1将不能使用治疗动作 設定當距離超過%1將不能使用治療動作 - - This person (%1) is awake and cannot be loaded - Diese Person (%1) ist wach und kann nicht verladen werden - Ta osoba (%1) jest przytomna i nie może zostać załadowana - Esta persona (%1) está despierto y no puede ser cargado - Боец (%1) в сознании и не может быть погружен - Esta pessoa (%1) está acordada e não pode ser carregada - Tato osoba (%1) je vzhůru a nemůže být naložena - Questa persona (%1) è sveglia e non può essere caricata. - %1 est conscient et ne peut être embarqué. - 患者 (%1) は意識があり、積み込めない - 이 사람 (%1) 은(는) 의식이 있어 태우지 못합니다 - 此人(%1)是清醒且不能被装载 - 此人(%1)是清醒且不能被裝載 - Unconscious Wake Up Chance 気絶から覚醒する可能性 diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index 72a41161374..0a2587cd003 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -26,7 +26,7 @@ private _animConfig = if (_isBandage) then { configFile >> "ACE_Medical_Actions" >> "Basic" >> "Morphine"; }; -private _configProperty = "animationCaller"; +private _configProperty = "animationMedic"; if (_isSelfTreatment) then { _configProperty = _configProperty + "Self"; }; diff --git a/addons/medical_blood/initSettings.sqf b/addons/medical_blood/initSettings.sqf index e743002ffa7..2ba5edccbf9 100644 --- a/addons/medical_blood/initSettings.sqf +++ b/addons/medical_blood/initSettings.sqf @@ -1,6 +1,6 @@ // CBA Settings [ADDON: ace_medical_blood]: -private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)]; +private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; [ QGVAR(enabledFor), "LIST", diff --git a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf index 87fd6ef42e8..4a05b75e2c4 100644 --- a/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf +++ b/addons/medical_damage/functions/fnc_woundsHandlerSQF.sqf @@ -136,9 +136,9 @@ private _bodyPartVisParams = [_unit, false, false, false, false]; // params arra case (_causeFracture && {EGVAR(medical,fractures) > 0} && {_bodyPartNToAdd > 1} && {_woundDamage > FRACTURE_DAMAGE_THRESHOLD}): { TRACE_1("limb fracture",_bodyPartNToAdd); // todo: play sound? - private _fractures = _unit getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]]; + private _fractures = GET_FRACTURES(_unit); _fractures set [_bodyPartNToAdd, 1]; - _unit setVariable [QEGVAR(medical,fractures), _fractures, true]; + _unit setVariable [VAR_FRACTURES, _fractures, true]; [QEGVAR(medical,fracture), [_unit, _bodyPartNToAdd]] call CBA_fnc_localEvent; // local event for fracture _updateDamageEffects = true; }; diff --git a/addons/medical_damage/initSettings.sqf b/addons/medical_damage/initSettings.sqf index 88a1283cf71..0982be17d2d 100644 --- a/addons/medical_damage/initSettings.sqf +++ b/addons/medical_damage/initSettings.sqf @@ -1,6 +1,6 @@ // CBA Settings [ADDON: ace_medical_damage]: -private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)]; +private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; [ QEGVAR(medical,playerDamageThreshold), "SLIDER", diff --git a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf index dffe7f2ebc7..6fa09effcc2 100644 --- a/addons/medical_engine/functions/fnc_updateDamageEffects.sqf +++ b/addons/medical_engine/functions/fnc_updateDamageEffects.sqf @@ -23,7 +23,7 @@ if (!local _unit) exitWith { ERROR("Unit not local or null"); }; private _isLimping = false; if (EGVAR(medical,fractures) > 0) then { - private _fractures = _unit getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]]; + private _fractures = GET_FRACTURES(_unit); TRACE_1("",_fractures); if (((_fractures select 4) == 1) || {(_fractures select 5) == 1}) then { TRACE_1("limping because of fracture",_fractures); diff --git a/addons/medical_engine/script_macros_medical.hpp b/addons/medical_engine/script_macros_medical.hpp index 7f17a19161d..a56e357fe1d 100644 --- a/addons/medical_engine/script_macros_medical.hpp +++ b/addons/medical_engine/script_macros_medical.hpp @@ -2,7 +2,6 @@ // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS - #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_HITPOINTS ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"] @@ -97,6 +96,8 @@ #define DEFAULT_TOURNIQUET_VALUES [0,0,0,0,0,0] +#define DEFAULT_FRACTURE_VALUES [0,0,0,0,0,0] + // Triage colors, for consistency across UIs and functions #define TRIAGE_COLOR_NONE 0, 0, 0, 0.9 #define TRIAGE_COLOR_MINIMAL 0, 0.5, 0, 0.9 @@ -110,25 +111,29 @@ #define TRIAGE_TEXT_COLOR_IMMEDIATE 1, 1, 1, 1 #define TRIAGE_TEXT_COLOR_DECEASED 1, 1, 1, 1 +// Medical activity logs +#define MED_LOG_MAX_ENTRIES 8 +#define MED_LOG_VARNAME(type) (format [QEGVAR(medical,log_%1), type]) + // - 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) -#define VAR_BLOOD_VOL QEGVAR(medical,bloodVolume) +#define VAR_BLOOD_PRESS QEGVAR(medical,bloodPressure) +#define VAR_BLOOD_VOL QEGVAR(medical,bloodVolume) #define VAR_WOUND_BLEEDING QEGVAR(medical,woundBleeding) -#define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest) -#define VAR_HEART_RATE QEGVAR(medical,heartRate) -#define VAR_PAIN QEGVAR(medical,pain) -#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress) -#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance) -#define VAR_UNCON "ACE_isUnconscious" +#define VAR_CRDC_ARRST QEGVAR(medical,inCardiacArrest) +#define VAR_HEART_RATE QEGVAR(medical,heartRate) +#define VAR_PAIN QEGVAR(medical,pain) +#define VAR_PAIN_SUPP QEGVAR(medical,painSuppress) +#define VAR_PERIPH_RES QEGVAR(medical,peripheralResistance) +#define VAR_UNCON "ACE_isUnconscious" // These variables track gradual adjustments (from medication, etc.) -#define VAR_MEDICATIONS QEGVAR(medical,medications) +#define VAR_MEDICATIONS QEGVAR(medical,medications) // 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_TOURNIQUET QEGVAR(medical,tourniquets) - +#define VAR_HEMORRHAGE QEGVAR(medical,hemorrhage) +#define VAR_IN_PAIN QEGVAR(medical,inPain) +#define VAR_TOURNIQUET QEGVAR(medical,tourniquets) +#define VAR_FRACTURES QEGVAR(medical,fractures) // - Unit Functions --------------------------------------------------- // Retrieval macros for common unit values @@ -140,6 +145,7 @@ #define GET_PAIN(unit) (unit getVariable [VAR_PAIN,0]) #define GET_PAIN_SUPPRESS(unit) (unit getVariable [VAR_PAIN_SUPP,0]) #define GET_TOURNIQUETS(unit) (unit getVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES]) +#define GET_FRACTURES(unit) (unit getVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES]) #define IN_CRDC_ARRST(unit) (unit getVariable [VAR_CRDC_ARRST,false]) #define IS_BLEEDING(unit) (GET_WOUND_BLEEDING(unit) > 0) #define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN,false]) diff --git a/addons/medical_feedback/initSettings.sqf b/addons/medical_feedback/initSettings.sqf index 9dd0e957c40..e22a953f76f 100644 --- a/addons/medical_feedback/initSettings.sqf +++ b/addons/medical_feedback/initSettings.sqf @@ -1,6 +1,6 @@ // CBA Settings [ADDON: ace_medical_feedback]: -private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)]; +private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; [ QGVAR(painEffectType), diff --git a/addons/medical_gui/CfgVehicles.hpp b/addons/medical_gui/CfgVehicles.hpp index 3d11924bf3c..eecae9a3596 100644 --- a/addons/medical_gui/CfgVehicles.hpp +++ b/addons/medical_gui/CfgVehicles.hpp @@ -44,11 +44,11 @@ class CfgVehicles { #include "InteractionBodyParts.hpp" #undef ACTION_CONDITION }; - class ACE_LoadPatient { + class ACE_LoadPatient { displayName = CSTRING(LoadPatient); condition = QUOTE(_target getVariable [ARR_2('ACE_isUnconscious',false)] && {alive _target} && {vehicle _target == _target}); exceptions[] = {"isNotDragging", "isNotCarrying"}; - statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,actionLoadUnit)); + statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,loadUnit)); icon = QPATHTOF(ui\cross.paa); insertChildren = QUOTE(call DEFUNC(medical_treatment,addLoadPatientActions)); }; @@ -56,7 +56,7 @@ class CfgVehicles { displayName = CSTRING(UnloadPatient); condition = QUOTE(_target getVariable [ARR_2('ACE_isUnconscious',false)] && {vehicle _target != _target} && {vehicle _player == _player}); exceptions[] = {"isNotDragging", "isNotCarrying", "isNotInside"}; - statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,actionUnloadUnit)); + statement = QUOTE([ARR_2(_player, _target)] call EFUNC(medical_treatment,unloadUnit)); icon = QPATHTOF(ui\cross.paa); }; }; diff --git a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf index 25f87f93ce1..ac76d340125 100644 --- a/addons/medical_gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical_gui/functions/fnc_displayPatientInformation.sqf @@ -53,7 +53,7 @@ if (isNull _display) then { // Update activity log private _ctrlActivityLog = _display displayCtrl IDC_ACTIVITY; - private _activityLog = _target getVariable [QEGVAR(medical,logFile_activity_view), []]; + private _activityLog = _target getVariable [MED_LOG_VARNAME("activity"), []]; [_ctrlActivityLog, _activityLog] call FUNC(updateLogList); // Update triage status diff --git a/addons/medical_gui/functions/fnc_menuPFH.sqf b/addons/medical_gui/functions/fnc_menuPFH.sqf index 9d24ffd6d39..2a12ede13c3 100644 --- a/addons/medical_gui/functions/fnc_menuPFH.sqf +++ b/addons/medical_gui/functions/fnc_menuPFH.sqf @@ -44,11 +44,11 @@ private _ctrlBodyImage = _display displayCtrl IDC_BODY_GROUP; // Update activity and quick view logs private _ctrlActivityLog = _display displayCtrl IDC_ACTIVITY; -private _activityLog = GVAR(target) getVariable [QEGVAR(medical,logFile_activity_view), []]; +private _activityLog = GVAR(target) getVariable [MED_LOG_VARNAME("activity"), []]; [_ctrlActivityLog, _activityLog] call FUNC(updateLogList); private _ctrlQuickView = _display displayCtrl IDC_QUICKVIEW; -private _quickView = GVAR(target) getVariable [QEGVAR(medical,logFile_quick_view), []]; +private _quickView = GVAR(target) getVariable [MED_LOG_VARNAME("quick_view"), []]; [_ctrlQuickView, _quickView] call FUNC(updateLogList); // Update triage status diff --git a/addons/medical_gui/functions/fnc_updateBodyImage.sqf b/addons/medical_gui/functions/fnc_updateBodyImage.sqf index 8093286eea4..7f08e9bddfe 100644 --- a/addons/medical_gui/functions/fnc_updateBodyImage.sqf +++ b/addons/medical_gui/functions/fnc_updateBodyImage.sqf @@ -20,7 +20,7 @@ params ["_ctrlGroup", "_target"]; // Get tourniquets, damage, and blood loss for target private _tourniquets = GET_TOURNIQUETS(_target); -private _fractures = _target getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]]; +private _fractures = GET_FRACTURES(_target); private _bodyPartDamage = _target getVariable [QEGVAR(medical,bodyPartDamage), [0, 0, 0, 0, 0, 0]]; private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; @@ -38,18 +38,19 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; private _ctrlTourniquet = _ctrlGroup controlsGroupCtrl _tourniquetIDC; _ctrlTourniquet ctrlShow _hasTourniquet; }; + // Show or hide fractrue/bones if (_fractureIDC != -1) then { private _ctrlBone = _ctrlGroup controlsGroupCtrl _fractureIDC; switch (_fractures select _forEachIndex) do { - case (0): { + case 0: { _ctrlBone ctrlShow false; }; - case (1): { + case 1: { _ctrlBone ctrlShow true; _ctrlBone ctrlSetTextColor [1, 0, 0, 1]; }; - case (-1): { + case -1: { if (EGVAR(medical,fractures) == 2) then { _ctrlBone ctrlShow true; _ctrlBone ctrlSetTextColor [0, 0, 1, 1]; @@ -74,8 +75,8 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; } forEach [ [IDC_BODY_HEAD], [IDC_BODY_TORSO], - [IDC_BODY_ARMLEFT, IDC_BODY_ARMLEFT_T, IDC_BODY_ARMLEFT_B], + [IDC_BODY_ARMLEFT, IDC_BODY_ARMLEFT_T, IDC_BODY_ARMLEFT_B], [IDC_BODY_ARMRIGHT, IDC_BODY_ARMRIGHT_T, IDC_BODY_ARMRIGHT_B], - [IDC_BODY_LEGLEFT, IDC_BODY_LEGLEFT_T, IDC_BODY_LEGLEFT_B], + [IDC_BODY_LEGLEFT, IDC_BODY_LEGLEFT_T, IDC_BODY_LEGLEFT_B], [IDC_BODY_LEGRIGHT, IDC_BODY_LEGRIGHT_T, IDC_BODY_LEGRIGHT_B] ]; diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index 39a8120f368..736be6eba16 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -58,10 +58,14 @@ switch (GET_HEMORRHAGE(_target)) do { if (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then { _entries pushBack [localize LSTRING(Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; }; -switch ((_target getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]]) select _selectionN) do { - case (1): {_entries pushBack [localize LSTRING(Status_Fractured), [1, 0, 0, 1]];}; - case (-1): { - if (EGVAR(medical,fractures) == 2) then { // Ignore if the split has no effect + +// Indicate current body part fracture status +switch (GET_FRACTURES(_target) select _selectionN) do { + case 1: { + _entries pushBack [localize LSTRING(Status_Fractured), [1, 0, 0, 1]]; + }; + case -1: { + if (EGVAR(medical,fractures) == 2) then { // Ignore if the splint has no effect _entries pushBack [localize LSTRING(Status_SplintApplied), [1, 1, 1, 1]]; }; }; diff --git a/addons/medical_gui/functions/fnc_updateLogList.sqf b/addons/medical_gui/functions/fnc_updateLogList.sqf index 731b3587964..fb836406989 100644 --- a/addons/medical_gui/functions/fnc_updateLogList.sqf +++ b/addons/medical_gui/functions/fnc_updateLogList.sqf @@ -21,7 +21,7 @@ params ["_ctrl", "_logs"]; lbClear _ctrl; { - _x params ["_message", "_moment", "", "_arguments"]; + _x params ["_message", "_timeStamp", "_arguments"]; // Localize message and arguments if (isLocalized _message) then { @@ -33,5 +33,5 @@ lbClear _ctrl; // Format message with arguments _message = format ([_message] + _arguments); - _ctrl lbAdd format ["%1 %2", _moment, _message]; + _ctrl lbAdd format ["%1 %2", _timeStamp, _message]; } forEach _logs; diff --git a/addons/medical_gui/initSettings.sqf b/addons/medical_gui/initSettings.sqf index 6066d073afe..245b3fd5ca9 100644 --- a/addons/medical_gui/initSettings.sqf +++ b/addons/medical_gui/initSettings.sqf @@ -2,7 +2,7 @@ QGVAR(enableActions), "LIST", [LSTRING(EnableActions_DisplayName), LSTRING(EnableActions_Description)], - LSTRING(Category), + [ELSTRING(medical,Category), LSTRING(SubCategory)], [[0, 1, 2], [LSTRING(Selections3D), LSTRING(Radial), ELSTRING(common,Disabled)], 0], false ] call CBA_settings_fnc_init; @@ -11,7 +11,7 @@ QGVAR(enableSelfActions), "CHECKBOX", [LSTRING(EnableSelfActions_DisplayName), LSTRING(EnableSelfActions_Description)], - LSTRING(Category), + [ELSTRING(medical,Category), LSTRING(SubCategory)], true, false ] call CBA_settings_fnc_init; @@ -20,7 +20,7 @@ QGVAR(enableMedicalMenu), "LIST", [LSTRING(EnableMedicalMenu_DisplayName), LSTRING(EnableMedicalMenu_Description)], - LSTRING(Category), + [ELSTRING(medical,Category), LSTRING(SubCategory)], [[0, 1, 2], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), ELSTRING(common,VehiclesOnly)], 1], false ] call CBA_settings_fnc_init; @@ -29,7 +29,7 @@ QGVAR(openAfterTreatment), "CHECKBOX", [LSTRING(OpenAfterTreatment_DisplayName), LSTRING(OpenAfterTreatment_Description)], - LSTRING(Category), + [ELSTRING(medical,Category), LSTRING(SubCategory)], true, false ] call CBA_settings_fnc_init; @@ -38,7 +38,7 @@ QGVAR(maxDistance), "SLIDER", [LSTRING(MaxDistance_DisplayName), LSTRING(MaxDistance_Description)], - LSTRING(Category), + [ELSTRING(medical,Category), LSTRING(SubCategory)], [0, 10, 3, 1], false ] call CBA_settings_fnc_init; diff --git a/addons/medical_gui/script_component.hpp b/addons/medical_gui/script_component.hpp index c4c7aafcd82..04565dc5b65 100644 --- a/addons/medical_gui/script_component.hpp +++ b/addons/medical_gui/script_component.hpp @@ -69,8 +69,8 @@ #define IDC_BODY_LEGRIGHT_T 6050 #define IDC_BODY_ARMLEFT_B 6055 #define IDC_BODY_ARMRIGHT_B 6060 -#define IDC_BODY_LEGRIGHT_B 6065 -#define IDC_BODY_LEGLEFT_B 6070 +#define IDC_BODY_LEGLEFT_B 6065 +#define IDC_BODY_LEGRIGHT_B 6070 #define IDC_TRIAGE_STATUS 7000 #define IDC_TRIAGE_SELECT 7100 diff --git a/addons/medical_statemachine/initSettings.sqf b/addons/medical_statemachine/initSettings.sqf index 268902a0f1e..34f5b487bb9 100644 --- a/addons/medical_statemachine/initSettings.sqf +++ b/addons/medical_statemachine/initSettings.sqf @@ -1,6 +1,6 @@ // CBA Settings [ADDON: ace_medical_statemachine]: -private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)]; +private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; [ QGVAR(fatalInjuryCondition), "LIST", diff --git a/addons/medical_status/functions/fnc_initUnit.sqf b/addons/medical_status/functions/fnc_initUnit.sqf index 95d587778fb..859ea83e80b 100644 --- a/addons/medical_status/functions/fnc_initUnit.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -50,7 +50,7 @@ if (_isRespawn) then { _unit setVariable [QEGVAR(medical,bandagedWounds), [], true]; _unit setVariable [QEGVAR(medical,stitchedWounds), [], true]; _unit setVariable [QEGVAR(medical,isLimping), false, true]; - _unit setVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0], true]; + _unit setVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES, true]; // - Misc --------------------------------------------------------------------- _unit setVariable [VAR_UNCON, false, true]; @@ -72,13 +72,6 @@ if (_isRespawn) then { // medication _unit setVariable [VAR_MEDICATIONS, [], true]; - - // TODO move to treatment - private _logs = _unit getVariable [QEGVAR(medical,allLogs), []]; - { - _unit setVariable [_x, nil]; - } forEach _logs; - _unit setVariable [QEGVAR(medical,allLogs), [], true]; }; [{ diff --git a/addons/medical_status/initSettings.sqf b/addons/medical_status/initSettings.sqf index 1118973f375..32d6193a7d4 100644 --- a/addons/medical_status/initSettings.sqf +++ b/addons/medical_status/initSettings.sqf @@ -1,6 +1,6 @@ // CBA Settings [ADDON: ace_medical_status]: -private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)]; +private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; [ QEGVAR(medical,bleedingCoefficient), "SLIDER", diff --git a/addons/medical_treatment/ACE_Medical_Treatment.hpp b/addons/medical_treatment/ACE_Medical_Treatment.hpp index 88a2e46663b..19181287a8b 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment.hpp @@ -582,7 +582,7 @@ class ADDON { timeInSystem = 1800; timeTillMaxEffect = 30; maxDose = 4; - inCompatableMedication[] = {}; + incompatibleMedication[] = {}; viscosityChange = -10; }; class Epinephrine { @@ -593,7 +593,7 @@ class ADDON { timeInSystem = 120; timeTillMaxEffect = 10; maxDose = 10; - inCompatableMedication[] = {}; + incompatibleMedication[] = {}; }; class Adenosine { painReduce = 0; @@ -603,7 +603,7 @@ class ADDON { timeInSystem = 120; timeTillMaxEffect = 15; maxDose = 6; - inCompatableMedication[] = {}; + incompatibleMedication[] = {}; }; class Atropine { painReduce = 0; @@ -613,14 +613,14 @@ class ADDON { timeInSystem = 120; timeTillMaxEffect = 15; maxDose = 6; - inCompatableMedication[] = {}; + incompatibleMedication[] = {}; }; class PainKillers { painReduce = 0.1; timeInSystem = 600; timeTillMaxEffect = 60; maxDose = 10; - inCompatableMedication[] = {}; + incompatibleMedication[] = {}; viscosityChange = 5; }; }; diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index d3cd6dbc0b9..2ba1ceaaa59 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -1,39 +1,46 @@ - -class GVAR(Actions) { - // --- bandages +class GVAR(actions) { + // - Bandages ------------------------------------------------------------- class BasicBandage { displayName = CSTRING(Bandage); displayNameProgress = CSTRING(Bandaging); icon = QPATHTOEF(medical_gui,ui\bandage.paa); category = "bandage"; - treatmentLocations[] = {"All"}; - allowedSelections[] = {"All"}; + + consumeItem = 1; + items[] = {"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot"}; + + medicRequired = 0; allowSelfTreatment = 1; - requiredMedic = 0; - treatmentTime = QFUNC(getBandageTime); - treatmentTimeSelfCoef = 1; - items[] = {{"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot"}}; + allowedSelections[] = {"All"}; condition = QFUNC(canBandage); - itemConsumed = 1; - callbackSuccess = QFUNC(treatmentBandage); - callbackFailure = ""; + treatmentLocations = TREATMENT_LOCATIONS_ALL; + + treatmentTime = QFUNC(getBandageTime); + treatmentTimeSelfCoef = 1; // todo: this isn't used anywhere, remove? + + callbackStart = ""; callbackProgress = ""; + callbackSuccess = QFUNC(bandage); + callbackFailure = ""; + + animationMedic = "AinvPknlMstpSlayW[wpn]Dnon_medicOther"; + animationMedicProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; + animationMedicSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; + animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medicOther"; - animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; - animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; - animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; litter[] = { - {"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}} + {}, + {"ACE_MedicalLitter_clean"}, + {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }; }; class FieldDressing: BasicBandage { displayName = CSTRING(Actions_FieldDressing); items[] = {"ACE_fieldDressing"}; litter[] = { - {"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}} + {}, + {"ACE_MedicalLitter_clean"}, + {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }; }; class PackingBandage: BasicBandage { @@ -41,49 +48,51 @@ class GVAR(Actions) { icon = QPATHTOEF(medical_gui,ui\packing_bandage.paa); items[] = {"ACE_packingBandage"}; litter[] = { - {"All", "", {"ACE_MedicalLitter_packingBandage"}}, - {"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}} + {"ACE_MedicalLitter_packingBandage"}, + {"ACE_MedicalLitter_clean"}, + {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }; }; class ElasticBandage: BasicBandage { displayName = CSTRING(Actions_ElasticBandage); items[] = {"ACE_elasticBandage"}; litter[] = { - {"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}} + {}, + {"ACE_MedicalLitter_clean"}, + {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }; }; class QuikClot: BasicBandage { displayName = CSTRING(Actions_QuikClot); items[] = {"ACE_quikclot"}; litter[] = { - {"All", "", {"ACE_MedicalLitter_QuickClot"}}, - {"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}} + {"ACE_MedicalLitter_QuickClot"}, + {"ACE_MedicalLitter_clean"}, + {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }; }; - // --- tourniquet - class Tourniquet: BasicBandage { + // - Tourniquets ---------------------------------------------------------- + class ApplyTourniquet: BasicBandage { displayName = CSTRING(Apply_Tourniquet); displayNameProgress = CSTRING(Applying_Tourniquet); icon = QPATHTOEF(medical_gui,ui\tourniquet.paa); allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; items[] = {"ACE_tourniquet"}; treatmentTime = 7; - callbackSuccess = QFUNC(treatmentTourniquet); - condition = QUOTE(!([ARR_2(_target,_bodyPart)] call FUNC(hasTourniquetAppliedTo))); + condition = QUOTE(!([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo))); + callbackSuccess = QFUNC(tourniquet); litter[] = {}; }; - class RemoveTourniquet: Tourniquet { + class RemoveTourniquet: ApplyTourniquet { displayName = CSTRING(Actions_RemoveTourniquet); displayNameProgress = CSTRING(RemovingTourniquet); items[] = {}; - callbackSuccess = QFUNC(treatmentTourniquetRemove); - condition = QUOTE([ARR_2(_target,_bodyPart)] call FUNC(hasTourniquetAppliedTo)); + condition = QUOTE([ARR_2(_patient,_bodyPart)] call FUNC(hasTourniquetAppliedTo)); + callbackSuccess = QFUNC(tourniquetRemove); }; - // --- splint + + // - Splint --------------------------------------------------------------- class Splint: BasicBandage { displayName = CSTRING(Apply_Splint); displayNameProgress = CSTRING(Applying_Splint); @@ -93,11 +102,11 @@ class GVAR(Actions) { items[] = {"ACE_splint"}; treatmentTime = 7; callbackSuccess = QFUNC(splint); - condition = QFUNC(splintCondition); + condition = QFUNC(canSplint); litter[] = {}; }; - // --- syringes + // - Syringes ------------------------------------------------------------- class Morphine: FieldDressing { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); @@ -107,35 +116,35 @@ class GVAR(Actions) { items[] = {"ACE_morphine"}; condition = ""; treatmentTime = 5; - callbackSuccess = QFUNC(treatmentMedication); - animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; - litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} }; + callbackSuccess = QFUNC(medication); + animationMedic = "AinvPknlMstpSnonWnonDnon_medic1"; sounds[] = {{QPATHTO_R(sounds\Inject.ogg),1,1,50}}; + litter[] = {{"ACE_MedicalLitter_morphine"}}; }; class Adenosine: Morphine { displayName = CSTRING(Inject_Adenosine); displayNameProgress = CSTRING(Injecting_Adenosine); condition = QGVAR(advancedMedication); items[] = {"ACE_adenosine"}; - litter[] = { {"All", "", {"ACE_MedicalLitter_adenosine"}} }; + litter[] = {{"ACE_MedicalLitter_adenosine"}}; }; class Atropine: Morphine { displayName = CSTRING(Inject_Atropine); displayNameProgress = CSTRING(Injecting_Atropine); condition = QGVAR(advancedMedication); items[] = {"ACE_atropine"}; - litter[] = { {"All", "", {"ACE_MedicalLitter_atropine"}} }; + litter[] = {{"ACE_MedicalLitter_atropine"}}; }; class Epinephrine: Morphine { displayName = CSTRING(Inject_Epinephrine); displayNameProgress = CSTRING(Injecting_Epinephrine); - requiredMedic = QEGVAR(medical,medicSetting_Epi); + medicRequired = QGVAR(medicEpinephrine); items[] = {"ACE_epinephrine"}; - litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} }; - treatmentLocations[] = {QEGVAR(medical,useLocation_Epi)}; + treatmentLocations = QGVAR(locationEpinephrine); + litter[] = {{"ACE_MedicalLitter_epinephrine"}}; }; - // --- iv bags + // - IV Bags -------------------------------------------------------------- class BloodIV: BasicBandage { displayName = CSTRING(Actions_Blood4_1000); displayNameProgress = CSTRING(Transfusing_Blood); @@ -143,12 +152,12 @@ class GVAR(Actions) { allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; allowSelfTreatment = QGVAR(allowSelfIV); category = "advanced"; - requiredMedic = 1; + medicRequired = 1; treatmentTime = 12; items[] = {"ACE_bloodIV"}; condition = ""; - callbackSuccess = QFUNC(treatmentIV); - animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + callbackSuccess = QFUNC(ivBag); + animationMedic = "AinvPknlMstpSnonWnonDnon_medic1"; litter[] = {}; }; class BloodIV_500: BloodIV { @@ -163,7 +172,7 @@ class GVAR(Actions) { displayName = CSTRING(Actions_Plasma4_1000); displayNameProgress = CSTRING(Transfusing_Plasma); items[] = {"ACE_plasmaIV"}; - animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + animationMedic = "AinvPknlMstpSnonWnonDnon_medic1"; }; class PlasmaIV_500: PlasmaIV { displayName = CSTRING(Actions_Plasma4_500); @@ -177,7 +186,7 @@ class GVAR(Actions) { displayName = CSTRING(Actions_Saline4_1000); displayNameProgress = CSTRING(Transfusing_Saline); items[] = {"ACE_salineIV"}; - animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; + animationMedic = "AinvPknlMstpSnonWnonDnon_medic1"; }; class SalineIV_500: SalineIV { displayName = CSTRING(Actions_Saline4_500); @@ -188,23 +197,23 @@ class GVAR(Actions) { items[] = {"ACE_salineIV_250"}; }; - // --- diagnose + // - Diagnose ------------------------------------------------------------- class Diagnose: BasicBandage { displayName = CSTRING(Actions_Diagnose); displayNameProgress = CSTRING(Actions_Diagnosing); icon = ""; category = "examine"; - treatmentLocations[] = {"All"}; + treatmentLocations = TREATMENT_LOCATIONS_ALL; allowedSelections[] = {"Head", "Body"}; - requiredMedic = 0; + medicRequired = 0; treatmentTime = 2.5; items[] = {}; condition = QUOTE(!GVAR(advancedDiagnose)); - callbackSuccess = QFUNC(actionDiagnose); + callbackSuccess = QFUNC(diagnose); callbackFailure = ""; callbackProgress = ""; - animationCaller = ""; // TODO - itemConsumed = 0; + animationMedic = ""; // TODO + consumeItem = 0; litter[] = {}; }; class CheckPulse: Diagnose { @@ -212,40 +221,38 @@ class GVAR(Actions) { displayNameProgress = CSTRING(Check_Pulse_Content); allowedSelections[] = {"All"}; condition = QGVAR(advancedDiagnose); - callbackSuccess = QFUNC(actionCheckPulse); - animationCallerProne = ""; - animationCallerSelfProne = ""; + callbackSuccess = QFUNC(checkPulse); + animationMedicProne = ""; + animationMedicSelfProne = ""; }; class CheckBloodPressure: CheckPulse { displayName = CSTRING(Actions_CheckBloodPressure); displayNameProgress = CSTRING(Check_Bloodpressure_Content); allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; - callbackSuccess = QFUNC(actionCheckBloodPressure); + callbackSuccess = QFUNC(checkBloodPressure); }; class CheckResponse: CheckPulse { displayName = CSTRING(Check_Response); displayNameProgress = CSTRING(Check_Response_Content); allowedSelections[] = {"Head"}; allowSelfTreatment = 0; - callbackSuccess = QFUNC(actionCheckResponse); + callbackSuccess = QFUNC(checkResponse); }; - // --- misc + // - Misc ----------------------------------------------------------------- class BodyBag: BasicBandage { displayName = CSTRING(PlaceInBodyBag); displayNameProgress = CSTRING(PlacingInBodyBag); icon = QPATHTOEF(medical_gui,ui\bodybag.paa); category = "advanced"; - treatmentLocations[] = {"All"}; + treatmentLocations = TREATMENT_LOCATIONS_ALL; allowSelfTreatment = 0; - requiredMedic = 0; + medicRequired = 0; treatmentTime = 15; items[] = {"ACE_bodyBag"}; - condition = "!alive _target"; - callbackSuccess = QFUNC(actionPlaceInBodyBag); - callbackFailure = ""; - callbackProgress = ""; - itemConsumed = 1; + condition = QUOTE(!alive _patient); + callbackSuccess = QFUNC(placeInBodyBag); + consumeItem = 1; litter[] = {}; }; class CPR: BasicBandage { @@ -253,62 +260,64 @@ class GVAR(Actions) { displayNameProgress = CSTRING(Actions_PerformingCPR); icon = ""; category = "advanced"; - treatmentLocations[] = {"All"}; + treatmentLocations = TREATMENT_LOCATIONS_ALL; allowedSelections[] = {"Body"}; allowSelfTreatment = 0; - requiredMedic = 0; + medicRequired = 0; treatmentTime = 15; items[] = {}; - condition = QUOTE(!(_target call EFUNC(common,isAwake)) && {!(_target getVariable [ARR_2('GVAR(receiveCPR)', false)])}); - callbackSuccess = QFUNC(treatmentCPR); - callbackFailure = QFUNC(treatmentCPR_failure); - callbackProgress = QFUNC(treatmentCPR_progress); - callbackStart = QFUNC(treatmentCPR_start); - animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medic"; - animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - animationCallerSelf = ""; - animationCallerSelfProne = ""; - itemConsumed = 0; + condition = QFUNC(canCPR); + callbackSuccess = QFUNC(cpr); + callbackFailure = QFUNC(cprFailure); + callbackProgress = QFUNC(cprProgress); + callbackStart = QFUNC(cprStart); + animationMedic = "AinvPknlMstpSlayW[wpn]Dnon_medic"; + animationMedicProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; + animationMedicSelf = ""; + animationMedicSelfProne = ""; + consumeItem = 0; litter[] = {}; }; - class SurgicalKit: FieldDressing { displayName = CSTRING(Use_SurgicalKit); displayNameProgress = CSTRING(Stitching); icon = QPATHTOEF(medical_gui,ui\surgical_kit.paa); category = "advanced"; items[] = {"ACE_surgicalKit"}; - treatmentLocations[] = {QEGVAR(medical,useLocation_SurgicalKit)}; + treatmentLocations = QGVAR(locationSurgicalKit); allowSelfTreatment = 0; - requiredMedic = QEGVAR(medical,medicSetting_SurgicalKit); - treatmentTime = QUOTE(count (_target getVariable [ARR_2('EGVAR(medical,bandagedWounds)',[])]) * 5); + medicRequired = QGVAR(medicSurgicalKit); + treatmentTime = QFUNC(getStitchTime); condition = QFUNC(canStitch); callbackSuccess = ""; - callbackProgress = QFUNC(treatmentSurgicalKit_onProgress); - itemConsumed = QEGVAR(medical,consumeItem_SurgicalKit); - animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; - litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }}; + callbackProgress = QFUNC(surgicalKitProgress); + consumeItem = QGVAR(consumeSurgicalKit); + animationMedic = "AinvPknlMstpSnonWnonDnon_medic1"; + litter[] = {{"ACE_MedicalLitter_gloves"}}; }; class PersonalAidKit: BasicBandage { displayName = CSTRING(Use_Aid_Kit); displayNameProgress = CSTRING(TreatmentAction); icon = ""; category = "advanced"; - condition = QUOTE(_target call EFUNC(medical_status,isInStableCondition)); + condition = QUOTE(_patient call EFUNC(medical_status,isInStableCondition)); items[] = {"ACE_personalAidKit"}; - treatmentLocations[] = {QEGVAR(medical,useLocation_PAK)}; - requiredMedic = QEGVAR(medical,medicSetting_PAK); - treatmentTime = QUOTE(_target call FUNC(healTime)); - callbackSuccess = QFUNC(treatmentFullHeal); - itemConsumed = QEGVAR(medical,consumeItem_PAK); - animationCaller = "AinvPknlMstpSlayW[wpn]Dnon_medicOther"; - animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; - animationCallerSelf = ""; - animationCallerSelfProne = ""; - litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, - {"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_bloodLossOnBodyPart > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_bloodLossOnBodyPart <= 0", {"ACE_MedicalLitter_clean"}} + treatmentLocations = QGVAR(locationPAK); + medicRequired = QGVAR(medicPAK); + treatmentTime = QFUNC(getHealTime); + callbackSuccess = QFUNC(fullHeal); + consumeItem = QGVAR(consumePAK); + animationMedic = "AinvPknlMstpSlayW[wpn]Dnon_medicOther"; + animationMedicProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; + animationMedicSelf = ""; + animationMedicSelfProne = ""; + litter[] = { + {"ACE_MedicalLitter_gloves"}, + {"ACE_MedicalLitter_clean"}, + { + {"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}, + {"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"} + } }; }; }; diff --git a/addons/medical_treatment/CfgEden.hpp b/addons/medical_treatment/Cfg3DEN.hpp similarity index 60% rename from addons/medical_treatment/CfgEden.hpp rename to addons/medical_treatment/Cfg3DEN.hpp index d3c2f6c721b..74e2730c3e4 100644 --- a/addons/medical_treatment/CfgEden.hpp +++ b/addons/medical_treatment/Cfg3DEN.hpp @@ -1,3 +1,10 @@ + +#define GRID_3DEN_W (pixelW * pixelGrid * 0.5) +#define GRID_3DEN_H (pixelH * pixelGrid * 0.5) + +#define DEFAULT_IS_MEDIC (parseNumber (_this getUnitTrait 'medic')) +#define DEFAULT_IS_MEDICAL_VEHICLE (getNumber (configFile >> 'CfgVehicles' >> typeOf _this >> 'attendant') > 0) + class ctrlToolbox; class Cfg3DEN { @@ -9,19 +16,23 @@ class Cfg3DEN { }; }; class GVAR(isMedicControl): Title { - attributeLoad = "(_this controlsGroupCtrl 100) lbSetCurSel (((_value + 1) min 3) max 0);"; - attributeSave = "(lbCurSel (_this controlsGroupCtrl 100)) - 1"; + attributeLoad = QUOTE((_this controlsGroupCtrl 100) lbSetCurSel (0 max (_value + 1) min 3)); + attributeSave = QUOTE(lbCurSel (_this controlsGroupCtrl 100) - 1); class Controls: Controls { - class Title: Title{}; + class Title: Title {}; class Value: ctrlToolbox { idc = 100; - style = "0x02"; - x = "48 * (pixelW * pixelGrid * 0.50)"; - w = "82 * (pixelW * pixelGrid * 0.50)"; - h = "5 * (pixelH * pixelGrid * 0.50)"; + x = 48 * GRID_3DEN_W; + w = 82 * GRID_3DEN_W; + h = 5 * GRID_3DEN_H; rows = 1; columns = 4; - strings[] = {"$STR_3DEN_Attributes_Lock_Default_text", CSTRING(AssignMedicRoles_role_none), CSTRING(AssignMedicRoles_role_medic), CSTRING(AssignMedicRoles_role_doctorShort)}; + strings[] = { + "$STR_3DEN_Attributes_Lock_Default_text", + CSTRING(AssignMedicRoles_role_none), + CSTRING(AssignMedicRoles_role_medic), + CSTRING(AssignMedicRoles_role_doctorShort) + }; }; }; }; @@ -31,36 +42,34 @@ class Cfg3DEN { class ace_attributes { class Attributes { class ace_isMedic { - property = QUOTE(ace_isMedic); - control = QGVAR(isMedicControl); displayName = CSTRING(AssignMedicRoles_role_DisplayName); tooltip = CSTRING(Attributes_isMedic_Description); - expression = QUOTE(if (_value > -1) then {_this setVariable [ARR_3(QQEGVAR(medical,medicClass),_value,true)];};); - typeName = "NUMBER"; + property = QUOTE(ace_isMedic); + control = QGVAR(isMedicControl); + expression = QUOTE(if (_value != -1 && {_value != DEFAULT_IS_MEDIC}) then {_this setVariable [ARR_3(QQEGVAR(medical,medicClass),_value,true)]}); + defaultValue = QUOTE(DEFAULT_IS_MEDIC); condition = "objectBrain"; - defaultValue = "-1"; + typeName = "NUMBER"; }; class ace_isMedicalVehicle { - property = QUOTE(ace_isMedicalVehicle); - value = 0; - control = "CheckboxNumber"; displayName = CSTRING(AssignMedicVehicle_enabled_DisplayName); tooltip = CSTRING(Attributes_isMedicalVehicle_Description); - expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(medical,medicClass),_value,true)];); - typeName = "NUMBER"; + property = QUOTE(ace_isMedicalVehicle); + control = "Checkbox"; + expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(medical,isMedicalVehicle),_value,true)]); + defaultValue = QUOTE(DEFAULT_IS_MEDICAL_VEHICLE); condition = "objectVehicle"; - defaultValue = 0; + typeName = "BOOL"; }; class ace_isMedicalFacility { - property = QUOTE(ace_isMedicalFacility); - value = 0; - control = "Checkbox"; displayName = CSTRING(AssignMedicalFacility_enabled_DisplayName); tooltip = CSTRING(AssignMedicalFacility_enabled_Description); + property = QUOTE(ace_isMedicalFacility); + control = "Checkbox"; expression = QUOTE(_this setVariable [ARR_3(QQEGVAR(medical,isMedicalFacility),_value,true)];); - typeName = "BOOL"; - condition = "(1 - objectBrain) * (1 - objectVehicle)"; defaultValue = "false"; + condition = "(1 - objectBrain) * (1 - objectVehicle)"; + typeName = "BOOL"; }; }; }; diff --git a/addons/medical_treatment/CfgReplacementItems.hpp b/addons/medical_treatment/CfgReplacementItems.hpp new file mode 100644 index 00000000000..4c5c4f126d1 --- /dev/null +++ b/addons/medical_treatment/CfgReplacementItems.hpp @@ -0,0 +1,17 @@ +class EGVAR(medical,replacementItems) { + FirstAidKit[] = { + {"ACE_fieldDressing", 1}, + {"ACE_packingBandage", 1}, + {"ACE_morphine", 1}, + {"ACE_tourniquet", 1} + }; + Medikit[] = { + {"ACE_fieldDressing", 1}, + {"ACE_packingBandage", 2}, + {"ACE_epinephrine", 1}, + {"ACE_morphine", 1}, + {"ACE_salineIV_250", 1}, + {"ACE_tourniquet", 1} + }; + // todo: add GM medical items +}; diff --git a/addons/medical_treatment/CfgWeapons.hpp b/addons/medical_treatment/CfgWeapons.hpp index c2fdb2b5d0d..ecb45728587 100644 --- a/addons/medical_treatment/CfgWeapons.hpp +++ b/addons/medical_treatment/CfgWeapons.hpp @@ -1,32 +1,31 @@ class CfgWeapons { class ItemCore; + class ACE_ItemCore; class CBA_MiscItem_ItemInfo; class InventoryFirstAidKitItem_Base_F; class MedikitItem; - // ITEMS class FirstAidKit: ItemCore { type = 0; - ace_arsenal_hide = 1; + EGVAR(arsenal,hide) = 1; class ItemInfo: InventoryFirstAidKitItem_Base_F { mass = 4; }; }; class Medikit: ItemCore { type = 0; - ace_arsenal_hide = 1; + EGVAR(arsenal,hide) = 1; class ItemInfo: MedikitItem { mass = 60; }; }; - class ACE_ItemCore; class ACE_fieldDressing: ACE_ItemCore { scope = 2; author = ECSTRING(common,ACETeam); model = QPATHTOF(data\bandage.p3d); - picture = QPATHTOF(ui\items\fieldDressing_x_ca.paa); + picture = QPATHTOF(ui\fieldDressing_ca.paa); displayName = CSTRING(Bandage_Basic_Display); descriptionShort = CSTRING(Bandage_Basic_Desc_Short); descriptionUse = CSTRING(Bandage_Basic_Desc_Use); @@ -38,7 +37,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Packing_Bandage_Display); - picture = QPATHTOF(ui\items\packingBandage_x_ca.paa); + picture = QPATHTOF(ui\packingBandage_ca.paa); model = QPATHTOF(data\packingbandage.p3d); descriptionShort = CSTRING(Packing_Bandage_Desc_Short); descriptionUse = CSTRING(Packing_Bandage_Desc_Use); @@ -50,7 +49,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Bandage_Elastic_Display); - picture = QPATHTOF(ui\items\elasticBandage_x_ca.paa); + picture = QPATHTOF(ui\elasticBandage_ca.paa); model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; descriptionShort = CSTRING(Bandage_Elastic_Desc_Short); descriptionUse = CSTRING(Bandage_Elastic_Desc_Use); @@ -62,7 +61,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Tourniquet_Display); - picture = QPATHTOF(ui\items\tourniquet_x_ca.paa); + picture = QPATHTOF(ui\tourniquet_ca.paa); model = QPATHTOF(data\tourniquet.p3d); descriptionShort = CSTRING(Tourniquet_Desc_Short); descriptionUse = CSTRING(Tourniquet_Desc_Use); @@ -74,7 +73,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(splint_Display); - picture = QPATHTOF(ui\items\tourniquet_x_ca.paa); + picture = QPATHTOF(ui\tourniquet_ca.paa); model = QPATHTOF(data\tourniquet.p3d); descriptionShort = CSTRING(splint_Desc_Short); class ItemInfo: CBA_MiscItem_ItemInfo { @@ -85,7 +84,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Morphine_Display); - picture = QPATHTOF(ui\items\morphine_x_ca.paa); + picture = QPATHTOF(ui\morphine_ca.paa); model = QPATHTOF(data\morphine.p3d); descriptionShort = CSTRING(Morphine_Desc_Short); descriptionUse = CSTRING(Morphine_Desc_Use); @@ -97,7 +96,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Adenosine_Display); - picture = QPATHTOF(ui\items\adenosine_x_ca.paa); + picture = QPATHTOF(ui\adenosine_ca.paa); model = QPATHTOF(data\adenosine.p3d); descriptionShort = CSTRING(adenosine_Desc_Short); descriptionUse = CSTRING(adenosine_Desc_Use); @@ -109,7 +108,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Atropine_Display); - picture = QPATHTOF(ui\items\atropine_x_ca.paa); + picture = QPATHTOF(ui\atropine_ca.paa); model = QPATHTOF(data\atropine.p3d); descriptionShort = CSTRING(Atropine_Desc_Short); descriptionUse = CSTRING(Atropine_Desc_Use); @@ -121,7 +120,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Epinephrine_Display); - picture = QPATHTOF(ui\items\epinephrine_x_ca.paa); + picture = QPATHTOF(ui\epinephrine_ca.paa); model = QPATHTOF(data\epinephrine.p3d); descriptionShort = CSTRING(Epinephrine_Desc_Short); descriptionUse = CSTRING(Epinephrine_Desc_Use); @@ -136,8 +135,8 @@ class CfgWeapons { displayName = CSTRING(Plasma_IV); model = QPATHTOF(data\IVBag_1000ml.p3d); hiddenSelections[] = {"camo"}; - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_plasma_1000ml_ca.paa) }; - picture = QPATHTOF(ui\items\plasmaIV_x_ca.paa); + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_plasma_1000ml_ca.paa)}; + picture = QPATHTOF(ui\plasmaIV_ca.paa); descriptionShort = CSTRING(Plasma_IV_Desc_Short); descriptionUse = CSTRING(Plasma_IV_Desc_Use); class ItemInfo: CBA_MiscItem_ItemInfo { @@ -147,7 +146,7 @@ class CfgWeapons { class ACE_plasmaIV_500: ACE_plasmaIV { displayName = CSTRING(Plasma_IV_500); model = QPATHTOF(data\IVBag_500ml.p3d); - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_plasma_500ml_ca.paa) }; + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_plasma_500ml_ca.paa)}; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; @@ -155,7 +154,7 @@ class CfgWeapons { class ACE_plasmaIV_250: ACE_plasmaIV { displayName = CSTRING(Plasma_IV_250); model = QPATHTOF(data\IVBag_250ml.p3d); - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_plasma_250ml_ca.paa) }; + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_plasma_250ml_ca.paa)}; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2.5; }; @@ -165,9 +164,9 @@ class CfgWeapons { author = ECSTRING(common,ACETeam); model = QPATHTOF(data\IVBag_1000ml.p3d); displayName = CSTRING(Blood_IV); - picture = QPATHTOF(ui\items\bloodIV_x_ca.paa); + picture = QPATHTOF(ui\bloodIV_ca.paa); hiddenSelections[] = {"camo"}; - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_blood_1000ml_ca.paa) }; + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_blood_1000ml_ca.paa)}; descriptionShort = CSTRING(Blood_IV_Desc_Short); descriptionUse = CSTRING(Blood_IV_Desc_Use); class ItemInfo: CBA_MiscItem_ItemInfo { @@ -177,7 +176,7 @@ class CfgWeapons { class ACE_bloodIV_500: ACE_bloodIV { displayName = CSTRING(Blood_IV_500); model = QPATHTOF(data\IVBag_500ml.p3d); - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_blood_500ml_ca.paa) }; + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_blood_500ml_ca.paa)}; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; @@ -185,7 +184,7 @@ class CfgWeapons { class ACE_bloodIV_250: ACE_bloodIV { displayName = CSTRING(Blood_IV_250); model = QPATHTOF(data\IVBag_250ml.p3d); - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_blood_250ml_ca.paa) }; + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_blood_250ml_ca.paa)}; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2.5; }; @@ -196,8 +195,8 @@ class CfgWeapons { displayName = CSTRING(Saline_IV); model = QPATHTOF(data\IVBag_1000ml.p3d); hiddenSelections[] = {"camo"}; - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_saline_1000ml_ca.paa) }; - picture = QPATHTOF(ui\items\salineIV_x_ca.paa); + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_saline_1000ml_ca.paa)}; + picture = QPATHTOF(ui\salineIV_ca.paa); descriptionShort = CSTRING(Saline_IV_Desc_Short); descriptionUse = CSTRING(Saline_IV_Desc_Use); class ItemInfo: CBA_MiscItem_ItemInfo { @@ -207,7 +206,7 @@ class CfgWeapons { class ACE_salineIV_500: ACE_salineIV { displayName = CSTRING(Saline_IV_500); model = QPATHTOF(data\IVBag_500ml.p3d); - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_saline_500ml_ca.paa) }; + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_saline_500ml_ca.paa)}; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; @@ -215,7 +214,7 @@ class CfgWeapons { class ACE_salineIV_250: ACE_salineIV { displayName = CSTRING(Saline_IV_250); model = QPATHTOF(data\IVBag_250ml.p3d); - hiddenSelectionsTextures[] = { QPATHTOF(data\IVBag_saline_250ml_ca.paa) }; + hiddenSelectionsTextures[] = {QPATHTOF(data\IVBag_saline_250ml_ca.paa)}; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2.5; }; @@ -225,7 +224,7 @@ class CfgWeapons { author = ECSTRING(common,ACETeam); displayName = CSTRING(QuikClot_Display); model = QPATHTOF(data\QuikClot.p3d); - picture = QPATHTOF(ui\items\quickclot_x_ca.paa); + picture = QPATHTOF(ui\quickclot_ca.paa); descriptionShort = CSTRING(QuikClot_Desc_Short); descriptionUse = CSTRING(QuikClot_Desc_Use); class ItemInfo: CBA_MiscItem_ItemInfo { @@ -236,7 +235,7 @@ class CfgWeapons { scope = 2; author = ECSTRING(common,ACETeam); displayName = CSTRING(Aid_Kit_Display); - picture = QPATHTOF(ui\items\personal_aid_kit_x_ca.paa); + picture = QPATHTOF(ui\personal_aid_kit_ca.paa); descriptionShort = CSTRING(Aid_Kit_Desc_Short); descriptionUse = CSTRING(Aid_Kit_Desc_Use); class ItemInfo: CBA_MiscItem_ItemInfo { @@ -244,11 +243,11 @@ class CfgWeapons { }; }; class ACE_surgicalKit: ACE_ItemCore { - scope=2; + scope = 2; author = ECSTRING(common,ACETeam); displayName= CSTRING(SurgicalKit_Display); model = QPATHTOF(data\surgical_kit.p3d); - picture = QPATHTOF(ui\items\surgicalKit_x_ca.paa); + picture = QPATHTOF(ui\surgicalKit_ca.paa); descriptionShort = CSTRING(SurgicalKit_Desc_Short); descriptionUse = CSTRING(SurgicalKit_Desc_Use); class ItemInfo: CBA_MiscItem_ItemInfo { @@ -256,11 +255,11 @@ class CfgWeapons { }; }; class ACE_bodyBag: ACE_ItemCore { - scope=2; + scope = 2; author = ECSTRING(common,ACETeam); displayName= CSTRING(Bodybag_Display); model = QPATHTOF(data\bodybagItem.p3d); - picture = QPATHTOF(ui\items\bodybag_x_ca.paa); + picture = QPATHTOF(ui\bodybag_ca.paa); descriptionShort = CSTRING(Bodybag_Desc_Short); descriptionUse = CSTRING(Bodybag_Desc_Use); class ItemInfo: CBA_MiscItem_ItemInfo { diff --git a/addons/medical_treatment/XEH_PREP.hpp b/addons/medical_treatment/XEH_PREP.hpp index 5d0e71ae53e..628003ff620 100644 --- a/addons/medical_treatment/XEH_PREP.hpp +++ b/addons/medical_treatment/XEH_PREP.hpp @@ -1,75 +1,62 @@ - -// actions -PREP(actionCheckBloodPressure); -PREP(actionCheckBloodPressureLocal); -PREP(actionCheckPulse); -PREP(actionCheckPulseLocal); -PREP(actionCheckResponse); -PREP(actionDiagnose); -PREP(actionLoadUnit); -PREP(actionPlaceInBodyBag); -PREP(actionUnloadUnit); PREP(addLoadPatientActions); - -// treaments -PREP(canTreat); -PREP(canTreatCached); -PREP(treatment); -PREP(treatment_failure); -PREP(treatment_success); - -PREP(treatmentBandage); -PREP(treatmentBandageLocal); -PREP(treatmentCPR); -PREP(treatmentCPR_failure); -PREP(treatmentCPR_progress); -PREP(treatmentCPR_start); -PREP(treatmentCPRLocal); -PREP(treatmentFullHeal); -PREP(treatmentFullHealLocal); -PREP(treatmentIV); -PREP(treatmentIVLocal); -PREP(treatmentMedication); -PREP(treatmentMedicationLocal); -PREP(treatmentSurgicalKit_onProgress); -PREP(treatmentTourniquet); -PREP(treatmentTourniquetLocal); -PREP(treatmentTourniquetRemove); - -PREP(splint); -PREP(splintCondition); -PREP(splintLocal); - -// misc PREP(addToLog); PREP(addToTriageCard); +PREP(bandage); +PREP(bandageLocal); PREP(bodyCleanupLoop); PREP(calculateBlood); -PREP(canAccessMedicalEquipment); PREP(canBandage); +PREP(canCPR); +PREP(canSplint); PREP(canStitch); +PREP(canTreat); +PREP(canTreatCached); +PREP(checkBloodPressure); +PREP(checkBloodPressureLocal); +PREP(checkItems); +PREP(checkPulse); +PREP(checkPulseLocal); +PREP(checkResponse); +PREP(cpr); +PREP(cprFailure); +PREP(cprLocal); +PREP(cprProgress); +PREP(cprStart); +PREP(createLitter); +PREP(createLitterServer); +PREP(diagnose); PREP(findMostEffectiveWound); +PREP(fullHeal); +PREP(fullHealLocal); PREP(getBandageTime); +PREP(getHealTime); +PREP(getStitchTime); PREP(getTriageStatus); PREP(handleBandageOpening); +PREP(hasItem); PREP(hasTourniquetAppliedTo); -PREP(healTime); PREP(isInMedicalFacility); PREP(isInMedicalVehicle); PREP(isMedic); PREP(isMedicalVehicle); +PREP(ivBag); +PREP(ivBagLocal); +PREP(litterCleanupLoop); +PREP(loadUnit); +PREP(medication); +PREP(medicationLocal); PREP(onMedicationUsage); -PREP(serverRemoveBody); +PREP(placeInBodyBag); +PREP(removeBody); PREP(setTriageStatus); - -// items -PREP(checkItems); -PREP(hasItem); -PREP(hasItems); +PREP(splint); +PREP(splintLocal); +PREP(surgicalKitProgress); +PREP(tourniquet); +PREP(tourniquetLocal); +PREP(tourniquetRemove); +PREP(treatment); +PREP(treatmentFailure); +PREP(treatmentSuccess); +PREP(unloadUnit); PREP(useItem); -PREP(useItems); - -// litter -PREP(litterCleanupLoop); -PREP(litterCreate); -PREP(litterHandleCreate); diff --git a/addons/medical_treatment/XEH_postInit.sqf b/addons/medical_treatment/XEH_postInit.sqf index 05d78e97d92..76222dca57a 100644 --- a/addons/medical_treatment/XEH_postInit.sqf +++ b/addons/medical_treatment/XEH_postInit.sqf @@ -1,28 +1,38 @@ #include "script_component.hpp" -[QEGVAR(medical_status,initialized), FUNC(checkItems)] call CBA_fnc_addEventHandler; +[QEGVAR(medical_status,initialized), { + params ["_unit"]; + + // Clear all saved medical logs + { + _unit setVariable [_x, nil, true]; + } forEach (_unit getVariable [QEGVAR(medical,allLogs), []]); + + _unit setVariable [QEGVAR(medical,allLogs), [], true]; + + [_unit] call FUNC(checkItems); +}] call CBA_fnc_addEventHandler; + ["loadout", FUNC(checkItems)] call CBA_fnc_addPlayerEventHandler; -// Handle bodybags and litter on server +// Handle body removal and litter on server if (isServer) then { - [QGVAR(createLitterServer), FUNC(litterHandleCreate)] call CBA_fnc_addEventHandler; - ["ace_placedInBodyBag", FUNC(serverRemoveBody)] call CBA_fnc_addEventHandler; + [QGVAR(createLitterServer), FUNC(createLitterServer)] call CBA_fnc_addEventHandler; + ["ace_placedInBodyBag", FUNC(removeBody)] call CBA_fnc_addEventHandler; }; -// treatment events -[QGVAR(treatmentBandageLocal), FUNC(treatmentBandageLocal)] call CBA_fnc_addEventHandler; -[QGVAR(treatmentTourniquetLocal), FUNC(treatmentTourniquetLocal)] call CBA_fnc_addEventHandler; -[QGVAR(treatmentMedicationLocal), FUNC(treatmentMedicationLocal)] call CBA_fnc_addEventHandler; -[QGVAR(treatmentIVLocal), FUNC(treatmentIVLocal)] call CBA_fnc_addEventHandler; -[QGVAR(treatmentCPRLocal), FUNC(treatmentCPRLocal)] call CBA_fnc_addEventHandler; -[QGVAR(treatmentFullHealLocal), FUNC(treatmentFullHealLocal)] call CBA_fnc_addEventHandler; -[QGVAR(treatmentSplintLocal), FUNC(splintLocal)] call CBA_fnc_addEventHandler; - -// action events -[QGVAR(actionCheckPulseLocal), FUNC(actionCheckPulseLocal)] call CBA_fnc_addEventHandler; -[QGVAR(actionCheckBloodPressureLocal), FUNC(actionCheckBloodPressureLocal)] call CBA_fnc_addEventHandler; -[QGVAR(actionPlaceInBodyBag), FUNC(actionPlaceInBodyBag)] call CBA_fnc_addEventHandler; - -// log events -[QGVAR(addToMedicalLog), FUNC(addToLog)] call CBA_fnc_addEventHandler; +// Treatment events +[QGVAR(bandageLocal), FUNC(bandageLocal)] call CBA_fnc_addEventHandler; +[QGVAR(checkBloodPressureLocal), FUNC(checkBloodPressureLocal)] call CBA_fnc_addEventHandler; +[QGVAR(checkPulseLocal), FUNC(checkPulseLocal)] call CBA_fnc_addEventHandler; +[QGVAR(cprLocal), FUNC(cprLocal)] call CBA_fnc_addEventHandler; +[QGVAR(fullHealLocal), FUNC(fullHealLocal)] call CBA_fnc_addEventHandler; +[QGVAR(ivBagLocal), FUNC(ivBagLocal)] call CBA_fnc_addEventHandler; +[QGVAR(medicationLocal), FUNC(medicationLocal)] call CBA_fnc_addEventHandler; +[QGVAR(placeInBodyBag), FUNC(placeInBodyBag)] call CBA_fnc_addEventHandler; +[QGVAR(splintLocal), FUNC(splintLocal)] call CBA_fnc_addEventHandler; +[QGVAR(tourniquetLocal), FUNC(tourniquetLocal)] call CBA_fnc_addEventHandler; + +// Logging events +[QGVAR(addToLog), FUNC(addToLog)] call CBA_fnc_addEventHandler; [QGVAR(addToTriageCard), FUNC(addToTriageCard)] call CBA_fnc_addEventHandler; diff --git a/addons/medical_treatment/XEH_preInit.sqf b/addons/medical_treatment/XEH_preInit.sqf index a4ddb9f082f..19c28ab4ab5 100644 --- a/addons/medical_treatment/XEH_preInit.sqf +++ b/addons/medical_treatment/XEH_preInit.sqf @@ -34,4 +34,28 @@ GVAR(animDurations) = [] call CBA_fnc_createNamespace; ["AinvPknlMstpSnonWnonDnon_medic1", 10] ]; +// class names of medical facilities +// global variable so it can be accessed by mission makers +GVAR(facilityClasses) = [ + "TK_GUE_WarfareBFieldhHospital_Base_EP1", + "TK_GUE_WarfareBFieldhHospital_EP1", + "TK_WarfareBFieldhHospital_Base_EP1", + "TK_WarfareBFieldhHospital_EP1", + "US_WarfareBFieldhHospital_Base_EP1", + "US_WarfareBFieldhHospital_EP1", + "MASH_EP1", + "MASH", + "Land_A_Hospital", + "CDF_WarfareBFieldhHospital", + "GUE_WarfareBFieldhHospital", + "INS_WarfareBFieldhHospital", + "RU_WarfareBFieldhHospital", + "USMC_WarfareBFieldhHospital" +]; + +// array of medical items to replace and their ACE equivalents +GVAR(replacementItems) = configProperties [configFile >> QEGVAR(medical,replacementItems), "isArray _x"] apply { + [configName _x, getArray _x] +}; + ADDON = true; diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index 30ea36a861d..2dfe99d04a3 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -17,7 +17,8 @@ class CfgPatches { #include "ACE_Medical_Treatment.hpp" #include "ACE_Medical_Treatment_Actions.hpp" #include "ACE_Settings.hpp" -#include "CfgEden.hpp" #include "CfgEventHandlers.hpp" +#include "CfgReplacementItems.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "Cfg3DEN.hpp" diff --git a/addons/medical_treatment/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical_treatment/functions/fnc_actionCheckBloodPressure.sqf deleted file mode 100644 index 6c5c17a1518..00000000000 --- a/addons/medical_treatment/functions/fnc_actionCheckBloodPressure.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Action for checking the blood pressure of the patient - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * - * Return Value: - * None - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart"]; - -[QGVAR(actionCheckBloodPressureLocal), [_caller, _target, _bodyPart], _target] call CBA_fnc_targetEvent; - -true diff --git a/addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf deleted file mode 100644 index c0a995e3cdb..00000000000 --- a/addons/medical_treatment/functions/fnc_actionCheckBloodPressureLocal.sqf +++ /dev/null @@ -1,57 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Local callback for checking the blood pressure of a patient - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * - * Return Value: - * None - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart"]; - -private _bloodPressure = [0, 0]; - -if (alive _target && {!([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then { - _bloodPressure = GET_BLOOD_PRESSURE(_target); -}; - -private _bloodPressureOutput = ELSTRING(medical_treatment,Check_Bloodpressure_Output_6); -private _logOutPut = ELSTRING(medical_treatment,Check_Bloodpressure_NoBloodpressure); - -_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"]; - -if (_bloodPressureHigh > 20) then { - if (_caller call FUNC(isMedic)) then { - _bloodPressureOutput = ELSTRING(medical_treatment,Check_Bloodpressure_Output_1); - _logOutPut = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow]; - } else { - if (_bloodPressureHigh > 20) then { - _bloodPressureOutput = ELSTRING(medical_treatment,Check_Bloodpressure_Output_2); - _logOutPut = ELSTRING(medical_treatment,Check_Bloodpressure_Low); - - if (_bloodPressureHigh > 100) then { - _bloodPressureOutput = ELSTRING(medical_treatment,Check_Bloodpressure_Output_3); - _logOutPut = ELSTRING(medical_treatment,Check_Bloodpressure_Normal); - - if (_bloodPressureHigh > 160) then { - _bloodPressureOutput = ELSTRING(medical_treatment,Check_Bloodpressure_Output_4); - _logOutPut = ELSTRING(medical_treatment,Check_Bloodpressure_High); - }; - }; - }; - }; -}; - -[QEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _target call EFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _caller], _caller] call CBA_fnc_targetEvent; - -if (_logOutPut != "") then { - [_target, "activity", ELSTRING(medical_treatment,Check_Bloodpressure_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); - [_target, "quick_view", ELSTRING(medical_treatment,Check_Bloodpressure_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); -}; diff --git a/addons/medical_treatment/functions/fnc_actionCheckPulse.sqf b/addons/medical_treatment/functions/fnc_actionCheckPulse.sqf deleted file mode 100644 index 29afe8a60e5..00000000000 --- a/addons/medical_treatment/functions/fnc_actionCheckPulse.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Action for checking the pulse or heart rate of the patient - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * - * Return Value: - * None - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart"]; - -[QGVAR(actionCheckPulseLocal), [_caller, _target, _bodyPart], _target] call CBA_fnc_targetEvent; - -true diff --git a/addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf deleted file mode 100644 index 585ba4c7d8d..00000000000 --- a/addons/medical_treatment/functions/fnc_actionCheckPulseLocal.sqf +++ /dev/null @@ -1,54 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Local callback for checking the pulse of a patient - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * - * Return Value: - * None - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart"]; - -private _heartRate = 0; - -if (alive _target && {!([_target, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then { - _heartRate = GET_HEART_RATE(_target); -}; - -private _heartRateOutput = ELSTRING(medical_treatment,Check_Pulse_Output_5); -private _logOutPut = ELSTRING(medical_treatment,Check_Pulse_None); - -if (_heartRate > 1.0) then { - if (_caller call FUNC(isMedic)) then { - _heartRateOutput = ELSTRING(medical_treatment,Check_Pulse_Output_1); - _logOutPut = format ["%1", round(_heartRate)]; - } else { - // non medical personel will only find a pulse/HR - _heartRateOutput = ELSTRING(medical_treatment,Check_Pulse_Output_2); - _logOutPut = ELSTRING(medical_treatment,Check_Pulse_Weak); - - if (_heartRate > 60) then { - if (_heartRate > 100) then { - _heartRateOutput = ELSTRING(medical_treatment,Check_Pulse_Output_3); - _logOutPut = ELSTRING(medical_treatment,Check_Pulse_Strong); - } else { - _heartRateOutput = ELSTRING(medical_treatment,Check_Pulse_Output_4); - _logOutPut = ELSTRING(medical_treatment,Check_Pulse_Normal); - }; - }; - }; -}; - -[QEGVAR(common,displayTextStructured), [[_heartRateOutput, _target call EFUNC(common,getName), round _heartRate], 1.5, _caller], _caller] call CBA_fnc_targetEvent; - -if (_logOutPut != "") then { - [_target, "activity", ELSTRING(medical_treatment,Check_Pulse_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); - [_target, "quick_view", ELSTRING(medical_treatment,Check_Pulse_Log), [_caller call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); -}; diff --git a/addons/medical_treatment/functions/fnc_actionCheckResponse.sqf b/addons/medical_treatment/functions/fnc_actionCheckResponse.sqf deleted file mode 100644 index 7bf7cf7c5c9..00000000000 --- a/addons/medical_treatment/functions/fnc_actionCheckResponse.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Action for checking the response status of the patient - * - * Arguments: - * 0: The medic - * 1: The patient - * - * Return Value: - * None - * - * Example: - * [bob, kevin] call ace_medical_treatment_fnc_actionCheckResponse - * - * Public: No - */ - -params ["_caller", "_target"]; - -private _output = [ELSTRING(medical_treatment,Check_Response_Unresponsive), ELSTRING(medical_treatment,Check_Response_Responsive)] select (_target call EFUNC(common,isAwake)); - -[QEGVAR(common,displayTextStructured), [[_output, _target call EFUNC(common,getName)], 2, _caller], _caller] call CBA_fnc_targetEvent; - -[_target ,"activity", _output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "quick_view", _output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical_treatment/functions/fnc_actionDiagnose.sqf b/addons/medical_treatment/functions/fnc_actionDiagnose.sqf deleted file mode 100644 index 6e9eda96101..00000000000 --- a/addons/medical_treatment/functions/fnc_actionDiagnose.sqf +++ /dev/null @@ -1,45 +0,0 @@ -#include "script_component.hpp" -/* -* Author: Glowbal -* Action for diagnosing in basic medical -* -* Arguments: -* 0: The medic -* 1: The patient -* -* Return Value: -* None -* -* Public: No -*/ - -params ["_caller", "_target"]; - -private _genericMessages = [ELSTRING(medical_treatment,diagnoseMessage), _target call EFUNC(common,getName)]; - -if (alive _target) then { - _genericMessages pushBack ELSTRING(medical_treatment,diagnoseAlive); -} else { - _genericMessages pushBack ELSTRING(medical_treatment,diagnoseDead); -}; - -private _hemorrhage = GET_HEMORRHAGE(_target); -if (_hemorrhage > 0) then { - if (_hemorrhage > 1) then { - _genericMessages pushBack ELSTRING(medical_treatment,lostBloodALot); - } else { - _genericMessages pushBack ELSTRING(medical_treatment,lostBlood); - }; -} else { - _genericMessages pushBack ELSTRING(medical_treatment,noBloodloss); -}; - -if (alive _target) then { - if IS_IN_PAIN(_target) then { - _genericMessages pushBack ELSTRING(medical_treatment,inPain); - } else { - _genericMessages pushBack ELSTRING(medical_treatment,noPain); - }; -}; - -[QEGVAR(common,displayTextStructured), [_genericMessages, 3.0, _caller], _caller] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf b/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf deleted file mode 100644 index d4e6b57dc4b..00000000000 --- a/addons/medical_treatment/functions/fnc_actionLoadUnit.sqf +++ /dev/null @@ -1,42 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Action for loading an unconscious or dead unit in the nearest vehicle, or _vehicle if given. - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: The vehicle (default: objNull) - * - * Return Value: - * Vehicle they are loaded into (objNull on failure) - * - * Example: - * [bob, kevin] call ace_medical_treatment_treatment_fnc_actionLoadUnit - * - * Public: No - */ - -params ["_caller", "_target", ["_vehicle", objNull]]; - -if ([_target] call EFUNC(common,isAwake)) exitWith { - [QEGVAR(common,displayTextStructured), [[ELSTRING(medical,CanNotLoaded), _target call EFUNC(common,getName)], 1.5, _caller], _caller] call CBA_fnc_targetEvent; -}; - -if ([_target] call EFUNC(medical_status,isBeingCarried)) then { - [_caller, _target] call EFUNC(dragging,dropObject_carry); -}; - -if ([_target] call EFUNC(medical_status,isBeingDragged)) then { - [_caller, _target] call EFUNC(dragging,dropObject); -}; - -private _vehicle = [_caller, _target, _vehicle] call EFUNC(common,loadPerson); -if (!isNull _vehicle) then { - private _hint = LSTRING(loadedInto); - private _itemName = [_target, false, true] call EFUNC(common,getName); - private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - [[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured); -}; - -_vehicle diff --git a/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf deleted file mode 100644 index 0069e74e67b..00000000000 --- a/addons/medical_treatment/functions/fnc_actionPlaceInBodyBag.sqf +++ /dev/null @@ -1,51 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Replace a (dead) body by a body bag - * - * Arguments: - * 0: The actor - * 1: The patient - * - * Return Value: - * body bag (will return objNull when run where target is not local) - * - * Example: - * [player, cursorTarget] call ace_medical_treatment_fnc_actionPlaceInBodyBag - * - * Public: No - */ - -params ["_caller", "_target"]; -TRACE_2("params",_caller,_target); - -if (!local _target) exitWith { - TRACE_1("running where local",local _target); - [QGVAR(actionPlaceInBodyBag), [_caller, _target], _target] call CBA_fnc_targetEvent; - objNull -}; - -if (alive _target) then { - TRACE_1("manually killing with setDead",_target); - [_target, true, "buried_alive"] call EFUNC(medical_status,setDead); -}; - -private _position = (getPosASL _target) vectorAdd [0, 0, 0.2]; - -private _headPos = _target modelToWorldVisual (_target selectionPosition "head"); -private _spinePos = _target modelToWorldVisual (_target selectionPosition "Spine3"); -private _dirVect = _headPos vectorFromTo _spinePos; -private _direction = _dirVect call CBA_fnc_vectDir; - -// move the body away now, so it won't physX the bodyBag object (this setPos seems to need to be called where object is local) -_target setPosASL [-5000, -5000, 0]; - -private _bodyBag = createVehicle ["ACE_bodyBagObject", _position, [], 0, "NONE"]; - -// prevent body bag from flipping -_bodyBag setPosASL _position; -_bodyBag setDir _direction; - -["ace_placedInBodyBag", [_target, _bodyBag]] call CBA_fnc_globalEvent; // hide and delete body on server - -_bodyBag diff --git a/addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf b/addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf deleted file mode 100644 index d69b2a7c64a..00000000000 --- a/addons/medical_treatment/functions/fnc_actionUnloadUnit.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Action for unloading an unconscious or dead unit from a vechile - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Drag after unload (default: false) - * - * Return Value: - * None - * - * Example: - * [bob, kevin, false] call ace_medical_treatment_fnc_actionUnloadUnit - * - * Public: No - */ - -params ["_caller", "_target", ["_drag", false]]; - -// cannot unload a unit not in a vehicle. -if (vehicle _target == _target) exitWith {WARNING_1("Unit [%1] not in vehicle",_target);}; -if (_target call EFUNC(common,isAwake)) exitWith {WARNING_1("Unit [%1] is awake",_target);}; - -["ace_unloadPersonEvent", [_target, vehicle _target, _caller], _target] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_addLoadPatientActions.sqf b/addons/medical_treatment/functions/fnc_addLoadPatientActions.sqf index 3448793847e..fe97152c92b 100644 --- a/addons/medical_treatment/functions/fnc_addLoadPatientActions.sqf +++ b/addons/medical_treatment/functions/fnc_addLoadPatientActions.sqf @@ -1,16 +1,16 @@ #include "script_component.hpp" /* * Author: 654wak654 - * Adds child actions to the "load patient" action for near vehicles. + * Returns children actions to the "Load Patient" action for nearby vehicles. * * Arguments: * 0: Patient * * Return Value: - * Child actions + * Actions * * Example: - * [kevin] call ace_medical_treatment_fnc_addLoadPatientActions + * [cursorObject] call ace_medical_treatment_fnc_addLoadPatientActions * * Public: No */ @@ -19,7 +19,7 @@ params ["_target"]; private _statement = { params ["_target", "_player", "_vehicle"]; - [_player, _target, _vehicle] call FUNC(actionLoadUnit); + [_player, _target, _vehicle] call FUNC(loadUnit); }; [_target call EFUNC(common,nearestVehiclesFreeSeat), _statement, _target] call EFUNC(interact_menu,createVehiclesActions) diff --git a/addons/medical_treatment/functions/fnc_addToLog.sqf b/addons/medical_treatment/functions/fnc_addToLog.sqf index 077cfc73aba..b250fec9b1c 100644 --- a/addons/medical_treatment/functions/fnc_addToLog.sqf +++ b/addons/medical_treatment/functions/fnc_addToLog.sqf @@ -1,56 +1,45 @@ #include "script_component.hpp" /* - * Author: Glowbal - * Add an entry to the specified log + * Author: Glowbal, mharis001 + * Adds an entry to the specified medical log of the unit. * * Arguments: - * 0: The patient - * 1: The log type - * 2: The message - * 3: The arguments for localization + * 0: Unit + * 1: Log Type + * 2: Message + * 3: Formatting Arguments * * Return Value: * None * * Example: - * [bob, "type", "message", [_args]] call ace_medical_treatment_fnc_addToLog + * [player, "activity", "Message %1", ["Name"]] call ace_medical_treatment_fnc_addToLog * * Public: No */ -params ["_unit", "_type", "_message", "_arguments"]; +params ["_unit", "_logType", "_message", "_arguments"]; if (!local _unit) exitWith { - [QGVAR(addToMedicalLog), _this, _unit] call CBA_fnc_targetEvent; + [QGVAR(addToLog), _this, _unit] call CBA_fnc_targetEvent; }; date params ["", "", "", "_hour", "_minute"]; +private _timeStamp = format ["%1:%2", _hour, [_minute, 2] call CBA_fnc_formatNumber]; -private _moment = format [["%1:%2", "%1:0%2"] select (_minute < 10), _hour, _minute]; -private _logVarName = format [QEGVAR(medical,logFile_%1), _type]; +private _logVarName = MED_LOG_VARNAME(_logType); private _log = _unit getVariable [_logVarName, []]; -if (count _log >= 8) then { - private _newLog = []; - - { - // ensure the first element will not be added - if (_forEachIndex > 0) then { - _newLog pushBack _x; - }; - } forEach _log; - - _log = _newLog; +if (count _log >= MED_LOG_MAX_ENTRIES) then { + _log deleteAt 0; }; -_log pushBack [_message, _moment, _type, _arguments]; - +_log pushBack [_message, _timeStamp, _arguments, _logType]; _unit setVariable [_logVarName, _log, true]; -["ace_medicalLogEntryAdded", [_unit, _type, _message, _arguments]] call CBA_fnc_localEvent; -private _logs = _unit getVariable [QEGVAR(medical,allLogs), []]; +private _allLogs = _unit getVariable [QEGVAR(medical,allLogs), []]; -if !(_logVarName in _logs) then { - _logs pushBack _logVarName; - _unit setVariable [QEGVAR(medical,allLogs), _logs, true]; +if !(_logVarName in _allLogs) then { + _allLogs pushBack _logVarName; + _unit setVariable [QEGVAR(medical,allLogs), _allLogs, true]; }; diff --git a/addons/medical_treatment/functions/fnc_addToTriageCard.sqf b/addons/medical_treatment/functions/fnc_addToTriageCard.sqf index 3d67d3288c8..75cbc76b267 100644 --- a/addons/medical_treatment/functions/fnc_addToTriageCard.sqf +++ b/addons/medical_treatment/functions/fnc_addToTriageCard.sqf @@ -1,46 +1,37 @@ #include "script_component.hpp" /* - * Author: Glowbal - * Add an entry to the triage card + * Author: Glowbal, mharis001 + * Adds an entry to the unit's triage card. * * Arguments: - * 0: The patient - * 1: The new item class name + * 0: Unit + * 1: Item Classname * * Return Value: * None * * Example: - * [bob, "bandage"] call ace_medical_treatment_fnc_addToTriageCard + * [player, "ACE_morphine"] call ace_medical_treatment_fnc_addToTriageCard * * Public: No */ -params ["_unit", "_newItem"]; +params ["_unit", "_item"]; if (!local _unit) exitWith { [QGVAR(addToTriageCard), _this, _unit] call CBA_fnc_targetEvent; }; -private _log = _unit getVariable [QEGVAR(medical,triageCard), []]; -private _inList = false; -private _amount = 1; +private _triageCard = _unit getVariable [QEGVAR(medical,triageCard), []]; +private _index = _triageCard findIf {_x select 0 == _item}; -{ - if (_x select 0 == _newItem) exitWith { - private _info = _log select _forEachIndex; - _info set [1, (_info select 1) + 1]; - _info set [2, CBA_missionTime]; - _log set [_forEachIndex, _info]; - - _amount = _info select 1; - _inList = true; - }; -} forEach _log; - -if (!_inList) then { - _log pushBack [_newItem, 1, CBA_missionTime]; +if (_index == -1) then { + _triageCard pushBack [_item, 1, CBA_missionTime]; +} else { + _triageCard set [_index, [_item, (_triageCard select _index select 1) + 1, CBA_missionTime]]; }; -_unit setVariable [QEGVAR(medical,triageCard), _log, true]; -["ace_triageCardItemAdded", [_unit, _newItem, _amount]] call CBA_fnc_localEvent; +_unit setVariable [QEGVAR(medical,triageCard), _triageCard, true]; + +// todo: add amount of item to event args? +["ace_triageCardItemAdded", [_unit, _item]] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/functions/fnc_bandage.sqf b/addons/medical_treatment/functions/fnc_bandage.sqf new file mode 100644 index 00000000000..1a7dd4f8186 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_bandage.sqf @@ -0,0 +1,25 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Bandages open wounds on the given body part of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head", "FieldDressing"] call ace_medical_treatment_fnc_bandage + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart", "_classname"]; + +[_patient, "activity", LSTRING(Activity_bandagedPatient), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); + +[QGVAR(bandageLocal), [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_treatmentBandageLocal.sqf b/addons/medical_treatment/functions/fnc_bandageLocal.sqf similarity index 52% rename from addons/medical_treatment/functions/fnc_treatmentBandageLocal.sqf rename to addons/medical_treatment/functions/fnc_bandageLocal.sqf index 94ab425b008..a27eaa511c5 100644 --- a/addons/medical_treatment/functions/fnc_treatmentBandageLocal.sqf +++ b/addons/medical_treatment/functions/fnc_bandageLocal.sqf @@ -1,30 +1,33 @@ #include "script_component.hpp" /* * Author: Glowbal - * Handles the bandage of a patient. + * Local callback for bandaging a patient's open wounds. * * Arguments: - * 0: The patient - * 1: Treatment class name - * 2: Body part + * 0: Patient + * 1: Body Part + * 2: Treatment * * Return Value: - * Succesful treatment started + * None + * + * Example: + * [player, "Head", "FieldDressing"] call ace_medical_treatment_fnc_bandageLocal * * Public: No */ -params ["_target", "_bandage", "_bodyPart"]; +params ["_patient", "_bodyPart", "_bandage"]; private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; -if (_partIndex < 0) exitWith { false }; +if (_partIndex < 0) exitWith {false}; -private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; -if (_openWounds isEqualTo []) exitWith { false }; +private _openWounds = _patient getVariable [QEGVAR(medical,openWounds), []]; +if (_openWounds isEqualTo []) exitWith {false}; // Figure out which injury for this bodypart is the best choice to bandage // TODO also use up the remainder on left over injuries -private _targetWound = [_target, _bandage, _partIndex] call FUNC(findMostEffectiveWound); +private _targetWound = [_patient, _bandage, _partIndex] call FUNC(findMostEffectiveWound); _targetWound params ["_wound", "_woundIndex", "_effectiveness"]; // Everything is patched up on this body part already @@ -37,18 +40,18 @@ _amountOf = _amountOf - _impact; _wound set [2, _amountOf]; _openWounds set [_woundIndex, _wound]; -_target setVariable [QEGVAR(medical,openWounds), _openWounds, true]; +_patient setVariable [QEGVAR(medical,openWounds), _openWounds, true]; -[_target] call EFUNC(medical_status,updateWoundBloodLoss); +[_patient] call EFUNC(medical_status,updateWoundBloodLoss); // Handle the reopening of bandaged wounds if (_impact > 0 && {GVAR(advancedBandages) && {GVAR(woundReopening)}}) then { - [_target, _impact, _partIndex, _woundIndex, _wound, _bandage] call FUNC(handleBandageOpening); + [_patient, _impact, _partIndex, _woundIndex, _wound, _bandage] call FUNC(handleBandageOpening); }; // Check if we fixed limping from this treatment -if ((EGVAR(medical,limping) == 1) && {_partIndex > 3} && {_amountOf <= 0} && {_target getVariable [QEGVAR(medical,isLimping), false]}) then { - [_target] call EFUNC(medical_engine,updateDamageEffects); +if ((EGVAR(medical,limping) == 1) && {_partIndex > 3} && {_amountOf <= 0} && {_patient getVariable [QEGVAR(medical,isLimping), false]}) then { + [_patient] call EFUNC(medical_engine,updateDamageEffects); }; true diff --git a/addons/medical_treatment/functions/fnc_bodyCleanupLoop.sqf b/addons/medical_treatment/functions/fnc_bodyCleanupLoop.sqf index a11c9a7a251..eed0020ddf0 100644 --- a/addons/medical_treatment/functions/fnc_bodyCleanupLoop.sqf +++ b/addons/medical_treatment/functions/fnc_bodyCleanupLoop.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" /* * Author: Glowbal, esteldunedain - * Loop that cleans up player bodies that were replaced by bodybags + * Handles cleaning up bodies that were replaced by body bags. * * Arguments: * None @@ -10,23 +10,23 @@ * None * * Example: - * call ace_medical_treatment_fnc_bodyCleanupLoop + * [] call ace_medical_treatment_fnc_bodyCleanupLoop * * Public: No */ { - TRACE_2("body",_x,isPlayer _x); - if ((!isNull _x) && {!isPlayer _x}) then {deleteVehicle _x}; + TRACE_2("Handling body cleanup",_x,isPlayer _x); + if (!isNull _x && {!isPlayer _x}) then {deleteVehicle _x}; } forEach GVAR(bodiesToDelete); // deleteVehicle doesn't have instant results so it won't usualy be filtered until next run GVAR(bodiesToDelete) = GVAR(bodiesToDelete) - [objNull]; -// If no more bodies remain, exit the loop +// Exit the loop if no more bodies remain if (GVAR(bodiesToDelete) isEqualTo []) exitWith { - TRACE_1("array emptied - rem PFEH",GVAR(bodiesToDelete)); + TRACE_1("Ending body cleanup loop",GVAR(bodiesToDelete)); }; -// Schedule the loop to be executed again 20 sec later -[DFUNC(bodyCleanupLoop), [], 20] call CBA_fnc_waitAndExecute; +// Schedule cleanup loop to executed again +[FUNC(litterCleanupLoop), [], BODY_CLEANUP_CHECK_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf b/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf deleted file mode 100644 index 3544022c2b0..00000000000 --- a/addons/medical_treatment/functions/fnc_canAccessMedicalEquipment.sqf +++ /dev/null @@ -1,28 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Check if caller can access targets medical equipment, based upon accessLevel. - * - * Arguments: - * 0: The caller - * 1: The target - * - * Return Value: - * Can Treat - * - * Example: - * [bob, target] call ace_medical_treatment_fnc_canAccessMedicalEquipment - * - * Public: No - */ - -params ["_caller", "_target"]; - -private _accessLevel = _target getVariable [QGVAR(allowSharedEquipmentAccess), -1]; - -switch (_accessLevel) do { - case 0: { true }; - case 1: { side _target == side _caller }; - case 2: { group _target == group _caller }; - default { false }; -}; diff --git a/addons/medical_treatment/functions/fnc_canBandage.sqf b/addons/medical_treatment/functions/fnc_canBandage.sqf index 58e1246c3c9..a67dbb7873b 100644 --- a/addons/medical_treatment/functions/fnc_canBandage.sqf +++ b/addons/medical_treatment/functions/fnc_canBandage.sqf @@ -5,12 +5,12 @@ * Toggles between showing all or only basic bandage action for advanced setting. * * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment * - * ReturnValue: + * Return Value: * Can Bandage * * Example: @@ -19,12 +19,12 @@ * Public: No */ -params ["_medic", "_patient", "_bodypart", "_bandage"]; +params ["_medic", "_patient", "_bodyPart", "_bandage"]; // Bandage type and bandage setting XNOR to show only active actions -if ((_bandage == "BasicBandage") isEqualTo GVAR(advancedBandages)) exitWith { false }; +if ((_bandage == "BasicBandage") isEqualTo GVAR(advancedBandages)) exitWith {false}; -private _index = ALL_BODY_PARTS find toLower _bodypart; +private _index = ALL_BODY_PARTS find toLower _bodyPart; private _canBandage = false; { diff --git a/addons/medical_treatment/functions/fnc_canCPR.sqf b/addons/medical_treatment/functions/fnc_canCPR.sqf new file mode 100644 index 00000000000..9da6ec6891d --- /dev/null +++ b/addons/medical_treatment/functions/fnc_canCPR.sqf @@ -0,0 +1,21 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Checks if CPR can be performed on the patient. + * + * Arguments: + * 0: Medic (not used) + * 1: Patient + * + * Return Value: + * Can CPR + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_canCPR + * + * Public: No + */ + +params ["", "_patient"]; + +!(_patient call EFUNC(common,isAwake)) && {!(_patient getVariable [QGVAR(isReceivingCPR), false])} diff --git a/addons/medical_treatment/functions/fnc_splintCondition.sqf b/addons/medical_treatment/functions/fnc_canSplint.sqf similarity index 52% rename from addons/medical_treatment/functions/fnc_splintCondition.sqf rename to addons/medical_treatment/functions/fnc_canSplint.sqf index be8f9abe9fb..56551ace02e 100644 --- a/addons/medical_treatment/functions/fnc_splintCondition.sqf +++ b/addons/medical_treatment/functions/fnc_canSplint.sqf @@ -1,18 +1,18 @@ #include "script_component.hpp" /* * Author: PabstMirror - * Can apply a splint to the patient + * Checks if a splint can be applied to the patient. * * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part + * 0: Medic (not used) + * 1: Patient + * 2: Body Part * * Return Value: - * Nothing + * Can Splint * * Example: - * [player, cursorObject, "LeftLeg"] call ace_medical_treatment_fnc_splintCondition + * [player, cursorObject, "LeftLeg"] call ace_medical_treatment_fnc_canSplint * * Public: No */ @@ -20,6 +20,5 @@ params ["", "_patient", "_bodyPart"]; private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; -private _fractures = _patient getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]]; -(_fractures select _partIndex) == 1 +(GET_FRACTURES(_patient) select _partIndex) == 1 diff --git a/addons/medical_treatment/functions/fnc_canStitch.sqf b/addons/medical_treatment/functions/fnc_canStitch.sqf index d4013d97f1b..738823114f4 100644 --- a/addons/medical_treatment/functions/fnc_canStitch.sqf +++ b/addons/medical_treatment/functions/fnc_canStitch.sqf @@ -1,11 +1,11 @@ #include "script_component.hpp" /* * Author: Katalam - * Prevents stitch actions from showing if the body is either fully stitched or has no open wounds. + * Checks if the patient can be stitched. * * Arguments: - * 0: The medic - * 1: The patient + * 0: Medic (not used) + * 1: Patient * * ReturnValue: * Can Stitch diff --git a/addons/medical_treatment/functions/fnc_canTreat.sqf b/addons/medical_treatment/functions/fnc_canTreat.sqf index 26c981a02c9..efb7778f09b 100644 --- a/addons/medical_treatment/functions/fnc_canTreat.sqf +++ b/addons/medical_treatment/functions/fnc_canTreat.sqf @@ -1,116 +1,57 @@ #include "script_component.hpp" /* - * Author: Glowbal - * Check if the treatment action can be performed. + * Author: Glowbal, mharis001 + * Checks if the given treatment can be performed. * * Arguments: - * 0: The caller - * 1: The target - * 2: Body part - * 3: Treatment class name + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment * - * ReturnValue: + * Return Value: * Can Treat * * Example: - * [player, cursorTarget, "Head", "SurgicalKit"] call ace_medical_treatment_fnc_canTreat + * [player, cursorObject, "Head", "SurgicalKit"] call ace_medical_treatment_fnc_canTreat * * Public: No */ -params ["_caller", "_target", "_bodyPart", "_className"]; +params ["_medic", "_patient", "_bodyPart", "_classname"]; -if !(_target isKindOf "CAManBase") exitWith {false}; +private _config = configFile >> QGVAR(actions) >> _classname; -private _config = configFile >> QGVAR(Actions) >> _className; +isClass _config +&& {_patient isKindOf "CAManBase"} +&& {_medic != _patient || {GET_NUMBER_ENTRY(_config >> "allowSelfTreatment") == 1}} +&& {[_medic, GET_NUMBER_ENTRY(_config >> "medicRequired")] call FUNC(isMedic)} +&& { + private _selections = getArray (_config >> "allowedSelections") apply {toLower _x}; + "all" in _selections || {_bodyPart in _selections} +} && { + private _items = getArray (_config >> "items"); + _items isEqualTo [] || {[_medic, _patient, _items] call FUNC(hasItem)} +} && { + GET_FUNCTION(_condition,_config >> "condition"); -if !(isClass _config) exitWith {false}; - -// allow self treatment check -private _isSelf = _caller isEqualTo _target; -private _allowSelf = 0; - -if (_isSelf) then { - if (isNumber (_config >> "allowSelfTreatment")) then { - _allowSelf = getNumber (_config >> "allowSelfTreatment"); - } else { - if (isText (_config >> "allowSelfTreatment")) then { - _allowSelf = missionNamespace getVariable [getText (_config >> "allowSelfTreatment"), 0]; - }; - }; -}; - -if (_isSelf && {_allowSelf == 0}) exitWith {false}; - -private _medicRequired = 0; - -if (isNumber (_config >> "requiredMedic")) then { - _medicRequired = getNumber (_config >> "requiredMedic"); -} else { - if (isText (_config >> "requiredMedic")) then { - _medicRequired = missionNamespace getVariable [getText (_config >> "requiredMedic"), 0]; - }; -}; - -if !([_caller, _medicRequired] call FUNC(isMedic)) exitWith {false}; - -// check selection -private _allowedSelections = getArray (_config >> "allowedSelections") apply {toLower _x}; - -if !("all" in _allowedSelections || {(_bodyPart in _allowedSelections)}) exitWith {false}; - -// check item -private _items = getArray (_config >> "items"); - -if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitWith {false}; - -private _condition = true; - -if (isText (_config >> "condition")) then { - _condition = getText (_config >> "condition"); - - if (_condition isEqualTo "") exitWith { - _condition = true; - }; - - if (isNil _condition) then { - _condition = compile _condition; - } else { - _condition = missionNamespace getVariable _condition; - }; - - if !(_condition isEqualType false) then { + if (_condition isEqualType {}) then { _condition = call _condition; }; -}; - -if !(_condition) exitWith {false}; -// check allowed locations -private _locations = getArray (_config >> "treatmentLocations") apply {toLower _x}; - -if ("all" in _locations) then { - _locations = true; -} else { - private _medFacility = {([_caller] call FUNC(isInMedicalFacility)) || ([_target] call FUNC(isInMedicalFacility))}; - private _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isInMedicalVehicle))}; - - { - if (_x == "field") exitWith { _locations = true; }; - if (_x == "MedicalFacility" && _medFacility) exitWith { _locations = true; }; - if (_x == "MedicalVehicle" && _medVeh) exitWith { _locations = true; }; - if !(isNil _x) exitWith { - _locations = missionNamespace getVariable _x; - - if !(_locations isEqualType false) then { - if (_locations isEqualTo 0) exitWith { _locations = true; }; //AdvancedMedicalSettings_anywhere - if (_locations isEqualTo 1) exitWith { _locations = call _medVeh; }; //AdvancedMedicalSettings_vehicle - if (_locations isEqualTo 2) exitWith { _locations = call _medFacility; }; //AdvancedMedicalSettings_facility - if (_locations isEqualTo 3) exitWith { _locations = call _medFacility || {call _medVeh}; }; //AdvancedMedicalSettings_vehicleAndFacility - _locations = false; //Disabled - }; + _condition +} && { + switch (GET_NUMBER_ENTRY(_config >> "treatmentLocations")) do { + case TREATMENT_LOCATIONS_ALL: {true}; + case TREATMENT_LOCATIONS_VEHICLES: { + IN_MED_VEHICLE(_medic) || {IN_MED_VEHICLE(_patient)} }; - } forEach _locations; -}; - -_locations + case TREATMENT_LOCATIONS_FACILITIES: { + IN_MED_FACILITY(_medic) || {IN_MED_FACILITY(_patient)} + }; + case TREATMENT_LOCATIONS_VEHICLES_AND_FACILITIES: { + IN_MED_VEHICLE(_medic) || {IN_MED_VEHICLE(_patient)} || {IN_MED_FACILITY(_medic)} || {IN_MED_FACILITY(_patient)} + }; + default {false}; + }; +} diff --git a/addons/medical_treatment/functions/fnc_canTreatCached.sqf b/addons/medical_treatment/functions/fnc_canTreatCached.sqf index 53ad59cdf47..d70f041c174 100644 --- a/addons/medical_treatment/functions/fnc_canTreatCached.sqf +++ b/addons/medical_treatment/functions/fnc_canTreatCached.sqf @@ -1,24 +1,23 @@ #include "script_component.hpp" /* * Author: Glowbal - * Cached Check if the treatment action can be performed. + * Cached check to determine if given treatment can be performed. * * Arguments: - * 0: The caller - * 1: The target - * 2: Selection name - * 3: ACE_Medical_Treatment Classname + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment * * Return Value: * Can Treat * * Example: - * [bob, kevin, "selection", "classname"] call ace_medical_treatment_fnc_canTreatCached + * [player, cursorObject, "Head", "SurgicalKit"] call ace_medical_treatment_fnc_canTreatCached * * Public: No */ -params ["", "_target", "_selection", "_classname"]; +params ["", "_patient", "_bodyPart", "_classname"]; -// parameters, function, namespace, uid -[_this, DFUNC(canTreat), _target, format [QGVAR(canTreat_%1_%2), _selection, _classname], CAN_TREAT_CONDITION_CACHE_EXPIRY, QEGVAR(interact_menu,clearConditionCaches)] call EFUNC(common,cachedCall); +[_this, FUNC(canTreat), _patient, format [QGVAR(canTreat_%1_%2), _bodyPart, _classname], CAN_TREAT_CONDITION_CACHE_EXPIRY, QEGVAR(interact_menu,clearConditionCaches)] call EFUNC(common,cachedCall); diff --git a/addons/medical_treatment/functions/fnc_checkBloodPressure.sqf b/addons/medical_treatment/functions/fnc_checkBloodPressure.sqf new file mode 100644 index 00000000000..b708b7e50fe --- /dev/null +++ b/addons/medical_treatment/functions/fnc_checkBloodPressure.sqf @@ -0,0 +1,22 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Checks the blood pressure of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftArm"] call ace_medical_treatment_fnc_checkBloodPressure + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +[QGVAR(checkBloodPressureLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_checkBloodPressureLocal.sqf b/addons/medical_treatment/functions/fnc_checkBloodPressureLocal.sqf new file mode 100644 index 00000000000..5da7495f74b --- /dev/null +++ b/addons/medical_treatment/functions/fnc_checkBloodPressureLocal.sqf @@ -0,0 +1,57 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Local callback for checking the blood pressure of a patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftArm"] call ace_medical_treatment_fnc_checkBloodPressureLocal + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +private _bloodPressure = [0, 0]; + +if (alive _patient && {!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then { + _bloodPressure = GET_BLOOD_PRESSURE(_patient); +}; + +private _bloodPressureOutput = LSTRING(Check_Bloodpressure_Output_6); +private _logOutput = LSTRING(Check_Bloodpressure_NoBloodpressure); + +_bloodPressure params ["_bloodPressureLow", "_bloodPressureHigh"]; + +if (_bloodPressureHigh > 20) then { + if (_medic call FUNC(isMedic)) then { + _bloodPressureOutput = LSTRING(Check_Bloodpressure_Output_1); + _logOutput = format ["%1/%2", round _bloodPressureHigh, round _bloodPressureLow]; + } else { + if (_bloodPressureHigh > 20) then { + _bloodPressureOutput = LSTRING(Check_Bloodpressure_Output_2); + _logOutput = LSTRING(Check_Bloodpressure_Low); + + if (_bloodPressureHigh > 100) then { + _bloodPressureOutput = LSTRING(Check_Bloodpressure_Output_3); + _logOutput = LSTRING(Check_Bloodpressure_Normal); + + if (_bloodPressureHigh > 160) then { + _bloodPressureOutput = LSTRING(Check_Bloodpressure_Output_4); + _logOutput = LSTRING(Check_Bloodpressure_High); + }; + }; + }; + }; +}; + +[_patient, "quick_view", LSTRING(Check_Bloodpressure_Log), [_medic call EFUNC(common,getName), _logOutput]] call FUNC(addToLog); + +[QEGVAR(common,displayTextStructured), [[_bloodPressureOutput, _patient call EFUNC(common,getName), round _bloodPressureHigh, round _bloodPressureLow], 1.75, _medic], _medic] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_checkItems.sqf b/addons/medical_treatment/functions/fnc_checkItems.sqf index 4c2278a408c..2f4c20175ef 100644 --- a/addons/medical_treatment/functions/fnc_checkItems.sqf +++ b/addons/medical_treatment/functions/fnc_checkItems.sqf @@ -1,42 +1,47 @@ #include "script_component.hpp" /* - * Author: KoffeinFlummi, commy2 - * Replaces vanilla items with ACE ones. + * Author: KoffeinFlummi, commy2, mharis001 + * Handles converting vanilla medical items with ACE equivalents. * * Arguments: - * 0: The unit + * 0: Unit * - * ReturnValue: + * Return Value: * None * + * Example: + * [player] call ace_medical_treatment_fnc_checkItems + * * Public: No */ -if (EGVAR(medical,convertItems) == 2) exitWith {}; +if (GVAR(convertItems) == 2) exitWith {}; params ["_unit"]; -private _countFirstAidKit = [_unit, "FirstAidKit"] call EFUNC(common,getCountOfItem); -_unit removeItems "FirstAidKit"; +private _fnc_loop = if (GVAR(convertItems) == 0) then { + { + _x params ["_itemToRemove", "_replacementItems"]; -private _countMedikit = [_unit, "Medikit"] call EFUNC(common,getCountOfItem); -_unit removeItems "Medikit"; + private _count = [_unit, _itemToRemove] call EFUNC(common,getCountOfItem); -if (EGVAR(medical,convertItems) != 0) exitWith {}; + if (_count > 0) then { + _unit removeItems _itemToRemove; -for "_i" from 1 to _countFirstAidKit do { - _unit addItem "ACE_fieldDressing"; - _unit addItem "ACE_packingBandage"; - _unit addItem "ACE_morphine"; - _unit addItem "ACE_tourniquet"; -}; + { + _x params ["_item", "_amount"]; -for "_i" from 1 to _countMedikit do { - _unit addItemToBackpack "ACE_fieldDressing"; - _unit addItemToBackpack "ACE_packingBandage"; - _unit addItemToBackpack "ACE_packingBandage"; - _unit addItemToBackpack "ACE_epinephrine"; - _unit addItemToBackpack "ACE_morphine"; - _unit addItemToBackpack "ACE_salineIV_250"; - _unit addItemToBackpack "ACE_tourniquet"; + for "_i" from 1 to (_amount * _count) do { + _unit addItem _item; + }; + } forEach _replacementItems; + }; + } +} else { + { + _x params ["_itemToRemove"]; + _unit removeItems _itemToRemove; + } }; + +_fnc_loop forEach GVAR(replacementItems); diff --git a/addons/medical_treatment/functions/fnc_checkPulse.sqf b/addons/medical_treatment/functions/fnc_checkPulse.sqf new file mode 100644 index 00000000000..6c5b628fae6 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_checkPulse.sqf @@ -0,0 +1,22 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Checks the pulse or heart rate of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head"] call ace_medical_treatment_fnc_checkPulse + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +[QGVAR(checkPulseLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf new file mode 100644 index 00000000000..f386fa2c899 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf @@ -0,0 +1,53 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Local callback for checking the pulse or heart rate of a patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head"] call ace_medical_treatment_fnc_checkPulseLocal + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +private _heartRate = 0; + +if (alive _patient && {!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then { + _heartRate = GET_HEART_RATE(_patient); +}; + +private _heartRateOutput = LSTRING(Check_Pulse_Output_5); +private _logOutput = LSTRING(Check_Pulse_None); + +if (_heartRate > 1) then { + if (_medic call FUNC(isMedic)) then { + _heartRateOutput = LSTRING(Check_Pulse_Output_1); + _logOutput = format ["%1", round _heartRate]; + } else { + _heartRateOutput = LSTRING(Check_Pulse_Output_2); + _logOutput = LSTRING(Check_Pulse_Weak); + + if (_heartRate > 60) then { + if (_heartRate > 100) then { + _heartRateOutput = LSTRING(Check_Pulse_Output_3); + _logOutput = LSTRING(Check_Pulse_Strong); + } else { + _heartRateOutput = LSTRING(Check_Pulse_Output_4); + _logOutput = LSTRING(Check_Pulse_Normal); + }; + }; + }; +}; + +[_patient, "quick_view", LSTRING(Check_Pulse_Log), [_medic call EFUNC(common,getName), _logOutput]] call FUNC(addToLog); + +[QEGVAR(common,displayTextStructured), [[_heartRateOutput, _patient call EFUNC(common,getName), round _heartRate], 1.5, _medic], _medic] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_checkResponse.sqf b/addons/medical_treatment/functions/fnc_checkResponse.sqf new file mode 100644 index 00000000000..0fe0bbd60e4 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_checkResponse.sqf @@ -0,0 +1,24 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Checks the response status of the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_checkResponse + * + * Public: No + */ + +params ["_medic", "_patient"]; + +private _output = [LSTRING(Check_Response_Unresponsive), LSTRING(Check_Response_Responsive)] select (_patient call EFUNC(common,isAwake)); +[[_output, _patient call EFUNC(common,getName)], 2] call EFUNC(common,displayTextStructured); + +[_patient, "quick_view", _output, [[_patient, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical_treatment/functions/fnc_cpr.sqf b/addons/medical_treatment/functions/fnc_cpr.sqf new file mode 100644 index 00000000000..a0732bcbf8e --- /dev/null +++ b/addons/medical_treatment/functions/fnc_cpr.sqf @@ -0,0 +1,27 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Handles finishing performing CPR on the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_cpr + * + * Public: No + */ + +params ["_medic", "_patient"]; + +_patient setVariable [QGVAR(isReceivingCPR), false, true]; +_patient setVariable [VAR_HEART_RATE, 0, true]; +_patient call FUNC(calculateBlood); + +if (alive _patient && {IN_CRDC_ARRST(_patient)}) then { + [QGVAR(cprLocal), [_medic, _patient], _patient] call CBA_fnc_targetEvent; +}; diff --git a/addons/medical_treatment/functions/fnc_cprFailure.sqf b/addons/medical_treatment/functions/fnc_cprFailure.sqf new file mode 100644 index 00000000000..a19179c5f81 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_cprFailure.sqf @@ -0,0 +1,28 @@ +#include "script_component.hpp" +/* + * Author: Zakant + * Handles failure of the CPR treatment. + * + * Arguments: + * 0: Medic (not used) + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_cprFailure + * + * Public: No + */ + +params ["", "_patient"]; + +if (!(_patient call EFUNC(common,isAwake)) || {IN_CRDC_ARRST(_patient)}) then { + _patient setVariable [VAR_HEART_RATE, 0, true]; +}; + +// Patient is no longer receiving CPR +_patient setVariable [QGVAR(isReceivingCPR), false, true]; + +_patient call FUNC(calculateBlood); diff --git a/addons/medical_treatment/functions/fnc_cprLocal.sqf b/addons/medical_treatment/functions/fnc_cprLocal.sqf new file mode 100644 index 00000000000..da72faba455 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_cprLocal.sqf @@ -0,0 +1,25 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Local callback for finishing performing CPR on the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_cprLocal + * + * Public: No + */ + +params ["_medic", "_patient"]; + +[_patient, "activity", LSTRING(Activity_CPR), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); + +if (random 1 >= 0.6) then { + [QEGVAR(medical,CPRSucceeded), _patient] call CBA_fnc_localEvent; +}; diff --git a/addons/medical_treatment/functions/fnc_cprProgress.sqf b/addons/medical_treatment/functions/fnc_cprProgress.sqf new file mode 100644 index 00000000000..e595b7ffdd6 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_cprProgress.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" +/* + * Author: Zakant + * Handles the progress of the CPR treatment. + * + * Arguments: + * 0: Arguments + * 0: Medic (not used) + * 1: Patient + * + * Return Value: + * Continue CPR + * + * Example: + * [[player, cursorObject]] call ace_medical_treatment_fnc_cprProgress + * + * Public: No + */ + +params ["_args"]; +_args params ["", "_patient"]; + +// Cancel CPR is patient wakes up +if (_patient getVariable EFUNC(common,isAwake) || {!IN_CRDC_ARRST(_patient)}) exitWith {false}; + +// Calculate blood volume, if there is no pulse nothing happens +_patient call FUNC(calculateBlood); + +true diff --git a/addons/medical_treatment/functions/fnc_cprStart.sqf b/addons/medical_treatment/functions/fnc_cprStart.sqf new file mode 100644 index 00000000000..677e8a516aa --- /dev/null +++ b/addons/medical_treatment/functions/fnc_cprStart.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" +/* + * Author: Zakant + * Handles starting the CPR treatment. + * + * Arguments: + * 0: Medic (not used) + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_cprStart + * + * Public: No + */ + +params ["", "_patient"]; + +// Prevent others from performing CPR +_patient setVariable [QGVAR(isReceivingCPR), true, true]; + +// Create a random pulse based on setting +if (GVAR(cprCreatesPulse) && {GET_HEART_RATE(_patient) == 0}) then { + _patient setVariable [VAR_HEART_RATE, round random [25, 30, 35], true]; +}; + +_patient setVariable [QEGVAR(medical,lastTimeUpdated), CBA_missionTime, true]; diff --git a/addons/medical_treatment/functions/fnc_createLitter.sqf b/addons/medical_treatment/functions/fnc_createLitter.sqf new file mode 100644 index 00000000000..587648de49c --- /dev/null +++ b/addons/medical_treatment/functions/fnc_createLitter.sqf @@ -0,0 +1,70 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Creates litter around the patient based on the treatment. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "Head", "BasicBandage"] call ace_medical_fnc_createLitter + * + * Public: No + */ + +// Exit if litter creation is disabled +if (!GVAR(allowLitterCreation)) exitWith {}; + +params ["_medic", "_patient", "_bodyPart", "_classname"]; + +// Don't create litter if medic or patient are inside a vehicle +if (vehicle _medic != _medic || {vehicle _patient != _patient}) exitWith {}; + +// Determine if treated body part is bleeding +private _index = ALL_BODY_PARTS find toLower _bodyPart; +private _isBleeding = (_patient getVariable [QEGVAR(medical,openWounds), []]) findIf { + _x params ["", "_bodyPartN", "_amountOf", "_bleeding"]; + + _bodyPartN == _index && {_amountOf * _bleeding > 0} +} != -1; + +// Get litter config for the treatment +private _litter = getArray (configFile >> QGVAR(actions) >> _classname >> "litter"); +_litter params [["_alwaysLitter", [], [[]]], ["_cleanLitter", [], [[]]], ["_bloodyLitter", [], [[]]]]; + +private _fnc_createLitter = { + params ["_litterOptions"]; + + private _position = getPosASL _patient; + + // For now, don't spawn litter over water to avoid floating litter + // todo: handle carriers over water + if (surfaceIsWater _position) exitWith {}; + + { + if (_x isEqualType []) then { + _x = selectRandom _x; + }; + + // Randomize position XY +/- 1 m + private _position = _position vectorAdd [ + random 2 - 1, + random 2 - 1, + 0 + ]; + + // Create litter on server which will also handle cleanup + [QGVAR(createLitterServer), [_x, _position, random 360]] call CBA_fnc_serverEvent; + } forEach _litterOptions; +}; + +private _conditionalLitter = [_cleanLitter, _bloodyLitter] select _isBleeding; + +[_alwaysLitter] call _fnc_createLitter; +[_conditionalLitter] call _fnc_createLitter; diff --git a/addons/medical_treatment/functions/fnc_createLitterServer.sqf b/addons/medical_treatment/functions/fnc_createLitterServer.sqf new file mode 100644 index 00000000000..5b94c5f1997 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_createLitterServer.sqf @@ -0,0 +1,57 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Creates a litter object and handles its cleanup. Only execute on server. + * + * Arguments: + * 0: Litter Class + * 1: Position ASL + * 2: Direction + * + * Return Value: + * None + * + * Example: + * ["Litter_1", [100, 100, 0], 90] call ace_medical_fnc_createLitterServer + * + * Public: No + */ + +params ["_litterClass", "_position", "_direction"]; + +if (isNil QGVAR(litterObjects)) then { + GVAR(litterObjects) = []; + GVAR(litterCleanup) = false; +}; + +private _model = getText (configFile >> "CfgVehicles" >> _litterClass >> "model"); +if (_model == "") exitWith {}; + +// createSimpleObject expects a path without the leading slash +if (_model select [0, 1] == "\") then { + _model = _model select [1]; +}; + +private _object = createSimpleObject [_model, [0, 0, 0]]; +_object setPosASL _position; +_object setDir _direction; + +// Set the litter object's position next frame to correct HORRIBLE spacing (fixes #1112) +[{ + params ["_object", "_position"]; + _object setPosASL _position; +}, [_object, _position]] call CBA_fnc_execNextFrame; + +// Delete oldest litter object if max count reached +if (count GVAR(litterObjects) > GVAR(maxLitterObjects)) then { + private _litterToDelete = GVAR(litterObjects) deleteAt 0; + deleteVehicle (_litterToDelete select 0); +}; + +GVAR(litterObjects) pushBack [_object, CBA_missionTime]; + +// Start cleanup loop if not already running and litter lifetime is not forever +if (!GVAR(litterCleanup) && {GVAR(litterCleanupDelay) > 0}) then { + [] call FUNC(litterCleanupLoop); + GVAR(litterCleanup) = true; +}; diff --git a/addons/medical_treatment/functions/fnc_diagnose.sqf b/addons/medical_treatment/functions/fnc_diagnose.sqf new file mode 100644 index 00000000000..531827302db --- /dev/null +++ b/addons/medical_treatment/functions/fnc_diagnose.sqf @@ -0,0 +1,49 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Action for diagnosing in basic medical + * + * Arguments: + * 0: Medic + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_diagnose + * + * Public: No + */ + +params ["_medic", "_patient"]; + +private _messages = [LSTRING(diagnoseMessage), _patient call EFUNC(common,getName)]; + +if (alive _patient) then { + _messages pushBack LSTRING(diagnoseAlive); +} else { + _messages pushBack LSTRING(diagnoseDead); +}; + +private _hemorrhage = GET_HEMORRHAGE(_patient); +if (_hemorrhage > 0) then { + if (_hemorrhage > 1) then { + _messages pushBack LSTRING(lostBloodALot); + } else { + _messages pushBack LSTRING(lostBlood); + }; +} else { + _messages pushBack LSTRING(noBloodloss); +}; + +// todo: mirror pain visualization logic of medical_gui? +if (alive _patient) then { + if IS_IN_PAIN(_patient) then { + _messages pushBack LSTRING(inPain); + } else { + _messages pushBack LSTRING(noPain); + }; +}; + +[_messages, 3] call EFUNC(common,displayTextStructured); diff --git a/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf b/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf index 76221060547..d1a451e3af2 100644 --- a/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf +++ b/addons/medical_treatment/functions/fnc_findMostEffectiveWound.sqf @@ -4,8 +4,8 @@ * Finds the wound most effective to bandage on the given bodypart of the patient for the given bandage type. * * Arguments: - * 0: The patient - * 1: Treatment class name + * 0: Patient + * 1: Treatment classname * 2: Body part index * * Return Value: diff --git a/addons/medical_treatment/functions/fnc_fullHeal.sqf b/addons/medical_treatment/functions/fnc_fullHeal.sqf new file mode 100644 index 00000000000..c5027e7dbea --- /dev/null +++ b/addons/medical_treatment/functions/fnc_fullHeal.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Fully heals the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_fullHeal + * + * Public: No + */ + +params ["_medic", "_patient"]; + +[_patient, "activity", LSTRING(Activity_fullHeal), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); + +[QGVAR(fullHealLocal), _patient, _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf new file mode 100644 index 00000000000..75ccb26674d --- /dev/null +++ b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf @@ -0,0 +1,84 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Local callback for fully healing a patient. + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call ace_medical_treatment_fnc_fullHealLocal + * + * Public: No + */ + +params ["_patient"]; + +if (!alive _patient) exitWith {}; + +// Treatment conditions would normally limit full heal to non-unconscious units +// However, this may be called externally (through Zeus) +if IN_CRDC_ARRST(_patient) then { + TRACE_1("Exiting cardiac arrest",_patient); + [QEGVAR(medical,CPRSucceeded), _patient] call CBA_fnc_localEvent; +}; + +if IS_UNCONSCIOUS(_patient) then { + TRACE_1("Waking up",_patient); + // Wake patient up first or unconscious variables will be reset + [QEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent; +}; + +_patient setVariable [VAR_PAIN, 0, true]; +_patient setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true]; + +// Tourniquets +_patient setVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES, true]; +_patient setVariable [QGVAR(occludedMedications), nil, true]; + +// Wounds and Injuries +_patient setVariable [QEGVAR(medical,openWounds), [], true]; +_patient setVariable [QEGVAR(medical,bandagedWounds), [], true]; +_patient setVariable [QEGVAR(medical,stitchedWounds), [], true]; +_patient setVariable [QEGVAR(medical,isLimping), false, true]; +_patient setVariable [VAR_FRACTURES, DEFAULT_FRACTURE_VALUES, true]; + +// Update wound bleeding +[_patient] call EFUNC(medical_status,updateWoundBloodLoss); + +// Vitals +_patient setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true]; +_patient setVariable [VAR_BLOOD_PRESS, [80, 120], true]; +_patient setVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES, true]; + +// IVs +_patient setVariable [QEGVAR(medical,ivBags), nil, true]; + +// Damage storage +_patient setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true]; +#ifdef DEBUG_TESTRESULTS +_patient setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true]; +#endif + +// Generic medical admin +_patient setVariable [VAR_CRDC_ARRST, false, true]; +_patient setVariable [VAR_UNCON, false, true]; +_patient setVariable [VAR_HEMORRHAGE, 0, true]; +_patient setVariable [VAR_IN_PAIN, false, true]; +_patient setVariable [VAR_PAIN_SUPP, 0, true]; + +// Medication +_patient setVariable [VAR_MEDICATIONS, [], true]; + +// Reset triage card since medication is reset +_patient setVariable [QEGVAR(medical,triageCard), [], true]; + +[_patient] call EFUNC(medical_engine,updateDamageEffects); + +// Reset damage +_patient setDamage 0; + +[QEGVAR(medical,FullHeal), _patient] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/functions/fnc_getBandageTime.sqf b/addons/medical_treatment/functions/fnc_getBandageTime.sqf index 48fd27fdac8..e56727cfc7a 100644 --- a/addons/medical_treatment/functions/fnc_getBandageTime.sqf +++ b/addons/medical_treatment/functions/fnc_getBandageTime.sqf @@ -4,13 +4,16 @@ * Calculates the time to bandage a wound based on it's size, the patient and the medic. * * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment * * Return Value: - * Time in seconds + * Treatment Time + * + * Example: + * [player, cursorTarget, "Head", "FieldDressing"] call ace_medical_treatment_fnc_getBandageTime * * Public: No */ @@ -48,4 +51,4 @@ if (_medic == _patient) then { }; // Nobody can bandage instantly -_bandageTime max 1 +_bandageTime max 2 diff --git a/addons/medical_treatment/functions/fnc_getHealTime.sqf b/addons/medical_treatment/functions/fnc_getHealTime.sqf new file mode 100644 index 00000000000..e8e8c302bfc --- /dev/null +++ b/addons/medical_treatment/functions/fnc_getHealTime.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" +/* + * Author: Ruthberg + * Calculates the PAK treatment time based on the amount of damage to heal. + * + * Arguments: + * 0: Medic (not used) + * 1: Patient + * + * Return Value: + * Treatment Time + * + * Example: + * [player] call ace_medical_treatment_fnc_getHealTime + * + * Public: No + */ + +#define DAMAGE_SCALING_FACTOR 5 + +params ["", "_patient"]; + +private _bodyPartDamage = 0; + +{ + _bodyPartDamage = _bodyPartDamage + _x; +} forEach (_patient getVariable [QEGVAR(medical,bodyPartDamage), []]); + +10 max (((_bodyPartDamage * DAMAGE_SCALING_FACTOR) min 180) * GVAR(timeCoefficientPAK)) diff --git a/addons/medical_treatment/functions/fnc_getStitchTime.sqf b/addons/medical_treatment/functions/fnc_getStitchTime.sqf new file mode 100644 index 00000000000..63e970301bc --- /dev/null +++ b/addons/medical_treatment/functions/fnc_getStitchTime.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Calculates the Surgical Kit treatment time based on the amount of bandaged wounds. + * + * Arguments: + * 0: Medic (not used) + * 1: Patient + * + * Return Value: + * Treatment Time + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_getStitchTime + * + * Public: No + */ + +#define TIME_PER_WOUND 5 + +params ["", "_patient"]; + +count (_patient getVariable [QEGVAR(medical,bandagedWounds), []]) * TIME_PER_WOUND diff --git a/addons/medical_treatment/functions/fnc_getTriageStatus.sqf b/addons/medical_treatment/functions/fnc_getTriageStatus.sqf index de4f78a8534..6db6484b8f2 100644 --- a/addons/medical_treatment/functions/fnc_getTriageStatus.sqf +++ b/addons/medical_treatment/functions/fnc_getTriageStatus.sqf @@ -7,11 +7,11 @@ * 0: Unit * * Return Value: - * Triage info - * 0: Status ID - * 1: Name - * 2: Color - * 3: Text color + * Triage Info + * 0: Status ID + * 1: Name + * 2: Color + * 3: Text Color * * Example: * [player] call ace_medical_treatment_fnc_getTriageStatus diff --git a/addons/medical_treatment/functions/fnc_hasItem.sqf b/addons/medical_treatment/functions/fnc_hasItem.sqf index f6e07b576ec..564e7c4be25 100644 --- a/addons/medical_treatment/functions/fnc_hasItem.sqf +++ b/addons/medical_treatment/functions/fnc_hasItem.sqf @@ -1,44 +1,31 @@ #include "script_component.hpp" /* - * Author: Glowbal - * Check if the item is present between the patient and the medic + * Author: Glowbal, mharis001 + * Checks if one of the given items are present between the medic and patient. + * Does not respect the priority defined by the allowSharedEquipment setting. + * Will check medic first and then patient if shared equipment is allowed. * * Arguments: * 0: Medic * 1: Patient - * 2: Item + * 2: Items * * Return Value: - * Has the items + * Has Item * * Example: - * [bob, patient, "bandage"] call ace_medical_treatment_fnc_hasItem + * [player, cursorObject, ["ACE_fieldDressing"]] call ace_medical_treatment_fnc_hasItems * * Public: No */ -params ["_medic", "_patient", "_item"]; +params ["_medic", "_patient", "_items"]; -if (isNil QEGVAR(medical,setting_allowSharedEquipment)) then { - EGVAR(medical,setting_allowSharedEquipment) = true; -}; - -if (EGVAR(medical,setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith { - true -}; - -if ([_medic, _item] call EFUNC(common,hasItem)) exitWith { - true -}; - -private _hasItem = false; +private _fnc_checkItems = { + params ["_unit"]; -if (vehicle _medic != _medic && {vehicle _medic call FUNC(isMedicalVehicle)}) then { - { - if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {[_x, _item] call EFUNC(common,hasItem)}) exitWith { - _hasItem = true; - }; - } forEach crew vehicle _medic; + private _unitItems = _unit call EFUNC(common,uniqueItems); + _items findIf {_x in _unitItems} != -1 }; -_hasItem +_medic call _fnc_checkItems || {GVAR(allowSharedEquipment) != 2 && {_patient call _fnc_checkItems}} diff --git a/addons/medical_treatment/functions/fnc_hasItems.sqf b/addons/medical_treatment/functions/fnc_hasItems.sqf deleted file mode 100644 index c55ad47e340..00000000000 --- a/addons/medical_treatment/functions/fnc_hasItems.sqf +++ /dev/null @@ -1,36 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Check if all items are present between the patient and the medic. - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Items > - * - * Return Value: - * Has the items - * - * Example: - * [bob, patient, ["bandage", "morphine"]] call ace_medical_treatment_fnc_hasItems - * - * Public: No - */ - -params ["_medic", "_patient", "_items"]; - -private _return = true; - -{ - // handle a one of type use item - if (_x isEqualType [] && {{[_medic, _patient, _x] call FUNC(hasItem)} count _x == 0}) exitWith { - _return = false; - }; - - // handle required item - if (_x isEqualType "" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitWith { - _return = false; - }; -} forEach _items; - -_return diff --git a/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf index d3f573cb55a..c8d2aa8e7bf 100644 --- a/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical_treatment/functions/fnc_hasTourniquetAppliedTo.sqf @@ -1,14 +1,14 @@ #include "script_component.hpp" /* * Author: Glowbal - * Check if unit has a tourniquet applied to the specified bodypart + * Checks if the unit has a tourniquet applied on the specified body part. * * Arguments: - * 0: The Unit + * 0: Unit * 1: Body Part * * Return Value: - * Has tourniquet applied + * Has Tourniquet Been Applied * * Example: * [player, "leftleg"] call ace_medical_treatment_fnc_hasTourniquetAppliedTo @@ -16,8 +16,8 @@ * Public: No */ -params ["_target", "_bodyPart"]; +params ["_unit", "_bodyPart"]; private _index = ALL_BODY_PARTS find toLower _bodyPart; -_index >= 0 && {HAS_TOURNIQUET_APPLIED_ON(_target,_index)} +_index >= 0 && {HAS_TOURNIQUET_APPLIED_ON(_unit,_index)} diff --git a/addons/medical_treatment/functions/fnc_healTime.sqf b/addons/medical_treatment/functions/fnc_healTime.sqf deleted file mode 100644 index 0dcb1f74d2f..00000000000 --- a/addons/medical_treatment/functions/fnc_healTime.sqf +++ /dev/null @@ -1,32 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Ruthberg - * Calculates the personal aid kit treatment time based on amount of damage to heal - * - * Arguments: - * unit - * - * Return Value: - * treatment time - * - * Example: - * [_target] call ace_medical_treatment_fnc_healTime - * - * Public: No - */ - -params ["_unit"]; - -private _totalDamage = 0; -private _treatTime = 0; - -{ - _totalDamage = _totalDamage + _x; -} forEach (_unit getVariable [QEGVAR(medical,bodyPartDamage), []]); - -if (EGVAR(medical,PAKTime) > 0) then { - _treatTime = EGVAR(medical,PAKTime); -} else { - _treatTime = 10 max (_totalDamage * 5) min 180; -}; -_treatTime diff --git a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf index a9b01345b8e..fe144ea78a2 100644 --- a/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical_treatment/functions/fnc_isInMedicalFacility.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" /* - * Author: Glowbal - * Checks if a unit is in a designated medical facility + * Author: Glowbal, mharis001 + * Checks if the unit is in a medical facility. * * Arguments: - * 0: The Unit + * 0: Unit * * Return Value: - * Is in medical facility + * In Medical Facility * * Example: * [player] call ace_medical_treatment_fnc_isInMedicalFacility @@ -15,49 +15,13 @@ * Public: No */ -params ["_unit"]; - -//Cache the results as this function could be called rapidly -(_unit getVariable [QGVAR(cacheInFacility), [-9, false]]) params ["_expireTime", "_lastResult"]; -if (CBA_missionTime < _expireTime) exitWith {_lastResult}; - -private _eyePos = eyePos _unit; -private _isInBuilding = false; +#define CHECK_OBJECTS(var) ((var) findIf {typeOf _x in GVAR(facilityClasses) || {_x getVariable [QEGVAR(medical,isMedicalFacility), false]}} != -1) -private _medicalFacility = - [ - "TK_GUE_WarfareBFieldhHospital_Base_EP1", - "TK_GUE_WarfareBFieldhHospital_EP1", - "TK_WarfareBFieldhHospital_Base_EP1", - "TK_WarfareBFieldhHospital_EP1", - "US_WarfareBFieldhHospital_Base_EP1", - "US_WarfareBFieldhHospital_EP1", - "MASH_EP1", - "MASH", - "Land_A_Hospital", - "CDF_WarfareBFieldhHospital", - "GUE_WarfareBFieldhHospital", - "INS_WarfareBFieldhHospital", - "RU_WarfareBFieldhHospital", - "USMC_WarfareBFieldhHospital" - ]; - -private _objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]); -{ - if (((typeOf _x) in _medicalFacility) || {_x getVariable [QEGVAR(medical,isMedicalFacility),false]}) exitWith { - _isInBuilding = true; - }; -} forEach _objects; +params ["_unit"]; -if (!_isInBuilding) then { - _objects = _unit nearObjects 7.5; - { - if (((typeOf _x) in _medicalFacility) || {_x getVariable [QEGVAR(medical,isMedicalFacility),false]}) exitWith { - _isInBuilding = true; - }; - } forEach _objects; +private _fnc_check = { + private _position = _unit modelToWorldVisual [0, 0, eyePos _unit select 2]; + CHECK_OBJECTS(ARR_5(lineIntersectsWith [_position, _position vectorAdd [0, 0, 10], _unit])) || {CHECK_OBJECTS(_unit nearObjects 7.5)} }; -_unit setVariable [QGVAR(cacheInFacility), [CBA_missionTime + IN_MEDICAL_FACILITY_CACHE_EXPIRY, _isInBuilding]]; - -_isInBuilding; +[[], _fnc_check, _unit, QGVAR(inMedicalFacilityCache), IN_MEDICAL_FACILITY_CACHE_EXPIRY] call EFUNC(common,cachedCall); diff --git a/addons/medical_treatment/functions/fnc_isInMedicalVehicle.sqf b/addons/medical_treatment/functions/fnc_isInMedicalVehicle.sqf index 6c4d8954926..2f76f04f99a 100644 --- a/addons/medical_treatment/functions/fnc_isInMedicalVehicle.sqf +++ b/addons/medical_treatment/functions/fnc_isInMedicalVehicle.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" /* * Author: KoffeinFlummi - * Checks if a unit is in a medical vehicle. + * Checks if the unit is in a medical vehicle. * * Arguments: - * 0: unit to be checked + * 0: Unit * * Return Value: - * Is unit in medical vehicle? + * In Medical Vehicle * * Example: * [player] call ace_medical_treatment_fnc_isInMedicalVehicle @@ -19,7 +19,4 @@ params ["_unit"]; private _vehicle = vehicle _unit; -if (_unit == _vehicle) exitWith {false}; -if (_unit in [driver _vehicle, gunner _vehicle, commander _vehicle]) exitWith {false}; - -[_vehicle] call FUNC(isMedicalVehicle); +_unit != _vehicle && {!(_unit in [driver _vehicle, gunner _vehicle, commander _vehicle])} && {[_vehicle] call FUNC(isMedicalVehicle)} diff --git a/addons/medical_treatment/functions/fnc_isMedic.sqf b/addons/medical_treatment/functions/fnc_isMedic.sqf index 65bbdcc853b..d109ad24521 100644 --- a/addons/medical_treatment/functions/fnc_isMedic.sqf +++ b/addons/medical_treatment/functions/fnc_isMedic.sqf @@ -1,14 +1,15 @@ #include "script_component.hpp" /* * Author: Glowbal, KoffeinFlummi - * Check if a unit is any medical class + * Checks if the unit is a medic of the given level. + * Medic Levels: 0 - None, 1 - Medic, 2 - Doctor * * Arguments: - * 0: The Unit - * 1: Class (default: 1) + * 0: Unit + * 1: Medic Level (default: 1) * * Return Value: - * Is in of medic class + * Is Medic * * Example: * [player] call ace_medical_treatment_fnc_isMedic @@ -18,13 +19,13 @@ params ["_unit", ["_medicN", 1]]; -private _class = _unit getVariable [QEGVAR(medical,medicClass), [0, 1] select (_unit getUnitTrait "medic")]; +private _class = _unit getVariable [QEGVAR(medical,medicClass), parseNumber (_unit getUnitTrait "medic")]; if (_class >= _medicN) exitWith {true}; -if (!EGVAR(medical,increaseTrainingInLocations)) exitWith {false}; +if (!GVAR(locationsBoostTraining)) exitWith {false}; -if (([_unit] call FUNC(isInMedicalVehicle)) || {[_unit] call FUNC(isInMedicalFacility)}) then { - _class = _class + 1; //boost by one: untrained becomes medic, medic becomes doctor +if (IN_MED_VEHICLE(_unit) || {IN_MED_FACILITY(_unit)}) then { + _class = _class + 1; // Boost medical training by one: untrained becomes medic, medic becomes doctor }; _class >= _medicN diff --git a/addons/medical_treatment/functions/fnc_isMedicalVehicle.sqf b/addons/medical_treatment/functions/fnc_isMedicalVehicle.sqf index d109a14e87f..4b06ffdb557 100644 --- a/addons/medical_treatment/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical_treatment/functions/fnc_isMedicalVehicle.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" /* * Author: Glowbal - * Check if vehicle is a medical vehicle + * Checks if the vehicle is a medical vehicle. * * Arguments: - * 0: The Vehicle + * 0: Vehicle * * Return Value: - * Is in of medic class + * Is Medical Vehicle * * Example: * [cursorObject] call ace_medical_treatment_fnc_isMedicalVehicle @@ -17,4 +17,4 @@ params ["_vehicle"]; -(_vehicle getVariable [QEGVAR(medical,medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0 +_vehicle getVariable [QEGVAR(medical,isMedicalVehicle), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") > 0] diff --git a/addons/medical_treatment/functions/fnc_ivBag.sqf b/addons/medical_treatment/functions/fnc_ivBag.sqf new file mode 100644 index 00000000000..bfc149564e1 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_ivBag.sqf @@ -0,0 +1,28 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Administers an IV bag treatment to the patient. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment + * 4: Item User (not used) + * 5: Used Item + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "RightArm", "BloodIV", objNull, "ACE_bloodIV"] call ace_medical_treatment_fnc_ivBag + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart", "_classname", "", "_usedItem"]; + +[_patient, _usedItem] call FUNC(addToTriageCard); +[_patient, "activity", LSTRING(Activity_gaveIV), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); + +[QGVAR(ivBagLocal), [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_ivBagLocal.sqf b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf new file mode 100644 index 00000000000..5017e74aae2 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_ivBagLocal.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Local callback for administering an IV bag to a patient. + * + * Arguments: + * 0: Patient + * 1: Body Part + * 2: Treatment + * + * Return Value: + * None + * + * Example: + * [player, "RightArm", "BloodIV"] call ace_medical_treatment_fnc_ivBagLocal + * + * Public: No + */ + +params ["_patient", "_bodyPart", "_classname"]; + +// Exit if patient has max blood volume +private _bloodVolume = GET_BLOOD_VOLUME(_patient); +if (_bloodVolume >= DEFAULT_BLOOD_VOLUME) exitWith {}; + +private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; + +// Get attributes for the used IV +private _defaultConfig = configFile >> QUOTE(ADDON) >> "IV"; +private _ivConfig = _defaultConfig >> _classname; + +private _volume = GET_NUMBER(_ivConfig >> "volume",getNumber (_defaultConfig >> "volume")); +private _type = GET_STRING(_ivConfig >> "type",getText (_defaultConfig >> "type")); + +// Add IV bag to patient's ivBags array +private _ivBags = _patient getVariable [QEGVAR(medical,ivBags), []]; +_ivBags pushBack [_volume, _type, _partIndex]; +_ivBags setVariable [QEGVAR(medical,ivBags), _ivBags, true]; diff --git a/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf b/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf index 20b2cc20ec9..1039edb4c62 100644 --- a/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf +++ b/addons/medical_treatment/functions/fnc_litterCleanupLoop.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" /* - * Author: Glowbal, esteldunedain - * Loop that cleans up litter + * Author: Glowbal, esteldunedain, mharis001 + * Handles cleaning up litter objects that have reached the end of their lifetime. * * Arguments: * None @@ -10,31 +10,28 @@ * None * * Example: - * call ace_medical_treatment_fnc_litterCleanupLoop + * [] call ace_medical_treatment_fnc_litterCleanupLoop * * Public: No */ { - _x params ["_time", "_objects"]; + _x params ["_object", "_timeCreated"]; - // Older elements are always at the begining of the array - if (CBA_missionTime - _time < GVAR(litterCleanUpDelay)) exitWith {}; + // Litter array has older objects at the beginning + // Can exit on first element that still has lifetime remaining + if (CBA_missionTime - _timeCreated < GVAR(litterCleanupDelay)) exitWith {}; - TRACE_2("deleting",_time,_objects); - { - deleteVehicle _x; - } forEach _objects; + deleteVehicle _object; + GVAR(litterObjects) set [_forEachIndex, objNull]; +} forEach GVAR(litterObjects); - GVAR(allCreatedLitter) set [_forEachIndex, objNull]; -} forEach GVAR(allCreatedLitter); +GVAR(litterObjects) = GVAR(litterObjects) - [objNull]; -GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; - -// If no more litter remain, exit the loop -if (GVAR(allCreatedLitter) isEqualTo []) exitWith { - GVAR(litterPFHRunning) = false; +// Exit the loop if no litter objects left +if (GVAR(litterObjects) isEqualTo []) exitWith { + GVAR(litterCleanup) = false; }; -// Schedule the loop to be executed again 30 sec later -[FUNC(litterCleanupLoop), [], 30] call CBA_fnc_waitAndExecute; +// Schedule cleanup loop to executed again +[FUNC(litterCleanupLoop), [], LITTER_CLEANUP_CHECK_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/medical_treatment/functions/fnc_litterCreate.sqf b/addons/medical_treatment/functions/fnc_litterCreate.sqf deleted file mode 100644 index 1f48a56a8b8..00000000000 --- a/addons/medical_treatment/functions/fnc_litterCreate.sqf +++ /dev/null @@ -1,98 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Spawns litter for the treatment action on the ground around the target - * - * Arguments: - * 0: The Caller - * 1: The target - * 2: The treatment Selection Name - * 3: The treatment classname - * 4: ? - * 5: Users of Items - * 6: Blood Loss on selection (previously called _previousDamage) - * - * Return Value: - * None - * - * Public: No - */ - -#define MIN_ENTRIES_LITTER_CONFIG 3 - -params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_bloodLossOnSelection"]; -TRACE_6("params",_caller,_target,_selectionName,_className,_usersOfItems,_bloodLossOnSelection); - -// Ensures comptibilty with other possible medical treatment configs -private _previousDamage = _bloodLossOnSelection; - -// Exit if litter is disabled by setting -if !(EGVAR(medical,allowLitterCreation)) exitWith {}; - -// Don't create litter if medic or patient are inside a vehicle -if (vehicle _caller != _caller || {vehicle _target != _target}) exitWith {}; - -private _config = configFile >> QGVAR(Actions) >> _className; -if !(isClass _config) exitWith {TRACE_1("No action config",_className);}; - -if !(isArray (_config >> "litter")) exitWith {TRACE_1("No litter config",_className);}; -private _litter = getArray (_config >> "litter"); - -private _createLitter = { - params ["_unit", "_litterClass"]; - - private _position = getPosASL _unit; - - // @TODO: handle carriers over water - // For now, don't spawn litter if we are over water to avoid floating litter - if (surfaceIsWater _position) exitWith {false}; - - _position = _position vectorAdd [ - random 2 - 1, - random 2 - 1, - 0 - ]; - - private _direction = random 360; - - // Create the litter, and timeout the event based on the cleanup delay - // The cleanup delay for events in MP is handled by the server side - TRACE_3("Creating Litter on server",_litterClass,_position,_direction); - [QGVAR(createLitterServer), [_litterClass, _position, _direction]] call CBA_fnc_serverEvent; - - true -}; - -{ - if (count _x < MIN_ENTRIES_LITTER_CONFIG) then { - WARNING_1("Wrong litter array: %1",_x); - } else { - _x params [ - ["_selection", "", [""]], - ["_litterCondition", "", [""]], - ["_litterOptions", [], [[]]] - ]; - - if (toLower _selection in [toLower _selectionName, "all"]) then { - if (_litterCondition isEqualTo "") then { - _litterCondition = {true}; - } else { - _litterCondition = compile _litterCondition; - }; - - // existing configs seem to use carried over magic variables. we pass them as arguments (_this) anyway - if !([_caller, _target, _selectionName, _className, _usersOfItems, _bloodLossOnSelection] call _litterCondition) exitWith {}; - - // Loop through through the litter options and place the litter - { - if (_x isEqualType "") then { - [_target, _x] call _createLitter; - }; - - if (_x isEqualType [] && {count _x > 0}) then { - [_target, selectRandom _x] call _createLitter; - }; - } foreach _litterOptions; - }; - }; -} foreach _litter; diff --git a/addons/medical_treatment/functions/fnc_litterHandleCreate.sqf b/addons/medical_treatment/functions/fnc_litterHandleCreate.sqf deleted file mode 100644 index 10cbc1f5808..00000000000 --- a/addons/medical_treatment/functions/fnc_litterHandleCreate.sqf +++ /dev/null @@ -1,68 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * handle Litter Create - * - * Arguments: - * 0: Litter Class - * 1: Position - * 2: Unit - * - * Return Value: - * None - * - * Example: - * ["litter", [2, 5, 6], bob] call ace_medical_treatment_fnc_handleCreateLitter - * - * Public: No - */ - -params ["_litterClass", "_position", "_direction"]; -TRACE_3("params",_litterClass,_position,_direction); - -//IGNORE_PRIVATE_WARNING ["_values"]; - -if (isNil QGVAR(allCreatedLitter)) then { - GVAR(allCreatedLitter) = []; - GVAR(litterPFHRunning) = false; -}; - -private _model = getText (configFile >> "CfgVehicles" >> _litterClass >> "model"); -if (_model == "") exitWith {TRACE_2("no model",_litterClass,_model)}; - -// createSimpleObject expects a path without the leading slash -if (_model select [0,1] == "\") then { - _model = _model select [1]; -}; - -private _litterObject = createSimpleObject [_model, [0,0,0]]; -TRACE_2("created",_litterClass,_litterObject); - -_litterObject setDir _direction; -_litterObject setPosASL _position; - -// Move the litter next frame to get rid of HORRIBLE spacing, fixes #1112 -[{ - params ["_object", "_position"]; - - _object setPosASL _position; -}, [_litterObject, _position]] call CBA_fnc_execNextFrame; - -private _maxLitterCount = getArray (configFile >> "ACE_Settings" >> QEGVAR(medical,litterSimulationDetail) >> "_values") select EGVAR(medical,litterSimulationDetail); - -if (count GVAR(allCreatedLitter) > _maxLitterCount) then { - // gank the first litter object, and spawn ours. - private _oldLitter = GVAR(allCreatedLitter) deleteAt 0; - - { - deleteVehicle _x; - } forEach (_oldLitter select 1); -}; - -GVAR(allCreatedLitter) pushBack [CBA_missionTime, [_litterObject]]; - -if (!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { - // Start the litter cleanup loop - GVAR(litterPFHRunning) = true; - call FUNC(litterCleanupLoop); -}; diff --git a/addons/medical_treatment/functions/fnc_loadUnit.sqf b/addons/medical_treatment/functions/fnc_loadUnit.sqf new file mode 100644 index 00000000000..8c65fd88cef --- /dev/null +++ b/addons/medical_treatment/functions/fnc_loadUnit.sqf @@ -0,0 +1,40 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Loads an unconscious or dead patient in the given or nearest vehicle. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Vehicle (default: objNull) + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_loadUnit + * + * Public: No + */ + +params ["_medic", "_patient", ["_vehicle", objNull]]; + +if (_patient call EFUNC(common,isAwake)) exitWith { + [[LSTRING(CanNotLoad), _patient call EFUNC(common,getName)]] call EFUNC(common,displayTextStructured); +}; + +if (_patient call EFUNC(medical_status,isBeingCarried)) then { + [_medic, _patient] call EFUNC(dragging,dropObject_carry); +}; + +if (_patient call EFUNC(medical_status,isBeingDragged)) then { + [_medic, _patient] call EFUNC(dragging,dropObject); +}; + +private _vehicle = [_medic, _patient, _vehicle] call EFUNC(common,loadPerson); + +if (!isNull _vehicle) then { + private _patientName = [_patient, false, true] call EFUNC(common,getName); + private _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + [[LSTRING(LoadedInto), _patientName, _vehicleName], 3] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/medical_treatment/functions/fnc_medication.sqf b/addons/medical_treatment/functions/fnc_medication.sqf new file mode 100644 index 00000000000..32124c23a4e --- /dev/null +++ b/addons/medical_treatment/functions/fnc_medication.sqf @@ -0,0 +1,28 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Administers medication to the patient on the given body bodypart. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment + * 4: Item User (not used) + * 5: Used Item + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "RightArm", "Morphine", objNull, "ACE_morphine"] call ace_medical_treatment_fnc_medication + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart", "_classname", "", "_usedItem"]; + +[_patient, _usedItem] call FUNC(addToTriageCard); +[_patient, "activity", LSTRING(Activity_usedItem), [[_medic, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call FUNC(addToLog); + +[QGVAR(medicationLocal), [_patient, _bodyPart, _classname]] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf new file mode 100644 index 00000000000..30b64860e69 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -0,0 +1,78 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Local callback for administering medication to a patient. + * + * Arguments: + * 0: Patient + * 1: Body Part + * 2: Treatment + * + * Return Value: + * None + * + * Example: + * [player, "RightArm", "Morphine"] call ace_medical_treatment_fnc_medicationLocal + * + * Public: No + */ + +// todo: move this macro to script_macros_medical.hpp? +#define MORPHINE_PAIN_SUPPRESSION 0.6 + +params ["_patient", "_bodyPart", "_classname"]; +TRACE_3("medicationLocal",_patient,_bodyPart,_classname); + +// Medication has no effects on dead units +if (!alive _patient) exitWith {}; + +// Exit with basic medication handling if advanced medication not enabled +if (!GVAR(advancedMedication)) exitWith { + switch (_classname) do { + case "Morphine": { + private _painSuppress = GET_PAIN_SUPPRESS(_patient); + _patient setVariable [VAR_PAIN_SUPP, (_painSuppress + MORPHINE_PAIN_SUPPRESSION) min 1, true]; + }; + case "Epinephrine": { + [QEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent; + }; + }; +}; +TRACE_1("Running treatmentMedicationLocal with Advanced configuration for", _target); + + +// Handle tourniquet on body part blocking blood flow at injection site +private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; + +if (HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex)) exitWith { + TRACE_1("unit has tourniquets blocking blood flow on injection site",_tourniquets); + private _occludedMedications = _patient getVariable [QEGVAR(medical,occludedMedications), []]; + _occludedMedications pushBack [_partIndex, _classname]; + _patient setVariable [QEGVAR(medical,occludedMedications), _occludedMedications, true]; +}; + +// Get adjustment attributes for used medication +private _defaultConfig = configFile >> QUOTE(ADDON) >> "Medication"; +private _medicationConfig = _defaultConfig >> _classname; + +private _painReduce = GET_NUMBER(_medicationConfig >> "painReduce",getNumber (_defaultConfig >> "painReduce")); +private _timeInSystem = GET_NUMBER(_medicationConfig >> "timeInSystem",getNumber (_defaultConfig >> "timeInSystem")); +private _timeTillMaxEffect = GET_NUMBER(_medicationConfig >> "timeTillMaxEffect",getNumber (_defaultConfig >> "timeTillMaxEffect")); +private _maxDose = GET_NUMBER(_medicationConfig >> "maxDose",getNumber (_defaultConfig >> "maxDose")); +private _viscosityChange = GET_NUMBER(_medicationConfig >> "viscosityChange",getNumber (_defaultConfig >> "viscosityChange")); +private _hrIncreaseLow = GET_ARRAY(_medicationConfig >> "hrIncreaseLow",getArray (_defaultConfig >> "hrIncreaseLow")); +private _hrIncreaseNormal = GET_ARRAY(_medicationConfig >> "hrIncreaseNormal",getArray (_defaultConfig >> "hrIncreaseNormal")); +private _hrIncreaseHigh = GET_ARRAY(_medicationConfig >> "hrIncreaseHigh",getArray (_defaultConfig >> "hrIncreaseHigh")); +private _incompatibleMedication = GET_ARRAY(_medicationConfig >> "incompatibleMedication",getArray (_defaultConfig >> "incompatibleMedication")); + +private _heartRate = GET_HEART_RATE(_patient); +private _hrIncrease = [_hrIncreaseLow, _hrIncreaseNormal, _hrIncreaseHigh] select (floor ((0 max _heartRate min 110) / 55)); +_hrIncrease params ["_minIncrease", "_maxIncrease"]; +private _heartRateChange = _minIncrease + random (_maxIncrease - _minIncrease); + +// Adjust the medication effects and add the medication to the list +TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); +[_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange] call EFUNC(medical_status,addMedicationAdjustment); + +// Check for medication compatiblity +[_patient, _className, _maxDose, _incompatibleMedication] call FUNC(onMedicationUsage); diff --git a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf index 6cbcf48f5aa..9784acb1ab4 100644 --- a/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical_treatment/functions/fnc_onMedicationUsage.sqf @@ -18,8 +18,8 @@ * Public: No */ -params ["_target", "_className", "_maxDosage", "_incompatabileMeds"]; -TRACE_4("onMedicationUsage",_target,_className,_maxDosage,_incompatabileMeds); +params ["_target", "_className", "_maxDosage", "_incompatibleMedication"]; +TRACE_4("onMedicationUsage",_target,_className,_maxDosage,_incompatibleMedication); private _fnc_getMedicationCount = { params ["_target", "_medication"]; @@ -51,7 +51,7 @@ if (_currentDose >= floor (_maxDosage + round(random(2))) && {_maxDosage >= 1}) if (_inSystem> _xLimit) then { _overdosedMedications pushBackUnique _xMed; }; -} forEach _incompatabileMeds; +} forEach _incompatibleMedication; if !(_overdosedMedications isEqualTo []) then { private _medicationConfig = (configFile >> "ace_medical_treatment" >> "Medication"); diff --git a/addons/medical_treatment/functions/fnc_placeInBodyBag.sqf b/addons/medical_treatment/functions/fnc_placeInBodyBag.sqf new file mode 100644 index 00000000000..02feb520253 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_placeInBodyBag.sqf @@ -0,0 +1,48 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Places a dead body inside a body bag. + * + * Arguments: + * 0: Medic (not used) + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, cursorObject] call ace_medical_treatment_fnc_placeInBodyBag + * + * Public: No + */ + +params ["", "_patient"]; +TRACE_1("placeInBodyBag",_patient); + +if (!local _patient) exitWith { + TRACE_1("Calling where local",local _patient); + [QGVAR(placeInBodyBag), [nil, _patient], _patient] call CBA_fnc_targetEvent; +}; + +if (alive _patient) then { + TRACE_1("Manually killing with setDead",_patient); + [_patient, "buried_alive"] call EFUNC(medical_status,setDead); +}; + +private _position = (getPosASL _patient) vectorAdd [0, 0, 0.2]; + +private _headPos = _patient modelToWorldVisual (_patient selectionPosition "head"); +private _spinePos = _patient modelToWorldVisual (_patient selectionPosition "Spine3"); +private _direction = (_headPos vectorFromTo _spinePos) call CBA_fnc_vectDir; + +// Move the body away so it won't collide with the body bag object +// This setPosASL seems to need to be called where the unit is local +_patient setPosASL [-5000, -5000, 0]; + +// Create the body bag object, set its position to prevent it from flipping +private _bodyBag = createVehicle ["ACE_bodyBagObject", [0, 0, 0], [], 0, "NONE"]; +_bodyBag setPosASL _position; +_bodyBag setDir _direction; + +// Server will handle hiding and deleting the body +["ace_placedInBodyBag", [_patient, _bodyBag]] call CBA_fnc_globalEvent; diff --git a/addons/medical_treatment/functions/fnc_removeBody.sqf b/addons/medical_treatment/functions/fnc_removeBody.sqf new file mode 100644 index 00000000000..e86d374e8e3 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_removeBody.sqf @@ -0,0 +1,35 @@ +#include "script_component.hpp" +/* + * Author: PabstMirror + * Removes a body. Ideally it is deleted the next frame. + * However, player bodies cannot be deleted until they respawn, so it is hidden and deleted later. + * + * Arguments: + * 0: Body + * + * Return Value: + * None + * + * Example: + * [cursorObject] call ace_medical_treatment_fnc_removeBody + * + * Public: No + */ + +params ["_body"]; +TRACE_2("removeBody",_body,isPlayer _body); + +// Hide the body globally +[QEGVAR(common,hideObjectGlobal), [_body, true]] call CBA_fnc_serverEvent; + +// Add body to array of those waiting for deletion +if (isNil QGVAR(bodiesToDelete)) then { + GVAR(bodiesToDelete) = []; +}; + +GVAR(bodiesToDelete) pushBack _body; + +// Start up the body cleanup loop to delete bodies once they are free +if (count GVAR(bodiesToDelete) == 1) then { + [] call FUNC(bodyCleanupLoop); +}; diff --git a/addons/medical_treatment/functions/fnc_serverRemoveBody.sqf b/addons/medical_treatment/functions/fnc_serverRemoveBody.sqf deleted file mode 100644 index aa29cbc982a..00000000000 --- a/addons/medical_treatment/functions/fnc_serverRemoveBody.sqf +++ /dev/null @@ -1,33 +0,0 @@ -#include "script_component.hpp" -/* - * Author: PabstMirror - * Removes corpse. Idealy it is just deleted the next frame, - * but player bodies cannot be deleted until they respawn, so it is hidden and deleted later. - * - * Arguments: - * 0: Mr Body - * - * Return Value: - * None - * - * Example: - * [cursorTarget] call ace_medical_treatment_fnc_serverRemoveBody - * - * Public: No - */ - -params ["_target"]; -TRACE_2("",_target,isPlayer _target); - -// Hide the body globaly -[QEGVAR(common,hideObjectGlobal), [_target, true]] call CBA_fnc_serverEvent; - -if (isNil QGVAR(bodiesToDelete)) then {GVAR(bodiesToDelete) = [];}; -GVAR(bodiesToDelete) pushBack _target; - -// Start up a loop to wait for bodies to be free to delete -if ((count GVAR(bodiesToDelete)) == 1) then { - [] call FUNC(bodyCleanupLoop); -}; - -nil diff --git a/addons/medical_treatment/functions/fnc_splint.sqf b/addons/medical_treatment/functions/fnc_splint.sqf index 4ced63109c8..f7883da86a0 100644 --- a/addons/medical_treatment/functions/fnc_splint.sqf +++ b/addons/medical_treatment/functions/fnc_splint.sqf @@ -1,12 +1,12 @@ #include "script_component.hpp" /* * Author: PabstMirror - * Apply a splint to the patient + * Applies a splint to the patient on the given body part. * * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part + * 0: Medic + * 1: Patient + * 2: Body Part * * Return Value: * Nothing @@ -17,9 +17,7 @@ * Public: No */ -params ["_caller", "_target", "_bodyPart"]; -TRACE_3("splint",_caller,_target,_bodyPart); +params ["_medic", "_patient", "_bodyPart"]; +TRACE_3("splint",_medic,_patient,_bodyPart); -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; - -[QGVAR(treatmentSplintLocal), [_caller, _target, _partIndex], _target] call CBA_fnc_targetEvent; +[QGVAR(splintLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_splintLocal.sqf b/addons/medical_treatment/functions/fnc_splintLocal.sqf index 1996e8321ae..4ee190b5a44 100644 --- a/addons/medical_treatment/functions/fnc_splintLocal.sqf +++ b/addons/medical_treatment/functions/fnc_splintLocal.sqf @@ -1,31 +1,32 @@ #include "script_component.hpp" /* * Author: PabstMirror - * Apply a splint to the patient + * Local callback for applying a splint to a patient. * * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part index + * 0: Medic + * 1: Patient + * 2: Body Part * * Return Value: * Nothing * * Example: - * [player, cursorObject, 4] call ace_medical_treatment_fnc_splintLocal + * [player, cursorObject, "LeftLeg"] call ace_medical_treatment_fnc_splintLocal * * Public: No */ -params ["_caller", "_target", "_bodyPartNum"]; -TRACE_3("splintLocal",_caller,_target,_bodyPart); +params ["_medic", "_patient", "_bodyPart"]; +TRACE_3("splintLocal",_medic,_patient,_bodyPart); -// Place a tourniquet on the bodypart -private _fractures = _target getVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0]]; -_fractures set [_bodyPartNum, -1]; -_target setVariable [QEGVAR(medical,fractures), _fractures, true]; +private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; + +private _fractures = GET_FRACTURES(_patient); +_fractures set [_partIndex, -1]; +_patient setVariable [VAR_FRACTURES, _fractures, true]; // Check if we fixed limping from this treatment -[_target] call EFUNC(medical_engine,updateDamageEffects); +[_patient] call EFUNC(medical_engine,updateDamageEffects); -// toDo: AddToLog: +// todo: add logging diff --git a/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf b/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf new file mode 100644 index 00000000000..565df32e547 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_surgicalKitProgress.sqf @@ -0,0 +1,49 @@ +#include "script_component.hpp" +/* + * Author: BaerMitUmlaut + * Handles the surgical kit treatment by periodically closing bandaged wounds. + * + * Arguments: + * 0: Arguments + * 0: Medic (not used) + * 1: Patient + * 1: Elapsed Time + * 2: Total Time + * + * Return Value: + * Continue Treatment + * + * Example: + * [[objNull, player], 5, 10] call ace_medical_treatment_fnc_surgicalKitProgress + * + * Public: No + */ + +params ["_args", "_elapsedTime", "_totalTime"]; +_args params ["", "_patient"]; + +private _bandagedWounds = _patient getVariable [QEGVAR(medical,bandagedWounds), []]; +private _stitchedWounds = _patient getVariable [QEGVAR(medical,stitchedWounds), []]; + +// Stop treatment if there are no wounds that can be stitched remaining +if (_bandagedWounds isEqualTo []) exitWith { false }; + +// Check if enough time has elapsed to stitch another wound +if (_totalTime - _elapsedTime <= (count _bandagedWounds - 1) * 5) then { + private _treatedWound = _bandagedWounds deleteAt 0; + _stitchedWounds pushBack _treatedWound; + _patient setVariable [QEGVAR(medical,bandagedWounds), _bandagedWounds, true]; + _patient setVariable [QEGVAR(medical,stitchedWounds), _stitchedWounds, true]; + TRACE_3("stitched",_treatedWound,count _bandagedWounds,count _stitchedWounds); + + // Check if we fixed limping from this treatment + if ((EGVAR(medical,limping) == 2) && {_patient getVariable [QEGVAR(medical,isLimping), false]}) then { + _treatedWound params ["", "_partN"]; + if (_partN > 3) then { // only for LEG wounds + TRACE_3("updating damage effects",_patient,_partN,local _patient); + [QEGVAR(medical_engine,updateDamageEffects), [_patient], _patient] call CBA_fnc_patientEvent; + }; + }; +}; + +true diff --git a/addons/medical_treatment/functions/fnc_tourniquet.sqf b/addons/medical_treatment/functions/fnc_tourniquet.sqf new file mode 100644 index 00000000000..cd1a4c82679 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_tourniquet.sqf @@ -0,0 +1,33 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Applies a tourniquet to the patient on the given body part. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment (not used) + * 4: Item User (not used) + * 5: Used Item + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftLeg", "", objNull, "ACE_tourniquet"] call ace_medical_treatment_fnc_tourniquet + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart", "", "", "_usedItem"]; + +// Exit if there is a tourniquet already applied to body part +if ([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo)) exitWith { + ["There is already a tourniquet on this body part!", 1.5] call EFUNC(common,displayTextStructured); // todo: localize +}; + +[_patient, _usedItem] call FUNC(addToTraigeCard); +[_patient, "activity", LSTRING(Activity_appliedTourniquet), [[_medic, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); + +[QGVAR(tourniquetLocal), [_patient, _bodyPart], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf new file mode 100644 index 00000000000..4bc803a8a83 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_tourniquetLocal.sqf @@ -0,0 +1,28 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Local callback for applying a tourniquet to a patient. + * + * Arguments: + * 0: Patient + * 1: Body Part + * + * Return Value: + * None + * + * Example: + * [player, "LeftLeg"] call ace_medical_treatment_fnc_tourniquetLocal + * + * Public: No + */ + +params ["_patient", "_bodyPart"]; +TRACE_2("tourniquetLocal",_patient,_bodyPart); + +private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; + +private _tourniquets = GET_TOURNIQUETS(_patient); +_tourniquets set [_partIndex, CBA_missionTime]; +_patient setVariable [VAR_TOURNIQUET, _tourniquets, true]; + +[_patient] call EFUNC(medical_status,updateWoundBloodLoss); diff --git a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf new file mode 100644 index 00000000000..50f4c084c04 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf @@ -0,0 +1,59 @@ +#include "script_component.hpp" +/* + * Author: Glowbal, mharis001 + * Removes the tourniquet from the patient on the given body part. + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftLeg"] call ace_medical_treatment_fnc_tourniquetRemove + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; +TRACE_3("tourniquetRemove",_medic,_patient,_bodyPart); + +// Remove tourniquet from body part, exit if no tourniquet applied +private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; +private _tourniquets = GET_TOURNIQUETS(_patient); + +if (_tourniquets select _partIndex == 0) exitWith { + [LSTRING(noTourniquetOnBodyPart), 1.5] call EFUNC(common,displayTextStructured); +}; + +_tourniquets set [_partIndex, 0]; +_patient setVariable [VAR_TOURNIQUET, _tourniquets, true]; + +[_patient] call EFUNC(medical_status,updateWoundBloodLoss); + +// Add tourniquet item to medic's inventory +// todo: should there be a setting to select who receives the removed tourniquet? +[_medic, "ACE_tourniquet", true] call EFUNC(common,addToInventory); + +// Handle occluded medications that were blocked due to tourniquet +private _occludedMedications = _patient getVariable [QEGVAR(medical,occludedMedications), []]; +private _arrayModified = false; + +{ + _x params ["_bodyPartN", "_medication"]; + + if (_partIndex == _bodyPartN) then { + TRACE_1("delayed medication call after tourniquet removeal",_x); + [QGVAR(medicationLocal), [_patient, _bodyPart, _medication], _patient] call CBA_fnc_targetEvent; + _occludedMedications set [_forEachIndex, []]; + _arrayModified = true; + }; + +} forEach _occludedMedications; + +if (_arrayModified) then { + _occludedMedications = _occludedMedications - [[]]; + _patient setVariable [QEGVAR(medical,occludedMedications), _occludedMedications, true]; +}; diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index b76e6799eef..e75c0ba6ddf 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -1,199 +1,146 @@ #include "script_component.hpp" /* - * Author: Glowbal, KoffeinFlummi - * Starts the treatment process + * Author: Glowbal, KoffeinFlummi, mharis001 + * Starts the treatment process. * * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment * * Return Value: - * Succesful treatment started + * Treatment Started + * + * Example: + * [player, cursorObject, "Head", "BasicBandage"] call ace_medical_treatment_fnc_treatment * * Public: No */ -params ["_caller", "_target", "_bodyPart", "_className"]; +params ["_medic", "_patient", "_bodyPart", "_classname"]; -// if the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine +// Delay by a frame if cursor menu is open to prevent progress bar failing if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened), false]) exitWith { - [DFUNC(treatment), _this] call CBA_fnc_execNextFrame; + [FUNC(treatment), _this] call CBA_fnc_execNextFrame; }; -if !([_caller, _target, _bodyPart, _className] call FUNC(canTreat)) exitWith {false}; - -private _config = configFile >> QGVAR(Actions) >> _className; -private _isSelf = _caller isEqualTo _target; +if !(_this call FUNC(canTreat)) exitWith {false}; -// handle items -private _items = getArray (_config >> "items"); +private _config = configFile >> QGVAR(actions) >> _classname; -private _consumeItems = 0; +// Get treatment time from config, exit if treatment time is zero +private _treatmentTime = if (isText (_config >> "treatmentTime")) then { + GET_FUNCTION(_treatmentTime,_config >> "treatmentTime"); -if (isNumber (_config >> "itemConsumed")) then { - _consumeItems = getNumber (_config >> "itemConsumed"); -} else { - if (isText (_config >> "itemConsumed")) then { - _consumeItems = missionNamespace getVariable [getText (_config >> "itemConsumed"), 0]; + if (_treatmentTime isEqualType {}) then { + _treatmentTime = call _treatmentTime; }; -}; - -private _usersOfItems = []; -if (_consumeItems > 0) then { - _usersOfItems = ([_caller, _target, _items] call FUNC(useItems)) select 1; + _treatmentTime +} else { + getNumber (_config >> "treatmentTime"); }; -// parse the config for the progress callback -private _callbackProgress = getText (_config >> "callbackProgress"); +if (_treatmentTime == 0) exitWith {false}; -if (_callbackProgress isEqualTo "") then { - _callbackProgress = "true"; -}; - -if (isNil _callbackProgress) then { - _callbackProgress = compile _callbackProgress; +// Consume one of the treatment items if needed +// Store item user so that used item can be returned on failure +private _userAndItem = if (GET_NUMBER_ENTRY(_config >> "consumeItem") == 1) then { + [_medic, _patient, getArray (_config >> "items")] call FUNC(useItem); } else { - _callbackProgress = missionNamespace getVariable _callbackProgress; + [objNull, ""]; // Treatment does not require items to be consumed }; -// play animation -private _callerAnim = if (_isSelf) then { - getText (_config >> ["animationCallerSelf", "animationCallerSelfProne"] select (stance _caller == "PRONE")); +_userAndItem params ["_itemUser", "_usedItem"]; + +// Get treatment animation for the medic +private _medicAnim = if (_medic isEqualTo _patient) then { + getText (_config >> ["animationMedicSelf", "animationMedicSelfProne"] select (stance _medic == "PRONE")); } else { - getText (_config >> ["animationCaller", "animationCallerProne"] select (stance _caller == "PRONE")); + getText (_config >> ["animationMedic", "animationMedicProne"] select (stance _medic == "PRONE")); }; -_caller setVariable [QGVAR(selectedWeaponOnTreatment), weaponState _caller]; +_medic setVariable [QGVAR(selectedWeaponOnTreatment), weaponState _medic]; -private _wpn = ["non", "rfl", "lnr", "pst"] param [["", primaryWeapon _caller, secondaryWeapon _caller, handgunWeapon _caller] find currentWeapon _caller, "non"]; +// Adjust animation based on the current weapon of the medic +private _wpn = ["non", "rfl", "lnr", "pst"] param [["", primaryWeapon _medic, secondaryWeapon _medic, handgunWeapon _medic] find currentWeapon _medic, "non"]; +_medicAnim = [_medicAnim, "[wpn]", _wpn] call CBA_fnc_replace; -_callerAnim = [_callerAnim, "[wpn]", _wpn] call CBA_fnc_replace; - -// this one is missing -if (_callerAnim == "AinvPknlMstpSlayWlnrDnon_medic") then { - _callerAnim = "AinvPknlMstpSlayWlnrDnon_medicOther"; +// This animation is missing, use alternative +if (_medicAnim == "AinvPknlMstpSlayWlnrDnon_medic") then { + _medicAnim = "AinvPknlMstpSlayWlnrDnon_medicOther"; }; -private _animDuration = GVAR(animDurations) getVariable _callerAnim; +// Determine the animation length +private _animDuration = GVAR(animDurations) getVariable _medicAnim; -// these animations have transitions that take a bit longer... -if (weaponLowered _caller) then { +// These animations have transitions that take a bit longer... +if (weaponLowered _medic) then { _animDuration = _animDuration + 0.5; - // fix problems with lowered weapon transitions by raising the weapon first - if (currentWeapon _caller != "" && {_callerAnim != ""}) then { - _caller action ["WeaponInHand", _caller]; + // Fix problems with lowered weapon transitions by raising the weapon first + if (currentWeapon _medic != "" && {_medicAnim != ""}) then { + _medic action ["WeaponInHand", _medic]; }; }; -if (binocular _caller != "" && {binocular _caller == currentWeapon _caller}) then { - _animDuration = _animDuration + 1.0; +if (binocular _medic != "" && {binocular _medic == currentWeapon _medic}) then { + _animDuration = _animDuration + 1; }; -if (vehicle _caller == _caller && {_callerAnim != ""}) then { +// Play treatment animation for medic and determine the ending animation +if (vehicle _medic == _medic && {_medicAnim != ""}) then { private _endInAnim = "AmovP[pos]MstpS[stn]W[wpn]Dnon"; - private _pos = ["knl", "pne"] select (stance _caller == "PRONE"); + private _pos = ["knl", "pne"] select (stance _medic == "PRONE"); private _stn = "non"; if (_wpn != "non") then { - _stn = ["ras", "low"] select (weaponLowered _caller); + _stn = ["ras", "low"] select (weaponLowered _medic); }; _endInAnim = [_endInAnim, "[pos]", _pos] call CBA_fnc_replace; _endInAnim = [_endInAnim, "[stn]", _stn] call CBA_fnc_replace; _endInAnim = [_endInAnim, "[wpn]", _wpn] call CBA_fnc_replace; - TRACE_1("",_endInAnim); - [_caller, _callerAnim] call EFUNC(common,doAnimation); - [_caller, _endInAnim] call EFUNC(common,doAnimation); - _caller setVariable [QGVAR(endInAnim), _endInAnim]; -}; + [_medic, _medicAnim] call EFUNC(common,doAnimation); + [_medic, _endInAnim] call EFUNC(common,doAnimation); + _medic setVariable [QGVAR(endInAnim), _endInAnim]; -// get treatment time from config - also supports variables and code expressions -private _treatmentTime = 0; + // Speed up animation based on treatment time (but cap max to prevent odd animiations/cam shake) + private _animRatio = (_animDuration / _treatmentTime) min 3; + TRACE_3("setAnimSpeedCoef",_animRatio,_animDuration,_treatmentTime); + [QEGVAR(common,setAnimSpeedCoef), [_medic, _animRatio]] call CBA_fnc_globalEvent; -if (isNumber (_config >> "treatmentTime")) then { - _treatmentTime = getNumber (_config >> "treatmentTime"); -} else { - if (isText (_config >> "treatmentTime")) then { - _treatmentTime = getText (_config >> "treatmentTime"); - - if (isNil _treatmentTime) then { - _treatmentTime = compile _treatmentTime; - } else { - _treatmentTime = missionNamespace getVariable _treatmentTime; - }; - - if !(_treatmentTime isEqualType 0) then { - _treatmentTime = call _treatmentTime; - }; + if (!isNil QEGVAR(advanced_fatigue,setAnimExclusions)) then { + EGVAR(advanced_fatigue,setAnimExclusions) pushBack QUOTE(ADDON); }; }; -TRACE_1("",_treatmentTime); -if (_treatmentTime == 0) exitWith { false }; - -// speed up animation depending on treatment time -if (!isNil "_animDuration") then { - [QEGVAR(common,setAnimSpeedCoef), [_caller, _animDuration / _treatmentTime]] call CBA_fnc_globalEvent; - TRACE_2("",_animDuration,_treatmentTime); -}; - -// play sound +// Play a random treatment sound globally if defined if (isArray (_config >> "sounds")) then { - selectRandom getArray (_config >> "sounds") params ["_file", ["_volume", 1], ["_pitch", 1], ["_distance", 0]]; - TRACE_4("playSound3D",_file,_volume,_pitch,_distance); - playSound3D [ - _file, - objNull, - false, - getPosASL _caller, - _volume, - _pitch, - _distance - ]; + selectRandom getArray (_config >> "sounds") params ["_file", ["_volume", 1], ["_pitch", 1], ["_distance", 10]]; + playSound3D [_file, objNull, false, getPosASL _medic, _volume, _pitch, _distance]; }; -private _startCallback = getText (_config >> "callbackStart"); -if (isNil _startCallback) then { - _startCallback = compile _startCallback; -} else { - _startCallback = missionNamespace getVariable _startCallback; -}; +GET_FUNCTION(_callbackStart,_config >> "callbackStart"); +GET_FUNCTION(_callbackProgress,_config >> "callbackProgress"); -if !(_startCallback isEqualType {}) then { - _startCallback = {TRACE_1("startCallback was NOT code",_startCallback)}; +if (_callbackProgress isEqualTo {}) then { + _callbackProgress = {true}; }; -[_caller, _target, _bodyPart, _className, _items, _usersOfItems] call _startCallback; +[_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem] call _callbackStart; -// start treatment [ _treatmentTime, - [_caller, _target, _bodyPart, _className, _items, _usersOfItems], - DFUNC(treatment_success), - DFUNC(treatment_failure), + [_medic, _patient, _bodyPart, _classname, _itemUser, _usedItem], + FUNC(treatmentSuccess), + FUNC(treatmentFailure), getText (_config >> "displayNameProgress"), _callbackProgress, - ["isnotinside"] + ["isNotInside"] ] call EFUNC(common,progressBar); -// display icon -private _iconDisplayed = getText (_config >> "actionIconPath"); - -if (_iconDisplayed != "") then { - [QGVAR(treatmentActionIcon), true, _iconDisplayed, [1,1,1,1], getNumber (_config >> "actionIconDisplayTime")] call EFUNC(common,displayIcon); -}; - -// handle display of text/hints -private _displayText = getText (_config >> ["displayTextOther", "displayTextSelf"] select _isSelf); - -if (_displayText != "") then { - [QEGVAR(common,displayTextStructured), [[_displayText, _caller call EFUNC(common,getName), _target call EFUNC(common,getName)], 1.5, _caller], _caller] call CBA_fnc_targetEvent; -}; - true diff --git a/addons/medical_treatment/functions/fnc_treatmentBandage.sqf b/addons/medical_treatment/functions/fnc_treatmentBandage.sqf deleted file mode 100644 index bb4ac5ed9b9..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentBandage.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Bandage treatment callback - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * 4: Item - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart", "_className", "_items"]; - -[_target, "activity", ELSTRING(medical_treatment,Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", ELSTRING(medical_treatment,Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message - -[QGVAR(treatmentBandageLocal), [_target, _className, _bodyPart], _target] call CBA_fnc_targetEvent; - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR.sqf deleted file mode 100644 index 69adc04bc6d..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentCPR.sqf +++ /dev/null @@ -1,30 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Callback for the CPR treatment action on success. - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_caller", "_target", "_selectionName", "_className", "_items"]; - -_target setVariable [VAR_HEART_RATE, 0, true]; -_target setVariable [QGVAR(receiveCPR), false, true]; // CPR finished -[_target] call FUNC(calculateBlood); - -if (alive _target && {IN_CRDC_ARRST(_target)}) then { - [_target, "activity_view", ELSTRING(medical_treatment,Activity_cpr), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); - - [QGVAR(treatmentCPRLocal), [_caller, _target], _target] call CBA_fnc_targetEvent; -}; - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentCPRLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentCPRLocal.sqf deleted file mode 100644 index 58d882d9271..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentCPRLocal.sqf +++ /dev/null @@ -1,25 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * local Callback for the CPR treatment action on success. - * - * Arguments: - * 0: The medic - * 1: The patient - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_caller", "_target"]; - -if ((random 1) >= 0.6) then { - [QEGVAR(medical,CPRSucceeded), _target] call CBA_fnc_localEvent; -}; - -[_target, "activity", ELSTRING(medical_treatment,Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", ELSTRING(medical_treatment,Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR_failure.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR_failure.sqf deleted file mode 100644 index a09dfccba47..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentCPR_failure.sqf +++ /dev/null @@ -1,22 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Zakant - * Handles the failure of the CPR treatment. - * - * Arguments: - * 0: The medic - * 1: The patient - * - * Return Value: - * None - * - * Public: No - */ - -params ["_caller", "_target"]; - -if (!(_target call EFUNC(common,isAwake)) || {IN_CRDC_ARRST(_target)}) then { - _target setVariable [VAR_HEART_RATE, 0, true]; -}; -_target setVariable [QGVAR(receiveCPR), false, true]; -[_target] call FUNC(calculateBlood); diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf deleted file mode 100644 index f03f9708fda..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentCPR_progress.sqf +++ /dev/null @@ -1,28 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Zakant - * Handles the progress of the CPR treatment. - * - * Arguments: - * 0: Arguments - * 0: Caller - * 1: Target - * 1: Elapsed Time - * 2: Total Time - * - * Return Value: - * May Treatment continue - * - * Public: No - */ - -params ["_args", "_elapsedTime", "_totalTime"]; -_args params ["_caller", "_target"]; - -// If the patient awakes by mysterious force, no cpr is needed! -if (_target call EFUNC(common,isAwake)) exitWith {false}; -if !IN_CRDC_ARRST(_target) exitWith {false}; - -[_target] call FUNC(calculateBlood); // Calculate blood volume. If their is no pulse, nothing happens! - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentCPR_start.sqf b/addons/medical_treatment/functions/fnc_treatmentCPR_start.sqf deleted file mode 100644 index 642cd722a02..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentCPR_start.sqf +++ /dev/null @@ -1,23 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Zakant - * Handles the start of the CPR treatment. - * - * Arguments: - * 0: The medic - * 1: The patient - * - * Return Value: - * None - * - * Public: No - */ - -params ["_caller", "_target"]; - -_target setVariable [QGVAR(receiveCPR), true, true]; // Target receives CPR -if (EGVAR(medical,CPRcreatesPulse) && {GET_HEART_RATE(_target) == 0}) then { - _target setVariable [VAR_HEART_RATE, round (30 + random [-5, 0, 5]) , true]; // And we have a (random) pulse -}; - -_target setVariable [QEGVAR(medical,lastTimeUpdated), CBA_missionTime, true]; diff --git a/addons/medical_treatment/functions/fnc_treatmentFailure.sqf b/addons/medical_treatment/functions/fnc_treatmentFailure.sqf new file mode 100644 index 00000000000..f59331fc770 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_treatmentFailure.sqf @@ -0,0 +1,50 @@ +#include "script_component.hpp" +/* + * Author: KoffeinFlummi, Glowbal, mharis001 + * Handles treatment process failure. + * + * Arguments: + * 0: Arguments + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment + * 4: Item User + * 5: Used Item + * + * Return Value: + * None + * + * Public: No + */ + +params ["_args"]; +_args params ["_medic", "_patient", "_bodyPart", "_classname", "_itemUser", "_usedItem"]; + +// Return used item to user (if used) +if (!isNull _itemUser) then { + [_itemUser, _usedItem] call EFUNC(common,addToInventory); +}; + +// Switch medic to end animation immediately +private _endInAnim = _medic getVariable QGVAR(endInAnim); + +if (!isNil "_endInAnim") then { + if (animationState _medic != _endInAnim) then { + [_medic, _endInAnim, 2] call EFUNC(common,doAnimation); + }; + + _medic setVariable [QGVAR(endInAnim), nil]; +}; + +// Reset medic animation speed coefficient +[QEGVAR(common,setAnimSpeedCoef), [_medic, 1]] call CBA_fnc_globalEvent; + +if (!isNil QEGVAR(advanced_fatigue,setAnimExclusions)) then { + EGVAR(advanced_fatigue,setAnimExclusions) deleteAt (EGVAR(advanced_fatigue,setAnimExclusions) find QUOTE(ADDON)); +}; + +// Call treatment specific failure callback +GET_FUNCTION(_callbackFailure,configFile >> QGVAR(actions) >> _classname >> "callbackFailure"); + +_args call _callbackFailure; diff --git a/addons/medical_treatment/functions/fnc_treatmentFullHeal.sqf b/addons/medical_treatment/functions/fnc_treatmentFullHeal.sqf deleted file mode 100644 index 8499d4f525e..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentFullHeal.sqf +++ /dev/null @@ -1,26 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Full heal treatment - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * 4: Item - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_caller", "_target"]; - -[QGVAR(treatmentFullHealLocal), [_target], _target] call CBA_fnc_targetEvent; - -[_target, "activity", ELSTRING(medical_treatment,Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", ELSTRING(medical_treatment,Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf deleted file mode 100644 index 705efc716ea..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentFullHealLocal.sqf +++ /dev/null @@ -1,76 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Handles full heal of a patient. - * - * Arguments: - * 0: The patient - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_target"]; - -if (!alive _target) exitWith {}; - -// Treatment conditions would normally limit this to non-unconc units, but treatment event may be called externally (zeus) -if (_target getVariable [QEGVAR(medical,inCardiacArrest), false]) then { - TRACE_1("exiting cardiac arrest",_target); - [QEGVAR(medical,CPRSucceeded), _target] call CBA_fnc_localEvent; -}; -if (_target getVariable ["ACE_isUnconscious",false]) then { - TRACE_1("waking up",_target); // wake up first or unconc variables will be reset - [QEGVAR(medical,WakeUp), _target] call CBA_fnc_localEvent; -}; - - -_target setVariable [VAR_PAIN, 0, true]; -_target setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true]; - -// tourniquets -_target setVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES, true]; -_target setVariable [QGVAR(occludedMedications), nil, true]; - -// wounds and injuries -_target setVariable [QEGVAR(medical,openWounds), [], true]; -_target setVariable [QEGVAR(medical,bandagedWounds), [], true]; -_target setVariable [QEGVAR(medical,stitchedWounds), [], true]; -_target setVariable [QEGVAR(medical,isLimping), false, true]; -_target setVariable [QEGVAR(medical,fractures), [0,0,0,0,0,0], true]; - -// - Update wound bleeding -[_target] call EFUNC(medical_status,updateWoundBloodLoss); - -// vitals -_target setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true]; -_target setVariable [VAR_BLOOD_PRESS, [80, 120], true]; -_target setVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES, true]; - -// IVs -_target setVariable [QEGVAR(medical,ivBags), nil, true]; - -// damage storage -_target setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true]; - -// generic medical admin -_target setVariable [VAR_CRDC_ARRST, false, true]; -_target setVariable [VAR_UNCON, false, true]; -_target setVariable [VAR_HEMORRHAGE, 0, true]; -_target setVariable [VAR_IN_PAIN, false, true]; -_target setVariable [VAR_PAIN_SUPP, 0, true]; - -// medication -_target setVariable [VAR_MEDICATIONS, [], true]; - -// Reset triage card since medication is all reset -_target setVariable [QEGVAR(medical,triageCard), [], true]; - -[_target] call EFUNC(medical_engine,updateDamageEffects); - -// Resetting damage -_target setDamage 0; - -[QEGVAR(medical,FullHeal), _target] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/functions/fnc_treatmentIV.sqf b/addons/medical_treatment/functions/fnc_treatmentIV.sqf deleted file mode 100644 index e6f6be0e16d..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentIV.sqf +++ /dev/null @@ -1,31 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Patient IV Treatment callback - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * 4: Item - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart", "_className", "_items"]; - -if (_items isEqualTo []) exitWith {false}; - -_items params ["_removeItem"]; - -[QGVAR(treatmentIVLocal), [_target, _className, _bodyPart], _target] call CBA_fnc_targetEvent; - -[_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", ELSTRING(medical_treatment,Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", ELSTRING(medical_treatment,Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentIVLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentIVLocal.sqf deleted file mode 100644 index a7c39143138..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentIVLocal.sqf +++ /dev/null @@ -1,48 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * IV Treatment local callback - * - * Arguments: - * 0: The patient - * 1: Treatment class name - * 2: Body part - * - * Return Value: - * None - * - * Public: No - */ - -params ["_target", "_treatmentClassname", "_bodyPart"]; - -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; -if (_partIndex < 0) exitWith { false }; - -private _bloodVolume = GET_BLOOD_VOLUME(_target); - -if (_bloodVolume >= DEFAULT_BLOOD_VOLUME) exitWith {}; - -// Find the proper attributes for the used IV -private _config = configFile >> QUOTE(ADDON) >> "IV"; -private _volumeAdded = getNumber (_config >> "volume"); -private _type = getText (_config >> "type"); - -if (isClass (_config >> _treatmentClassname)) then { - _config = _config >> _treatmentClassname; - - if (isNumber (_config >> "volume")) then { - _volumeAdded = getNumber (_config >> "volume"); - }; - - if (isText (_config >> "type")) then { - _type = getText (_config >> "type"); - }; -} else { - ERROR("IV Treatment Classname not found"); -}; - -private _bloodBags = _target getVariable [QEGVAR(medical,ivBags), []]; -_bloodBags pushBack [_volumeAdded, _type, _partIndex]; - -_target setVariable [QEGVAR(medical,ivBags), _bloodBags, true]; diff --git a/addons/medical_treatment/functions/fnc_treatmentMedication.sqf b/addons/medical_treatment/functions/fnc_treatmentMedication.sqf deleted file mode 100644 index 77fabe5bf85..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentMedication.sqf +++ /dev/null @@ -1,34 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * IV Treatment callback - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * 4: Items Used - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart", "_className", "_items"]; -TRACE_5("params",_caller,_target,_bodyPart,_className,_items); - -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; - -[QGVAR(treatmentMedicationLocal), [_target, _className, _partIndex], _target] call CBA_fnc_targetEvent; - -{ - if (_x != "") then { - [_target, _x] call FUNC(addToTriageCard); - [_target, "activity", ELSTRING(medical_treatment,Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); - [_target, "activity_view", ELSTRING(medical_treatment,Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); - }; -} forEach _items; - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf deleted file mode 100644 index 2732b0f3982..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentMedicationLocal.sqf +++ /dev/null @@ -1,87 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Handles the medication given to a patient. - * - * Arguments: - * 0: The patient - * 1: Treatment class name - * 2: Injection Site Part Number - * - * Return Value: - * Succesful treatment started - * - * Example: - * [player, "Morphine", 2] call ace_medical_treatment_fnc_treatmentMedicationLocal - * - * Public: No - */ -#define MORPHINE_PAIN_SUPPRESSION 0.6 - -params ["_target", "_className", "_partIndex"]; -TRACE_3("treatmentMedicationLocal",_target,_className,_partIndex); - -if (!alive _target) exitWith {false}; - -if (!GVAR(advancedMedication)) exitWith { - TRACE_1("MedicalSettingAdvancedMedication is:", GVAR(advancedMedication)); - if (_className == "Morphine") exitWith { - private _painSupress = GET_PAIN_SUPPRESS(_target); - _target setVariable [VAR_PAIN_SUPP, (_painSupress + MORPHINE_PAIN_SUPPRESSION) min 1, true]; - }; - if (_className == "Epinephrine") exitWith { - [QEGVAR(medical,WakeUp), _target] call CBA_fnc_localEvent; - }; -}; -TRACE_1("Running treatmentMedicationLocal with Advanced configuration for", _target); - -private _tourniquets = GET_TOURNIQUETS(_target); - -if (_tourniquets select _partIndex > 0) exitWith { - TRACE_1("unit has tourniquets blocking blood flow on injection site",_tourniquets); - private _delayedMedications = _target getVariable [QEGVAR(medical,occludedMedications), []]; - - _delayedMedications pushBack _this; - _target setVariable [QEGVAR(medical,occludedMedications), _delayedMedications, true]; - - true -}; - -// Find the proper attributes for the used medication -private _medicationConfig = configFile >> QUOTE(ADDON) >> "Medication"; -private _painReduce = getNumber (_medicationConfig >> "painReduce"); -private _hrIncreaseLow = getArray (_medicationConfig >> "hrIncreaseLow"); -private _hrIncreaseNorm = getArray (_medicationConfig >> "hrIncreaseNormal"); -private _hrIncreaseHigh = getArray (_medicationConfig >> "hrIncreaseHigh"); -private _timeInSystem = getNumber (_medicationConfig >> "timeInSystem"); -private _timeTillMaxEffect = getNumber (_medicationConfig >> "timeTillMaxEffect"); -private _maxDose = getNumber (_medicationConfig >> "maxDose"); -private _viscosityChange = getNumber (_medicationConfig >> "viscosityChange"); -private _inCompatableMedication = []; - -if (isClass (_medicationConfig >> _className)) then { - _medicationConfig = _medicationConfig >> _className; - if (isNumber (_medicationConfig >> "painReduce")) then { _painReduce = getNumber (_medicationConfig >> "painReduce");}; - if (isArray (_medicationConfig >> "hrIncreaseLow")) then { _hrIncreaseLow = getArray (_medicationConfig >> "hrIncreaseLow"); }; - if (isArray (_medicationConfig >> "hrIncreaseNormal")) then { _hrIncreaseNorm = getArray (_medicationConfig >> "hrIncreaseNormal"); }; - if (isArray (_medicationConfig >> "hrIncreaseHigh")) then { _hrIncreaseHigh = getArray (_medicationConfig >> "hrIncreaseHigh"); }; - if (isNumber (_medicationConfig >> "timeInSystem")) then { _timeInSystem = getNumber (_medicationConfig >> "timeInSystem"); }; - if (isNumber (_medicationConfig >> "timeTillMaxEffect")) then { _timeTillMaxEffect = getNumber (_medicationConfig >> "timeTillMaxEffect"); }; - if (isNumber (_medicationConfig >> "maxDose")) then { _maxDose = getNumber (_medicationConfig >> "maxDose"); }; - if (isArray (_medicationConfig >> "inCompatableMedication")) then { _inCompatableMedication = getArray (_medicationConfig >> "inCompatableMedication"); }; - if (isNumber (_medicationConfig >> "viscosityChange")) then { _viscosityChange = getNumber (_medicationConfig >> "viscosityChange"); }; -}; - -private _heartRate = GET_HEART_RATE(_target); -private _hrIncrease = [_hrIncreaseLow, _hrIncreaseNorm, _hrIncreaseHigh] select (floor ((0 max _heartRate min 110) / 55)); -_hrIncrease params ["_minIncrease", "_maxIncrease"]; -private _heartRateChange = _minIncrease + random (_maxIncrease - _minIncrease); - -// Adjust the medication effects and add the medication to the list -TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange); -[_target, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange] call EFUNC(medical_status,addMedicationAdjustment); - -// Check for medication compatiblity -[_target, _className, _maxDose, _inCompatableMedication] call FUNC(onMedicationUsage); - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf b/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf new file mode 100644 index 00000000000..07dd5261b3e --- /dev/null +++ b/addons/medical_treatment/functions/fnc_treatmentSuccess.sqf @@ -0,0 +1,51 @@ +#include "script_component.hpp" +/* + * Author: KoffeinFlummi, Glowbal, mharis001 + * Handles treatment process success. + * + * Arguments: + * 0: Arguments + * 0: Medic + * 1: Patient + * 2: Body Part + * 3: Treatment + * 4: Item User + * 5: Used Item + * + * Return Value: + * None + * + * Public: No + */ + +params ["_args"]; +_args params ["_medic", "_patient", "_bodyPart", "_classname"]; + +// Switch medic to end animation immediately +private _endInAnim = _medic getVariable QGVAR(endInAnim); + +if (!isNil "_endInAnim") then { + if (animationState _medic != _endInAnim) then { + [_medic, _endInAnim, 2] call EFUNC(common,doAnimation); + }; + + _medic setVariable [QGVAR(endInAnim), nil]; +}; + +// Reset medic animation speed coefficient +[QEGVAR(common,setAnimSpeedCoef), [_medic, 1]] call CBA_fnc_globalEvent; + +if (!isNil QEGVAR(advanced_fatigue,setAnimExclusions)) then { + EGVAR(advanced_fatigue,setAnimExclusions) deleteAt (EGVAR(advanced_fatigue,setAnimExclusions) find QUOTE(ADDON)); +}; + +// Call treatment specific success callback +GET_FUNCTION(_callbackSuccess,configFile >> QGVAR(actions) >> _classname >> "callbackSuccess"); + +_args call _callbackSuccess; + +// Call litter creation handler +_args call FUNC(createLitter); + +// Emit local event for medical API +["ace_treatmentSucceded", [_medic, _patient, _bodyPart, _classname]] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf b/addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf deleted file mode 100644 index 66d2373804d..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentSurgicalKit_onProgress.sqf +++ /dev/null @@ -1,49 +0,0 @@ -#include "script_component.hpp" -/* - * Author: BaerMitUmlaut - * Handles treatment via surgical kit per frame - * - * Arguments: - * 0: Arguments - * 0: Caller - * 1: Target - * 1: Elapsed Time - * 2: Total Time - * - * Return Value: - * Succesful treatment started - * - * Example: - * [[bob, kevin], 5, 5] call ace_medical_treatment_fnc_treatmentAdvanced_surgicalKit_onProgress - * - * Public: No - */ - -params ["_args", "_elapsedTime", "_totalTime"]; -_args params ["_caller", "_target"]; - -private _bandagedWounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; -private _stitchedWounds = _target getVariable [QEGVAR(medical,stitchedWounds), []]; - -//In case two people stitch up one patient and the last wound has already been closed we can stop already -if (_bandagedWounds isEqualTo []) exitWith { false }; - -//Has enough time elapsed that we can close another wound? -if (_totalTime - _elapsedTime <= (count _bandagedWounds - 1) * 5) then { - private _treatedWound = _bandagedWounds deleteAt 0; - _stitchedWounds pushBack _treatedWound; - _target setVariable [QEGVAR(medical,bandagedWounds), _bandagedWounds, true]; - _target setVariable [QEGVAR(medical,stitchedWounds), _stitchedWounds, true]; - TRACE_3("stitched",_treatedWound,count _bandagedWounds,count _stitchedWounds); - - // Check if we fixed limping from this treatment - if ((EGVAR(medical,limping) == 2) && {_target getVariable [QEGVAR(medical,isLimping), false]}) then { - _treatedWound params ["", "_partN"]; - if (_partN > 3) then { // only for LEG wounds - TRACE_3("updating damage effects",_target,_partN,local _target); - [QEGVAR(medical_engine,updateDamageEffects), [_target], _target] call CBA_fnc_targetEvent; - }; - }; -}; - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentTourniquet.sqf b/addons/medical_treatment/functions/fnc_treatmentTourniquet.sqf deleted file mode 100644 index 595d55d5899..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentTourniquet.sqf +++ /dev/null @@ -1,40 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Apply a tourniquet to the patient - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * - * Return Value: - * Succesful treatment started - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart", "_className", "_items"]; - -if (count _items == 0) exitWith {false}; - -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; - -private _tourniquets = GET_TOURNIQUETS(_target); - -if (_tourniquets select _partIndex > 0) exitWith { - private _output = "There is already a tourniquet on this body part!"; // TODO localization - [QEGVAR(common,displayTextStructured), [_output, 1.5, _caller], _caller] call CBA_fnc_targetEvent; - false -}; - -private _removeItem = _items select 0; - -[QGVAR(treatmentTourniquetLocal), [_target, _removeItem, _bodyPart], _target] call CBA_fnc_targetEvent; - -[_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", ELSTRING(medical_treatment,Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", ELSTRING(medical_treatment,Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message - -true diff --git a/addons/medical_treatment/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical_treatment/functions/fnc_treatmentTourniquetLocal.sqf deleted file mode 100644 index a3bd24d381a..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentTourniquetLocal.sqf +++ /dev/null @@ -1,28 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Apply a tourniquet to the patient, local callback. - * - * Arguments: - * 0: The patient - * 1: Item used classname - * 2: Body part - * - * Return Value: - * None - * - * Public: No - */ - -params ["_target", "_tourniquetItem", "_bodyPart"]; - -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; - -// Place a tourniquet on the bodypart -private _tourniquets = GET_TOURNIQUETS(_target); - -_tourniquets set [_partIndex, CBA_missionTime]; - -_target setVariable [VAR_TOURNIQUET, _tourniquets, true]; - -[_target] call EFUNC(medical_status,updateWoundBloodLoss); diff --git a/addons/medical_treatment/functions/fnc_treatmentTourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_treatmentTourniquetRemove.sqf deleted file mode 100644 index 07587135723..00000000000 --- a/addons/medical_treatment/functions/fnc_treatmentTourniquetRemove.sqf +++ /dev/null @@ -1,56 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Action for removing the tourniquet on specified selection - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * - * Return Value: - * None - * - * Public: No - */ - -params ["_caller", "_target", "_bodyPart"]; -TRACE_3("params",_caller,_target,_bodyPart); - -// grab the required data -private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; -private _tourniquets = GET_TOURNIQUETS(_target); - -// Check if there is a tourniquet on this bodypart -if (_tourniquets select _partIndex == 0) exitWith { - [QEGVAR(common,displayTextStructured), [ELSTRING(medical_treatment,noTourniquetOnBodyPart), 1.5, _caller], [_caller]] call CBA_fnc_targetEvent; -}; - -// Removing the tourniquet -_tourniquets set [_partIndex, 0]; -_target setVariable [VAR_TOURNIQUET, _tourniquets, true]; - -[_target] call EFUNC(medical_status,updateWoundBloodLoss); - -// Adding the tourniquet item to the caller -[_caller, "ACE_tourniquet", true] call CBA_fnc_addItem; - -//Handle all injected medications now that blood is flowing -private _delayedMedications = _target getVariable [QEGVAR(medical,occludedMedications), []]; -private _updatedArray = false; -TRACE_2("meds",_partIndex,_delayedMedications); - -{ - _x params ["", "", "_medPartNum"]; - if (_partIndex == _medPartNum) then { - TRACE_1("delayed medication call after tourniquet removeal",_x); - [QGVAR(treatmentMedicationLocal), _x, _target] call CBA_fnc_targetEvent; - _delayedMedications set [_forEachIndex, -1]; - _updatedArray = true; - }; -} forEach _delayedMedications; - -if (_updatedArray) then { - _delayedMedications = _delayedMedications - [-1]; - _target setVariable [QEGVAR(medical,occludedMedications), _delayedMedications, true]; -}; diff --git a/addons/medical_treatment/functions/fnc_treatment_failure.sqf b/addons/medical_treatment/functions/fnc_treatment_failure.sqf deleted file mode 100644 index 8b3114cc663..00000000000 --- a/addons/medical_treatment/functions/fnc_treatment_failure.sqf +++ /dev/null @@ -1,56 +0,0 @@ -#include "script_component.hpp" -/* - * Author: KoffeinFlummi, Glowbal - * Callback when the treatment fails - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * 4: Items available > - * - * Return Value: - * None - * - * Public: No - */ - -params ["_args"]; -_args params ["_caller", "_target", "_bodyPart", "_className", "_items", "_usersOfItems"]; - -// switch to end anim immediately -private _endInAnim = _caller getVariable QGVAR(endInAnim); - -if (!isNil "_endInAnim") then { - if (animationState _caller != _endInAnim) then { - [_caller, _endInAnim, 2] call EFUNC(common,doAnimation); - }; - _caller setVariable [QGVAR(endInAnim), nil]; - TRACE_1("abort",_endInAnim); -}; - -// reset sped up animations -[QEGVAR(common,setAnimSpeedCoef), [_caller, 1]] call CBA_fnc_globalEvent; - -{ - _x params ["_unit", "_item"]; - _unit addItem _item; -} forEach _usersOfItems; - -// Record specific callback -private _config = configFile >> QGVAR(Actions) >> _className; - -private _callback = getText (_config >> "callbackFailure"); - -if (isNil _callback) then { - _callback = compile _callback; -} else { - _callback = missionNamespace getVariable _callback; -}; - -if !(_callback isEqualType {}) then { - _callback = {TRACE_1("callback was NOT code",_callback)}; -}; - -_args call _callback; diff --git a/addons/medical_treatment/functions/fnc_treatment_success.sqf b/addons/medical_treatment/functions/fnc_treatment_success.sqf deleted file mode 100644 index d3329574cb5..00000000000 --- a/addons/medical_treatment/functions/fnc_treatment_success.sqf +++ /dev/null @@ -1,71 +0,0 @@ -#include "script_component.hpp" -/* - * Author: KoffeinFlummi, Glowbal - * Callback when the treatment is completed - * - * Arguments: - * 0: The medic - * 1: The patient - * 2: Body part - * 3: Treatment class name - * 4: Items available > - * - * Return Value: - * None - * - * Public: No - */ - -params ["_args"]; -_args params ["_caller", "_target", "_bodyPart", "_className", "_items", "_usersOfItems"]; - -// switch to end anim immediately -private _endInAnim = _caller getVariable QGVAR(endInAnim); - -if (!isNil "_endInAnim") then { - if (animationState _caller != _endInAnim) then { - [_caller, _endInAnim, 2] call EFUNC(common,doAnimation); - }; - _caller setVariable [QGVAR(endInAnim), nil]; - TRACE_1("abort",_endInAnim); -}; - -// reset sped up animations -[QEGVAR(common,setAnimSpeedCoef), [_caller, 1]] call CBA_fnc_globalEvent; - -// Record specific callback -private _config = configFile >> QGVAR(Actions) >> _className; - -private _callback = getText (_config >> "callbackSuccess"); - -if (isNil _callback) then { - _callback = compile _callback; -} else { - _callback = missionNamespace getVariable _callback; -}; - -if !(_callback isEqualType {}) then { - _callback = {TRACE_1("callback was NOT code",_callback)}; -}; - -//Get current blood loose on limb (for "bloody" litter) -private _bloodLossOnBodyPart = 0; -private _partIndex = (ALL_BODY_PARTS find toLower _bodyPart) max 0; - -// Add all bleeding from wounds on selection -private _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; - -{ - _x params ["", "_bodyPartN", "_amountOf", "_percentageOpen"]; - - if (_bodyPartN isEqualTo _partIndex) then { - _bloodLossOnBodyPart = _bloodLossOnBodyPart + (_amountOf * _percentageOpen); - }; -} forEach _openWounds; -TRACE_1("advanced",_bloodLossOnBodyPart); - -_args call _callback; -_args pushBack _bloodLossOnBodyPart; -_args call FUNC(litterCreate); - -["ace_treatmentSucceded", [_caller, _target, _bodyPart, _className]] call CBA_fnc_localEvent; diff --git a/addons/medical_treatment/functions/fnc_unloadUnit.sqf b/addons/medical_treatment/functions/fnc_unloadUnit.sqf new file mode 100644 index 00000000000..ef36e2faa81 --- /dev/null +++ b/addons/medical_treatment/functions/fnc_unloadUnit.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" +/* + * Author: Glowbal + * Unloads an unconscious or dead patient from their vehicle. + * + * Arguments: + * 0: Medic + * 1: Patient + * + * Return Value: + * None + * + * Example: + * [player, bob] call ace_medical_treatment_fnc_unloadUnit + * + * Public: No + */ + +params ["_medic", "_patient"]; + +if (vehicle _patient == _patient) exitWith { + TRACE_1("Unit is not in a vehicle",_patient); +}; + +if (_patient call EFUNC(common,isAwake)) exitWith { + TRACE_1("Unit is awake",_patient); +}; + +["ace_unloadPersonEvent", [_patient, vehicle _patient, _medic], _patient] call CBA_fnc_targetEvent; diff --git a/addons/medical_treatment/functions/fnc_useItem.sqf b/addons/medical_treatment/functions/fnc_useItem.sqf index 6977052209e..a7484639da0 100644 --- a/addons/medical_treatment/functions/fnc_useItem.sqf +++ b/addons/medical_treatment/functions/fnc_useItem.sqf @@ -1,45 +1,38 @@ #include "script_component.hpp" /* - * Author: Glowbal - * Use Equipment if any is available. Priority: 1) Medic, 2) Patient. If in vehicle: 3) Crew + * Author: Glowbal, mharis001 + * Uses one of the treatment items. Respects the priority defined by the allowSharedEquipment setting. * * Arguments: * 0: Medic * 1: Patient - * 2: Item + * 2: Items * - * ReturnValue: - * 0: success - * 1: Unit + * Return Value: + * User and Item + * + * Example: + * [player, cursorObject, ["bandage"]] call ace_medical_treatment_fnc_useItems * * Public: No */ -params ["_medic", "_patient", "_item"]; - -if (isNil QEGVAR(medical,setting_allowSharedEquipment)) then { - EGVAR(medical,setting_allowSharedEquipment) = true; -}; +params ["_medic", "_patient", "_items"]; -if (EGVAR(medical,setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith { - ["ace_useItem", [_patient, _item], _patient] call CBA_fnc_targetEvent; - [true, _patient] -}; +scopeName "Main"; -if ([_medic, _item] call EFUNC(common,hasItem)) exitWith { - ["ace_useItem", [_medic, _item], _medic] call CBA_fnc_targetEvent; - [true, _medic] -}; +private _useOrder = [[_patient, _medic], [_medic, _patient], [_medic]] select GVAR(allowSharedEquipment); -private _return = [false, objNull]; +{ + private _unit = _x; + private _unitItems = _x call EFUNC(common,uniqueItems); -if (vehicle _medic != _medic && {vehicle _medic call FUNC(isMedicalVehicle)}) then { { - if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {[_x, _item] call EFUNC(common,hasItem)}) exitWith { - ["ace_useItem", [_x, _item], _x] call CBA_fnc_targetEvent; - _return = [true, _x]; + if (_x in _unitItems) then { + _unit removeItem _x; + [_unit, _x] breakOut "Main"; }; - } forEach crew vehicle _medic; -}; + } forEach _items; +} forEach _useOrder; -_return +[objNull, ""] diff --git a/addons/medical_treatment/functions/fnc_useItems.sqf b/addons/medical_treatment/functions/fnc_useItems.sqf deleted file mode 100644 index 13ccf627b00..00000000000 --- a/addons/medical_treatment/functions/fnc_useItems.sqf +++ /dev/null @@ -1,50 +0,0 @@ -#include "script_component.hpp" -/* - * Author: Glowbal - * Use Equipment items if any is available. Priority: 1) Medic, 2) Patient. If in vehicle: 3) Crew - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Items > - * - * Return Value: - * 0: success - * 1: Unit - * - * Example: - * [unit, patient, ["bandage"]] call ace_medical_treatment_fnc_useItems - * - * Public: No - */ - -#define HAS_USED_ITEM(itemUsedInfo) (itemUsedInfo select 0) -#define GET_ITEM_USED_BY(itemUsedInfo) (itemUsedInfo select 1) - -params ["_medic", "_patient", "_items"]; - -private _itemsUsedBy = []; - -{ - // handle a one of type use item - if (_x isEqualType []) then { - { - private _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); - - if (HAS_USED_ITEM(_itemUsedInfo)) exitWith { - _itemsUsedBy pushBack [GET_ITEM_USED_BY(_itemUsedInfo), _x]; - }; - } forEach _x; - }; - - // handle required item - if (_x isEqualType "") then { - private _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); - - if (HAS_USED_ITEM(_itemUsedInfo)) exitWith { - _itemsUsedBy pushBack [GET_ITEM_USED_BY(_itemUsedInfo), _x]; - }; - }; -} forEach _items; - -[count _items == count _itemsUsedBy, _itemsUsedBy]; diff --git a/addons/medical_treatment/initSettings.sqf b/addons/medical_treatment/initSettings.sqf index 6cd3f8c897a..0717c8e88fd 100644 --- a/addons/medical_treatment/initSettings.sqf +++ b/addons/medical_treatment/initSettings.sqf @@ -1,206 +1,193 @@ -// CBA Settings [ADDON: ace_medical_treatment]: -private _categoryArray = [LELSTRING(medical,Category_DisplayName), LLSTRING(subCategory)]; - -// todo: the strings for all three advanced bandages/medication/diagnose settings are terribly ambigious +// todo: this setting just disables some treatment options, remove? +[ + QGVAR(advancedDiagnose), + "CHECKBOX", + [LSTRING(AdvancedDiagnose_DisplayName), LSTRING(AdvancedDiagnose_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + true, + true +] call CBA_settings_fnc_init; -[// todo: I don't like that wound reopening requires this setting to be enabled, they should be independent - QGVAR(advancedBandages), "CHECKBOX", - [LSTRING(advancedBandages_DisplayName), LSTRING(advancedBandages_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QGVAR(advancedBandages), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart +[ + QGVAR(advancedBandages), + "CHECKBOX", + [LSTRING(AdvancedBandages_DisplayName), LSTRING(AdvancedBandages_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + true, + true ] call CBA_settings_fnc_init; -[// todo: this setting just disables some treatment options, remove? - QGVAR(advancedDiagnose), "CHECKBOX", - [LSTRING(advancedDiagnose_DisplayName), LSTRING(advancedDiagnose_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QGVAR(advancedDiagnose), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart +// todo: verify that this setting does not require a restart +// todo: this setting requires advanced bandages to be enabled, they should be independent +[ + QGVAR(woundReopening), + "CHECKBOX", + [LSTRING(WoundReopening_DisplayName), LSTRING(WoundReopening_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + true, + true ] call CBA_settings_fnc_init; [ - QGVAR(advancedMedication), "CHECKBOX", - [LSTRING(advancedMedication_DisplayName), LSTRING(advancedMedication_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QGVAR(advancedMedication), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(advancedMedication), + "CHECKBOX", + [LSTRING(AdvancedMedication_DisplayName), LSTRING(AdvancedMedication_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + true, + true ] call CBA_settings_fnc_init; [ - QGVAR(woundReopening), "CHECKBOX", - [LSTRING(woundReopening_DisplayName), LSTRING(woundReopening_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QGVAR(woundReopening), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(cprCreatesPulse), + "CHECKBOX", + [LSTRING(CPRCreatesPulse_DisplayName), LSTRING(CPRCreatesPulse_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + true, + true ] call CBA_settings_fnc_init; +// todo: should this setting differentiate between medical vehicles and facilities? [ - QGVAR(allowSelfIV), "LIST", // This setting is list because we want number for treatment config - [LSTRING(allowSelfIV_DisplayName), LSTRING(allowSelfIV_Description)], - _categoryArray, - [[0,1],["No","Yes"],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(allowSelfIV), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(locationsBoostTraining), + "CHECKBOX", + [LSTRING(LocationsBoostTraining_DisplayName), LSTRING(LocationsBoostTraining_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + false, + true ] call CBA_settings_fnc_init; -// Ported Settings: [ - QEGVAR(medical,convertItems), "LIST", - [LSTRING(convertItems_DisplayName), LSTRING(convertItems_Description)], - _categoryArray, - [[0,1,2],[LELSTRING(common,Enabled),LLSTRING(convertItems_remove),LELSTRING(common,Disabled)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,convertItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(allowSelfIV), + "LIST", + [LSTRING(AllowSelfIV_DisplayName), LSTRING(AllowSelfIV_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 0], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,allowLitterCreation), "CHECKBOX", - [LSTRING(allowLitterCreation), LSTRING(allowLitterCreation_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QEGVAR(medical,allowLitterCreation), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(allowSharedEquipment), + "LIST", + [LSTRING(AllowSharedEquipment_DisplayName), LSTRING(AllowSharedEquipment_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2], [LSTRING(AllowSharedEquipment_PriorityPatient), LSTRING(AllowSharedEquipment_PriorityMedic), ELSTRING(common,No)], 0], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,CPRcreatesPulse), "CHECKBOX", - [LSTRING(CPRcreatesPulse), LSTRING(CPRcreatesPulse_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QEGVAR(medical,CPRcreatesPulse), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(convertItems), + "LIST", + [LSTRING(ConvertItems_DisplayName), LSTRING(ConvertItems_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2], [ELSTRING(common,Enabled), LSTRING(ConvertItems_RemoveOnly), ELSTRING(common,Disabled)], 0], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,litterCleanUpDelay), "SLIDER", - [LSTRING(litterCleanUpDelay), LSTRING(litterCleanUpDelay_Description)], - _categoryArray, - [-1,5000,0,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QEGVAR(medical,litterCleanUpDelay), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(medicEpinephrine), + "LIST", + [LSTRING(MedicEpinephrine_DisplayName), LSTRING(MedicEpinephrine_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 0], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,litterSimulationDetail), "LIST", - [LSTRING(litterSimulationDetail), LSTRING(litterSimulationDetail_Description)], - _categoryArray, - [[0,1,2,3,4],["Off","Low","Medium","High","Ultra"],3], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,litterSimulationDetail), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(locationEpinephrine), + "LIST", + [LSTRING(LocationEpinephrine_DisplayName), LSTRING(LocationEpinephrine_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,increaseTrainingInLocations), "CHECKBOX", - [LSTRING(increaseTrainingInLocations_DisplayName), LSTRING(increaseTrainingInLocations_Description)], - _categoryArray, - false, // default value - true, // isGlobal - {[QEGVAR(medical,increaseTrainingInLocations), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(medicPAK), + "LIST", + [LSTRING(MedicPAK_DisplayName), LSTRING(MedicPAK_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 1], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,PAKTime), "SLIDER", - [LSTRING(PAKTime), LSTRING(PAKTime_Description)], - _categoryArray, - [-1,5000,0,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QEGVAR(medical,PAKTime), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(locationPAK), + "LIST", + [LSTRING(LocationPAK_DisplayName), LSTRING(LocationPAK_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 3], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,medicSetting_Epi), "LIST", - [LSTRING(medicSetting_Epi_DisplayName), LSTRING(medicSetting_Epi_Description)], - _categoryArray, - [[0,1,2],["Anyone","Medics only","Doctors only"],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,medicSetting_Epi), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(consumePAK), + "LIST", + [LSTRING(ConsumePAK_DisplayName), LSTRING(ConsumePAK_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 0], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,medicSetting_PAK), "LIST", - [LSTRING(medicSetting_PAK_DisplayName), LSTRING(medicSetting_PAK_Description)], - _categoryArray, - [[0,1,2],["Anyone","Medics only","Doctors only"],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,medicSetting_PAK), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(timeCoefficientPAK), + "SLIDER", + [LSTRING(TimeCoefficientPAK_DisplayName), LSTRING(TimeCoefficientPAK_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [0, 5, 1, 1], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,medicSetting_SurgicalKit), "LIST", - [LSTRING(MedicalSettings_medicSetting_SurgicalKit_DisplayName), LSTRING(MedicalSettings_medicSetting_SurgicalKit_Description)], - _categoryArray, - [[0,1,2],["Anyone","Medics only","Doctors only"],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,medicSetting_SurgicalKit), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(medicSurgicalKit), + "LIST", + [LSTRING(MedicSurgicalKit_DisplayName), LSTRING(MedicSurgicalKit_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 1], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,consumeItem_PAK), "LIST", - [LSTRING(MedicalSettings_consumeItem_PAK_DisplayName), LSTRING(MedicalSettings_consumeItem_PAK_Description)], - _categoryArray, - [[0,1],["No","Yes"],1], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,consumeItem_PAK), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(locationSurgicalKit), + "LIST", + [LSTRING(LocationSurgicalKit_DisplayName), LSTRING(LocationSurgicalKit_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 2], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,consumeItem_SurgicalKit), "LIST", - [LSTRING(MedicalSettings_consumeItem_SurgicalKit_DisplayName), LSTRING(MedicalSettings_consumeItem_SurgicalKit_Description)], - _categoryArray, - [[0,1],["No","Yes"],1], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,consumeItem_SurgicalKit), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(consumeSurgicalKit), + "LIST", + [LSTRING(ConsumeSurgicalKit_DisplayName), LSTRING(ConsumeSurgicalKit_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 0], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,useLocation_Epi), "LIST", - [LSTRING(MedicalSettings_useLocation_Epi_DisplayName), LSTRING(MedicalSettings_useLocation_Epi_Description)], - _categoryArray, - [[0,1,2,3,4],[LELSTRING(common,Anywhere), LELSTRING(common,Vehicle), LLSTRING(medicalFacility), LLSTRING(vehicleAndFacility), LELSTRING(common,Disabled)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,useLocation_Epi), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(allowLitterCreation), + "CHECKBOX", + [LSTRING(AllowLitterCreation_DisplayName), LSTRING(AllowLitterCreation_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Litter)], + true, + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,useLocation_PAK), "LIST", - [LSTRING(MedicalSettings_useLocation_PAK_DisplayName), LSTRING(MedicalSettings_useLocation_PAK_Description)], - _categoryArray, - [[0,1,2,3,4],[LELSTRING(common,Anywhere), LELSTRING(common,Vehicle), LLSTRING(medicalFacility), LLSTRING(vehicleAndFacility), LELSTRING(common,Disabled)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,useLocation_PAK), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(maxLitterObjects), + "LIST", + [LSTRING(MaxLitterObjects_DisplayName), LSTRING(MaxLitterObjects_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Litter)], + [[50, 100, 200, 300, 400, 500, 1000, 2000, 3000, 4000, 5000], [/* settings function will auto create names */], 5], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,useLocation_SurgicalKit), "LIST", - [LSTRING(MedicalSettings_useLocation_SurgicalKit_DisplayName), LSTRING(MedicalSettings_useLocation_SurgicalKit_Description)], - _categoryArray, - [[0,1,2,3,4],[LELSTRING(common,Anywhere), LELSTRING(common,Vehicle), LLSTRING(medicalFacility), LLSTRING(vehicleAndFacility), LELSTRING(common,Disabled)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,useLocation_SurgicalKit), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(litterCleanupDelay), + "SLIDER", + [LSTRING(LitterCleanupDelay_DisplayName), LSTRING(LitterCleanupDelay_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory_Litter)], + [-1, 3600, 600, 0], + true ] call CBA_settings_fnc_init; diff --git a/addons/medical_treatment/script_component.hpp b/addons/medical_treatment/script_component.hpp index 7f746cdcfe2..db401332482 100644 --- a/addons/medical_treatment/script_component.hpp +++ b/addons/medical_treatment/script_component.hpp @@ -2,9 +2,9 @@ #define COMPONENT_BEAUTIFIED Medical Treatment #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_MODE_FULL -// #define DISABLE_COMPILE_CACHE -// #define ENABLE_PERFORMANCE_COUNTERS +#define DEBUG_MODE_FULL +#define DISABLE_COMPILE_CACHE +#define ENABLE_PERFORMANCE_COUNTERS #ifdef DEBUG_ENABLED_MEDICAL_TREATMENT #define DEBUG_MODE_FULL @@ -16,3 +16,35 @@ #include "\z\ace\addons\medical_engine\script_macros_medical.hpp" #include "\z\ace\addons\main\script_macros.hpp" + +// Returns a text config entry as compiled code or variable from missionNamespace +#define GET_FUNCTION(var,cfg) \ + private var = getText (cfg); \ + if (isNil var) then { \ + var = compile var; \ + } else { \ + var = missionNamespace getVariable var; \ + } + +// Returns a number config entry with default value of 0 +// If entry is a string, will get the variable from missionNamespace +#define GET_NUMBER_ENTRY(cfg) \ + if (isText (cfg)) then { \ + missionNamespace getVariable [getText (cfg), 0]; \ + } else { \ + getNumber (cfg); \ + } + +// Macros for checking if unit is in medical vehicle or facility +// Defined mostly to make location check in canTreat more readable +#define IN_MED_VEHICLE(unit) (unit call FUNC(isInMedicalVehicle)) +#define IN_MED_FACILITY(unit) (unit call FUNC(isInMedicalFacility)) + +#define TREATMENT_LOCATIONS_ALL 0 +#define TREATMENT_LOCATIONS_VEHICLES 1 +#define TREATMENT_LOCATIONS_FACILITIES 2 +#define TREATMENT_LOCATIONS_VEHICLES_AND_FACILITIES 3 +#define TREATMENT_LOCATIONS_NONE 4 + +#define LITTER_CLEANUP_CHECK_DELAY 30 +#define BODY_CLEANUP_CHECK_DELAY 20 diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 1036b3505f3..cee25996768 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -1,404 +1,265 @@ - - - Treatment - 治療 - Лечение - - - Advanced Bandages - アドバンスド包帯 - Расширенная Перевязка - - - Enable advanced bandages (required for wound reopening) - アドバンスド包帯を有効化 (アドバンスド負傷が必要です) - Устанавливает расширенное использование бинтов (требуется для открывающихся ран) - - - Advanced Diagnose - アドバンスド診断 - Расширенная Диагностика - - - Enable advanced diagnose - アドバンスド診断を有効化 - Устанавливает расширенную диагностику - - - Advanced Medication - アドバンスド医薬品 - Расширенные Лекарства - - - Enable advanced medication - アドバンスド医薬品を有効化 - Устанавливает расширенное использование лекарств - - - Locations boost training - Místa pro vylepšení zkušeností - Località aumentano addestramento - Örtliche Trainingssteigerung - Ubicación mejora entrenamiento. - Miejsca zwiększają wyszkolenie - Localização melhora treinamento - Le lieu améliore l'efficacité - Места ускоренного обучения - 衛生兵能力を与える場所 - 교육 증가 지역 - 受所在位置影响提升医疗能力 - 受所在位置影響提升醫療能力 - - - Boost medic rating in medical vehicles or near medical facilities [untrained becomes medic, medic becomes doctor] - Zlepšit zkušenosti zdravotníka v medickém vozidle nebo poblíž zdravotního zařízení [nezkušení se stane zdravotníkem, zdravotník se stane doktorem] - Aumenta il rating medico in veicoli medici o vicino strutture mediche [non addestrato diventa medico, medico diventa dottore] - Steigert die medizinische Einstufung eines Soldaten in Sanitätsfarhzeugen oder in der Nähe von Sanitätseinrichtungen [untrainiert wird zu Sanitäter, Sanitäter zu Doktor] - Mejora el entrenamiento médico dentro de vehículos médicos o cerca de instalaciones médicas (no entrenados se convierten en médicos, médicos se convierten en doctores) - Zwiększa poziom wyszkolenia medyków wewnątrz pojazdów medycznych lub w pobliżu budynków medycznych [niedoświadczony zostaje medykiem, medyk zostaje doktorem] - Aumenta a classificação do médico dentro de veículos médicos ou perto de instalações médicas [sem treinamento vira médico, médico vira doutor] - Améliore l'efficacité des soins dans les véhicules ou structures de soins [non formés deviennent médecins, médecins deviennent docteurs] - Улучшает медицинскую подготовку в мед. транспорте и около мед. строений [нетренированные становятся медиками, медики становятся врачами] - 医療車両や医療施設の近くは衛生兵としての能力を与える場所となり、衛生兵の訓練を受けていないのに衛生兵としてなります (未訓練は衛生兵に、衛生兵は医師に) - 의무병의 수준이 주변의 차량이나 의료시설에 따라 증가합니다. [비교육자가 의무병이되고, 의무병이 의사가 됩니다] - 当人员在医疗载具或是医护设施旁进行医疗时, 该员医疗能力将会有所提升 (未受训人员提升为医疗兵, 医疗兵提升为军医) - 當人員在醫療載具或是醫護設施旁進行醫療時, 該員醫療能力將會有所提升 (未受訓人員提升為醫療兵, 醫療兵提升為軍醫) - - - Self IV Transfusion - 自己 IV 輸血 - Внутривенное переливание на себе - - - Allows using IV Transfusions on yourself - 自ら IV 輸血することを許可します - Позволяет использовать внутривенные переливания на себе - - - CPR creates pulse - HLW erzeugt einen Puls - 心肺蘇生による脈 - СЛР создаст пульс - - - CPR will create a pulse for the patient while performing - HLW erzeugt während der Behandlung beim Patienten einen Puls - 心肺蘇生を行っている間は患者に脈を作ります - СЛР создаст пульс для пациента во время выполнения - - - Enable Advanced wounds - Усложненные раны - Aktywuj zaawansowane rany - Activa heridas avanzadas - Aktiviere erweiterte Wunden - Povolit pokročilé zranění - Ativar ferimentos avançados - Activer les plaies compliquées - Komplex sebek engedélyezése - Abilita ferite Avanzate - アドバンスド負傷を有効化 - 고급 부상 활성화 - 启用进阶伤口系统 - 啟用進階傷口系統 - - - Allow reopening of bandaged wounds? - Будут ли открываться уже перевязанные раны? - Pozwól na otwieranie się zabandażowanych ran? - Permitir la reapertura de las heridas vendadas? - Erlaube das Öffnen von bandagierten Wunden? - Umožnit znovuotevření zavázané rány? - Permitr reabertura de ferimentos enfaixados? - Les plaies peuvent se rouvrir - Visszanyílhatnak a bekötözött sebek? - Permetti la riapertura di ferite bendate? - 包帯で巻かれた傷を再び開くようにしますか? - 붕대가 풀리는것을 활성화합니까? - 启用进阶伤口系统会使已被包扎的伤口有机率裂开 - 啟用進階傷口系統會使已被包紮的傷口有機率裂開 - - - - - Allow Epinephrine - Erlaube Epiniphrin - Permitir Epinefrina - Ograniczenia adrenaliny - Activer l'épinéphrine - Permette epinefrina - Povolit adrenalin - Permitir Epinefrina - Разрешить Адреналин - アドレナリンの許可 - 에피네프린 활성화 - 允许使用肾上腺素 - 允許使用腎上腺素 - - - Who can use Epinephrine? - 誰がアドレナリンを使えるようにしますか? - Кто может использовать Адреналин? - - - Allow PAK - Использование аптечки - Ustawienie apteczek osobistych - Permitir EPA - Erlaube Erste-Hilfe-Set - Povolit osobní lékárničky (PAK) - Permitir Kit de Primeiros Socorros - Activer la trousse sanitaire - Elsősegélycsomag engedélyezése - Consenti Kit di Pronto Soccorso - 応急処置キットの許可 - 개인응급키트 활성화 - 允许使用个人急救包 - 允許使用個人急救包 - - - Who can use the PAK for full heal? - Кому разрешено выполнять полное лечение с помощью аптечки? - Kto może skorzystać z apteczki osobistej w celu pełnego uleczenia? - ¿Quién puede utilizar el EPA para una cura completa? - Wer kann das Erste-Hilfe-Set für eine Endheilung verwenden? - Kdo může použít osobní lékárničku pro plné vyléčení? - Quem pode usar o KPS para cura completa? - Qui peut utilier la trousse sanitaire pour des soins complets? - Ki használhatja az elsősegélycsomagot teljes gyógyításra? - Chi può usare il KPS per cura completa? - 完全に回復できるよう誰しもが応急処置キットを使えるようにしますか? - 완전한 체력회복을 위해 어느 인원이 개인응급키트을 쓸 수 있습니까? (기본 의료 전용) - 谁能够使用个人急救包来达到完整医疗? - 誰能夠使用個人急救包來達到完整醫療? - - - Anyone - Кем угодно - Wszyscy - Nadie - Jeder - Kdokoliv - Qualquer um - Tous - Akárki - Chiunque - だれでも - 모두 - 任何人 - 任何人 - - - Medics only - Только медиками - Tylko medycy - Solo médicos - Nur Sanitäter - Pouze zdravotník - Somente médicos - Infirmiers uniquement - Csak orvosok - Solo medici - 衛生兵のみ - 의무병만 - 只限医疗兵 - 只限醫療兵 - - - Doctors only - Только врачами - Tylko doktorzy - Solo doctores - Nur Ärzte - Pouze doktor - Somente doutores - Médecins uniquement - Csak doktorok - Solo dottori - 医師のみ - 오직 의사만 - 只限军医 - 只限軍醫 - - - Medical facility - В госпитале - Budynki medyczne - Centro médico - Medizinische Einrichtungen - Zdravotnické zařízení - Instalação médica - Dans les structures sanitaires - Orvosi létesítmény - Strutture mediche - 医療施設でのみ - 의료시설 - 医疗设施 - 醫療設施 - - - Vehicles & facility - В транспорте и госпитале - Pojazdy i budynki medyczne - Vehículos y centros - Fahrzeuge & Einrichtungen - Vozidla a zařízení - Veículos e instalações - Dans les véhicules et les structures sanitaires - Járművek & létesítmény - Veicoli e Strutture - 車両 & 施設 - 차량 및 시설 - 医疗载具 & 医疗设施 - 醫療載具 & 醫療設施 - - - Remove PAK on use - Удалять аптечки после использования - Usuń apteczkę po użyciu - Eliminar EPA después del uso - Entf. Erste-Hilfe-Set bei Verwendung - Odebrat osobní lékárničku po použití - Remover o KPS depois do uso - Utilisation unique de la trousse sanitaire - Elsősegélycsomag eltávolítása használatkor - Rimuovi Kit Pronto Soccorso dopo l'uso - 応急処置キットの削除 - 개인응급키트 사용후 사라짐 - 在使用后删除个人急救包 - 在使用後刪除個人急救包 - - - Should PAK be removed on usage? - Нужно ли удалять аптечки после использования? - Czy apteczka osobista powinna zniknąć z ekwipunku po jej użyciu? - El EPA será eliminado después de usarlo - Sollen Erste-Hilfe-Sets bei Verwendung entfernt werden? - Má se osobní lékárnička odstranit po použití? - Deve o KPS ser removido depois do uso? - La trousse sanitaire doit être consommée à l'utilisation? - Eltávolítódjon az elsősegélycsomag használatkor? - Il Kit Pronto Soccorso dev'essere rimosso dopo l'utilizzo? - 応急処置キットを使うと削除しますか? - 개인응급키트를 사용하고 나서 제거합니까? - 要在使用后删除个人急救包吗? - 要在使用後刪除個人急救包嗎? - - - Locations Epinephrine - Orte für Epiniphrin - Ubicaciones epinefrina - Ograniczenia adrenaliny - Utilisation de l'épinéphrine - Ubicazione epinefrina - Oblast k použití adrenalinu - Localizações de Epinefrina - Место использования адреналина - アドレナリンを使える場所 - 에피네프린 사용 장소 - 肾上腺素使用地点 - 腎上腺素使用地點 - - - Where can the Epinephrine be used? - どこでアドレナリンを使用できる場所にしますか? - Где можно использовать Адреналин? - - - How long should PAK take to apply? - 応急処置キットの使用時間 - Как долго занимает лечение Аптечкой? - - - How long should PAK take to apply? Use 0 for default (based on damage) - 応急処置キットの使用時間を決定しますか? 0 で標準になります (ダメージに比例) - Сколько времени занимает лечение Аптечкой? Используйте 0 для настроек по умолчанию (в зависимости от повреждений) - - - - - Enable Litter - Включить мусор - Aktywuj odpadki - Activar restos médicos - Abfälle aktivieren - Povolit odpadky - Ativar lixo médico - Activer les détritus - Szemét engedélyezése - Abilita Barella - 医療廃棄物の表示を有効化 - - - Enable litter being created upon treatment - Включить появление мусора после лечения - Twórz odpadki medyczne podczas leczenia - Activar los restos médicos que se crean en el tratamiento - Aktiviere Abfälle, wenn eine Behandlung durchgeführt wurde - Vytváří odpad zdravotnického materiálu pří léčení - Ativar lixo ser criado após tratamento - Activer la création de détrimus au début des traitements - Engedélyezi a szemét keletkezését ellátáskor - Abilita la creazione della barella dopo trattamento - 治療を始めると、医療廃棄物の作成を有効化します - - - Litter Simulation Detail - Detale zużytych medykamentów - Detalle de simulación de basura - Количество мусора от медицины - Dettagli Simulazione Rifiuti - Niveau de simulation des détritus - Abfall-Detaillevel - Hulladékszimuláció részletessége - Detalhe da simulação de sujeira - Počet zobrazených předmětů po použití zdravotnického materiálu - 医療廃棄物を再現する詳細度 - - - Litter simulation detail level sets the number of litter items which will be locally spawned in the client. Excessive amounts in local areas could cause FPS lag, so this is a client only setting. - Opcja ta ustawia liczbę zużytych medykamentów, jakie pojawiają się lokalnie wokół gracza. Ich zbyt duża ilość może spowodować spadki FPS, dlatego jest to ustawienie tylko po stronie klienta. - Detalle simulación de basura establece el número de artículos de basura que se generan a nivel local en el cliente. Las cantidades excesivas en áreas locales podrían causar caída de rendimiento, así que esto es un ajuste de cliente únicamente. - Устанавливает количество мусора, который появляется после использования мед. препаратов. Большое количество мусора может уменьшить производительность, поэтому данная настройка локальна для клиента. - Il numero di rifiuti che verranno creati localmente. La creazione di troppi rifiuti in aree locali potrebbe causare lag e calo di FPS. Questo è un settaggio lato client. - Le niveau de simulation des détritus règle la quantité de déchets qui vont être créés localement chez le client. Des quantitées excessive chez certains clients peuvent causer des chutes de FPS, c'est donc une option client uniquement. - Die Einstellung für das Abfall-Detaillevel stellt die Menge des lokal angezeigten medizinischen Abfalls ein. Zuviel Abfall kann FPS-Einbrüche erzeugen, weswegen diese Einstellung nur clientseitig ist. - A hulladékszimuláció részletessége megszabja a kliens által megjelenített hulladékobjektumok mennyiségét. Súlyos mennyiségek izolált területeken alacsony FPS-t okozhatnak, így ez egy kliensoldali beállítás. - O nível de detalhe de sujeira determina o número de itens que irão aparecer no cliente. Quantidades excessivas em áreas locais podem aumentar o lag do FPS, então esta é uma opção somente para o cliente. - Počet zobrazených předmětů po použití zdravotnického materiálu ovlivňuje počet objektů, které budou zobrazeny klientovi v místě použití zdravotnického materiálu. Vyšší množství objektů může způsobovat poklesy FPS a proto je toto nastavení čistě na klientovi. - 医療廃棄物再現度は各クライアントでローカルに作成される、医療廃棄物への詳細度を決定できます。ローカルで多くのアイテムがあると FPS の低下を引き起こすため、クライアント側のみの設定です。 - - - Life time of litter objects - Время удаления мусора - Długość życia odpadków - Tiempo de vida de los restos médicos - Dauer des angezeigten Abfalls - Životnost pro odpadky - Tempo de vida dos objetos do lixo - Durée d'affichage des détritus - Szemétobjektumok élettartama - Tempo di vita delle barelle - 医療廃棄物の作成限界数を設定 - - - How long should litter objects stay? In seconds. -1 is forever. - Как долго мусор будет оставаться на земле? В секундах. -1 означает бесконечное время. - Ile czasu musi upłynąć, aby odpadki zaczęły znikać? W sekundach. -1 dla nieskończoności. - ¿Por cuánto tiempo deben permanecer los restos médicos? En segundos. -1 es para siempre. - Wie lange sollen Abfälle am Boden liegen (in Sekunden)? -1 ist für immer. - Za jak dlouho začnou odpadky mizet? V sekundách. -1 navždy. - Quanto tempo os objetos do lixo devem ficar? Em segundos. -1 é para sempre. - Combien de temps doivent rester affiché les détritus? En secondes. -1 pour tout le temps - Milyen sokáig legyenek jelen a szemétobjektumok (másodpercben)? A -1 végtelen időt jelent. - Per quanto devono restare le barelle? In secondi. -1 è permanente - 医療廃棄物オブジェクトが表示されつづける時間を設定しますか?-1 は永遠です。 - - - + + Treatment + 治療 + Лечение + + + Litter + + + Advanced Diagnose + アドバンスド診断 + Расширенная Диагностика + + + Enables the Check Pulse, Check Blood Pressure, and Check Response treatment actions instead of the generic Diagnose action. + + + Advanced Bandages + アドバンスド包帯 + Расширенная Перевязка + + + Enables treatment actions for different bandage types instead of the generic Bandage action. + + + Wound Reopening + + + Enables the reopening of bandaged wounds. Requires Advanced Bandages to be enabled. + + + Advanced Medication + アドバンスド医薬品 + Расширенные Лекарства + + + Enables extended, more in-depth medication handling. Also, enables the use of Adenosine and Atropine. + Устанавливает расширенное использование лекарств + + + CPR Creates Pulse + HLW erzeugt einen Puls + 心肺蘇生による脈 + СЛР создаст пульс + + + Controls whether performing CPR creates a pulse for the patient. + + + Locations Boost Training + Místa pro vylepšení zkušeností + Località aumentano addestramento + Örtliche Trainingssteigerung + Ubicación mejora entrenamiento. + Miejsca zwiększają wyszkolenie + Localização melhora treinamento + Le lieu améliore l'efficacité + Места ускоренного обучения + 衛生兵としての能力を与える場所 + 교육 증가 지역 + 受所在位置影响提升医疗能力 + 受所在位置影響提升醫療能力 + + + Boost medical training when in medical vehicles or facilities. Untrained becomes medic, medic becomes doctor. + + + Self IV Transfusion + Внутривенное переливание на себе + + + Enables the use of IV Transfusions on oneself. + Позволяет использовать внутривенные переливания на себе + + + Allow Shared Equipment + + + Controls whether medical equipment can be shared between the patient and the medic. + + + Patient's Equipment First + + + Medic's Equipment First + + + Allow Epinephrine + Erlaube Epiniphrin + Permitir Epinefrina + Ograniczenia adrenaliny + Activer l'épinéphrine + Permette epinefrina + Povolit adrenalin + Permitir Epinefrina + Разрешить Адреналин + アドレナリンの許可 + 에피네프린 활성화 + 允许使用肾上腺素 + 允許使用腎上腺素 + + + Training level required to use Epinephrine. + + + Locations Epinephrine + Orte für Epiniphrin + Ubicaciones epinefrina + Ograniczenia adrenaliny + Utilisation de l'épinéphrine + Ubicazione epinefrina + Oblast k použití adrenalinu + Localizações de Epinefrina + Место использования адреналина + アドレナリンをつかう場所 + 에피네프린 사용 장소 + 肾上腺素使用地点 + 腎上腺素使用地點 + + + Controls where Epinephrine can be used. + + + Allow PAK + Использование аптечки + Ustawienie apteczek osobistych + Permitir EPA + Erlaube Erste-Hilfe-Set + Povolit osobní lékárničky (PAK) + Permitir Kit de Primeiros Socorros + Activer la trousse sanitaire + Elsősegélycsomag engedélyezése + Consenti Kit di Pronto Soccorso + 応急処置キットの許可 + 개인응급키트 활성화 + 允许使用个人急救包 + 允許使用個人急救包 + + + Training level required to use a PAK. + + + Locations PAK + Место использования аптечки + Ograniczenie apteczek osobistych + Ubicaciones del EPA + Orte für Erste-Hilfe-Set + Oblast k použití PAK + Localizações do KPS + Lieu d'utilisation da trousse sanitaire + Elsősegélycsomag helyek + Locazioni Kit Pronto Soccorso + 応急処置キットを使う場所 + 개인응급키트 사용 장소 + 个人急救包使用地点 + 個人急救包使用地點 + + + Controls where a PAK can be used. + + + Consume PAK + + + Controls whether a PAK should be consumed after use. + + + Time Coefficient PAK + + + Modifies how long a PAK takes to apply.\nThe treatment time is based on the total body part damage multiplied by this coefficient, with a minimum of 10 seconds. + + + Allow Surgical Kit + + + Training level required to use a Surgical Kit. + + + Locations Surgical Kit + + + Controls where a Surgical Kit can be used. + + + Consume Surgical Kit + + + Controls whether a Surgical Kit should be consumed after use. + + + Convert Vanilla Items + Конвертировать ванильные медикаменты + + + Controls whether vanilla medical items are converted to ACE Medical items, removed only, or ignored. + + + Remove Only + + + Enable Litter + Включить мусор + Aktywuj odpadki + Activar restos médicos + Abfälle aktivieren + Povolit odpadky + Ativar lixo médico + Activer les détritus + Szemét engedélyezése + Abilita Barella + 医療廃棄物の表示を有効化 + + + Enables the creation of litter upon treatment. + + + Max Litter Objects + + + Sets the maximum number of litter objects which can be spawned, excessive amounts can cause FPS lag. + + + Litter Lifetime + + + Controls the lifetime of litter objects, in seconds. -1 is forever. + + + + Anyone + Кем угодно + Wszyscy + Nadie + Jeder + Kdokoliv + Qualquer um + Tous + Akárki + Chiunque + だれでも + 모두 + 任何人 + 任何人 + + + Medics + + + Doctors + + + Medical Facilities + + + Vehicles & Facilities + + + [ACE] Medical Supply Crate (Basic) [ACE] Ящик с медикаментами (базовая медицина) [ACE] Skrzynka z zapasami medycznymi (podstawowa) @@ -414,7 +275,7 @@ [ACE] 医疗补给箱(基本) [ACE] 醫療補給箱(基本) - + [ACE] Medical Supply Crate (Advanced) [ACE] Ящик с медикаментами (усложн. медицина) [ACE] Skrzynka z zapasami medycznymi (zaawansowana) @@ -430,7 +291,7 @@ [ACE] 医疗补给箱(进阶) [ACE] 醫療補給箱(進階) - + Whether or not the object will be a medical vehicle. Czy pojazd ma być pojazdem medycznym? L'oggetto in questione sarà un veicolo medico o meno. @@ -444,7 +305,7 @@ 是否使该载具为医疗载具? 是否使該載具為醫療載具? - + Medical training Wyszkolenie medyczne Addestramento Medico @@ -459,7 +320,7 @@ 医疗训练 醫療訓練 - + Is Medic Является медиком Klasa medyczna @@ -475,7 +336,7 @@ 是医疗兵 是醫療兵 - + This module allows you to assign the medic class to selected units. Moduł ten pozwala przypisać klasę medyczną wybranym jednostkom. Dieses Modul legt fest, welche Einheiten Sanitäter sind. @@ -491,7 +352,7 @@ 本模块可让被同步的单位成为医疗兵 本模塊可讓被同步的單位成為醫療兵 - + None Нет Żadna @@ -507,8 +368,8 @@ - - Regular medic + + Regular Medic Обычный медик Zwykły medyk Médico regular @@ -523,7 +384,7 @@ 普通医疗兵 普通醫療兵 - + Is Medical Vehicle Является медицинским транспортом Jest pojazdem medycznym @@ -539,7 +400,7 @@ 是医疗载具 是醫療載具 - + Is Medical Facility Является госпиталем Jest budynkiem medycznym @@ -555,7 +416,7 @@ 是医疗设施 是醫療設施 - + Registers an object as a medical facility Определяет объект в качестве госпиталя Przypisuje danemu obiektowi status budynku medycznego @@ -571,7 +432,7 @@ 指定一个物件作为医疗设施 指定一個物件作為醫療設施 - + Doctor (Only Advanced Medics) Врач (только усложн.) Doktor (tylko zaawansowani medycy) @@ -587,7 +448,7 @@ 军医 (只限进阶医疗系统) 軍醫 (只限進階醫療系統) - + Doctor Врач Doktor @@ -603,7 +464,7 @@ 军医 軍醫 - + Bandage (Basic) Bandage (Einfach) Повязка (обычная) @@ -619,7 +480,7 @@ 基础绷带 基礎繃帶 - + Used to cover a wound Для перевязки ран Utilizado para cubrir una herida @@ -635,7 +496,7 @@ 用于覆盖伤口 用於覆蓋傷口 - + A dressing, that is a particular material used to cover a wound, which is applied over the wound once bleeding has been stemmed. Ein Verband, der aus einem besonderen Material besteht um die Wunde zu schützen, nachdem die Blutung gestoppt wurde. Повязка, накладываемая поверх раны после остановки кровотечения. @@ -651,7 +512,7 @@ 用于覆盖伤口以防止出血, 透过敷料的止血剂来让出血慢慢停止 用於覆蓋傷口以防止出血, 透過敷料的止血劑來讓出血慢慢停止 - + Packing Bandage Mullbinde Тампонирующая повязка @@ -667,7 +528,7 @@ 包扎绷带 包紮繃帶 - + Used to pack medium to large wounds and stem the bleeding Wird verwendet, um mittlere bis große Wunden abzudecken und Blutungen zu stoppen Для тампонирования ран среднего и большого размера и остановки кровотечения. @@ -683,7 +544,7 @@ 用于包扎中到大型伤口, 并防止出血 用於包紮中到大型傷口, 並防止出血 - + A bandage used to pack the wound to stem bleeding and facilitate wound healing. Packing a wound is an option in large polytrauma injuries. Повязка для тампонирования раны, остановки кровотечения и лучшего заживления. При тяжёлых сочетанных ранениях возможно тампонирование раны. Se utiliza para detener la hemorragia de una herida y favorecer su cicatrización. Se usa en grandes lesiones o politraumatismos. @@ -699,7 +560,7 @@ 用于包扎中到大型伤口, 并防止出血, 为在大型多处性伤口的选项之一! 用於包紮中到大型傷口, 並防止出血, 為在大型多處性傷口的選項之一! - + Bandage (Elastic) Bandage (Elastisch) Повязка (давящая) @@ -715,7 +576,7 @@ 弹性绷带 彈性繃帶 - + Bandage kit, Elastic Elastische Binde (Kompressionsbinde) Давящая повязка @@ -731,7 +592,7 @@ 弹性绷带 彈性繃帶 - + Allows an even compression and extra support to the injured area. Ermöglicht eine gleichmäßige Kompression und zusätzliche Unterstützung für den verletzten Bereich. Давящая повязка обеспечивает равномерное сжатие и дополнительную поддержку повреждённой области @@ -747,7 +608,7 @@ 可对伤口持续压迫并固定以防止伤口情况变严重 可對傷口持續壓迫並固定以防止傷口情況變嚴重 - + Tourniquet (CAT) Tourniquet [CAT] Жгут @@ -763,7 +624,7 @@ 军用止血带 軍用止血帶 - + Slows down blood loss when bleeding Замедляет кровопотерю при кровотечении Reduce la velocidad de pérdida de sangre @@ -779,7 +640,7 @@ 减缓失血的速度 減緩失血的速度 - + A constricting device used to compress venous and arterial circulation in effect inhibiting or slowing blood flow and therefore decreasing loss of blood. Жгут используется для прижатия сосудов к костным выступам, которое приводит к остановке или значительному уменьшению кровотечения Dispositivo utilizado para eliminar el pulso distal y de ese modo controlar la pérdida de sangre @@ -795,15 +656,15 @@ 用于压迫静脉与动脉的血液流动, 达到减缓失血速度的目的 用於壓迫靜脈與動脈的血液流動, 達到減緩失血速度的目的 - + Splint Шина - + Stabilizes a fractured limb Стабилизирует перелом конечности - + Morphine autoinjector Morphium-Autoinjektor Морфин в пневмошприце @@ -819,7 +680,7 @@ 吗啡自动注射器 嗎啡自動注射器 - + Used to combat moderate to severe pain experiences Wird verwendet um moderate bis starke Schmerzen zu lindern. Для снятия средних и сильных болевых ощущений @@ -835,7 +696,7 @@ 减低中度至重度的疼痛感 減低中度至重度的疼痛感 - + An analgesic used to combat moderate to severe pain experiences. Обезболивающее для снятия средних и сильных болевых ощущений. Analgésico usado para combatir los estados dolorosos de moderados a severos. @@ -851,7 +712,7 @@ 止痛药的一种, 用于减低中度至重度的疼痛感 止痛藥的一種, 用於減低中度至重度的疼痛感 - + Adenosine autoinjector Adenosin-Autoinjektor Asenosina auto-inyectable @@ -866,7 +727,7 @@ 腺苷自动注射器 腺苷自動注射器 - + Used to counter effects of Epinephrine Wird verwendet um die Symptome von Epiniphrin zu lindern Utilizada para contrarrestar los effectos de la Epinefrina @@ -881,7 +742,7 @@ 用来对付肾上腺素的影响 用來對付腎上腺素的影響 - + A drug used to counter the effects of Epinephrine Ein Medikament, das die Symptome von Epiniphrin bekämpft. Medicamento usado para contrarrestar los efectos de la Epinefrina. @@ -896,7 +757,7 @@ 一种药物用于减低肾上腺素的效果 一種藥物用於減低腎上腺素的效果 - + Atropine autoinjector Атропин в пневмошприце Atropina auto-inyectable @@ -912,7 +773,7 @@ 阿托品自动注射器 阿托品自動注射器 - + Used in NBC scenarios Применяется для защиты от ОМП Usado en escenarios NBQ @@ -928,7 +789,7 @@ 使用于核生化污染的情况 使用於核生化汙染的情況 - + A drug used by the Military in NBC scenarios. Препарат, используемый в войсках для защиты от оружия массового поражения. Medicamento usado por militares en escenarios NBQ @@ -944,7 +805,7 @@ 军用神经解毒针, 用来应付核生化污染的情况. 軍用神經解毒針, 用來應付核生化汙染的情況. - + Epinephrine autoinjector Адреналин в пневмошприце Epinefrina auto-inyectable @@ -960,7 +821,7 @@ 肾上腺素自动注射器 腎上腺素自動注射器 - + Increase heart rate and counter effects given by allergic reactions Стимулирует работу сердца и купирует аллергические реакции Aumenta la frecuencia cardiaca y contraresta los efectos de las reacciones alérgicas @@ -976,7 +837,7 @@ 增加心跳速率的一种药物 增加心跳速率的一種藥物 - + A drug that works on a sympathetic response to dilate the bronchi, increase heart rate and counter such effects given by allergic reactions (anaphylaxis). Used in sudden cardiac arrest scenarios with decreasing positive outcomes. Препарат, вызывающий симпатическую реакцию, приводящую к расширению бронхов, увеличению частоты сердечных сокращений и купированию аллергических реакций (анафилактического шока). Применяется при остановке сердца с уменьшенной вероятностью благоприятного исхода. Medicamento que dilata los bronquios, aumenta la frecuencia cardiaca y contrarresta los efectos de las reacciones alérgicas (anafilaxis). Se utiliza en caso de paros cardiacos repentinos. @@ -992,7 +853,7 @@ 俗称强心针, 为一种支气管扩张药物, 会增加心跳速率并减缓过敏反应(过敏性休克), 在心跳骤停时有恢复心跳的效果! 俗稱強心針, 為一種支氣管擴張藥物, 會增加心跳速率並減緩過敏反應(過敏性休克), 在心跳驟停時有恢復心跳的效果! - + Plasma IV (1000ml) Плазма для в/в вливания (1000 мл) Plasma IV (1000ml) @@ -1008,7 +869,7 @@ 血浆 (1000ml) 血漿 (1000ml) - + A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. @@ -1024,7 +885,7 @@ 可快速得到血液补充 可快速得到血液補充 - + A volume-expanding blood supplement. Дополнительный препарат, применяемый при возмещении объема крови. Suplemento para expandir el volumen sanguíneo. @@ -1040,7 +901,7 @@ 可快速得到血液补充 可快速得到血液補充 - + Plasma IV (500ml) Плазма для в/в вливания (500 мл) Plasma IV (500ml) @@ -1056,7 +917,7 @@ 血浆 (500ml) 血漿 (500ml) - + Plasma IV (250ml) Плазма для в/в вливания (250 мл) Plasma IV (250ml) @@ -1072,7 +933,7 @@ 血浆 (250ml) 血漿 (250ml) - + Blood IV (1000ml) Кровь для переливания (1000 мл) Sangre IV (1000ml) @@ -1088,7 +949,7 @@ 血液 (1000ml) 血液 (1000ml) - + Blood IV, for restoring a patients blood (keep cold) Пакет крови для возмещения объёма потерянной крови (хранить в холодильнике) Sangre intravenosa, para restarurar el volumen sanguíneo (mantener frío) @@ -1104,7 +965,7 @@ 血液, 用于补充伤者流失的血液 (需冷藏) 血液, 用於補充傷者流失的血液 (需冷藏) - + O Negative infusion blood used in strict and rare events to replenish blood supply usually conducted in the transport phase of medical care. Кровь I группы, резус-отрицательная, применяется по жизненным показаниям для возмещения объема потерянной крови на догоспитальном этапе оказания медицинской помощи. Krew 0 Rh-, używana w rzadkich i szczególnych przypadkach do uzupełnienia krwi u pacjenta, zazwyczaj w trakcie fazie transportu rannej osoby do szpitala. @@ -1120,7 +981,7 @@ O型负值注射用血液, 在紧急情况时使用, 用于补充伤者流失的血液 O型負值注射用血液, 在緊急情況時使用, 用於補充傷者流失的血液 - + Blood IV (500ml) Кровь для переливания (500 мл) Sangre IV (500ml) @@ -1136,7 +997,7 @@ 血液 (500ml) 血液 (500ml) - + Blood IV (250ml) Кровь для переливания (250 мл) Sangre IV (250ml) @@ -1152,7 +1013,7 @@ 血液 (250ml) 血液 (250ml) - + Saline IV (1000ml) Физраствор для в/в вливания (1000 мл) Salino IV (1000ml) @@ -1168,7 +1029,7 @@ 生理食盐水 (1000ml) 生理食鹽水 (1000ml) - + Saline IV, for restoring a patients blood Пакет физраствора для возмещения объёма потерянной крови Solución salina intravenosa, para restaurar el volumen sanguíneo @@ -1184,7 +1045,7 @@ 生理食盐水, 用于恢复伤者血液 生理食鹽水, 用於恢復傷者血液 - + A medical volume-replenishing agent introduced into the blood system through an IV infusion. Пакет физиологического раствора для возмещения объёма потерянной крови путем внутривенного вливания Suero fisiológico inoculado al torrente sanguíneo de forma intravenosa. @@ -1200,7 +1061,7 @@ 利用静脉注射进入人体血液系统, 帮助伤者血液恢复 利用靜脈注射進入人體血液系統, 幫助傷者血液恢復 - + Saline IV (500ml) Физраствор для в/в вливания (500 мл) Salino IV (500ml) @@ -1216,7 +1077,7 @@ 生理食盐水 (500ml) 生理食鹽水 (500ml) - + Saline IV (250ml) Физраствор для в/в вливания (250 мл) Salino IV (250ml) @@ -1232,7 +1093,7 @@ 生理食盐水 (250ml) 生理食鹽水 (250ml) - + Basic Field Dressing (QuikClot) Первичный перевязочный пакет (QuikClot) Vendaje básico (QuickClot) @@ -1248,7 +1109,7 @@ 基本战地包扎 (止血粉) 基本戰地包紮 (止血粉) - + QuikClot bandage Гемостатический пакет QuikClot Vendaje QuikClot @@ -1264,7 +1125,7 @@ 止血粉绷带 止血粉繃帶 - + Hemostatic bandage with coagulant that stops bleeding. Медицинский коагулянт для экстренной остановки кровотечения Un bandage aidant à coaguler les saignements mineurs à moyens. @@ -1280,7 +1141,7 @@ 包含止血粉成分的止血绷带, 可用于止血 包含止血粉成分的止血繃帶, 可用於止血 - + Personal Aid Kit Аптечка Trousse sanitaire @@ -1296,7 +1157,7 @@ 个人急救包 個人急救包 - + Includes various treatment kit needed for stitching or advanced treatment Содержит различные материалы и инструменты для зашивания ран и оказания специальной медпомощи. Incluye material médico para tratamientos avanzados @@ -1312,7 +1173,7 @@ 包含各种医疗套件, 以及进阶伤口系统需要的缝合用品 包含各種醫療套件, 以及進階傷口系統需要的縫合用品 - + Personal Aid Kit for in field stitching or advanced treatment W znacznym stopniu poprawia stan pacjenta Полевая аптчека для продвинутого лечения и зашивания ран @@ -1328,7 +1189,7 @@ 个人急救包可用于战地缝合手术或进阶伤口系统使用 個人急救包可用於戰地縫合手術或進階傷口系統使用 - + Use Personal Aid Kit Erste-Hilfe-Set benutzen Использовать аптечку @@ -1344,7 +1205,7 @@ 使用个人急救包 使用個人急救包 - + Surgical Kit Trousse chirurgicale Хирургический набор @@ -1360,7 +1221,7 @@ 手术包 手術包 - + Surgical Kit for in field advanced medical treatment Trousse chirurgicale pour le traitement sur le terrain Набор для хирургической помощи в полевых условиях @@ -1376,7 +1237,7 @@ 用于在战场上为伤口进行缝合(需要开启进阶伤口系统) 用於在戰場上為傷口進行縫合(需要開啟進階傷口系統) - + Surgical Kit for in field advanced medical treatment Набор для хирургической помощи в полевых условиях Kit quirúrgico para el tratamiento avanzado en el campo de batalla @@ -1392,7 +1253,7 @@ 用于在战场上为伤口进行缝合(需要开启进阶伤口系统) 用於在戰場上為傷口進行縫合(需要開啟進階傷口系統) - + Use Surgical Kit Operationsset benutzen Usa kit chirurgico @@ -1408,7 +1269,7 @@ 使用手术包 使用手術包 - + Bodybag Housse mortuaire Мешок для трупов @@ -1424,7 +1285,7 @@ 尸袋 屍袋 - + A bodybag for dead bodies Housse de transport des corps Мешок для упаковки трупов @@ -1440,7 +1301,7 @@ 用来装尸体用 用來裝屍體用 - + A bodybag for dead bodies Housse de transport des corps Мешок для упаковки трупов @@ -1456,7 +1317,7 @@ 用来装尸体用 用來裝屍體用 - + No injuries on this bodypart... Körperteil nicht verletzt... Non ci sono ferite in questa parte del corpo... @@ -1472,7 +1333,7 @@ 此身体部位没有受伤 此身體部位沒有受傷 - + Inject Adenosine Adenosin injizieren Inyectar Adenosina @@ -1487,7 +1348,7 @@ 注射腺苷 注射腺苷 - + Inject Atropine Atropin injizieren Inyectar Atropina @@ -1503,7 +1364,7 @@ 注射阿托品 注射阿托品 - + Inject Epinephrine Epinephrine injizieren Inyectar Epinefrina @@ -1519,7 +1380,7 @@ 注射肾上腺素 注射腎上腺素 - + Inject Morphine Morphin injizieren Inyectar Morfina @@ -1535,7 +1396,7 @@ 注射吗啡 注射嗎啡 - + Transfuse Blood Bluttransfusion Transfundir sangre @@ -1551,7 +1412,7 @@ 输血液 輸血液 - + Transfuse Plasma Plasmatransfusion Transfundir plasma @@ -1567,7 +1428,7 @@ 输血浆 輸血漿 - + Transfuse Saline Salzlösungstransfusion Transfundir salino @@ -1583,7 +1444,7 @@ 注射生理食盐水 注射生理食鹽水 - + Apply Tourniquet Tourniquet anwenden Aplicar torniquete @@ -1599,7 +1460,7 @@ 使用军用止血带 使用軍用止血帶 - + Bandage Verbinden Venda @@ -1615,7 +1476,7 @@ 绷带 繃帶 - + Bandage Head Kopf verbinden Vendar la cabeza @@ -1631,7 +1492,7 @@ 绷带包扎 头部 繃帶包紮 頭部 - + Bandage Torso Torso verbinden Vendar el torso @@ -1647,7 +1508,7 @@ 绷带包扎 身体 繃帶包紮 身體 - + Bandage Left Arm Linken Arm verbinden Vendar el brazo izquierdo @@ -1663,7 +1524,7 @@ 绷带包扎 左手 繃帶包紮 左手 - + Bandage Right Arm Rechten Arm verbinden Vendar el brazo derecho @@ -1679,7 +1540,7 @@ 绷带包扎 右手 繃帶包紮 右手 - + Bandage Left Leg Linkes Bein verbinden Vendar la pierna izquierda @@ -1695,7 +1556,7 @@ 绷带包扎 左脚 繃帶包紮 左腳 - + Bandage Right Leg Rechtes Bein verbinden Vendar la pierna derecha @@ -1711,7 +1572,7 @@ 绷带包扎 右脚 繃帶包紮 右腳 - + Injecting Morphine... Morphin injizieren... Inyectando Morfina... @@ -1727,7 +1588,7 @@ 吗啡注射中... 嗎啡注射中... - + Injecting Epinephrine... Epinephrin injizieren... Inyectando Epinefrina... @@ -1743,7 +1604,7 @@ 肾上腺素注射中... 腎上腺素注射中... - + Injecting Adenosine... Adenosin injizieren... Inyectando Adenosina... @@ -1758,7 +1619,7 @@ 腺苷注射中... 腺苷注射中... - + Injecting Atropine... Atropin injizieren... Inyectando Atropina... @@ -1774,7 +1635,7 @@ 阿托品注射中 ... 阿托品注射中 ... - + Transfusing Blood... Bluttransfusion... Transfusión de sangre... @@ -1790,7 +1651,7 @@ 输血液中 ... 輸血液中 ... - + Transfusing Saline... Salzlösungtransfusion... Transfusión de salino... @@ -1806,7 +1667,7 @@ 施打生理食盐水中 ... 施打生理食鹽水中 ... - + Transfusing Plasma... Plasmatransfusion... Transfusión de plasma... @@ -1822,7 +1683,7 @@ 输血浆中 ... 輸血漿中 ... - + Bandaging... Verbinden... Vendando... @@ -1838,7 +1699,7 @@ 绷带包扎中 ... 繃帶包紮中 ... - + Applying Tourniquet... Setze Tourniquet an... Aplicando torniquete... @@ -1854,7 +1715,7 @@ 使用军用止血带中 ... 使用軍用止血帶中 ... - + Field Dressing Wundverband Compresa de campaña @@ -1870,7 +1731,7 @@ 基础绷带 基礎繃帶 - + Packing Bandage Mullbinde Vendaje compresivo @@ -1886,7 +1747,7 @@ 包扎绷带 包紮繃帶 - + Elastic Bandage Elastischer Verband Vendaje elástico @@ -1902,7 +1763,7 @@ 弹性绷带 彈性繃帶 - + QuikClot QuikClot QuikClot @@ -1918,7 +1779,7 @@ 止血粉 止血粉 - + Check Pulse Puls überprüfen Comprobar pulso @@ -1934,7 +1795,7 @@ 检查脉搏 檢查脈搏 - + Check Blood Pressure Blutdruck überprüfen Comprobar presión arterial @@ -1950,7 +1811,7 @@ 检查血压 檢查血壓 - + No entries on this triage card. Keine Einträge auf der Triagekarte Nessuna voce sulla Triage Card @@ -1966,7 +1827,7 @@ 此检伤分类卡上没有任何资料 此檢傷分類卡上沒有任何資料 - + Tourniquet Tourniquet Torniquete @@ -1982,7 +1843,7 @@ 军用止血带 軍用止血帶 - + Remove Tourniquet Tourniquet entfernen Quitar torniquete @@ -1998,15 +1859,15 @@ 移除军用止血带 移除軍用止血帶 - + Apply Splint Наложить Шину - + Applying Splint... Накладывается Шина... - + Diagnose Diagnose Diagnosi @@ -2022,7 +1883,7 @@ 诊断 診斷 - + Diagnosing... Diagnostizieren... Diagnosi in corso... @@ -2038,7 +1899,7 @@ 诊断中... 診斷中... - + CPR HLW RCP @@ -2054,7 +1915,7 @@ 心肺复苏术 心肺復甦術 - + Performing CPR... HLW durchführen... Eseguendo RCP... @@ -2070,7 +1931,7 @@ 进行心肺复苏术中... 進行心肺復甦術中... - + Give Blood IV (1000ml) Bluttransfusion IV (1000ml) Dar Sangre IV (1000ml) @@ -2086,7 +1947,7 @@ 输血液 (1000ml) 輸血液 (1000ml) - + Give Blood IV (500ml) Bluttransfusion IV (500ml) Dar Sangre IV (500ml) @@ -2102,7 +1963,7 @@ 输血液 (500ml) 輸血液 (500ml) - + Give Blood IV (250ml) Bluttransfusion IV (250ml) Dar Sangre IV (250ml) @@ -2118,7 +1979,7 @@ 输血液 (250ml) 輸血液 (250ml) - + Give Plasma IV (1000ml) Plasmatransfusion IV (1000ml) Dar Plasma IV (1000ml) @@ -2134,7 +1995,7 @@ 输血浆 (1000ml) 輸血漿 (1000ml) - + Give Plasma IV (500ml) Plasmatransfusion IV (500ml) Dar Plasma IV (500ml) @@ -2150,7 +2011,7 @@ 输血浆 (500ml) 輸血漿 (500ml) - + Give Plasma IV (250ml) Plasmatransfusion IV (250ml) Dar Plasma IV (250ml) @@ -2166,7 +2027,7 @@ 输血浆 (250ml) 輸血漿 (250ml) - + Give Saline IV (1000ml) Kochsalzlösung IV (1000ml) Dar Salino IV (1000ml) @@ -2182,7 +2043,7 @@ 注射生理食盐水 (1000ml) 注射生理食鹽水 (1000ml) - + Give Saline IV (500ml) Kochsalzlösung IV (500ml) Dar Salino IV (500ml) @@ -2198,7 +2059,7 @@ 注射生理食盐水 (500ml) 注射生理食鹽水 (500ml) - + Give Saline IV (250ml) Kochsalzlösung IV (250ml) Dar Salino IV (250ml) @@ -2214,12 +2075,12 @@ 注射生理食盐水 (250ml) 注射生理食鹽水 (250ml) - + Minimal 軽処置群 Минимально - + Delayed Retrasado Срочная помощь @@ -2235,7 +2096,7 @@ 延后 延後 - + Immediate Inmediato Неотложная помощь @@ -2251,7 +2112,7 @@ 紧急 緊急 - + Deceased Fallecido Труп @@ -2267,7 +2128,7 @@ 死亡 死亡 - + None Ninguno Отсутствует @@ -2283,7 +2144,7 @@ 未分类 未分類 - + Normal breathing Дыхание в норме Respiración normal @@ -2299,7 +2160,7 @@ 呼吸正常 呼吸正常 - + No breathing Keine Atmung Дыхание отсутствует @@ -2315,7 +2176,7 @@ 没有呼吸 沒有呼吸 - + Difficult breathing Дыхание затруднено Dificultad para respirar @@ -2331,7 +2192,7 @@ 呼吸困难 呼吸困難 - + Almost no breathing Beinahe keine Atmung Дыхание очень слабое @@ -2347,13 +2208,13 @@ 快要没呼吸 快要沒呼吸 - + In mild pain Hat leichte Schmerzen 中くらいの痛みがある Небольшая боль - + In pain Hat Schmerzen Испытывает боль @@ -2369,13 +2230,13 @@ 疼痛中 疼痛中 - + In severe pain Hat starke Schmerzen ひどい痛みがある Сильная боль - + Tourniquet [CAT] Tourniquet [CAT] Жгут @@ -2391,7 +2252,7 @@ 军用止血带 軍用止血帶 - + Receiving IV [%1ml] Erhalte IV [%1ml] Recibiendo IV [%1ml] @@ -2407,7 +2268,7 @@ 接收静脉注射液中 [%1ml] 接收靜脈注射液中 [%1ml] - + Blood Pressure Tension artérielle Артериальное давление @@ -2423,7 +2284,7 @@ 血压 血壓 - + Checking Blood Pressure.. Prise de la tension... Проверка артериального давления... @@ -2439,7 +2300,7 @@ 检查血压中... 檢查血壓中... - + %1 checked Blood Pressure: %2 %1 kontrollierte Blutdruck: %2 %1 controllata pressione sanguigna: %2 @@ -2455,7 +2316,7 @@ 已由%1确认血压: %2 已由%1確認血壓: %2 - + You checked %1 Vous examinez %1 Вы осмотрели раненого %1 @@ -2471,7 +2332,7 @@ 你已经检查 %1 你已經檢查 %1 - + You find a blood pressure of %2/%3 Vous avez mesuré une tension de %2/%3 Артериальное давление %2/%3 @@ -2487,7 +2348,7 @@ 血压为%2/%3 血壓為%2/%3 - + You find a low blood pressure Tension basse Давление низкое @@ -2503,7 +2364,7 @@ 发现到低血压 發現到低血壓 - + You find a normal blood pressure Tension normale Давление нормальное @@ -2519,7 +2380,7 @@ 发现到正常血压 發現到正常血壓 - + You find a high blood pressure Tension élevée Давление высокое @@ -2535,7 +2396,7 @@ 发现到高血压 發現到高血壓 - + You find no blood pressure Pas de tension Давления нет @@ -2551,7 +2412,7 @@ 量不到血压 量不到血壓 - + You fail to find a blood pressure Vous n'avez pas pu mesurer de tension Артериальное давление не определяется @@ -2567,7 +2428,7 @@ 检查血压的动作失败 檢查血壓的動作失敗 - + Low Niedrig Bassa @@ -2583,7 +2444,7 @@ - + Normal Normal Normale @@ -2599,7 +2460,7 @@ 正常 正常 - + High Hoch Alta @@ -2615,7 +2476,7 @@ - + No Blood Pressure Kein Blutdruck Nessuna Pressione Sanguigna @@ -2631,7 +2492,7 @@ 无血压 無血壓 - + Pulse Пульс Pouls @@ -2647,7 +2508,7 @@ 脉搏 脈搏 - + Checking Heart Rate... Vérification du pouls... Проверка пульса... @@ -2663,7 +2524,7 @@ 检查心跳中... 檢查心跳中... - + You checked %1 Вы осмотрели раненого %1 Vous examinez %1 @@ -2679,7 +2540,7 @@ 你已经检查 %1 你已經檢查 %1 - + %1 checked Heart Rate: %2 %1 kontrollierte Herzfrequenz: %2 %1 Controllata Frequenza Cardiaca: %2 @@ -2695,7 +2556,7 @@ 已由%1确认心跳: %2 已由%1確認心跳: %2 - + None Нет Żadna @@ -2711,7 +2572,7 @@ - + Weak Schwach Lento @@ -2727,7 +2588,7 @@ 微弱 微弱 - + Normal Normal Normale @@ -2743,7 +2604,7 @@ 正常 正常 - + Strong Stark Veloce @@ -2759,7 +2620,7 @@ 过快 過快 - + You find a Heart Rate of %2 %2 battements par minute Пульс %2 уд./мин. @@ -2775,7 +2636,7 @@ 心跳为%2 心跳為%2 - + You find a weak Heart Rate Poulslent Пульс слабый @@ -2791,7 +2652,7 @@ 心跳微弱 心跳微弱 - + You find a strong Heart Rate pouls rapide Пульс учащенный @@ -2807,7 +2668,7 @@ 心跳过快 心跳過快 - + You find a normal Heart Rate pouls normal Пульс в норме @@ -2823,7 +2684,7 @@ 心跳正常 心跳正常 - + You find no Heart Rate pas de pouls Пульс не прощупывается @@ -2839,7 +2700,7 @@ 量不到心跳 量不到心跳 - + Response Conscience Реакция @@ -2855,7 +2716,7 @@ 反应 反應 - + You check response of patient Vous évaluez l'état de conscience Вы проверяете реакцию раненого @@ -2871,7 +2732,7 @@ 检查伤者的反应 檢查傷者的反應 - + %1 is responsive %1 реагирует на раздражители %1 est conscient @@ -2887,7 +2748,7 @@ %1 有反应 %1 有反應 - + %1 is not responsive %1 не реагирует на раздражители %1 est inconscient @@ -2903,7 +2764,7 @@ %1 没有反应 %1 沒有反應 - + You checked %1 Вы осмотрели раненого %1 Vous avez examiné %1 @@ -2919,7 +2780,7 @@ 你已经检查 %1 你已經檢查 %1 - + Patient %1<br/>is %2.<br/>%3.<br/>%4 Il paziente %1<br/>è %2.<br/>%3.<br/>%4 Пациент %1<br/>%2.<br/>%3.<br/>%4 @@ -2935,7 +2796,7 @@ 伤者 %1<br/>is %2.<br/>%3.<br/>%4 傷者 %1<br/>is %2.<br/>%3.<br/>%4 - + alive vivo жив @@ -2951,7 +2812,7 @@ 活着 活著 - + dead morto мёртв @@ -2967,7 +2828,7 @@ 死亡 死亡 - + He's lost some blood Ha perso poco sangue Ha perdido un poco de sangre @@ -2983,7 +2844,7 @@ 他流失一些血液 他流失一些血液 - + He's lost a lot of blood Er hat viel Blut verloren Sok vért vesztett @@ -2999,7 +2860,7 @@ 他流失大量血液 他流失大量血液 - + He hasn't lost blood Non ha perso sangue Нет кровопотери @@ -3015,7 +2876,7 @@ 他并没有失血 他並沒有失血 - + He is in pain Sente dolori Испытывает боль @@ -3031,7 +2892,7 @@ 他感到疼痛 他感到疼痛 - + He is not in pain Non sente dolori Не испытывает боли @@ -3047,7 +2908,7 @@ 他不会疼痛 他不會疼痛 - + Bandaged Pansé Повязка наложена @@ -3063,7 +2924,7 @@ 绷带 繃帶 - + You bandage %1 (%2) Vous pansez %1 (%2) Вы перевязали раненого %1 (%2) @@ -3079,7 +2940,7 @@ 你正在对 %1 (%2) 包扎绷带中 你正在對 %1 (%2) 包紮繃帶中 - + %1 is bandaging you %1 vous panse %1 перевязывает вас @@ -3095,7 +2956,7 @@ %1 正在对你包扎绷带中 %1 正在對你包紮繃帶中 - + You start stitching injuries from %1 (%2) Вы зашиваете ранения от %1 (%2) Du nähst die Wunden von %1 (%2) @@ -3111,7 +2972,7 @@ 你正开始对 %1 (%2) 缝合伤口中 你正開始對 %1 (%2) 縫合傷口中 - + Stitching Наложение швов Suturando @@ -3127,7 +2988,7 @@ 缝合中 縫合中 - + You treat the airway of %1 Вы интубируете раненого %1 Estás intubando a %1 @@ -3143,7 +3004,7 @@ 你治疗 %1 的呼吸道 你治療 %1 的呼吸道 - + Airway Дыхательные пути Vías aéreas @@ -3159,7 +3020,7 @@ 呼吸道 呼吸道 - + %1 is treating your airway %1 проводит вам интубацию %1 traite vos voies respiratoires @@ -3175,7 +3036,7 @@ %1 正在治疗你的呼吸道 %1 正在治療你的呼吸道 - + Drag Ziehen Arrastrar @@ -3191,7 +3052,7 @@ 拖拉 拖拉 - + Carry Tragen Cargar @@ -3207,7 +3068,7 @@ 背起 背起 - + Release Loslassen Soltar @@ -3223,7 +3084,7 @@ 放下 放下 - + Load Patient Into Patient einladen Cargar al paciente en @@ -3239,7 +3100,7 @@ 将伤者放入 將傷者放入 - + Unload Patient Patient ausladen Descargar al paciente @@ -3255,7 +3116,22 @@ 将伤者背出 將傷者背出 - + + This person (%1) is awake and cannot be loaded + Diese Person (%1) ist wach und kann nicht verladen werden + Ta osoba (%1) jest przytomna i nie może zostać załadowana + Esta persona (%1) está despierto y no puede ser cargado + Боец (%1) в сознании и не может быть погружен + Esta pessoa (%1) está acordada e não pode ser carregada + Tato osoba (%1) je vzhůru a nemůže být naložena + Questa persona (%1) è sveglia e non può essere caricata. + %1 est conscient et ne peut être embarqué. + 患者 (%1) は意識があり、積み込めない + 이 사람 (%1) 은(는) 의식이 있어 태우지 못합니다 + 此人(%1)是清醒且不能被装载 + 此人(%1)是清醒且不能被裝載 + + %1<br/>loaded into<br/>%2 %1<br/>cargado en<br/>%2 %1<br/>chargé dans<br/>%2 @@ -3271,7 +3147,7 @@ %1<br/>裝載至<br/>%2 %1<br/>装载至<br/>%2 - + Place body in bodybag Colocar cuerpo en bolsa para cadáveres Поместить тело в мешок для трупов @@ -3287,7 +3163,7 @@ 将尸体放入尸袋 將屍體放入屍袋 - + Placing body in bodybag... Colocando cuerpo en bolsa para cadáveres... Упаковка тела... @@ -3303,7 +3179,7 @@ 将尸体放入尸袋中... 將屍體放入屍袋中... - + %1 has bandaged patient %1 has vendado al paciente %1 перевязал пациента @@ -3319,7 +3195,7 @@ %1 已包扎伤者 %1 已包紮傷者 - + %1 performed CPR %1 wykonał cykl RKO %1 provádí CPR @@ -3334,7 +3210,7 @@ %1 已执行心肺复苏术 %1 已執行心肺復甦術 - + %1 used %2 %1 usó %2 %1 benutzt %2 @@ -3350,7 +3226,7 @@ %1 已使用 %2 %1 已使用 %2 - + %1 has given an IV %1 провёл переливание %1 ha puesto una IV @@ -3366,7 +3242,7 @@ %1 已经给予静脉注射液 %1 已經給予靜脈注射液 - + %1 applied a tourniquet %1 aplicado torniquete %1 наложил жгут @@ -3382,7 +3258,7 @@ %1 已经绑上止血带 %1 已經綁上止血帶 - + %1 used Personal Aid Kit %1 hat das eigene Erste-Hilfe-Set verwendet %1 użył apteczki @@ -3397,7 +3273,7 @@ %1 已使用了个人急救包 %1 已使用了個人急救包 - + Heavily wounded Schwer verwundet: Ciężko ranny @@ -3413,7 +3289,7 @@ 重伤 重傷 - + Lightly wounded Leicht verwundet: Lekko ranny @@ -3429,7 +3305,7 @@ 轻伤 輕傷 - + Very lightly wounded Sehr leicht verwundet: B. lekko ranny @@ -3445,7 +3321,7 @@ 小伤 小傷 - + Heal fully bandaged hitpoints Lecz w pełni zabandażowane hitpointy Curar miembros totalmente vendados @@ -3476,7 +3352,7 @@ 治疗中... 治療中... - + Removing Tourniquet... Tourniquet entfernen... Zdejmowanie stazy... @@ -3492,102 +3368,7 @@ 移除军用止血带中... 移除軍用止血帶中... - - Convert vanilla items - 標準アイテムを変換 - Конвертировать ванильные медикаменты - - - Enables or disables whether vanilla medical items are converted to ACE medical items or just removed - 有効化すると標準の治療アイテムは ACE 治療アイテムに変換され、無効化すると削除されます。 - Позволяет преобразовать ванильные медсредства в медикаменты ACE, или удалить их вообще - - - Just remove vanilla medical - 標準の治療アイテムを削除 - Убрать ванильные аптечки - - - Locations PAK - Место использования аптечки - Ograniczenie apteczek osobistych - Ubicaciones del EPA - Orte für Erste-Hilfe-Set - Oblast k použití PAK - Localizações do KPS - Lieu d'utilisation da trousse sanitaire - Elsősegélycsomag helyek - Locazioni Kit Pronto Soccorso - 応急処置キットを使う場所 - 개인응급키트 사용 장소 - 个人急救包使用地点 - 個人急救包使用地點 - - - Remove Surgical Kit (Adv) - Удалять хирургический набор (усл.) - Usuń zestaw chirurgiczny po użyciu - Eliminar equipo quirúrgico (Avanzado) - Entferne Operationskasten (erweitert) - Odebrat chirurgickou soupravu (Pokr.) - Remover kit cirúrgico (avançado) - Consommer les trousses chirurgicales (Av.) - Sebészkészlet (Fejlett) eltávolítása - Rimuovi Kit Chirurgico (Avanzato) - 縫合キットを削除 (アド) - 봉합키트 제거 (고급) - 在使用后删除手术包 (进阶伤口) - 在使用後刪除手術包 (進階傷口) - - - Should Surgical kit be removed on usage? - Нужно ли удалять хирургический набор после использования? - Czy zestaw chirurgiczny powinien zniknąć z ekwipunku po jego użyciu? - Eliminar el equipo quirúrgico después del uso - Entferne Operationskästen bei Verwendung? - Odebrat chirurgickou soupravu po použití? - Deve o kit cirúrgico ser removido após o uso? - La trousse chirurgicale doit être consommée à l'utilisation? - Eltávolítódjon a sebészkészlet használatkor? - Il Kit Chirurgico dev'essere rimosso dopo l'uso? - 縫合キットを使った後に削除しますか? - 봉합키트를 사용하고 나서 제거합니까? - 手术包会在使用后被删除吗? - 手術包會在使用後被刪除嗎? - - - Allow Surgical Kit (Adv) - Хирургический набор может использоваться (усл.) - Ustawienia zestawu chirurgicznego - Permitir equipo quirúrgico (Avanzado) - Erlaube Operationskasten - Povolit chirurgickou soupravu (Pokr.) - Permite kit cirúrgico (avançado) - Permettre les trousses chirurgicales (Avancé) - Sebészkészlet (Fejlett) engedélyezése - Permetti Kit Chirurgico (Avanzato) - 縫合キットの許可 (アド) - 봉합키트 활성화 (고급) - 允许使用手术包 (进阶伤口) - 允許使用手術包 (進階傷口) - - - Who can use the Surgical Kit? - Кто может использовать хирургический набор? - Kto może skorzystać z zestawu chirurgicznego w celu zszycia ran? - ¿Quién puede utilizar el equipo quirúrgico? - Wer kann den Operationskasten verwenden? - Kdo může použít chirurgickou soupravu? - Quem pode usar o kit cirúrgico? - Qui peut utiliser les trousses chirurgicales? - Ki használhatja a sebészkészletet? - Chi può usare il Kit Chirurgico? - だれでも縫合キットを使えるようにしますか? - 어느 인원이 봉합키트를 사용할 수 있습니까? - 谁能够使用手术包? - 誰能夠使用手術包? - - + There is no tourniquet on this body part! An diesem Körperteil befindet sich kein Tourniquet! Na tej części ciała nie ma stazy! @@ -3602,7 +3383,7 @@ 这部位没有止血带! 這部位沒有止血帶! - + When can the PAK be used? Wann kann das Erste-Hilfe-Set verwendet werden? Kdy může být použita osobní lékárnička? @@ -3611,46 +3392,14 @@ Po spełnieniu jakich warunków apteczka osobista może zostać zastosowana na pacjencie? Mikor lehet az elsősegélycsomagot használni? Onde o kit de primeiros socorros pode ser utilizado? - Когда может использоваться аптечка? + Где может использоваться аптечка? Quando può essere usato il Kit Pronto Soccorso? どこでも応急処置キットを使えるようにしますか? 언제 개인응급키트를 사용할 수 있습니까? 何时可以使用个人急救包? 何時可以使用個人急救包? - - Locations Surgical Kit (Adv) - Место использования хирургического набора (усл.) - Ograniczenie zestawu chirurgicznego - Ubicaciones del equipo quirúrgico (Avanzado) - Orte für Operationskästen (erweitert) - Lokace chirurgické soupravy (Pokr.) - Localizações do kit cirúrgico (avançado) - Lieu d'utilisation des trousses chirurgicales - Sebészkészlet (Fejlett) helyei - Località Kit Chirurgico (Avanzato) - 縫合キットを使う場所 (アド) - 봉합키트 사용 장소 (고급) - 手术包使用地点 (进阶伤口) - 手術包使用地點 (進階傷口) - - - Where can the Surgical Kit be used? - Где может использоваться хирургический набор? - Gdzie można korzystać z zestawu chirurgicznego? - Dónde se puede utilizar el equipo quirúrgico - Wo kann der Operationskasten verwendet werden? - Kde může být použita chirurgická souprava? - Onde o kit cirúrgico pode ser utilizado? - Où peut être utilisé les trousses chirurgicales? - Hol lehet a sebészkészletet használni? - Dove può essere usato il Kit Chirurgico? - どこでも縫合キットを使えるようにしますか? - 어디에서 봉합키트를 사용할 수 있게 합니까? - 定义手术包可被使用的地方? - 定義手術包可被使用的地方? - - + Condition Surgical Kit (Adv) Beding. für d. Operationskasten (erw.) Podmínka chirurgické soupravy (Pokr.) @@ -3666,7 +3415,7 @@ 使用手术包的条件 (进阶伤口) 使用手術包的條件 (進階傷口) - + When can the Surgical Kit be used? Wann kann der Operationskasten verwendet werden? Kde může být použita chirurgická souprava? @@ -3675,30 +3424,14 @@ Po spełnieniu jakich warunków zestaw chirurgiczny może zostać zastosowany na pacjencie? Mikor lehet a sebészkészletet használni? Onde o kit cirúrgico pode ser utilizado? - Когда может использоваться хирургический набор? + Где может использоваться хирургический набор? Quando può essere usato il Kit Chirurgico? いつでも縫合キットを使えるようにしますか? 언제 봉합키트를 사용할 수 있습니까? 何时可以使用手术工具包? 何時可以使用手術工具包? - - Where can the PAK be used? - Где может использоваться аптечка? - Gdzie można korzystać z apteczek osobistych? - ¿Dónde se puede utilizar el equipo de primeros auxilios? - Wo kann das Erste-Hilfe-Set verwendet werden? - Kde může být použita osobní lékárnička (PAK)? - Onde o kit de primeiros socorros pode ser utilizado? - Où la trousse sanitaire peut être utilisée ? - Hol lehet az elsősegélycsomagot használni? - Dove può essere usato il Kit Pronto Soccorso? - どこでも応急処置キットを使えるようにしますか? - 어디에서 개인응급키트를 사용할 수 있습니까? - 在哪里可以使用个人急救包? - 在哪裡可以使用個人急救包? - - + Condition PAK Bedingungen für d. Erste-Hilfe-Set Podmínky pro použití osobní lékárničky diff --git a/addons/medical_treatment/ui/items/adenosine_x_ca.paa b/addons/medical_treatment/ui/adenosine_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/adenosine_x_ca.paa rename to addons/medical_treatment/ui/adenosine_ca.paa diff --git a/addons/medical_treatment/ui/items/atropine_x_ca.paa b/addons/medical_treatment/ui/atropine_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/atropine_x_ca.paa rename to addons/medical_treatment/ui/atropine_ca.paa diff --git a/addons/medical_treatment/ui/items/bloodiv_x_ca.paa b/addons/medical_treatment/ui/bloodiv_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/bloodiv_x_ca.paa rename to addons/medical_treatment/ui/bloodiv_ca.paa diff --git a/addons/medical_treatment/ui/items/bodybag_x_ca.paa b/addons/medical_treatment/ui/bodybag_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/bodybag_x_ca.paa rename to addons/medical_treatment/ui/bodybag_ca.paa diff --git a/addons/medical_treatment/ui/items/elasticbandage_x_ca.paa b/addons/medical_treatment/ui/elasticbandage_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/elasticbandage_x_ca.paa rename to addons/medical_treatment/ui/elasticbandage_ca.paa diff --git a/addons/medical_treatment/ui/items/epinephrine_x_ca.paa b/addons/medical_treatment/ui/epinephrine_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/epinephrine_x_ca.paa rename to addons/medical_treatment/ui/epinephrine_ca.paa diff --git a/addons/medical_treatment/ui/items/fielddressing_x_ca.paa b/addons/medical_treatment/ui/fielddressing_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/fielddressing_x_ca.paa rename to addons/medical_treatment/ui/fielddressing_ca.paa diff --git a/addons/medical_treatment/ui/items/morphine_x_ca.paa b/addons/medical_treatment/ui/morphine_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/morphine_x_ca.paa rename to addons/medical_treatment/ui/morphine_ca.paa diff --git a/addons/medical_treatment/ui/items/packingbandage_x_ca.paa b/addons/medical_treatment/ui/packingbandage_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/packingbandage_x_ca.paa rename to addons/medical_treatment/ui/packingbandage_ca.paa diff --git a/addons/medical_treatment/ui/items/personal_aid_kit_x_ca.paa b/addons/medical_treatment/ui/personal_aid_kit_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/personal_aid_kit_x_ca.paa rename to addons/medical_treatment/ui/personal_aid_kit_ca.paa diff --git a/addons/medical_treatment/ui/items/plasmaiv_x_ca.paa b/addons/medical_treatment/ui/plasmaiv_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/plasmaiv_x_ca.paa rename to addons/medical_treatment/ui/plasmaiv_ca.paa diff --git a/addons/medical_treatment/ui/items/quickclot_x_ca.paa b/addons/medical_treatment/ui/quickclot_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/quickclot_x_ca.paa rename to addons/medical_treatment/ui/quickclot_ca.paa diff --git a/addons/medical_treatment/ui/items/salineiv_x_ca.paa b/addons/medical_treatment/ui/salineiv_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/salineiv_x_ca.paa rename to addons/medical_treatment/ui/salineiv_ca.paa diff --git a/addons/medical_treatment/ui/items/surgicalkit_x_ca.paa b/addons/medical_treatment/ui/surgicalkit_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/surgicalkit_x_ca.paa rename to addons/medical_treatment/ui/surgicalkit_ca.paa diff --git a/addons/medical_treatment/ui/items/tourniquet_x_ca.paa b/addons/medical_treatment/ui/tourniquet_ca.paa similarity index 100% rename from addons/medical_treatment/ui/items/tourniquet_x_ca.paa rename to addons/medical_treatment/ui/tourniquet_ca.paa