Expanded the medical settings

This commit is contained in:
Glowbal 2015-03-08 12:05:52 +01:00
parent 657cf14515
commit d016874583
6 changed files with 227 additions and 32 deletions

View File

@ -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;
};
};

View File

@ -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 {

View File

@ -81,6 +81,7 @@ PREP(moduleMedicalSettings);
PREP(moduleAssignMedicRoles);
PREP(moduleAssignMedicalVehicle);
PREP(moduleAssignMedicalFacility);
PREP(moduleTreatmentConfiguration);
GVAR(injuredUnitCollection) = [];
call FUNC(parseConfigForInjuries);

View File

@ -42,4 +42,4 @@ if (GVAR(level) >= 2) then {
} else {
// TODO basic medical
};
_totalBloodLoss;
_totalBloodLoss * GVAR(bleedingCoefficient);

View File

@ -1,6 +1,6 @@
/*
* Author: Glowbal
* Module for adjusting the medical settings
* Module for adjusting the medical damage settings
*
* Arguments:
* 0: The module logic <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);

View File

@ -0,0 +1,30 @@
/*
* Author: Glowbal
* Module for adjusting the medical treatment settings
*
* Arguments:
* 0: The module logic <LOGIC>
* 1: units <ARRAY>
* 2: activated <BOOL>
*
* Return Value:
* None <NIL>
*
* 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);