From d016874583cb51d31824e03cf8bd071d03c9e402 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Sun, 8 Mar 2015 12:05:52 +0100 Subject: [PATCH] Expanded the medical settings --- addons/medical/ACE_Settings.hpp | 50 ++++++ addons/medical/CfgVehicles.hpp | 165 +++++++++++++++--- addons/medical/XEH_preInit.sqf | 1 + addons/medical/functions/fnc_getBloodLoss.sqf | 2 +- .../functions/fnc_moduleMedicalSettings.sqf | 11 +- .../fnc_moduleTreatmentConfiguration.sqf | 30 ++++ 6 files changed, 227 insertions(+), 32 deletions(-) create mode 100644 addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 9aff92449f..a23e269000 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -14,4 +14,54 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {"Players only", "Players and AI"}; }; + class GVAR(maxRevives) { + typeName = "NUMBER"; + value = 1; + }; + class GVAR(enableOverdosing) { + typeName = "BOOL"; + value = true; + }; + class GVAR(bleedingCoefficient) { + typeName = "NUMBER"; + value = 1; + }; + + class GVAR(enableAirway) { + typeName = "BOOL"; + value = false; + }; + class GVAR(enableFractures) { + typeName = "BOOL"; + value = false; + }; + class GVAR(enableAdvancedWounds) { + typeName = "BOOL"; + value = false; + }; + class GVAR(enableVehicleCrashes) { + typeName = "BOOL"; + value = true; + }; + class GVAR(enableScreams) { + typeName = "BOOL"; + value = true; + }; + class GVAR(playerDamageThreshold) { + typeName = "NUMBER"; + value = 1; + }; + class GVAR(AIDamageThreshold) { + typeName = "NUMBER"; + value = 1; + }; + class GVAR(enableUnsconsiousnessAI) { + value = 1; + typeName = "NUMBER"; + values[] = {"Disabled", "Enabled", "50/50"}; + }; + class GVAR(preventInstaDeath) { + typeName = "BOOL"; + value = false; + }; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 9861b1d3f6..39cff67731 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -7,7 +7,7 @@ class CfgVehicles { }; }; // TODO localization for all the modules - class ACE_moduleMedicalSettings: Module_F { + class ACE_moduleMedicalSettings: Module_F { scope = 2; displayName = "Medical Settings [ACE]"; icon = QUOTE(PATHTOF(ui\moduleIcon.paa)); @@ -17,7 +17,7 @@ class CfgVehicles { isGlobal = 1; isTriggerActivated = 0; author = "Glowbal"; - class Arguments { + class Arguments { class level { displayName = "Medical Level"; description = "What is the medical simulation level?"; @@ -38,26 +38,6 @@ class CfgVehicles { }; }; }; - class medicSetting { - displayName = "Medics setting"; - description = "What is the level of detail prefered for medics?"; - typeName = "NUMBER"; - class values { - class disable { - name = "Disable medics"; - value = 0; - }; - class normal { - name = "Normal"; - value = 1; - default = 1; - }; - class full { - name = "Advanced"; - value = 2; - }; - }; - }; class enableFor { displayName = "Enabled for"; description = "Select what units the medical system will be enabled for"; @@ -74,6 +54,74 @@ class CfgVehicles { }; }; }; + class enableAirway { + displayName = "Enable Airway"; + description = "Enable Advanced medical Airway"; + typeName = "BOOL"; + defaultValue = 0; + }; + class enableFractures { + displayName = "Enable Fractures"; + description = "Enable Advanced medical Fractures"; + typeName = "BOOL"; + defaultValue = 0; + }; + class enableAdvancedWounds { + displayName = "Enable Advanced wounds"; + description = "Allow reopening of bandaged wounds?"; + typeName = "BOOL"; + defaultValue = 0; + }; + class enableVehicleCrashes { + displayName = "Vehicle Crashes"; + description = "Do units take damage from a vehicle crash?"; + typeName = "BOOL"; + defaultValue = 1; + }; + class enableScreams { + displayName = "Enable Screams"; + description = "Enable screaming by injuried units"; + typeName = "BOOL"; + defaultValue = 1; + }; + class playerDamageThreshold { + displayName = "Player Damage"; + description = "What is the damage a player can take before being killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class AIDamageThreshold { + displayName = "AI Damage"; + description = "What is the damage an AI can take before being killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class enableUnsconsiousnessAI { + displayName = "AI Unconsciousness"; + description = "Allow AI to go unconscious"; + typeName = "NUMBER"; + class values { + class disable { + name = "Disabled"; + value = 0; + }; + class normal { + name = "Enabled"; + value = 1; + default = 1; + }; + class full { + name = "50/50"; + value = 2; + }; + }; + }; + class preventInstaDeath { + displayName = "Prevent instant death"; + description = "Have a unit move to unconscious instead of death"; + typeName = "BOOL"; + defaultValue = 0; + }; }; class ModuleDescription { description = "Provides a medical system for both players and AI."; @@ -81,6 +129,63 @@ class CfgVehicles { }; }; + class ACE_moduleTreatmentConfiguration: Module_F { + scope = 2; + displayName = "Treatment Configuration [ACE]"; + icon = QUOTE(PATHTOF(ui\moduleIcon.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleTreatmentConfiguration)); + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Glowbal"; + class Arguments { + class medicSetting { + displayName = "Medics setting"; + description = "What is the level of detail prefered for medics?"; + typeName = "NUMBER"; + class values { + class disable { + name = "Disable medics"; + value = 0; + }; + class normal { + name = "Normal"; + value = 1; + default = 1; + }; + class full { + name = "Advanced"; + value = 2; + }; + }; + }; + class maxRevives { + displayName = "Max revives"; + description = "Max amount of revives available (when preventing death)"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class enableOverdosing { + displayName = "Enable Overdosing"; + description = "Enable overdosing of medications"; + typeName = "BOOL"; + defaultValue = 1; + }; + class bleedingCoefficient { + displayName = "Bleeding coefficient"; + description = "Coefficient to modify the bleeding speed"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Configure the treatment settings from ACE Medical"; + sync[] = {}; + }; + }; + class ACE_moduleAssignMedicRoles: Module_F { scope = 2; displayName = "Set Medic Class [ACE]"; @@ -92,11 +197,12 @@ class CfgVehicles { isTriggerActivated = 0; isDisposable = 0; author = "Glowbal"; - class Arguments { + class Arguments { class EnableList { displayName = "List"; description = "List of unit names that will be classified as medic, separated by commas."; defaultValue = ""; + typeName = "STRING"; }; class role { displayName = "Is Medic"; @@ -126,28 +232,29 @@ class CfgVehicles { }; }; - class ACE_moduleAssignMedicRoles: Module_F { + class ACE_moduleAssignMedicVehicle: Module_F { scope = 2; - displayName = "Set Medic Class [ACE]"; + displayName = "Set Medical Vehicle [ACE]"; icon = QUOTE(PATHTOF(ui\moduleIcon.paa)); category = "ACE_medical"; - function = QUOTE(FUNC(moduleAssignMedicRoles)); + function = QUOTE(FUNC(moduleAssignMedicalVehicle)); functionPriority = 10; isGlobal = 2; isTriggerActivated = 0; isDisposable = 0; author = "Glowbal"; - class Arguments { + class Arguments { class EnableList { displayName = "List"; - description = "List of unit names that will be classified as medic, separated by commas."; + description = "List of vehicles that will be classified as medical vehicle, separated by commas."; defaultValue = ""; + typeName = "STRING"; }; class enabled { displayName = "Is Medical Vehicle"; description = "Whatever or not the objects in the list will be a medical vehicle."; typeName = "BOOL"; - defaultValue = true; + defaultValue = 1; }; }; class ModuleDescription { diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 2ffe7a56fc..0ae17e2f4a 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -81,6 +81,7 @@ PREP(moduleMedicalSettings); PREP(moduleAssignMedicRoles); PREP(moduleAssignMedicalVehicle); PREP(moduleAssignMedicalFacility); +PREP(moduleTreatmentConfiguration); GVAR(injuredUnitCollection) = []; call FUNC(parseConfigForInjuries); diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 371cce1b3a..ef0a97ea35 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -42,4 +42,4 @@ if (GVAR(level) >= 2) then { } else { // TODO basic medical }; -_totalBloodLoss; +_totalBloodLoss * GVAR(bleedingCoefficient); diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index af5235ba35..003cf2afcf 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -1,6 +1,6 @@ /* * Author: Glowbal - * Module for adjusting the medical settings + * Module for adjusting the medical damage settings * * Arguments: * 0: The module logic @@ -23,5 +23,12 @@ _activated = _this select 2; if !(_activated) exitWith {}; [_logic, QGVAR(level), "level"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(medicSetting), "medicSetting"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableFor), "enableFor"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableAirway), "enableAirway"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableFractures), "enableFractures"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableAdvancedWounds), "enableAdvancedWounds"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableScreams), "enableScreams"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableUnsconsiousnessAI), "enableUnsconsiousnessAI"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf b/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf new file mode 100644 index 0000000000..74d663ba1e --- /dev/null +++ b/addons/medical/functions/fnc_moduleTreatmentConfiguration.sqf @@ -0,0 +1,30 @@ +/* + * Author: Glowbal + * Module for adjusting the medical treatment settings + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic", "_units", "_activated"]; +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(medicSetting), "medicSetting"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(maxRevives), "maxRevives"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(enableOverdosing), "enableOverdosing"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); + +