Settings overhaul

New settings:
* allowSelfIV
* showPainInMenu

Converted CBA -> ACE Settings:
* advancedBandages
* advancedMedication
* fatalInjuryCondition
* cardiacArrestTime

Fixed settings:
* useLocation_Epi
* medicSetting_Epi
* painCoefficient
This commit is contained in:
ulteq 2016-12-14 20:44:06 +01:00
parent dafefda04a
commit 151d4a4bfe
7 changed files with 110 additions and 95 deletions

View File

@ -14,6 +14,7 @@ class ACE_Settings {
value = 0;
typeName = "BOOL";
};
/* @todo
class GVAR(enableFor) {
category = CSTRING(Category_Medical);
displayName = CSTRING(AdvancedMedicalSettings_enableFor_DisplayName);
@ -22,6 +23,7 @@ class ACE_Settings {
typeName = "SCALAR";
values[] = {"Players only", "Players and AI"};
};
*/
class GVAR(bleedingCoefficient) {
category = CSTRING(Category_Medical);
displayName = CSTRING(MedicalSettings_bleedingCoefficient_DisplayName);
@ -36,13 +38,28 @@ class ACE_Settings {
typeName = "SCALAR";
value = 1;
};
class GVAR(enableAdvancedWounds) {
class GVAR(advancedBandages) {
category = CSTRING(Category_Medical);
displayName = CSTRING(AdvancedMedicalSettings_advancedBandages_DisplayName);
description = CSTRING(AdvancedMedicalSettings_advancedBandages_Description);
typeName = "BOOL";
value = 1;
};
class GVAR(advancedMedication) {
category = CSTRING(Category_Medical);
displayName = CSTRING(AdvancedMedicalSettings_advancedMedication_DisplayName);
description = CSTRING(AdvancedMedicalSettings_advancedMedication_Description);
typeName = "BOOL";
value = 1;
};
class GVAR(woundReopening) {
category = CSTRING(Category_Medical);
displayName = CSTRING(AdvancedMedicalSettings_enableAdvancedWounds_DisplayName);
description = CSTRING(AdvancedMedicalSettings_enableAdvancedWounds_Description);
typeName = "BOOL";
value = 1;
};
/* @todo
class GVAR(enableVehicleCrashes) {
category = CSTRING(Category_Medical);
displayName = CSTRING(AdvancedMedicalSettings_enableVehicleCrashes_DisplayName);
@ -50,6 +67,7 @@ class ACE_Settings {
typeName = "BOOL";
value = 1;
};
*/
class GVAR(enableScreams) {
category = CSTRING(Category_Medical);
displayName = CSTRING(MedicalSettings_enableScreams_DisplayName);
@ -57,6 +75,14 @@ class ACE_Settings {
typeName = "BOOL";
value = 1;
};
class GVAR(showPainInMenu) {
category = CSTRING(Category_Medical);
displayName = CSTRING(MedicalSettings_showPainInMenu_DisplayName);
description = CSTRING(MedicalSettings_showPainInMenu_Description);
typeName = "SCALAR";
value = 0;
values[] = {"Anyone", "Medics only", "Doctors only"};
};
class GVAR(playerDamageThreshold) {
category = CSTRING(Category_Medical);
displayName = CSTRING(MedicalSettings_playerDamageThreshold_DisplayName);
@ -71,25 +97,25 @@ class ACE_Settings {
typeName = "SCALAR";
value = 1.05;
};
class GVAR(enableUnconsciousnessAI) {
class GVAR(fatalInjuryCondition) {
category = CSTRING(Category_Medical);
displayName = CSTRING(MedicalSettings_enableUnconsciousnessAI_DisplayName);
description = CSTRING(MedicalSettings_enableUnconsciousnessAI_Description);
value = 2;
displayName = CSTRING(MedicalSettings_fatalInjuryCondition_DisplayName);
description = CSTRING(MedicalSettings_fatalInjuryCondition_Description);
value = 0;
typeName = "SCALAR";
values[] = {"Disabled", "50/50", "Enabled"};
values[] = {"Always", "In Cardiac Arrest", "Never"};
};
class GVAR(remoteControlledAI) {
class GVAR(cardiacArrestTime) {
category = CSTRING(Category_Medical);
displayName = CSTRING(MedicalSettings_remoteControlledAI_DisplayName);
description = CSTRING(MedicalSettings_remoteControlledAI_Description);
typeName = "BOOL";
value = 1;
displayName = CSTRING(MedicalSettings_cardiacArrestTime_DisplayName);
description = CSTRING(MedicalSettings_cardiacArrestTime_Description);
value = 30;
typeName = "SCALAR";
};
class GVAR(medicSetting_basicEpi) {
class GVAR(medicSetting_Epi) {
category = CSTRING(Category_Medical);
displayName = CSTRING(BasicMedicalSettings_medicSetting_basicEpi_DisplayName);
description = CSTRING(BasicMedicalSettings_medicSetting_basicEpi_Description);
displayName = CSTRING(BasicMedicalSettings_medicSetting_Epi_DisplayName);
description = CSTRING(BasicMedicalSettings_medicSetting_Epi_Description);
typeName = "SCALAR";
value = 0;
values[] = {"Anyone", "Medics only", "Doctors only"};
@ -142,10 +168,10 @@ class ACE_Settings {
value = 1;
values[] = {"No", "Yes"};
};
class GVAR(useLocation_basicEpi) {
class GVAR(useLocation_Epi) {
category = CSTRING(Category_Medical);
displayName = CSTRING(BasicMedicalSettings_useLocation_basicEpi_DisplayName);
description = CSTRING(BasicMedicalSettings_useLocation_basicEpi_Description);
displayName = CSTRING(BasicMedicalSettings_useLocation_Epi_DisplayName);
description = CSTRING(BasicMedicalSettings_useLocation_Epi_Description);
typeName = "SCALAR";
value = 0;
values[] = {CSTRING(AdvancedMedicalSettings_anywhere), CSTRING(AdvancedMedicalSettings_vehicle), CSTRING(AdvancedMedicalSettings_facility), CSTRING(AdvancedMedicalSettings_vehicleAndFacility), ECSTRING(common,Disabled)};
@ -210,4 +236,12 @@ class ACE_Settings {
typeName = "SCALAR";
value = 1;
};
class GVAR(allowSelfIV) {
category = CSTRING(Category_Medical);
displayName = CSTRING(MedicalSettings_allowSelfIV_DisplayName);
description = CSTRING(MedicalSettings_allowSelfIV_Description);
typeName = "SCALAR";
value = 0;
values[] = {"No", "Yes"};
};
};

View File

@ -11,7 +11,7 @@ GVAR(SELECTIONS) = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"];
GVAR(STATE_MACHINE) = (configFile >> "ACE_Medical_StateMachine") call CBA_statemachine_fnc_createFromConfig;
// @todo, ACE_Settings
/*
[
QGVAR(advancedBandages),
"CHECKBOX",
@ -51,5 +51,6 @@ GVAR(STATE_MACHINE) = (configFile >> "ACE_Medical_StateMachine") call CBA_statem
[0, 30, 2, 0],
true
] call CBA_Settings_fnc_init;
*/
ADDON = true;

View File

@ -22,6 +22,8 @@ if (!local _unit) exitWith { ERROR("unit is not local"); };
TRACE_2("ACE_DEBUG: adjustPainLevel Called",_unit,_desiredPainLevel);
_desiredPainLevel = _desiredPainLevel * GVAR(painCoefficient);
private _pain = _unit getVariable [QGVAR(pain), 0];
_pain = 0 max (_pain max _desiredPainLevel) min 1;

View File

@ -2770,6 +2770,12 @@
<Italian>Abilita Grida da parte delle unità ferite</Italian>
<Japanese>負傷したユニットが叫ぶように</Japanese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_showPainInMenu_DisplayName">
<English>Show pain</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_showPainInMenu_Description">
<English>Who can see the pain status in the medical menu</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_playerDamageThreshold_DisplayName">
<English>Player Damage</English>
<Russian>Урон игроку</Russian>
@ -2822,57 +2828,17 @@
<Italian>Quanto è il danno che un'IA può sostenere prima di essere uccisa?</Italian>
<Japanese>AI が死に始める前に損傷を受けるようにしますか?</Japanese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_enableUnconsciousnessAI_DisplayName">
<English>AI Unconsciousness</English>
<Russian>Потеря сознания ботами</Russian>
<Polish>Nieprzytomność AI</Polish>
<Spanish>Inconsciencia IA</Spanish>
<German>KI-Bewusstlosigkeit</German>
<Czech>Bezvědomí AI</Czech>
<Portuguese>Inconsciência da IA</Portuguese>
<French>Inconscience des IA</French>
<Hungarian>AI eszméletlenség</Hungarian>
<Italian>Incoscienza IA</Italian>
<Japanese>AI の気絶</Japanese>
<Key ID="STR_ACE_Medical_MedicalSettings_fatalInjuryCondition_DisplayName">
<English>Fatal Injury</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_enableUnconsciousnessAI_Description">
<English>Allow AI to go unconscious</English>
<Russian>Позволить ботам терять сознание</Russian>
<Polish>Czy AI może być nieprzytomne od odniesionych obrażeń?</Polish>
<Spanish>Permita a la IA caer inconsciente</Spanish>
<German>KI kann bewusstlos werden</German>
<Czech>Umožňuje AI upadnout do bezvědomí</Czech>
<Portuguese>Permite IA ficar inconsciente</Portuguese>
<French>Autoriser les IA à tomber inconscients</French>
<Hungarian>Engedélyezi az AI eszméletének elvesztését</Hungarian>
<Italian>Permetti alle IA di diventare incoscienti</Italian>
<Japanese>AI が気絶をするように</Japanese>
<Key ID="STR_ACE_Medical_MedicalSettings_fatalInjuryCondition_Description">
<English>Defines when you can receive a fatal injury</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_remoteControlledAI_DisplayName">
<English>Remote Controlled AI</English>
<German>Ferngesteuerte KI-Einheiten</German>
<Spanish>IA controlada remotamente</Spanish>
<Portuguese>IA controlada remotamente</Portuguese>
<Polish>Zdalnie sterowane AI</Polish>
<Czech>Vzdáleně ovládané AI</Czech>
<French>Contrôle à distance des IA</French>
<Hungarian>Távvezérelt AI</Hungarian>
<Russian>Зевса считать ботом</Russian>
<Italian>IA Controllate in Remoto</Italian>
<Japanese>遠隔操作された AI</Japanese>
<Key ID="STR_ACE_Medical_MedicalSettings_cardiacArrestTime_DisplayName">
<English>CA time</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_remoteControlledAI_Description">
<English>Treat remote controlled units as AI not players?</English>
<German>Legt fest, ob ferngesteuerte Einheiten als KI anstatt als Spieler behandelt werden sollen.</German>
<Spanish>¿Tratar unidades remotamente controladas como IA?</Spanish>
<Portuguese>Tratar unidades remotamente controladas como IA?</Portuguese>
<Polish>Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy?</Polish>
<Czech>Ošetřit vzdáleně ovládané jednotky jako AI, ne jako hráče?</Czech>
<French>Soigner les unitées controlées à distance comme des IA et non comme des joueurs?</French>
<Hungarian>Távvezérelt egységek AI-ként, nem játékosként való kezelése?</Hungarian>
<Russian>Обрабатывать дистанционно управляемых юнитов как ботов, а не как игроков?</Russian>
<Italian>Considera le unità controllate in remoto come IA e non come giocatori?</Italian>
<Japanese>遠隔操作された AI は、非プレイヤーとして扱いますか?</Japanese>
<Key ID="STR_ACE_Medical_MedicalSettings_cardiacArrestTime_Description">
<English>Defines how long it takes to die from cardiac arrest?</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_bleedingCoefficient_DisplayName">
<English>Bleeding coefficient</English>
@ -2926,6 +2892,18 @@
<Italian>Coefficiente che modifica l'intensità del dolore</Italian>
<Japanese>この係数では痛みの強さを変更できます</Japanese>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_advancedBandages_DisplayName">
<English>Advanced Bandages</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_advancedBandages_Description">
<English>Enable advanced bandages</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_advancedMedication_DisplayName">
<English>Advanced Medication</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_advancedMedication_Description">
<English>Enable advanced medication</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_Module_Description">
<English>Provides a medical system for both players and AI.</English>
<Russian>Включает медицинскую систему как для игроков, так и для ботов.</Russian>
@ -2945,6 +2923,12 @@
<Key ID="STR_ACE_Medical_MedicalSettings_ivFlowRate_Description">
<English>Effects how quickly IV Bags will have effect</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_allowSelfIV_DisplayName">
<English>Self IV Transfusion</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_allowSelfIV_Description">
<English>Allows using IV Transfusions on yourself</English>
</Key>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_Module_DisplayName">
<English>Basic Medical Settings [ACE]</English>
<German>Standard Sanitätseinstellungen [ACE]</German>
@ -3074,7 +3058,7 @@
<Italian>Le unità sostengono danni da incidenti con veicoli?</Italian>
<Japanese>ユニットは車両の衝突による損傷を受けるようにしますか?</Japanese>
</Key>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_medicSetting_basicEpi_DisplayName">
<Key ID="STR_ACE_Medical_BasicMedicalSettings_medicSetting_Epi_DisplayName">
<English>Allow Epinephrine</English>
<German>Erlaube Epiniphrin</German>
<Spanish>Permitir Epinefrina</Spanish>
@ -3086,17 +3070,8 @@
<Russian>Разрешить Адреналин</Russian>
<Japanese>アドレナリンの許可</Japanese>
</Key>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_medicSetting_basicEpi_Description">
<English>Who can use Epinephrine for full heal? (Basic medical only)</English>
<German>Wer darf Epiniphrin zur vollständigen Heilung benutzen? (Standard Sanitätseinstellungen)</German>
<Spanish>Configura quienes pueden usar Epinefrina (Solo sistema médico básico)</Spanish>
<Polish>Kto może skorzystać z adrenaliny w celu pełnego uleczenia? (Tylko podstawowy system medyczny)</Polish>
<French>Qui peut utiliser l'adrénaline pour les soins complets ? (Médical basique seulement)</French>
<Italian>Chi può usare l'epinefrina per la cura completa? (solo per sistema medico di base)</Italian>
<Czech>Kdo může použít adrenalin k úplnému vyléčení? (Pouze základní zdravotní systém)</Czech>
<Portuguese>Quem pode usar Epinefrina para cura completa? (Somente sistema médico básico)</Portuguese>
<Russian>Кому разрешено использовать адреналин для полного излечения? (Только для базовой медицины)</Russian>
<Japanese>完全に回復できるよう誰しもがアドレナリンを使えるようにしますか?(ベーシック医療のみ)</Japanese>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_medicSetting_Epi_Description">
<English>Who can use Epinephrine?</English>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_medicSetting_Medkit_DisplayName">
<English>Allow Medkit</English>
@ -3201,7 +3176,7 @@
<Italian>Il Kit Pronto Soccorso dev'essere rimosso dopo l'utilizzo?</Italian>
<Japanese>応急処置キットを使うと削除しますか?</Japanese>
</Key>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_useLocation_basicEpi_DisplayName">
<Key ID="STR_ACE_Medical_BasicMedicalSettings_useLocation_Epi_DisplayName">
<English>Locations Epinephrine</English>
<German>Orte für Epiniphrin</German>
<Spanish>Ubicaciones epinefrina</Spanish>
@ -3213,17 +3188,8 @@
<Russian>Место использования адреналина</Russian>
<Japanese>アドレナリンをつかう場所</Japanese>
</Key>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_useLocation_basicEpi_Description">
<English>Where can the Epinephrine be used? (Basic Medical)</English>
<German>Wo kann Epiniphrin verwendet werden? (Standard Sanitätseinstellungen)</German>
<Spanish>Configura donde puede usarse Epinefrina (Solo sistema médico básico)</Spanish>
<Polish>Gdzie można korzystać z adrenaliny? (Podstawowy system medyczny)</Polish>
<French>Où peuvent être utilisées les adrénalines ? (Médical basique)</French>
<Italian>Dove si può usare l'epinefrina? (Sistema medico di base)</Italian>
<Czech>Kde může být použit adrenalin? (Pouze základní zdravotní systém)</Czech>
<Portuguese>Onde pode-se usar a Epinefrina? (Somente sistema médico básico)</Portuguese>
<Russian>Где может использоваться адреналин? (Базовая медицина)</Russian>
<Japanese>どこでもアドレナリンをつかえるようにしますか?(ベーシック医療のみ)</Japanese>
<Key ID="STR_ACE_Medical_BasicMedicalSettings_useLocation_Epi_Description">
<English>Where can the Epinephrine be used?</English>
</Key>
<Key ID="STR_ACE_Medical_AdvancedMedicalSettings_useLocation_Medkit_DisplayName">
<English>Locations Medkit</English>

View File

@ -119,9 +119,10 @@ class GVAR(Actions) {
class Epinephrine: Morphine {
displayName = ECSTRING(medical,Inject_Epinephrine);
displayNameProgress = ECSTRING(medical,Injecting_Epinephrine);
requiredMedic = QEGVAR(medical,medicSetting_Epi);
items[] = {"ACE_epinephrine"};
litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} };
//treatmentLocations[] = {QGVAR(useLocation_basicEpi)};
treatmentLocations[] = {QEGVAR(medical,useLocation_Epi)};
};
// --- iv bags
@ -129,7 +130,7 @@ class GVAR(Actions) {
displayName = ECSTRING(medical,Actions_Blood4_1000);
displayNameProgress = ECSTRING(medical,Transfusing_Blood);
allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"};
allowSelfTreatment = 0;
allowSelfTreatment = QEGVAR(medical,allowSelfIV);
category = "advanced";
requiredMedic = 1;
treatmentTime = 12;

View File

@ -24,12 +24,23 @@ if !(_target isKindOf "CAManBase") exitWith {false};
private _config = configFile >> QGVAR(Actions) >> _className;
if !(isClass _config) exitwith {false};
if !(isClass _config) exitWith {false};
// allow self treatment check
private _isSelf = _caller isEqualTo _target;
private _allowSelf = 0;
if (_isSelf && {getNumber (_config >> "allowSelfTreatment") == 0}) exitwith {false};
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;

View File

@ -98,7 +98,7 @@ _openWounds set [_mostEffectiveSpot, _mostEffectiveInjury];
_target setVariable [QEGVAR(medical,openWounds), _openWounds, true];
// Handle the reopening of bandaged wounds
if (_impact > 0 && {EGVAR(medical,enableAdvancedWounds)}) then {
if (_impact > 0 && {EGVAR(medical,woundReopening)}) then {
[_target, _impact, _partIndex, _mostEffectiveSpot, _mostEffectiveInjury, _bandage] call FUNC(handleBandageOpening);
};