diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index ac67ce7dac..c081efc27f 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -181,12 +181,43 @@ class CfgVehicles sync[] = {}; }; }; + + class ACE_moduleDamageSettings: Module_F { + scope = 2; + displayName = "Damage Settings [ACE]"; + icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleDamageSettings)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Glowbal"; + class Arguments { + class damageThresholdAI { + displayName = "Damage Threshold AI"; + description = "How much damage does it take for an AI to be killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class damageThresholdPlayers { + displayName = "Damage Threshold Players"; + description = "How much damage does it take for a player to be killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Custom damage threshold module"; + sync[] = {}; + }; + }; + class ACE_moduleAssignMedicRoles: Module_F { scope = 2; displayName = "Set Medic Class [ACE]"; icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); category = "ACE_medical"; - function = QUOTE(FUNC(assignMedicRoles)); + function = QUOTE(FUNC(moduleAssignMedicRoles)); functionPriority = 10; isGlobal = 2; isTriggerActivated = 0; @@ -216,7 +247,7 @@ class CfgVehicles displayName = "set Medical Vehicle [ACE]"; icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); category = "ACE_medical"; - function = QUOTE(FUNC(assignMedicalVehicle)); + function = QUOTE(FUNC(moduleAssignMedicalVehicle)); functionPriority = 10; isGlobal = 2; isTriggerActivated = 0; @@ -246,7 +277,7 @@ class CfgVehicles displayName = "Set Medical Facility [ACE]"; icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); category = "ACE_medical"; - function = QUOTE(FUNC(assignMedicalFacility)); + function = QUOTE(FUNC(moduleAssignMedicalFacility)); functionPriority = 10; isGlobal = 2; isTriggerActivated = 0; @@ -269,7 +300,7 @@ class CfgVehicles displayName = "Assign Medical Equipment [ACE]"; icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); category = "ACE_medical"; - function = QUOTE(FUNC(assignMedicalEquipment)); + function = QUOTE(FUNC(moduleAssignMedicalEquipment)); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 8b60af3557..0d588e2fe4 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -240,6 +240,3 @@ ADD_TREATMENT_MEDICATION("STR_ACE_ACTION_EPINEPHRINE","STR_ACE_ACTION_EPINEPHRIN ((vehicle _target != _target)); }, {[_this select 0,_this select 1] call FUNC(actionUnloadUnit)},'drag'] call FUNC(addTreatmentOption); - -systemchat format["finished postInit"]; -diag_log format["finished postInit"]; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 89687a25b0..1c81d6de96 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -93,11 +93,11 @@ PREP(isMedicalVehicle); PREP(isSetTreatmentMutex); PREP(isMovingUnit); - PREP(moduleAssignMedicalEquipment); PREP(moduleAssignMedicalFacility); PREP(moduleAssignMedicalVehicle); PREP(moduleAssignMedicRoles); +PREP(moduleDamageSettings); PREP(onInitForUnit); PREP(onInjury_assignAirwayStatus); diff --git a/addons/medical/functions/fnc_ActionCheckPulse.sqf b/addons/medical/functions/fnc_ActionCheckPulse.sqf index d18bb76bc5..52e9158329 100644 --- a/addons/medical/functions/fnc_ActionCheckPulse.sqf +++ b/addons/medical/functions/fnc_ActionCheckPulse.sqf @@ -22,7 +22,7 @@ _content = ["STR_ACE_CHECK_PULSE_CONTENT"]; [_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; -[2 + round(random(6)), +[2 + round(random(1)), {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition { private ["_caller","_target"]; @@ -37,5 +37,3 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; }, // on failure [_caller, _target] // arguments ] call EFUNC(gui,loadingBar); - -systemChat format["actionCheckPulse: %1", _this]; \ No newline at end of file diff --git a/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf b/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf index f9e74a631b..d96ae8b19c 100644 --- a/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf @@ -22,7 +22,7 @@ _content = ["STR_ACE_CHECK_BLOODPRESSURE_CONTENT"]; [_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; -[2 + round(random(4)), +[2 + round(random(1)), {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition { private ["_caller","_target"]; diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 54898f0b5d..ae69f52272 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -14,7 +14,6 @@ private ["_caller","_unit", "_heartRateOutput", "_heartRate","_logOutPut", "_tit _caller = _this select 0; _unit = _this select 1; -systemChat format["called check pulse: %1", _this]; _heartRate = [_unit,QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); if (!alive _unit) then { @@ -50,6 +49,3 @@ _content = ["STR_ACE_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput]; if (_logOutPut != "") then { [_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToQuickViewLog); }; - -systemChat format["completed check pulse: %1 %2 %3 %4", _this, _logOutPut, _title, _content]; -diag_log format["completed check pulse: %1 %2 %3 %4", _this, _logOutPut, _title, _content]; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 3f6f31a822..d2201e15f2 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -22,7 +22,7 @@ _content = ["STR_ACE_CHECK_RESPONSE_CONTENT"]; [_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; -[2 + round(random(2)), +[2 + round(random(1)), {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition { private ["_caller","_target", "_output", "_title", "_content"]; diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf index ba2adcc482..f82e0fd5e4 100644 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -26,6 +26,4 @@ if ([_unit] call FUNC(hasMedicalEnabled)) then { }; if (_unit in GVAR(injuredUnitCollection)) exitwith {}; GVAR(injuredUnitCollection) pushback _unit; -} else { - systemChat format["has no medical system enabled: %1",_unit]; }; diff --git a/addons/medical/functions/fnc_addToQuickViewLog.sqf b/addons/medical/functions/fnc_addToQuickViewLog.sqf index 9943c55fc6..ddac44c3b2 100644 --- a/addons/medical/functions/fnc_addToQuickViewLog.sqf +++ b/addons/medical/functions/fnc_addToQuickViewLog.sqf @@ -16,8 +16,6 @@ _unit = _this select 0; _type = _this select 1; _message = _this select 2; -systemChat format["Added event to quick view: %1", _this]; - if (!local _unit) exitwith { [_this, QUOTE(FUNC(addToQuickViewLog)), _unit] call EFUNC(common,execRemoteFnc); }; diff --git a/addons/medical/functions/fnc_determineIfFatal.sqf b/addons/medical/functions/fnc_determineIfFatal.sqf index d407ff783a..a9f5597f11 100644 --- a/addons/medical/functions/fnc_determineIfFatal.sqf +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -10,8 +10,6 @@ #include "script_component.hpp" -#define DEFAULT_DAMAGE_THRESHOLD 1 - private ["_unit","_part","_damageThreshold"]; _unit = _this select 0; _part = _this select 1; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index eb3b5ecbcc..8bb99300c9 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -10,8 +10,6 @@ #include "script_component.hpp" -#define ARMOURCOEF 2 - private ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage", "_typeOfProjectile","_bodyPartn","_newDamage","_typeOfDamage","_caliber", "_hitPointName", "_returnDamage", "_varCheck"]; _unit = _this select 0; _selectionName = _this select 1; @@ -43,23 +41,22 @@ if (isNull _sourceOfDamage && (_selectionName == "head" || isBurning _unit) && _ 0 }; // Prefent excessive fire damage +// Ensure damage is being handled correctly. +_newDamage = [_unit, _amountOfDamage, _bodyPartn] call FUNC(getNewDamageBodyPart); +[_unit] call FUNC(setDamageBodyPart); + if ([_unit] call FUNC(hasMedicalEnabled)) then { _returnDamage = 0; if (_amountOfDamage < 0) then { _amountOfDamage = 0; }; - // Ensure damage is being handled correctly. - _newDamage = [_unit, _amountOfDamage, _bodyPartn] call FUNC(getNewDamageBodyPart); - [_unit] call FUNC(setDamageBodyPart); - // figure out the type of damage so we can use that to determine what injures should be given. _typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); [_unit, _newDamage, _typeOfDamage, _bodyPartn] call FUNC(onInjury_assignOpenWounds); if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) > 0) then { - //[_unit,_newDamage,_typeOfDamage,_bodyPartn] call FUNC(onInjury_assignFractures); if (GVAR(setting_allowAirwayInjuries)) then { [_unit, _amountOfDamage, _typeOfDamage, _bodyPartn] call FUNC(onInjury_assignAirwayStatus); }; @@ -84,7 +81,13 @@ if ([_unit] call FUNC(hasMedicalEnabled)) then { }; ["Medical_onHandleDamage", _this] call ace_common_fnc_localEvent; } else { - // handle damage thresholds + if (_returnDamage > 0.957) then { + _returnDamage = 0.957; + }; + if (([_unit, _bodyPartn] call FUNC(determineIfFatal)) || !(alive (vehicle _unit))) then { + [_unit] call FUNC(setDead); + _returnDamage = 1; + }; }; -_returnDamage \ No newline at end of file +_returnDamage; diff --git a/addons/medical/functions/fnc_handleTreatment.sqf b/addons/medical/functions/fnc_handleTreatment.sqf index 262ae137f4..929dcfdbb0 100644 --- a/addons/medical/functions/fnc_handleTreatment.sqf +++ b/addons/medical/functions/fnc_handleTreatment.sqf @@ -11,9 +11,6 @@ #include "script_component.hpp" -diag_log format["handleTreatment has been called - args: %1 ",_this]; -systemChat format["handleTreatment has been called - args: %1 ",_this]; - private ["_treatingPerson","_injuredPerson","_selectionName","_removeItem","_attributes","_patient", "_continue", "_prevAnim"]; _caller = _this select 0; _target = _this select 1; diff --git a/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf index 04315656d6..c6a09fa4de 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf @@ -16,8 +16,6 @@ _target = _this select 1; _selectionName = _this select 2; _removeItem = _this select 3; -systemChat format ["Local bandage: %1",_this]; - // TODO figure this out later on //_selectedData = [_this, 4, "", [""]] call BIS_fnc_Param; diff --git a/addons/medical/functions/fnc_handleTreatment_Action_tourniquet.sqf b/addons/medical/functions/fnc_handleTreatment_Action_tourniquet.sqf index 8e20e906e1..6b9e9b3f5d 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_tourniquet.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_tourniquet.sqf @@ -16,8 +16,6 @@ _target = _this select 1; _selectionName = _this select 2; _removeItem = _this select 3; -systemChat format["fnc_handleTreatment_Action_tourniquet %1", _this]; - _part = [_selectionName] call FUNC(getBodyPartNumber); if (_part == 0 || _part == 1) exitwith { [_caller,"You cannot apply a CAT on this body part!"] call EFUNC(common,sendHintTo); diff --git a/addons/medical/functions/fnc_inMedicalFacility.sqf b/addons/medical/functions/fnc_inMedicalFacility.sqf index 1e175ffccb..8f86fbab8b 100644 --- a/addons/medical/functions/fnc_inMedicalFacility.sqf +++ b/addons/medical/functions/fnc_inMedicalFacility.sqf @@ -11,7 +11,7 @@ #include "script_component.hpp" private ["_unit","_eyePos","_objects","_isInBuilding","_medicalFacility"]; -_unit = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_Param; +_unit = _this select 0; _eyePos = eyePos _unit; _isInBuilding = false; diff --git a/addons/medical/functions/fnc_moduleDamageSettings.sqf b/addons/medical/functions/fnc_moduleDamageSettings.sqf new file mode 100644 index 0000000000..9040d2ff81 --- /dev/null +++ b/addons/medical/functions/fnc_moduleDamageSettings.sqf @@ -0,0 +1,20 @@ +/** + * fnc_moduleDamageSettings.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_logic","_setting","_objects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + GVAR(damageThreshold_AI) = _logic getvariable ["damageThresholdAI", 1]; + GVAR(damageThreshold_Players) = _logic getvariable ["damageThresholdPlayers", 1]; +}; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_onInitForUnit.sqf b/addons/medical/functions/fnc_onInitForUnit.sqf index a0590b1d44..596dc38b98 100644 --- a/addons/medical/functions/fnc_onInitForUnit.sqf +++ b/addons/medical/functions/fnc_onInitForUnit.sqf @@ -13,9 +13,6 @@ private ["_unit","_handler"]; _unit = _this select 0; -systemChat format["Initalizing CMS for %1", _this]; -diag_log format["Initalizing CMS for %1", _this]; - if (!local _unit) exitwith {}; if !(_unit isKindOf "CAManBase") exitwith{}; diff --git a/addons/medical/functions/fnc_onMenuOpen.sqf b/addons/medical/functions/fnc_onMenuOpen.sqf index 1cfae51a29..5597dacce1 100644 --- a/addons/medical/functions/fnc_onMenuOpen.sqf +++ b/addons/medical/functions/fnc_onMenuOpen.sqf @@ -35,7 +35,6 @@ _display = _this select 0; //uiNamespace getVariable QGVAR(medicalMenu); if (isnil "_display") exitwith { }; -systemChat format["onMenuOpen: %1", _this]; (_display displayCtrl 11) ctrlSetTooltip localize "STR_ACE_UI_VIEW_TRIAGE_CARD"; (_display displayCtrl 12) ctrlSetTooltip localize "STR_ACE_UI_EXAMINE_PATIENT";