From b2f4b8ea20489df05e366683f6ddf34a2eeb1daf Mon Sep 17 00:00:00 2001 From: mharis001 <34453221+mharis001@users.noreply.github.com> Date: Fri, 28 Jun 2019 12:50:11 -0400 Subject: [PATCH] Medical - Cleanup settings (#7057) * Cleanup medical settings * Fix extra [ * Allow giving IV/blood to self by default * Medical Blood - Settings improvements and cleanup (#7069) * Add more blood settings and cleanup * Fix include before header * Update addons/medical_blood/functions/fnc_init.sqf Co-Authored-By: PabstMirror * Disable debug * Cleanup moved settings * Fix remaining setting descriptions --- addons/common/functions/fnc_cbaSettings.sqf | 14 ++ addons/medical/initSettings.sqf | 48 ++-- addons/medical/stringtable.xml | 216 +++--------------- addons/medical_blood/CfgEventHandlers.hpp | 1 - addons/medical_blood/README.md | 4 +- addons/medical_blood/XEH_PREP.hpp | 6 +- addons/medical_blood/XEH_postInit.sqf | 29 +-- addons/medical_blood/config.cpp | 2 +- ...erCleanupBlood.sqf => fnc_cleanupLoop.sqf} | 13 +- .../functions/fnc_createBlood.sqf | 20 +- .../functions/fnc_handleWoundReceived.sqf | 28 +-- addons/medical_blood/functions/fnc_init.sqf | 65 ++++++ .../functions/fnc_isBleeding.sqf | 6 +- .../functions/fnc_onBleeding.sqf | 23 +- addons/medical_blood/functions/fnc_spurt.sqf | 22 +- addons/medical_blood/initSettings.sqf | 34 ++- addons/medical_blood/script_component.hpp | 7 +- addons/medical_blood/stringtable.xml | 70 +++--- addons/medical_damage/initSettings.sqf | 28 +-- addons/medical_damage/stringtable.xml | 84 +------ addons/medical_feedback/ACE_Settings.hpp | 2 + addons/medical_feedback/initSettings.sqf | 21 +- addons/medical_feedback/stringtable.xml | 67 +++--- addons/medical_gui/stringtable.xml | 8 +- addons/medical_statemachine/ACE_Settings.hpp | 14 -- addons/medical_statemachine/Statemachine.hpp | 2 +- addons/medical_statemachine/config.cpp | 1 - .../functions/fnc_handleStateUnconscious.sqf | 17 +- addons/medical_statemachine/initSettings.sqf | 56 ++--- addons/medical_statemachine/stringtable.xml | 158 ++++++------- addons/medical_status/ACE_settings.hpp | 2 +- .../functions/fnc_getBloodVolumeChange.sqf | 2 +- addons/medical_status/initSettings.sqf | 43 ++-- addons/medical_status/stringtable.xml | 166 +++++++------- addons/medical_treatment/ACE_Settings.hpp | 45 ---- addons/medical_treatment/config.cpp | 1 - addons/medical_treatment/initSettings.sqf | 2 +- 37 files changed, 552 insertions(+), 775 deletions(-) rename addons/medical_blood/functions/{fnc_serverCleanupBlood.sqf => fnc_cleanupLoop.sqf} (55%) create mode 100644 addons/medical_blood/functions/fnc_init.sqf delete mode 100644 addons/medical_statemachine/ACE_Settings.hpp delete mode 100644 addons/medical_treatment/ACE_Settings.hpp diff --git a/addons/common/functions/fnc_cbaSettings.sqf b/addons/common/functions/fnc_cbaSettings.sqf index 4eb84d54da..273c72323e 100644 --- a/addons/common/functions/fnc_cbaSettings.sqf +++ b/addons/common/functions/fnc_cbaSettings.sqf @@ -21,6 +21,9 @@ LOG("Adding ACE_Settings to CBA_settings"); GVAR(cbaSettings_forcedSettings) = []; GVAR(cbaSettings_missionSettings) = []; GVAR(settings) = []; // will stay empty - for BWC? +#ifdef DEBUG_MODE_FULL +GVAR(settingsMovedToSQF) = []; +#endif // Add Event Handlers: [QGVAR(setSetting), { @@ -66,6 +69,13 @@ GVAR(settings) = []; // will stay empty - for BWC? false } count GVAR(runAtSettingsInitialized); GVAR(runAtSettingsInitialized) = nil; //cleanup + + #ifdef DEBUG_MODE_FULL + INFO_1("checking settingsMovedToSQF [%1]",count GVAR(settingsMovedToSQF)); + { + if (isNil _x) then { WARNING_1("setting [%1] NOT moved to sqf",_x); }; + } forEach GVAR(settingsMovedToSQF); + #endif }] call CBA_fnc_addEventHandler; private _start = diag_tickTime; @@ -81,6 +91,10 @@ for "_index" from 0 to (_countOptions - 1) do { } else { WARNING_1("Setting [%1] - Already defined from somewhere else??",_varName); }; + #ifdef DEBUG_MODE_FULL + } else { + GVAR(settingsMovedToSQF) pushBack configName _optionEntry; + #endif }; }; diff --git a/addons/medical/initSettings.sqf b/addons/medical/initSettings.sqf index 4fc473949f..9b1aee8464 100644 --- a/addons/medical/initSettings.sqf +++ b/addons/medical/initSettings.sqf @@ -1,34 +1,30 @@ -// CBA Settings [ADDON: ace_medical]: - -private _categoryArray = [LELSTRING(medical,Category), "?"]; - -// todo: Check the description is still accurate [ - QGVAR(spontaneousWakeUpChance), "SLIDER", - [LSTRING(MedicalSettings_spontaneousWakeUpChance_DisplayName), LSTRING(MedicalSettings_spontaneousWakeUpChance_Description)], - _categoryArray, - [0,1,0.05,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(spontaneousWakeUpChance), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(limping), + "LIST", + [LSTRING(Limping_DisplayName), LSTRING(Limping_Description)], + LSTRING(Category), + [[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(Limping_LimpOnOpenWounds), LSTRING(Limping_LimpRequiresStitching)], 1], + true, + {[QGVAR(limping), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,limping), "LIST", - [LSTRING(setting_limping_DisplayName), LSTRING(setting_limping_Description)], - _categoryArray, - [[0,1,2],[LELSTRING(common,disabled), LLSTRING(setting_limping_limpOnOpenWounds), LLSTRING(setting_limping_limpRequiresStitching)], 1], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,limping), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(fractures), + "LIST", + [LSTRING(Fractures_DisplayName), LSTRING(Fractures_Description)], + LSTRING(Category), + [[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(Fractures_SplintHealsFully), LSTRING(Fractures_SplintHasEffects)], 1], + true, + {[QGVAR(fractures), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,fractures), "LIST", - [LSTRING(setting_fractures_DisplayName), LSTRING(setting_fractures_Description)], - _categoryArray, - [[0,1,2],[LELSTRING(common,disabled), LLSTRING(setting_fractures_splintHealsFully), LLSTRING(setting_fractures_splintHasEffects)], 1], // [values, titles, defaultIndex] - true, // isGlobal - {[QEGVAR(medical,fractures), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(spontaneousWakeUpChance), + "SLIDER", + [LSTRING(SpontaneousWakeUpChance_DisplayName), LSTRING(SpontaneousWakeUpChance_Description)], + LSTRING(Category), + [0, 1, 0.05, 2], + true ] call CBA_settings_fnc_init; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index cce9a8705c..a2bb42f407 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -17,117 +17,49 @@ ACE 医疗系统 ACE 醫療系統 - - Medical Level - Сложность медицины - Poziom medyczny - Nivel médico - Stufe des Sanitätssystem - Úroveň medického - Nível médico - Niveau de simulation médicale - Orvosi szint - Livello Medico - 医療レベル - 의료 수준 - 医疗等级 - 醫療等級 + + Unconscious Wake Up Chance + Wahrscheinlichkeit aufzuwachen + 気絶から覚醒する可能性 + Шанс очнуться при потере сознания - - What is the medical simulation level? - Каков уровень сложности медицинской системы? - Jaki jest poziom symulacji medycznej? - ¿Cuál es el nivel de simulación médica? - Wie hoch soll das medizinische Simulationslevel sein? - Jaká je úroveň lékařské simulace? - Qual o nível de simulação médica? - Quel niveau de simulation médicale choisissez-vous? - Milyen komplex legyen az orvosi szimuláció? - Qual'è il livello di simulazione medica? - 治療の再現度は? - 의료 시뮬레이션의 수준 - 选择需要的医疗模拟等级 - 選擇需要的醫療模擬等級 + + The probablity that a unit with stable vitals will wake up from unconsciousness (checked every 15 seconds). + Wahrscheinlichkeit, dass eine bewusstlose Person mit stabilen Vitalwerten wieder aufwacht ()Überprüfung alle 15 Sekunden) + 安定状態にある人が覚醒する確率です。(15 秒毎に確認) + Вероятность, что стабилизированный юнит очнется от потери сознания (Проверяется каждые 15 сек) - - Disable medics - Отключить медиков - Wyłącz medyków - Desactivar médicos - Sanitäter deaktivieren - Zakázat zdravotníky - Desativar médicos - Désactiver les infirmiers - Orvosok letiltása - Disabilita medici - 衛生兵を無効化 - 의무병 비활성화 - 关闭医护兵 - 關閉醫護兵 + + Limping + Хромота - - 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 - 医療廃棄物の表示を有効化 - 의료폐기물 활성화 - 启用医疗废弃物 - 啟用醫療廢棄物 + + Limp when unit has leg wounds...(todo) + Хромота, когда юнит имеет ранения ног... - - 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 - 治療を始めると、医療廃棄物の作成を有効化する - 의료폐기물이 치료중 주변에 생성되는것을 활성화 합니다 - 本功能启用后,当每次医疗动作结束时,地上会产生相应的医疗废弃物 - 本功能啟用後,當每次醫療動作結束時,地上會產生相應的醫療廢棄物 + + Limp on open wounds + Хромота при открытых ранах - - 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 - 医療廃棄物の作成限界数を設定 - 의료폐기물 시간제한 - 医疗废弃物存在时间 - 醫療廢棄物存在時間 + + Limp on open or bandaged wounds + Хромота при открытых или забинтованых ранах - - 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 は永遠です。 - 얼마동안 폐기물이 존재합니까? 초 단위. -1 은 영구적. - 定义医疗废弃物存在时间,以秒为单位,-1为永远存在。 - 定義醫療廢棄物存在時間,以秒為單位,-1為永遠存在。 + + Fractures + Переломы + + + Limp fractures... (todo) + Хромота при переломах... + + + Splints fully heal fractures + Шины полностью лечат перелом + + + Splints heal (but cannot sprint) + Шины вылечивают, но не дают бегать Remote Controlled AI @@ -209,21 +141,6 @@ 医疗系统将同时对玩家与AI发生作用 醫療系統將同時對玩家與AI發生作用 - - Basic Medical Settings [ACE] - Standard Sanitätseinstellungen [ACE] - Podstawowe ustawienia medyczne - Ajustes médicos básicos [ACE] - Paramètres des soins basiques [ACE] - Impostazioni Mediche Di Base [ACE] - Základní zdravotnické nastavení [ACE] - Ajustes médicos básicos [ACE] - Настройки базовой медицины [ACE] - ベーシック医療設定 [ACE] - 기본 의료 설정 [ACE] - 基本医疗设定 [ACE] - 基本醫療設定 [ACE] - Enabled for Включено для @@ -320,21 +237,6 @@ 设定人员是否会因为载具冲撞别的物件而产生伤害? 設定人員是否會因為載具衝撞別的物件而產生傷害? - - Where can the Epinephrine be used? (Basic Medical) - Wo kann Epiniphrin verwendet werden? (Standard Sanitätseinstellungen) - Configura donde puede usarse Epinefrina (Solo sistema médico básico) - Gdzie można korzystać z adrenaliny? (Podstawowy system medyczny) - Où peut être utilisé l'épinéphrine ? (Médical basique) - Dove si può usare l'epinefrina? (Sistema medico di base) - Kde může být použit adrenalin? (Pouze základní zdravotní systém) - Onde pode-se usar a Epinefrina? (Somente sistema médico básico) - Где может использоваться адреналин? (Базовая медицина) - どこでもアドレナリンを使えるようにしますか? (ベーシック医療のみ) - 어디에서 에피네프린을 사용할 수 있습니까? (기본 의료) - 在哪里可以使用肾上腺素? (基本医疗) - 在哪裡可以使用腎上腺素? (基本醫療) - Heal hitpoints Heile Trefferpunkte @@ -440,18 +342,6 @@ 设定当距离超过%1将不能使用治疗动作 設定當距離超過%1將不能使用治療動作 - - Unconscious Wake Up Chance - Wahrscheinlichkeit aufzuwachen - 気絶から覚醒する可能性 - Шанс очнуться при потере сознания - - - Probablity that a unit with stable vitals will wake up from unconscious [Checked every 15 sec] - Wahrscheinlichkeit, dass eine bewusstlose Person mit stabilen Vitalwerten wieder aufwacht [Überprüfung alle 15 Sekunden] - 安定状態にある人が覚醒する確率です。(15 秒毎に確認) - Вероятность, что стабилизированный юнит очнется от потери сознания [Проверяется каждые 15 сек] - Open lid Deckel aufklappen @@ -474,37 +364,5 @@ Zamknij pokrywę Закрыть крышку - - Limping - Хромота - - - Limp when unit has leg wounds...(todo) - Хромота, когда юнит имеет ранения ног... - - - Limp on open wounds - Хромота при открытых ранах - - - Limp on open or bandaged wounds - Хромота при открытых или забинтованых ранах - - - Fractures - Переломы - - - Limp fractures... (todo) - Хромота при переломах... - - - Splints fully heal fractures - Шины полностью лечат перелом - - - Splints heal (but cannot sprint) - Шины вылечивают, но не дают бегать - diff --git a/addons/medical_blood/CfgEventHandlers.hpp b/addons/medical_blood/CfgEventHandlers.hpp index becf395052..0d3301d6e0 100644 --- a/addons/medical_blood/CfgEventHandlers.hpp +++ b/addons/medical_blood/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preStart)); diff --git a/addons/medical_blood/README.md b/addons/medical_blood/README.md index 29632ffd29..848f8f0308 100644 --- a/addons/medical_blood/README.md +++ b/addons/medical_blood/README.md @@ -1,7 +1,7 @@ ace_medical_blood -=============== +================= -Adds blood visual effect on the ground near a bleeding player. +Creates blood drops on the ground near bleeding units. ## Maintainers diff --git a/addons/medical_blood/XEH_PREP.hpp b/addons/medical_blood/XEH_PREP.hpp index aa7d358388..ebed657cc5 100644 --- a/addons/medical_blood/XEH_PREP.hpp +++ b/addons/medical_blood/XEH_PREP.hpp @@ -1,7 +1,7 @@ - +PREP(cleanupLoop); +PREP(createBlood); PREP(handleWoundReceived); +PREP(init); PREP(isBleeding); PREP(onBleeding); -PREP(createBlood); -PREP(serverCleanupBlood); PREP(spurt); diff --git a/addons/medical_blood/XEH_postInit.sqf b/addons/medical_blood/XEH_postInit.sqf index 11f86fdaca..02201f5506 100644 --- a/addons/medical_blood/XEH_postInit.sqf +++ b/addons/medical_blood/XEH_postInit.sqf @@ -10,33 +10,18 @@ if (isServer) then { [QGVAR(bloodDropCreated), { params ["_bloodDrop"]; - // Add to created queue with format [expireTime, object] - private _index = GVAR(bloodDrops) pushBack [(CBA_missionTime + BLOOD_OBJECT_LIFETIME), _bloodDrop]; - if (count GVAR(bloodDrops) >= MAX_BLOOD_OBJECTS) then { + // Add to created queue with format: [expire time, blood object] + private _index = GVAR(bloodDrops) pushBack [CBA_missionTime + GVAR(bloodLifetime), _bloodDrop]; + + if (count GVAR(bloodDrops) >= GVAR(maxBloodObjects)) then { (GVAR(bloodDrops) deleteAt 0) params ["", "_deletedBloodDrop"]; deleteVehicle _deletedBloodDrop; }; - if (_index == 1) then { // Start the waitAndExecute loop - [FUNC(serverCleanupBlood), [], BLOOD_OBJECT_LIFETIME] call CBA_fnc_waitAndExecute; + // Start the cleanup loop + if (_index == 0) then { + [FUNC(cleanupLoop), [], GVAR(bloodLifetime)] call CBA_fnc_waitAndExecute; }; }] call CBA_fnc_addEventHandler; }; - -["ace_settingsInitialized", { - TRACE_1("settingsInitialized", GVAR(enabledFor)); - if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled - if ((GVAR(enabledFor) == 1) && {!hasInterface}) exitWith {}; // 1: enabledFor_OnlyPlayers - - private _listcode = if (GVAR(enabledFor) == 1) then { - {if (alive ACE_player) then {[ACE_player]} else {[]}} // ace_player is only possible local player - } else { - EFUNC(common,getLocalUnits) // filter all local units - }; - - private _stateMachine = [_listcode, true] call CBA_statemachine_fnc_create; - [_stateMachine, LINKFUNC(onBleeding), {}, {}, "Bleeding"] call CBA_statemachine_fnc_addState; - - [QEGVAR(medical,woundReceived), FUNC(handleWoundReceived)] call CBA_fnc_addEventHandler; -}] call CBA_fnc_addEventHandler; diff --git a/addons/medical_blood/config.cpp b/addons/medical_blood/config.cpp index 5c133b9456..3e5d5227da 100644 --- a/addons/medical_blood/config.cpp +++ b/addons/medical_blood/config.cpp @@ -14,5 +14,5 @@ class CfgPatches { }; }; -#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" diff --git a/addons/medical_blood/functions/fnc_serverCleanupBlood.sqf b/addons/medical_blood/functions/fnc_cleanupLoop.sqf similarity index 55% rename from addons/medical_blood/functions/fnc_serverCleanupBlood.sqf rename to addons/medical_blood/functions/fnc_cleanupLoop.sqf index 5a1762a7a8..e8461b2e31 100644 --- a/addons/medical_blood/functions/fnc_serverCleanupBlood.sqf +++ b/addons/medical_blood/functions/fnc_cleanupLoop.sqf @@ -1,23 +1,26 @@ #include "script_component.hpp" /* * Author: PabstMirror - * Loop that cleans up blood + * Handles cleaning up blood objects that have reached the end of their lifetime. * * Arguments: * None * - * ReturnValue: + * Return Value: * None * + * Example: + * [] call ace_medical_blood_fnc_cleanupLoop + * * Public: No */ - + (GVAR(bloodDrops) deleteAt 0) params ["", "_deletedBloodDrop"]; deleteVehicle _deletedBloodDrop; -// If we cleaned out the array, exit loop +// Exit the loop if we have cleaned out the array if (GVAR(bloodDrops) isEqualTo []) exitWith {}; // Wait until the next blood drop in the queue will expire (GVAR(bloodDrops) select 0) params ["_expireTime"]; -[FUNC(serverCleanupBlood), [], (_expireTime - CBA_missionTime)] call CBA_fnc_waitAndExecute; +[FUNC(cleanupLoop), [], _expireTime - CBA_missionTime] call CBA_fnc_waitAndExecute; diff --git a/addons/medical_blood/functions/fnc_createBlood.sqf b/addons/medical_blood/functions/fnc_createBlood.sqf index 8d3fbc8776..e54247d02e 100644 --- a/addons/medical_blood/functions/fnc_createBlood.sqf +++ b/addons/medical_blood/functions/fnc_createBlood.sqf @@ -1,15 +1,15 @@ #include "script_component.hpp" /* * Author: Glowbal - * Spawn a blood drop. + * Creates a blood object and handles its cleanup. * Available blood drop classes are blooddrop_1 through blooddrop_4. * * Arguments: - * 0: classname of blood drop + * 0: Blood Drop Type * 1: Position * * Return Value: - * Created blood drop + * Blood Drop * * Example: * ["blooddrop_2", getPos player] call ace_medical_blood_fnc_createBlood @@ -17,15 +17,15 @@ * Public: No */ -params ["_type", "_pos"]; -TRACE_2("creating blood",_type,_pos); +params ["_type", "_position"]; +TRACE_2("Creating blood",_type,_position); private _model = GVAR(models) getVariable _type; -private _object = createSimpleObject [_model, [0,0,0]]; -_object setDir random 360; -_object setPos _pos; +private _bloodDrop = createSimpleObject [_model, [0, 0, 0]]; +_bloodDrop setDir random 360; +_bloodDrop setPos _position; -[QGVAR(bloodDropCreated), [_object]] call CBA_fnc_serverEvent; +[QGVAR(bloodDropCreated), _bloodDrop] call CBA_fnc_serverEvent; -_object +_bloodDrop diff --git a/addons/medical_blood/functions/fnc_handleWoundReceived.sqf b/addons/medical_blood/functions/fnc_handleWoundReceived.sqf index 20abbd4621..7447cac52f 100644 --- a/addons/medical_blood/functions/fnc_handleWoundReceived.sqf +++ b/addons/medical_blood/functions/fnc_handleWoundReceived.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" /* * Author: Glowbal, commy2 - * Handle wounds received event. + * Handles the wounds received event by triggering any needed blood creation. * * Arguments: - * 0: unit - * 1: bodyPart - * 2: damage - * 3: shooter + * 0: Unit + * 1: Body Part (not used) + * 2: Damage + * 3: Shooter * * Return Value: * None @@ -20,16 +20,16 @@ params ["_unit", "", "_damage", "_shooter"]; -if (GVAR(enabledFor) == 1 && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {}; -if (vehicle _unit != _unit && {!((vehicle _unit) isKindOf "StaticWeapon")}) exitWith {}; // Don't bleed on ground if mounted +// Don't bleed when players only and a non-player unit is wounded +if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {}; -_damage = _damage min 1; +// Don't bleed on the ground if in a vehicle +if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {}; -if (isNull _shooter) exitWith { // won't be able to calculate the direction properly, so instead we pick something at random - [QGVAR(spurt), [_unit, random 360, _damage]] call CBA_fnc_serverEvent; +private _bulletDir = if (isNull _shooter) then { + random 360 // Cannot calculate the direction properly, pick a random direction +} else { + _shooter getDir _unit // Calculate the bullet direction }; -// Calculate bulletDirection -private _bulletDir = _shooter getDir _unit; - -[QGVAR(spurt), [_unit, _bulletDir, _damage]] call CBA_fnc_serverEvent; +[QGVAR(spurt), [_unit, _bulletDir, _damage min 1]] call CBA_fnc_serverEvent; diff --git a/addons/medical_blood/functions/fnc_init.sqf b/addons/medical_blood/functions/fnc_init.sqf new file mode 100644 index 0000000000..336d964de7 --- /dev/null +++ b/addons/medical_blood/functions/fnc_init.sqf @@ -0,0 +1,65 @@ +#include "script_component.hpp" +/* + * Author: mharis001 + * Initializes the medical blood system based on the given mode. + * Should only be called from the CBA setting changed script. + * + * Arguments: + * 0: Mode + * + * Return Value: + * None + * + * Example: + * [2] call ace_medical_blood_fnc_init + * + * Public: No + */ + +params ["_mode"]; + +// Exit if setting is refreshed to the same value +if (!isNil QGVAR(currentSetup) && {_mode == GVAR(currentSetup)}) exitWith { + TRACE_2("Setting refreshed to current setup",GVAR(currentSetup),_mode); +}; + +// Track this new configuration that will be set up +GVAR(currentSetup) = _mode; + +// Delete current state machine if it exists +if (!isNil QGVAR(stateMachine)) then { + GVAR(stateMachine) call CBA_statemachine_fnc_delete; + GVAR(stateMachine) = nil; +}; + +// Remove wound received if it was previously added +if (!isNil QGVAR(woundReceivedEH)) then { + [QEGVAR(medical,woundReceived), GVAR(woundReceivedEH)] call CBA_fnc_removeEventHandler; + GVAR(woundReceivedEH) = nil; +}; + +// Don't need to set up anything if blood is disabled or players only on a non-player machine +if (_mode == BLOOD_DISABLED || {_mode == BLOOD_ONLY_PLAYERS && {!hasInterface}}) exitWith { + TRACE_1("Mode does not require any setup",_mode); +}; + +private _listCode = if (_mode == BLOOD_ONLY_PLAYERS) then { + // ACE_player is the only possible local player + { + if (alive ACE_player) then { + [ACE_player] + } else { + [] + }; + } +} else { + // Filter all local units + EFUNC(common,getLocalUnits) +}; + +GVAR(stateMachine) = [_listCode, true] call CBA_statemachine_fnc_create; +[GVAR(stateMachine), LINKFUNC(onBleeding), {}, {}, "Bleeding"] call CBA_statemachine_fnc_addState; + +GVAR(woundReceivedEH) = [QEGVAR(medical,woundReceived), FUNC(handleWoundReceived)] call CBA_fnc_addEventHandler; + +TRACE_3("Set up state machine and wounds event",_mode,GVAR(stateMachine),GVAR(woundReceivedEH)); diff --git a/addons/medical_blood/functions/fnc_isBleeding.sqf b/addons/medical_blood/functions/fnc_isBleeding.sqf index b063c52ab0..14aecbb55b 100644 --- a/addons/medical_blood/functions/fnc_isBleeding.sqf +++ b/addons/medical_blood/functions/fnc_isBleeding.sqf @@ -1,13 +1,13 @@ #include "script_component.hpp" /* * Author: Glowbal - * Check if is bleeding + * Checks if the given unit is bleeding. Handles both ACE Medical and Vanilla. * * Arguments: - * 0: unit + * 0: Unit * * Return Value: - * is Bleeding + * Is Bleeding * * Example: * [player] call ace_medical_blood_fnc_isBleeding diff --git a/addons/medical_blood/functions/fnc_onBleeding.sqf b/addons/medical_blood/functions/fnc_onBleeding.sqf index 2fe7b34043..8b6bcbb8f6 100644 --- a/addons/medical_blood/functions/fnc_onBleeding.sqf +++ b/addons/medical_blood/functions/fnc_onBleeding.sqf @@ -1,13 +1,14 @@ #include "script_component.hpp" /* * Author: Glowbal - * handle bleeding state (state machine) + * Handles periodically creating blood for a bleeding unit. + * Called from the medical_blood state machine. * * Arguments: - * 0: unit + * 0: Unit * * Return Value: - * is Bleeding + * None * * Example: * [player] call ace_medical_blood_fnc_onBleeding @@ -17,20 +18,20 @@ params ["_unit"]; -if (!([_unit] call FUNC(isBleeding))) exitWith {}; -if (((vehicle _unit) != _unit) && {!((vehicle _unit) isKindOf "StaticWeapon")}) exitWith {}; // Don't bleed on ground if mounted +// Nothing to do if unit is not bleeding +if !(_unit call FUNC(isBleeding)) exitWith {}; + +// Don't bleed on the ground if in a vehicle +if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {}; if (CBA_missionTime > (_unit getVariable [QGVAR(nextTime), -10])) then { private _bloodLoss = (if (GVAR(useAceMedical)) then {GET_BLOOD_LOSS(_unit) * 2.5} else {getDammage _unit * 2}) min 6; - TRACE_2("",_unit,_bloodLoss); _unit setVariable [QGVAR(nextTime), CBA_missionTime + 8 + random 2 - _bloodLoss]; + TRACE_2("Creating blood drop for bleeding unit",_unit,_bloodLoss); + private _position = getPosASL _unit; - _position = _position vectorAdd [ - random 0.4 - 0.2, - random 0.4 - 0.2, - 0 - ]; + _position = _position vectorAdd [random 0.4 - 0.2, random 0.4 - 0.2, 0]; _position set [2, 0]; private _bloodDrop = ["blooddrop_1", "blooddrop_2", "blooddrop_3", "blooddrop_4"] select floor (_bloodLoss min 3); diff --git a/addons/medical_blood/functions/fnc_spurt.sqf b/addons/medical_blood/functions/fnc_spurt.sqf index 9e3a1bf5e2..fd5c7a9fc0 100644 --- a/addons/medical_blood/functions/fnc_spurt.sqf +++ b/addons/medical_blood/functions/fnc_spurt.sqf @@ -1,18 +1,18 @@ #include "script_component.hpp" /* * Author: Sickboy - * Spurt blood on the ground + * Spurts blood on the ground based on the direction and damage. * * Arguments: - * 0: unit - * 1: direction - * 2: damage + * 0: Unit + * 1: Direction + * 2: Damage * * Return Value: * None * * Example: - * [UNIT, random 360, 1] call ace_medical_blood_fnc_spurt + * [player, random 360, 1] call ace_medical_blood_fnc_spurt * * Public: No */ @@ -21,20 +21,20 @@ #define DISTANCE_BETWEEN_DROPS 0.20 #define OFFSET 0.25 -params ["_unit", "_dir", "_damage"]; +params ["_unit", "_direction", "_damage"]; private _distanceBetweenDrops = DISTANCE_BETWEEN_DROPS * _damage; private _offset = OFFSET + _distanceBetweenDrops; -private _pos = _unit getPos [_offset, _dir]; +private _position = _unit getPos [_offset, _direction]; -["blooddrop_2", _pos, _dir] call FUNC(createBlood); +["blooddrop_2", _position, _direction] call FUNC(createBlood); private _dropAmount = ceil (MAXIMUM_DROPS * _damage); -TRACE_2("spurt blood",_dropAmount,_damage); +TRACE_2("Spurting blood",_dropAmount,_damage); if (_dropAmount > 1) then { for "_i" from 2 to _dropAmount do { - _pos = _pos getPos [_distanceBetweenDrops, _dir]; - ["blooddrop_1", _pos, _dir] call FUNC(createBlood); + _position = _position getPos [_distanceBetweenDrops, _direction]; + ["blooddrop_1", _position, _direction] call FUNC(createBlood); }; }; diff --git a/addons/medical_blood/initSettings.sqf b/addons/medical_blood/initSettings.sqf index 2ba5edccbf..c2c52f93b8 100644 --- a/addons/medical_blood/initSettings.sqf +++ b/addons/medical_blood/initSettings.sqf @@ -1,13 +1,27 @@ -// CBA Settings [ADDON: ace_medical_blood]: - -private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; +[ + QGVAR(enabledFor), + "LIST", + [LSTRING(EnabledFor_DisplayName), LSTRING(EnabledFor_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [[BLOOD_DISABLED, BLOOD_ONLY_PLAYERS, BLOOD_ENABLED], [ELSTRING(Common,Disabled), LSTRING(OnlyPlayers), ELSTRING(Common,Enabled)], 2], + true, + LINKFUNC(init) +] call CBA_settings_fnc_init; [ - QGVAR(enabledFor), "LIST", - [LSTRING(MedicalBloodSettings_enabledFor_DisplayName), LSTRING(MedicalBloodSettings_enabledFor_Description)], - _categoryArray, - [[0,1,2],[LELSTRING(Common,Disabled),LLSTRING(enabledFor_OnlyPlayers),LELSTRING(Common,Enabled)],2], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(enabledFor), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(maxBloodObjects), + "LIST", + [LSTRING(MaxBloodObjects_DisplayName), LSTRING(MaxBloodObjects_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [[50, 100, 200, 300, 400, 500, 1000, 2000, 3000, 4000, 5000], [/* settings function will auto create names */], 5], + true +] call CBA_settings_fnc_init; + +[ + QGVAR(bloodLifetime), + "TIME", + [LSTRING(BloodLifetime_DisplayName), LSTRING(BloodLifetime_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [1, 3600, 900], + true ] call CBA_settings_fnc_init; diff --git a/addons/medical_blood/script_component.hpp b/addons/medical_blood/script_component.hpp index ef72e2fdd5..d2bcbf9599 100644 --- a/addons/medical_blood/script_component.hpp +++ b/addons/medical_blood/script_component.hpp @@ -2,7 +2,7 @@ #define COMPONENT_BEAUTIFIED Medical Blood #include "\z\ace\addons\main\script_mod.hpp" -// #define DEBUG_ENABLED_MEDICAL_BLOOD +// #define DEBUG_MODE_FULL // #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS @@ -17,5 +17,6 @@ #include "\z\ace\addons\medical_engine\script_macros_medical.hpp" #include "\z\ace\addons\main\script_macros.hpp" -#define MAX_BLOOD_OBJECTS 500 -#define BLOOD_OBJECT_LIFETIME 900 +#define BLOOD_DISABLED 0 +#define BLOOD_ONLY_PLAYERS 1 +#define BLOOD_ENABLED 2 diff --git a/addons/medical_blood/stringtable.xml b/addons/medical_blood/stringtable.xml index f36f8abf31..4ffda9919e 100644 --- a/addons/medical_blood/stringtable.xml +++ b/addons/medical_blood/stringtable.xml @@ -1,25 +1,20 @@ - - - Bleeding Effect - Blutungseffekt - 出血中の効果 - Эффекты кровотечения + + + Blood + Sang + Sangre + Sangue + Krew + Кровь + Blut + Krev + Sangue + 혈흔 + - - Only Players - プレイヤーのみ - Nur Spieler - 오직 플레이어만 - Tylko gracze - Joueurs seulement - Solo Giocatori - 只有玩家 - 只有玩家 - Только игроки - - + Enable Blood Drops 血痕を有効化 Aktiviere Blutspritzer @@ -31,17 +26,32 @@ 開啟血液滴落效果 Разрешить капли крови - - Enable or disable Blood Drops created on bleeding and taking damage - ダメージを受けたり、出血していると出る血痕の有効か無効化 - Aktiviere oder deaktiviere Blutspritzer, die durch Blutungen oder bei Schadensnahme entstehen. - Włącz lub wyłącz pozostawianie śladów krwi na ziemi kiedy postać odnosi obrażenia bądź krwawi - (Dés)active les gouttes de sang lors d'un saignement ou de blessure - Abilita o disabilita la Perdite di Sangue create sanguinando e prendendo danno - 开启后, 会让受伤时伤口有血液滴落的效果 - 開啟後, 會讓受傷時傷口有血液滴落的效果 - 출혈이나 부상을 입었을 때, 떨어지는 혈액을 활성화 하거나 비활성화 합니다. - Включает или отключает капли крови при кровотечении и получении урона + + Enables the creation of blood drops when units are bleeding or take damage. + + + Max Blood Objects + + + Sets the maximum number of blood drop objects which can be spawned, excessive amounts can cause FPS lag. + + + Blood Lifetime + + + Controls the lifetime of blood drop objects. + + + Only Players + プレイヤーのみ + Nur Spieler + 오직 플레이어만 + Tylko gracze + Joueurs seulement + Solo Giocatori + 只有玩家 + 只有玩家 + Только игроки diff --git a/addons/medical_damage/initSettings.sqf b/addons/medical_damage/initSettings.sqf index 0982be17d2..25a153739c 100644 --- a/addons/medical_damage/initSettings.sqf +++ b/addons/medical_damage/initSettings.sqf @@ -1,23 +1,17 @@ -// CBA Settings [ADDON: ace_medical_damage]: - -private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; - [ - QEGVAR(medical,playerDamageThreshold), "SLIDER", - [LSTRING(playerDamageThreshold_DisplayName), LSTRING(playerDamageThreshold_Description)], - _categoryArray, - [0,25,1,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QEGVAR(medical,playerDamageThreshold), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QEGVAR(medical,playerDamageThreshold), + "SLIDER", + [LSTRING(PlayerDamageThreshold_DisplayName), LSTRING(PlayerDamageThreshold_Description)], + ELSTRING(medical,Category), + [0, 25, 1, 2], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,AIDamageThreshold), "SLIDER", + QEGVAR(medical,AIDamageThreshold), + "SLIDER", [LSTRING(AIDamageThreshold_DisplayName), LSTRING(AIDamageThreshold_Description)], - _categoryArray, - [0,25,1,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QEGVAR(medical,AIDamageThreshold), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + ELSTRING(medical,Category), + [0, 25, 1, 2], + true ] call CBA_settings_fnc_init; diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml index 2a1c94c6a4..995ef5888e 100644 --- a/addons/medical_damage/stringtable.xml +++ b/addons/medical_damage/stringtable.xml @@ -1,78 +1,18 @@ - - - Damage Threshold - Schaden - 損傷のしきい値 - Порог повреждения - - - Player Damage - Урон игроку - Próg obrażeń graczy - Daño de jugador - Spielerschaden - Poškození hráče - Dano do jogador - Dégats du joueur - Játékos sérülés - Danno Giocatore - プレイヤーへの損傷 - 플레이어 부상 - 玩家伤害 - 玩家傷害 - - - What is the damage a player can take before being killed? - Какой уровень урона необходим, чтобы убить игрока? - Jaki jest próg obrażeń, jakie gracz może otrzymać zanim zostanie zabity? - ¿Cuál es el daño que un jugador puede sufrir antes de morir? - Wie viel Schaden kann ein Spieler erleiden, bevor er getötet wird? - Jaké poškození může hráč dostat než bude zabit? - Qal é o dano que um jogador pode sofrer antes de morrer? - Quels dégâts peut subir un joueur avant d'être tué - Mennyi sérülést szenvedhet el egy játékos, mielőtt meghal? - Quanto è il danno che un giocatore può sostenere prima di essere ucciso? - プレイヤーが死に始める前に損傷を受けるようにしますか? - 얼마정도의 부상을 플레이어가 죽기 전까지 버틸 수 있습니까? - 玩家死亡前所能承受的伤害程度 - 玩家死亡前所能承受的傷害程度 - - - AI Damage - Урон ботам - Próg obrażeń AI - Daño IA - KI-Schaden - Poškození AI - Dano da IA - Dégâts des IA - AI sérülés - Danno AI - AI への損傷 - 인공지능 부상 - AI伤害 - AI傷害 - - - What is the damage an AI can take before being killed? - Какой уровень урона необходим, чтобы убить бота? - Jaki jest próg obrażeń, jakie AI może otrzymać zanim zostanie zabite? - ¿Cuál es el daño que la IA puede sufrir antes de morir? - Wie viel Schaden kann eine KI erleiden, bis sie getötet wird? - Jaké poškození může AI dostat než bude zabito? - Qual é o dano que uma IA pode sofrer antes de morrer? - Quels dégâts peut subir une IA avant d'être tuée - Mennyi sérülést szenvedhet el egy AI, mielőtt meghal? - Quanto è il danno che un'IA può sostenere prima di essere uccisa? - AI が死に始める前に損傷を受けるようにしますか? - 얼마정도의 부상을 인공지능이 죽기 전까지 버틸 수 있습니까? - AI 死亡前所能承受的伤害程度 - AI 死亡前所能承受的傷害程度 - - + + Player Critical Damage Threshold + + + Sets the amount of damage a player can receive before going unconscious. + + + AI Critical Damage Threshold + + + Sets the amount of damage an AI unit can receive before going unconscious. + Scrape Kratzer diff --git a/addons/medical_feedback/ACE_Settings.hpp b/addons/medical_feedback/ACE_Settings.hpp index 63266003e2..a42a2d0e59 100644 --- a/addons/medical_feedback/ACE_Settings.hpp +++ b/addons/medical_feedback/ACE_Settings.hpp @@ -1,4 +1,5 @@ class ACE_Settings { + /* // Not currently used anywhere class GVAR(enableScreams) { category = ECSTRING(medical,Category_Medical); @@ -7,4 +8,5 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + */ }; diff --git a/addons/medical_feedback/initSettings.sqf b/addons/medical_feedback/initSettings.sqf index e22a953f76..36c7dafc0c 100644 --- a/addons/medical_feedback/initSettings.sqf +++ b/addons/medical_feedback/initSettings.sqf @@ -1,21 +1,16 @@ -// CBA Settings [ADDON: ace_medical_feedback]: - -private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; - [ QGVAR(painEffectType), "LIST", - [localize LSTRING(painEffectType), "Selects the used pain effect type"], //@todo - _categoryArray, - [ - [0, 1], - [LLSTRING(painEffectType_whiteFlashing), LLSTRING(painEffectType_pulsingBlur)], - 0 - ], + [LSTRING(PainEffectType_DisplayName), LSTRING(PainEffectType_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [[0, 1], [LSTRING(PainEffectType_WhiteFlashing), LSTRING(PainEffectType_PulsingBlur)], 0], false, { - if (isNil QGVAR(ppPain)) exitWith {TRACE_1("Before Post-Init",_this)}; - TRACE_1("reseting ppEffect type",_this); + if (isNil QGVAR(ppPain)) exitWith { + TRACE_1("painEffectType setting - before postInit",_this); + }; + + TRACE_1("painEffectType setting - resetting effect",_this); [true] call FUNC(initEffects); } ] call CBA_Settings_fnc_init; diff --git a/addons/medical_feedback/stringtable.xml b/addons/medical_feedback/stringtable.xml index 818a535d90..5935647292 100644 --- a/addons/medical_feedback/stringtable.xml +++ b/addons/medical_feedback/stringtable.xml @@ -1,13 +1,42 @@ + + Feedback + Feedback + フィードバック + Реакция на ранения + + + Pain Effect Type + Schmerzeffekt-Typ + Rodzaj efektu bólu + Визуальный эффект боли + Pain Effect Type + Tipo de efecto de dolor + Type d'effet de douleur + Fájdalom-effekt típusa + Tipo do efeito de dor + Typ bolesti - efekt + 痛み効果の種類 + 고통 효과 종류 + + + Selects the used pain effect type. + + + White Flashing + Weißes blinken + 白く点滅 + Белые вспышки + + + Pulsing Blur + Wiederkehrende Unschärfe + ボケの強弱 + Пульсирующее размытие + - - Feedback - Feedback - フィードバック - Реакция на ранения - Enable Screams Включить крики @@ -41,31 +70,5 @@ 啟用傷者的尖叫聲 - - Pain Effect Type - Schmerzeffekt-Typ - Rodzaj efektu bólu - Визуальный эффект боли - Pain Effect Type - Tipo de efecto de dolor - Type d'effet de douleur - Fájdalom-effekt típusa - Tipo do efeito de dor - Typ bolesti - efekt - 痛み効果の種類 - 고통 효과 종류 - - - White flashing - Weißes blinken - 白く点滅 - Белые вспышки - - - Pulsing blur - Wiederkehrende Unschärfe - ボケの強弱 - Пульсирующее размытие - diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index 89fdbade4f..ecbcb0fb65 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -1,11 +1,9 @@ - - ACE Medical GUI - Sanitätsmenü - ACE 医療 GUI - ACE Медицина - Интерфейс + + GUI + GUI Enable Medical Actions diff --git a/addons/medical_statemachine/ACE_Settings.hpp b/addons/medical_statemachine/ACE_Settings.hpp deleted file mode 100644 index 8b47bd106d..0000000000 --- a/addons/medical_statemachine/ACE_Settings.hpp +++ /dev/null @@ -1,14 +0,0 @@ -class ACE_Settings { - class GVAR(fatalInjuryCondition) { - movedToSQF = 1; - }; - class GVAR(fatalInjuryConditionAI) { - movedToSQF = 1; - }; - class GVAR(unconsciousConditionAI) { - movedToSQF = 1; - }; - class GVAR(cardiacArrestTime) { - movedToSQF = 1; - }; -}; diff --git a/addons/medical_statemachine/Statemachine.hpp b/addons/medical_statemachine/Statemachine.hpp index 8c3e83d5d9..1516c680e2 100644 --- a/addons/medical_statemachine/Statemachine.hpp +++ b/addons/medical_statemachine/Statemachine.hpp @@ -47,7 +47,7 @@ class ACE_Medical_StateMachine { onStateEntered = QUOTE([ARR_2(_this,(true))] call EFUNC(medical_status,setUnconscious)); class DeathAI { targetState = "Dead"; - condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)}); + condition = QUOTE(!GVAR(AIUnconsciousness) && {!isPlayer _this}); }; class WakeUp { targetState = "Injured"; diff --git a/addons/medical_statemachine/config.cpp b/addons/medical_statemachine/config.cpp index a87d797163..23a55f5258 100644 --- a/addons/medical_statemachine/config.cpp +++ b/addons/medical_statemachine/config.cpp @@ -14,6 +14,5 @@ class CfgPatches { }; }; -#include "ACE_Settings.hpp" #include "Statemachine.hpp" #include "CfgEventHandlers.hpp" diff --git a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf index 1f124d2682..ccfe934e5b 100644 --- a/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf +++ b/addons/medical_statemachine/functions/fnc_handleStateUnconscious.sqf @@ -18,8 +18,7 @@ params ["_unit"]; // If the unit died the loop is finished -if (!alive _unit) exitWith {}; -if (!local _unit) exitWith {}; +if (!alive _unit || {!local _unit}) exitWith {}; [_unit] call EFUNC(medical_vitals,handleUnitVitals); @@ -28,14 +27,22 @@ if (_painLevel > 0) then { [QEGVAR(medical,moan), [_unit, _painLevel]] call CBA_fnc_localEvent; }; -// Handle spontaneous wakeup from unconsciousness +// Handle spontaneous wake up from unconsciousness if (EGVAR(medical,spontaneousWakeUpChance) > 0) then { if (_unit call EFUNC(medical_status,hasStableVitals)) then { - private _lastWakeUpCheck = _unit getVariable [QEGVAR(medical,lastWakeUpCheck), 0]; + private _lastWakeUpCheck = _unit getVariable QEGVAR(medical,lastWakeUpCheck); + + // Handle setting being changed mid-mission and still properly check + // already unconscious units, should handle locality changes as well + if (isNil "_lastWakeUpCheck") exitWith { + _unit setVariable [QGVAR(medical,lastWakeUpCheck), CBA_missionTime]; + }; + if (CBA_missionTime - _lastWakeUpCheck > SPONTANEOUS_WAKE_UP_INTERVAL) then { TRACE_2("Checking for wake up",_unit,EGVAR(medical,spontaneousWakeUpChance)); _unit setVariable [QEGVAR(medical,lastWakeUpCheck), CBA_missionTime]; - if ((random 1) < EGVAR(medical,spontaneousWakeUpChance)) then { + + if (random 1 <= EGVAR(medical,spontaneousWakeUpChance)) then { TRACE_1("Spontaneous wake up!",_unit); [QEGVAR(medical,WakeUp), _unit] call CBA_fnc_localEvent; }; diff --git a/addons/medical_statemachine/initSettings.sqf b/addons/medical_statemachine/initSettings.sqf index 34f5b487bb..2dfe27463e 100644 --- a/addons/medical_statemachine/initSettings.sqf +++ b/addons/medical_statemachine/initSettings.sqf @@ -1,43 +1,35 @@ -// CBA Settings [ADDON: ace_medical_statemachine]: - -private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; - [ - QGVAR(fatalInjuryCondition), "LIST", - [LSTRING(fatalInjuryCondition_DisplayName), LSTRING(fatalInjuryCondition_Description)], - _categoryArray, - [[0,1,2],["Always","In Cardiac Arrest","Never"],0], // [values, titles, defaultIndex] //ToDo: Localize - true, // isGlobal - {[QGVAR(fatalInjuryCondition), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(fatalInjuryCondition), + "LIST", + [LSTRING(FatalInjuryCondition_DisplayName), LSTRING(FatalInjuryCondition_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [[0, 1, 2], [ELSTRING(common,Always), LSTRING(InCardiacArrest), ELSTRING(common,Never)], 0], + true ] call CBA_settings_fnc_init; [ - QGVAR(fatalInjuryConditionAI), "CHECKBOX", - [LSTRING(fatalInjuryConditionAI_DisplayName), LSTRING(fatalInjuryConditionAI_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QGVAR(fatalInjuryConditionAI), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(fatalInjuryConditionAI), + "CHECKBOX", + [LSTRING(FatalInjuryConditionAI_DisplayName), LSTRING(FatalInjuryConditionAI_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + true, + true ] call CBA_settings_fnc_init; [ - QGVAR(unconsciousConditionAI), "CHECKBOX", - [LSTRING(unconsciousConditionAI_DisplayName), LSTRING(unconsciousConditionAI_Description)], - _categoryArray, - true, // default value - true, // isGlobal - {[QGVAR(unconsciousConditionAI), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(AIUnconsciousness), + "CHECKBOX", + [LSTRING(AIUnconsciousness_DisplayName), LSTRING(AIUnconsciousness_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + true, + true ] call CBA_settings_fnc_init; [ - QGVAR(cardiacArrestTime), "SLIDER", - [LSTRING(cardiacArrestTime_DisplayName), LSTRING(cardiacArrestTime_Description)], - _categoryArray, - [1,3600,30,0], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(cardiacArrestTime), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QGVAR(cardiacArrestTime), + "TIME", + [LSTRING(CardiacArrestTime_DisplayName), LSTRING(CardiacArrestTime_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [1, 3600, 30], + true ] call CBA_settings_fnc_init; diff --git a/addons/medical_statemachine/stringtable.xml b/addons/medical_statemachine/stringtable.xml index f9940d30ea..08a1ee575d 100644 --- a/addons/medical_statemachine/stringtable.xml +++ b/addons/medical_statemachine/stringtable.xml @@ -1,99 +1,69 @@ - - - States - Zustände - 状態 - Состояния - - - Fatal Injury Player - Tödliche Spielerverletzungen - 致命傷プレイヤー - Смертельные ранения игрока - - - Defines when Player can receive a fatal injury - Definiert wann ein Spieler tödliche Verletzungen bekommen kann - プレイヤーが致命傷から蘇生できるかどうか決定します - Определяет, когда игрок может получить смертельное ранение - - - Instant death AI - Direkter Tod KI - AI の即死 - Мгновенная смерть ИИ - - - Defines if AI will be able to die instantly - Legt fest, ob eine KI direkt sterben kann - AI が即死できるかどうか決定します - Определяет, сможет ли ИИ мгновенно умереть - - - Forbid unconscious AI - Verhindere KI-Bewusstlosigkeit - AI の気絶を禁止 - Запретить потерю сознания ИИ - - - Defines if AI will be denied to go unconscious and will die instead - Legt fest, ob eine KI bewusstlos wird oder stirbt - AI が気絶すると、即時に死亡するかどうか決定します - Определяет, потеряет ли ИИ сознание или вместо этого умрет - - - In Cardiac Arrest - Herzstillstand - 心停止中 - При остановке сердца - - - Cardiac Arrest time (seconds) - Zeit bis zum Herzstillstand (Sekunden) - 心停止時間 (秒) - Длительность остановки сердца (сек) - - - Defines how long it takes to die from cardiac arrest? - Legt fest, wie lang es dauert, bis man an einem Herzstillstand stirbt - 心停止がどのくらい続けば死亡するようにしますか? - Определяет, сколько времени требуется, чтобы умереть от остановки сердца - - - AI Unconsciousness - Потеря сознания ботами - Nieprzytomność AI - Inconsciencia IA - KI-Bewusstlosigkeit - Bezvědomí AI - Inconsciência da IA - Inconscience des IA - AI eszméletlenség - Incoscienza IA - AI の気絶 - 인공지능 기절 - AI无意识 - AI無意識 - - - Allow AI to go unconscious - Позволить ботам терять сознание - Czy AI może być nieprzytomne od odniesionych obrażeń? - Permita a la IA caer inconsciente - KI kann bewusstlos werden - Umožňuje AI upadnout do bezvědomí - Permite IA ficar inconsciente - Autoriser les IA à tomber inconscients - Engedélyezi az AI eszméletének elvesztését - Permetti alle IA di diventare incoscienti - AI が気絶をするようになります - 인공지능도 기절에 빠지게 합니다 - 允许AI进入无意识状态 - 允許AI進入無意識狀態 - - + + States + Zustände + 状態 + Состояния + + + Fatal Injury Player + Tödliche Spielerverletzungen + 致命傷プレイヤー + Смертельные ранения игрока + + + Controls when a player can receive a fatal injury. + Definiert wann ein Spieler tödliche Verletzungen bekommen kann + プレイヤーが致命傷から蘇生できるかどうか決定します + Определяет, когда игрок может получить смертельное ранение + + + AI Instant Death + Direkter Tod KI + AI の即死 + Мгновенная смерть ИИ + + + Controls if AI units are able to die instantly. + Legt fest, ob eine KI direkt sterben kann + AI が即死できるかどうか決定します + Определяет, сможет ли ИИ мгновенно умереть + + + AI Unconsciousness + Потеря сознания ботами + Nieprzytomność AI + Inconsciencia IA + KI-Bewusstlosigkeit + Bezvědomí AI + Inconsciência da IA + Inconscience des IA + AI eszméletlenség + Incoscienza IA + AI の気絶 + 인공지능 기절 + AI无意识 + AI無意識 + + + Allows AI to go unconscious instead of dying. + + + Cardiac Arrest Time + Zeit bis zum Herzstillstand + 心停止時間 + Длительность остановки сердца + + + Controls how long it takes to die from cardiac arrest. + + + In Cardiac Arrest + Herzstillstand + 心停止中 + При остановке сердца + diff --git a/addons/medical_status/ACE_settings.hpp b/addons/medical_status/ACE_settings.hpp index 11783ac42f..8613092861 100644 --- a/addons/medical_status/ACE_settings.hpp +++ b/addons/medical_status/ACE_settings.hpp @@ -5,7 +5,7 @@ class ACE_Settings { class EGVAR(medical,painCoefficient) { movedToSQF = 1; }; - class GVAR(ivFlowRate) { + class EGVAR(medical,ivFlowRate) { movedToSQF = 1; }; }; diff --git a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf index 904d33c79f..c46338a475 100644 --- a/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf @@ -29,7 +29,7 @@ if (!isNil {_unit getVariable QEGVAR(medical,ivBags)}) then { _x params ["_bagVolumeRemaining", "_type", "_bodyPart"]; if (_tourniquets select _bodyPart == 0) then { - private _bagChange = (_deltaT * GVAR(ivFlowRate) * IV_CHANGE_PER_SECOND) min _bagVolumeRemaining; // absolute value of the change in miliLiters + private _bagChange = (_deltaT * EGVAR(medical,ivFlowRate) * IV_CHANGE_PER_SECOND) min _bagVolumeRemaining; // absolute value of the change in miliLiters _bagVolumeRemaining = _bagVolumeRemaining - _bagChange; _bloodVolumeChange = _bloodVolumeChange + (_bagChange / 1000); }; diff --git a/addons/medical_status/initSettings.sqf b/addons/medical_status/initSettings.sqf index 32d6193a7d..95231b0acc 100644 --- a/addons/medical_status/initSettings.sqf +++ b/addons/medical_status/initSettings.sqf @@ -1,33 +1,26 @@ -// CBA Settings [ADDON: ace_medical_status]: - -private _categoryArray = [LELSTRING(medical,Category), LLSTRING(subCategory)]; - [ - QEGVAR(medical,bleedingCoefficient), "SLIDER", - [LSTRING(bleedingCoefficient_DisplayName), LSTRING(bleedingCoefficient_Description)], - _categoryArray, - [0,25,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QEGVAR(medical,bleedingCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QEGVAR(medical,bleedingCoefficient), + "SLIDER", + [LSTRING(BleedingCoefficient_DisplayName), LSTRING(BleedingCoefficient_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [0, 25, 1, 1], + true ] call CBA_settings_fnc_init; [ - QEGVAR(medical,painCoefficient), "SLIDER", - [LSTRING(painCoefficient_DisplayName), LSTRING(painCoefficient_Description)], - _categoryArray, - [0,25,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QEGVAR(medical,painCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QEGVAR(medical,painCoefficient), + "SLIDER", + [LSTRING(PainCoefficient_DisplayName), LSTRING(PainCoefficient_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [0, 25, 1, 1], + true ] call CBA_settings_fnc_init; [ - QGVAR(ivFlowRate), "SLIDER", - [LSTRING(ivFlowRate_DisplayName), LSTRING(ivFlowRate_Description)], - _categoryArray, - [0,25,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(ivFlowRate), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + QEGVAR(medical,ivFlowRate), + "SLIDER", + [LSTRING(IvFlowRate_DisplayName), LSTRING(IvFlowRate_Description)], + [ELSTRING(medical,Category), LSTRING(SubCategory)], + [0, 25, 1, 1], + true ] call CBA_settings_fnc_init; diff --git a/addons/medical_status/stringtable.xml b/addons/medical_status/stringtable.xml index b41d6924ca..1bbea55902 100644 --- a/addons/medical_status/stringtable.xml +++ b/addons/medical_status/stringtable.xml @@ -1,89 +1,87 @@ - - - Status - Zustand - 状態 - Статус - - - Bleeding coefficient - Коэффициент кровопотери - Mnożnik krwawienia - Coeficiente de sangrado - Verblutungsmultiplikator - Koeficient krvácení - Coeficiente de sangramento - Coéfficient de saignement - Vérzési koefficiens - Coefficiente sanguinamento - 出血の係数 - 출혈 계수 - 流血系数 - 流血係數 - - - Coefficient to modify the bleeding speed - Коэффициент, изменяющий скорость потери крови - Mnożnik modyfikujący prędkość wykrwawiania się - Coeficiente para modificar la velocidad de sangrado - Multiplikator um die Verblutungsgeschwindigkeit zu verändern - Koeficient rychlosti krvácení - Coeficiente para modificar a velocidade do sangramento - Modifie le débit des saignements - Egy szorzó a vérzés sebességének szabályozására - Coefficiente che modifica la velocità di sanguinamento - この係数では出血速度を変更できます - 출혈의 속도를 계수만큼 변경합니다 - 修改流血速度 - 修改流血速度 - - - Pain coefficient - Коэффициент боли - Mnożnik bólu - Coeficiente de dolor - Schmerzmultiplikator - Koeficient bolesti - Coeficiente de dor - Coéfficient de douleur - Fájdalmi koefficiens - Coefficiente dolore - 痛みの係数 - 고통 계수 - 疼痛系数 - 疼痛係數 - - - Coefficient to modify the pain intensity - Коэффициент, изменяющий уровень боли - Mnożnik modyfikujący intensywność bólu - Coeficiente para modificar la intensidad del dolor - Multiplikator um die Schmerzintensität zu verändern - Koeficient intenzity bolesti - Coeficiente para modificar a instensidade de dor - Modifie l'intensité de la douleur - Egy szorzó a fájdalom erősségének szabályozására - Coefficiente che modifica l'intensità del dolore - この係数では痛みの強さを変更できます - 고통의 정도를 계수만큼 변경합니다 - 修改疼痛强度的系数 - 修改疼痛強度的係數 - - - IV Transfusion Flow Rate - Transfusions Fließrate - IV 輸血の流量 - Скорость внутривенного переливания - - - Effects how quickly IV Bags will have effect - Wie schnell der Effekt der Transfusion eintritt - IV による輸血速度を変更できます - Определяет, насколько быстро подействуют эффекты внутривенного переливания - - + + Status + Zustand + 状態 + Статус + + + Bleeding Coefficient + Коэффициент кровопотери + Mnożnik krwawienia + Coeficiente de sangrado + Verblutungsmultiplikator + Koeficient krvácení + Coeficiente de sangramento + Coéfficient de saignement + Vérzési koefficiens + Coefficiente sanguinamento + 出血の係数 + 출혈 계수 + 流血系数 + 流血係數 + + + Coefficient for controlling the bleeding speed. + Коэффициент, изменяющий скорость потери крови + Mnożnik modyfikujący prędkość wykrwawiania się + Coeficiente para modificar la velocidad de sangrado + Multiplikator um die Verblutungsgeschwindigkeit zu verändern + Koeficient rychlosti krvácení + Coeficiente para modificar a velocidade do sangramento + Modifie le débit des saignements + Egy szorzó a vérzés sebességének szabályozására + Coefficiente che modifica la velocità di sanguinamento + この係数では出血速度を変更できます + 출혈의 속도를 계수만큼 변경합니다 + 修改流血速度 + 修改流血速度 + + + Pain Coefficient + Коэффициент боли + Mnożnik bólu + Coeficiente de dolor + Schmerzmultiplikator + Koeficient bolesti + Coeficiente de dor + Coéfficient de douleur + Fájdalmi koefficiens + Coefficiente dolore + 痛みの係数 + 고통 계수 + 疼痛系数 + 疼痛係數 + + + Coefficient for controlling the intensity of pain adjustments. + Коэффициент, изменяющий уровень боли + Mnożnik modyfikujący intensywność bólu + Coeficiente para modificar la intensidad del dolor + Multiplikator um die Schmerzintensität zu verändern + Koeficient intenzity bolesti + Coeficiente para modificar a instensidade de dor + Modifie l'intensité de la douleur + Egy szorzó a fájdalom erősségének szabályozására + Coefficiente che modifica l'intensità del dolore + この係数では痛みの強さを変更できます + 고통의 정도를 계수만큼 변경합니다 + 修改疼痛强度的系数 + 修改疼痛強度的係數 + + + IV Transfusion Flow Rate + Transfusions Fließrate + IV 輸血の流量 + Скорость внутривенного переливания + + + Controls how quickly fluid flows out of IV Bags. The IV Bag volume change is calculated as:\ntime interval (s) * iv change per second (4.1667 mL/s) * flow rate (this coefficient). + Wie schnell der Effekt der Transfusion eintritt + IV による輸血速度を変更できます + Определяет, насколько быстро подействуют эффекты внутривенного переливания + diff --git a/addons/medical_treatment/ACE_Settings.hpp b/addons/medical_treatment/ACE_Settings.hpp deleted file mode 100644 index 444e5236ed..0000000000 --- a/addons/medical_treatment/ACE_Settings.hpp +++ /dev/null @@ -1,45 +0,0 @@ -class ACE_Settings { - class EGVAR(medical,allowLitterCreation) { - movedToSqf = 1; - }; - class EGVAR(medical,litterCleanUpDelay) { - movedToSqf = 1; - }; - class EGVAR(medical,litterSimulationDetail) { - movedToSqf = 1; - _values[] = { 0, 50, 100, 1000, 5000 }; - }; - class EGVAR(medical,increaseTrainingInLocations) { - movedToSqf = 1; - }; - class EGVAR(medical,PAKTime) { - movedToSqf = 1; - }; - class EGVAR(medical,medicSetting_Epi) { - movedToSqf = 1; - }; - class EGVAR(medical,medicSetting_PAK) { - movedToSqf = 1; - }; - class EGVAR(medical,medicSetting_SurgicalKit) { - movedToSqf = 1; - }; - class EGVAR(medical,consumeItem_PAK) { - movedToSqf = 1; - }; - class EGVAR(medical,consumeItem_SurgicalKit) { - movedToSqf = 1; - }; - class EGVAR(medical,useLocation_Epi) { - movedToSqf = 1; - }; - class EGVAR(medical,useLocation_PAK) { - movedToSqf = 1; - }; - class EGVAR(medical,useLocation_SurgicalKit) { - movedToSqf = 1; - }; - class EGVAR(medical,convertItems) { - movedToSqf = 1; - }; -}; diff --git a/addons/medical_treatment/config.cpp b/addons/medical_treatment/config.cpp index 48a201d6aa..29c11c18ad 100644 --- a/addons/medical_treatment/config.cpp +++ b/addons/medical_treatment/config.cpp @@ -17,7 +17,6 @@ class CfgPatches { #include "ACE_Medical_Treatment.hpp" #include "ACE_Medical_Treatment_Actions.hpp" #include "ACE_Medical_Facilities.hpp" -#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgReplacementItems.hpp" #include "CfgVehicles.hpp" diff --git a/addons/medical_treatment/initSettings.sqf b/addons/medical_treatment/initSettings.sqf index 148af1686a..f42e4d4009 100644 --- a/addons/medical_treatment/initSettings.sqf +++ b/addons/medical_treatment/initSettings.sqf @@ -53,7 +53,7 @@ "LIST", [LSTRING(AllowSelfIV_DisplayName), LSTRING(AllowSelfIV_Description)], [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], - [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 0], + [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 1], true ] call CBA_settings_fnc_init;