diff --git a/addons/breathing/functions/fnc_fullHealLocal.sqf b/addons/breathing/functions/fnc_fullHealLocal.sqf index 9cb4f9b61..5baa569d4 100644 --- a/addons/breathing/functions/fnc_fullHealLocal.sqf +++ b/addons/breathing/functions/fnc_fullHealLocal.sqf @@ -145,3 +145,59 @@ _unit setDamage 0; [QACEGVAR(medical,FullHeal), _unit] call CBA_fnc_localEvent; _state = [_unit, ACEGVAR(medical,STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState; TRACE_1("after FullHeal",_state); + +/// Clear Stamina & weapon sway +if (ACEGVAR(advanced_fatigue,enabled)) then { + + ["PDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); + ["EDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); + ["LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); + ACEGVAR(advanced_fatigue,swayFactor) = EGVAR(pharma,originalSwayFactor); + +} else { + + _unit enableStamina true; + _unit setAnimSpeedCoef 1; + _unit setCustomAimCoef 1; + +}; + +/// Clear chroma effect & camera shake + +resetCamShake; +["ChromAberration", 200, [ 0, 0, true ]] spawn +{ + params["_name", "_priority", "_effect", "_handle"]; + while + { + _handle = ppEffectCreate[_name, _priority]; + _handle < 0 + } + do + { + _priority = _priority + 1; + }; + _handle ppEffectEnable true; + _handle ppEffectAdjust _effect; + _handle ppEffectCommit 0; + [ + { + params["_handle"]; + ppEffectCommitted _handle + }, + { + params["_handle"]; + _handle ppEffectEnable false; + ppEffectDestroy _handle; + }, + [_handle]] call CBA_fnc_waitUntilAndExecute; +}; + +// Reenable ace fatige animationspeed override + +if (!isNil QACEGVAR(advanced_fatigue,setAnimExclusions)) then { + _index = ACEGVAR(advanced_fatigue,setAnimExclusions) find "PervitinOverride"; + if (_index != -1) then { + ACEGVAR(advanced_fatigue,setAnimExclusions) deleteAt _index; + }; +}; \ No newline at end of file diff --git a/addons/breathing/functions/fnc_handleBreathing.sqf b/addons/breathing/functions/fnc_handleBreathing.sqf index 793169f98..163aa61b0 100644 --- a/addons/breathing/functions/fnc_handleBreathing.sqf +++ b/addons/breathing/functions/fnc_handleBreathing.sqf @@ -25,10 +25,6 @@ if (!local _unit) then { [QGVAR(handleBreathing), [_unit], _unit] call CBA_fnc_targetEvent; }; -if (!(_unit getVariable [QGVAR(lowSpO2ppActive), false]) && hasInterface && ACE_Player == _unit) then { - [QGVAR(lowSpO2pp), [_unit], _unit] call CBA_fnc_targetEvent; -}; - [{ params ["_args", "_idPFH"]; _args params ["_unit"]; @@ -37,6 +33,10 @@ if (!(_unit getVariable [QGVAR(lowSpO2ppActive), false]) && hasInterface && ACE_ [_idPFH] call CBA_fnc_removePerFrameHandler; }; + if (!(_unit getVariable [QGVAR(lowSpO2ppActive), false]) && hasInterface && ACE_Player == _unit) then { + [QGVAR(lowSpO2pp), [_unit], _unit] call CBA_fnc_targetEvent; + }; + private _airway = true; private _breathing = true; diff --git a/addons/breathing/functions/fnc_lowSpO2pp.sqf b/addons/breathing/functions/fnc_lowSpO2pp.sqf index b31a9e104..43dd8b89d 100644 --- a/addons/breathing/functions/fnc_lowSpO2pp.sqf +++ b/addons/breathing/functions/fnc_lowSpO2pp.sqf @@ -18,56 +18,46 @@ params ["_target"]; -_target setVariable [QGVAR(lowSpO2ppActive), true, true]; +_currentSpO2 = _target getVariable [QGVAR(airwayStatus), 100]; -[{ +if (!(alive _target) || !([_target] call ACEFUNC(common,isAwake)) || _currentSpO2 > GVAR(lowSPO2Level)) exitWith {}; - params ["_args", "_idPFH"]; - _args params ["_target"]; +["ColorCorrections", 1500, [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0.33, 0.33, 0.33, 0], [0.55, 0.5, 0, 0, 0, 0, 4]]] spawn { - _currentSpO2 = _target getVariable [QGVAR(airwayStatus), 100]; - if (!(alive _target) || !([_target] call ACEFUNC(common,isAwake)) || _currentSpO2 > GVAR(lowSPO2Level)) exitWith { - _target setVariable [QGVAR(lowSpO2ppActive), false, true]; - [_idPFH] call CBA_fnc_removePerFrameHandler; + params ["_name", "_priority", "_effect", "_handle"]; + while { + _handle = ppEffectCreate [_name, _priority]; + _handle < 0 + } do { + _priority = _priority + 1; }; - - ["ColorCorrections", 1500, [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0.33, 0.33, 0.33, 0], [0.55, 0.5, 0, 0, 0, 0, 4]]] spawn - { - params ["_name", "_priority", "_effect", "_handle"]; - while { - _handle = ppEffectCreate [_name, _priority]; - _handle < 0 - } do { - _priority = _priority + 1; - }; - _handle ppEffectEnable true; - _handle ppEffectAdjust _effect; - _handle ppEffectCommit 0.7; - - [{ params["_handle"]; - ppEffectCommitted _handle - }, - { params["_handle"]; - _handle ppEffectAdjust [1, 1, 0, [0, 0, 0, 0.9], [0, 0, 0, 1], [0.33, 0.33, 0.33, 0], [0.55, 0.5, 0, 0, 0, 0, 4]]; - _handle ppEffectCommit 0.7; - - [{ params["_handle"]; - ppEffectCommitted _handle - }, - { params["_handle"]; - _handle ppEffectAdjust [1, 1, 0, [0, 0, 0, 0.1], [0, 0, 0, 1], [0.33, 0.33, 0.33, 0], [0.55, 0.5, 0, 0, 0, 0, 4]]; - _handle ppEffectCommit 1.6; - - [{ params["_handle"]; - ppEffectCommitted _handle - }, - { params["_handle"]; - _handle ppEffectEnable false; - ppEffectDestroy _handle; - }, [_handle]] call CBA_fnc_waitUntilAndExecute; - - }, [_handle]] call CBA_fnc_waitUntilAndExecute; - - }, [_handle]] call CBA_fnc_waitUntilAndExecute; - }; -}, 3, [_target]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file + _handle ppEffectEnable true; + _handle ppEffectAdjust _effect; + _handle ppEffectCommit 0.7; + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectAdjust [1, 1, 0, [0, 0, 0, 0.9], [0, 0, 0, 1], [0.33, 0.33, 0.33, 0], [0.55, 0.5, 0, 0, 0, 0, 4]]; + _handle ppEffectCommit 0.7; + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectAdjust [1, 1, 0, [0, 0, 0, 0.1], [0, 0, 0, 1], [0.33, 0.33, 0.33, 0], [0.55, 0.5, 0, 0, 0, 0, 4]]; + _handle ppEffectCommit 1.6; + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectEnable false; + ppEffectDestroy _handle; + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; +}; \ No newline at end of file diff --git a/addons/misc/functions/fnc_handleRespawn.sqf b/addons/misc/functions/fnc_handleRespawn.sqf index 5d97d1864..17c30270d 100644 --- a/addons/misc/functions/fnc_handleRespawn.sqf +++ b/addons/misc/functions/fnc_handleRespawn.sqf @@ -224,20 +224,22 @@ if (EGVAR(pharma,coagulation)) then { /// Clear Stamina & weapon sway if (ACEGVAR(advanced_fatigue,enabled)) then { - ["PDF"] call ace_advanced_fatigue_fnc_removeDutyFactor; - ["EDF"] call ace_advanced_fatigue_fnc_removeDutyFactor; + ["PDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); + ["EDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); + ["LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); ACEGVAR(advanced_fatigue,swayFactor) = EGVAR(pharma,originalSwayFactor); } else { - _patient enableStamina true; - _patient setAnimSpeedCoef 1; - _patient setCustomAimCoef 1; + _unit enableStamina true; + _unit setAnimSpeedCoef 1; + _unit setCustomAimCoef 1; }; -/// Clear chroma effect +/// Clear chroma effect & camera shake +resetCamShake; ["ChromAberration", 200, [ 0, 0, true ]] spawn { params["_name", "_priority", "_effect", "_handle"]; @@ -253,7 +255,6 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { _handle ppEffectEnable true; _handle ppEffectAdjust _effect; _handle ppEffectCommit 0; - addCamShake[0, 0, 50]; [ { params["_handle"]; @@ -265,4 +266,13 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { ppEffectDestroy _handle; }, [_handle]] call CBA_fnc_waitUntilAndExecute; +}; + +// Reenable ace fatige animationspeed override + +if (!isNil QACEGVAR(advanced_fatigue,setAnimExclusions)) then { + _index = ACEGVAR(advanced_fatigue,setAnimExclusions) find "PervitinOverride"; + if (_index != -1) then { + ACEGVAR(advanced_fatigue,setAnimExclusions) deleteAt _index; + }; }; \ No newline at end of file diff --git a/addons/pharma/XEH_PREP.hpp b/addons/pharma/XEH_PREP.hpp index bd6bcb485..91c699d8f 100644 --- a/addons/pharma/XEH_PREP.hpp +++ b/addons/pharma/XEH_PREP.hpp @@ -1,6 +1,7 @@ PREP(alphaAction); PREP(applyIV); PREP(checkIV); +PREP(fentanylPP); PREP(fluid); PREP(fluidLocal); PREP(getBloodLoss); @@ -9,6 +10,8 @@ PREP(hasStableVitals); PREP(init); PREP(inspectBreath); PREP(inspectCatheter); +PREP(ketaminePP); +PREP(pervitinPP); PREP(removeItemfromMag); PREP(removeIV); PREP(retrieveIV); @@ -26,13 +29,11 @@ PREP(treatmentAdvanced_DialysisLocal); PREP(treatmentAdvanced_EACA); PREP(treatmentAdvanced_EACALocal); PREP(treatmentAdvanced_Fentanyl); -PREP(treatmentAdvanced_FentanylLocal); PREP(treatmentAdvanced_Flumazenil); PREP(treatmentAdvanced_FlumazenilLocal); PREP(treatmentAdvanced_Flush); PREP(treatmentAdvanced_FlushLocal); PREP(treatmentAdvanced_Ketamine); -PREP(treatmentAdvanced_KetamineLocal); PREP(treatmentAdvanced_Lorazepam); PREP(treatmentAdvanced_LorazepamLocal); PREP(treatmentAdvanced_medication); @@ -47,4 +48,3 @@ PREP(treatmentAdvanced_ReorientationLocal); PREP(treatmentAdvanced_TXA); PREP(treatmentAdvanced_TXALocal); PREP(vehicleCheckDialysis); - diff --git a/addons/pharma/XEH_postInit.sqf b/addons/pharma/XEH_postInit.sqf index 92d5a5bf8..7c9a805bb 100644 --- a/addons/pharma/XEH_postInit.sqf +++ b/addons/pharma/XEH_postInit.sqf @@ -14,8 +14,9 @@ [QGVAR(fluidLocal), LINKFUNC(fluidLocal)] call CBA_fnc_addEventHandler; [QGVAR(flushLocal), LINKFUNC(treatmentAdvanced_FlushLocal)] call CBA_fnc_addEventHandler; [QGVAR(pervitinLocal), LINKFUNC(treatmentAdvanced_PervitinLocal)] call CBA_fnc_addEventHandler; -[QGVAR(ketamineLocal), LINKFUNC(treatmentAdvanced_KetamineLocal)] call CBA_fnc_addEventHandler; -[QGVAR(fentanylLocal), LINKFUNC(treatmentAdvanced_FentanylLocal)] call CBA_fnc_addEventHandler; +[QGVAR(pervitinPP), LINKFUNC(pervitinPP)] call CBA_fnc_addEventHandler; +[QGVAR(ketaminePP), LINKFUNC(ketaminePP)] call CBA_fnc_addEventHandler; +[QGVAR(fentanylPP), LINKFUNC(fentanylPP)] call CBA_fnc_addEventHandler; [QGVAR(caffeineLocal), LINKFUNC(treatmentAdvanced_CaffeineLocal)] call CBA_fnc_addEventHandler; diff --git a/addons/pharma/XEH_preInit.sqf b/addons/pharma/XEH_preInit.sqf index 241ff86d8..27a7dcc23 100644 --- a/addons/pharma/XEH_preInit.sqf +++ b/addons/pharma/XEH_preInit.sqf @@ -60,7 +60,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_ApplyIV), LLSTRING(medlLvl_ApplyIV_Desc)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_ApplyIV)], - [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -116,7 +116,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(SETTING_Allow_Reorientation),LLSTRING(Allow_Reorientation_DESC)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Reorientation)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_settings_fnc_init; @@ -154,7 +154,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Carbonate)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Carbonate)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -182,7 +182,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Lorazepam)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Lorazepam)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -201,7 +201,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Etomidate)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Etomidate)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -220,7 +220,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Flumazenil)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Flumazenil)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -239,7 +239,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Naloxone)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Naloxone)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -259,7 +259,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Pervitin)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Pervitin)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -272,6 +272,15 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(weapon_sway_pervitin), + "CHECKBOX", + [LLSTRING(SETTING_Weapon_Sway_Pervitin), LLSTRING(SETTING_Weapon_Sway_Pervitin_DESC)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Pervitin)], + [true], + true +] call CBA_Settings_fnc_init; + [ QGVAR(chromatic_aberration_checkbox_pervitin), "CHECKBOX", @@ -286,26 +295,27 @@ PREP_RECOMPILE_END; "SLIDER", [LLSTRING(SETTING_Chromatic_Aberration_Slider_Pervitin), LLSTRING(SETTING_Chromatic_Aberration_Slider_Pervitin_DESC)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Pervitin)], - [0.1, 10, 1.5, 1], + [0.1, 10, 1, 1], true ] call CBA_Settings_fnc_init; [ - QGVAR(weapon_sway_pervitin), - "CHECKBOX", - [LLSTRING(SETTING_Weapon_Sway_Pervitin), LLSTRING(SETTING_Weapon_Sway_Pervitin_DESC)], - [CBA_SETTINGS_CAT, LSTRING(SubCategory_Pervitin)], - [true], - true + QGVAR(pervitinSpeed), + "SLIDER", + [LLSTRING(SETTING_PervitinSpeed_displayName), LLSTRING(SETTING_PervitinSpeed_DESC)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Pervitin)], + [1, 1.5, 1.15, 2], + true ] call CBA_Settings_fnc_init; + // TXA Settings Category [ QGVAR(medLvl_TXA), "LIST", [LLSTRING(medLvl_TXA)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_TXA)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -324,7 +334,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Norepinephrine)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Norepinephrine)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -343,7 +353,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Phenylephrine)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Phenylephrine)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -362,7 +372,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Nitroglycerin)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Nitroglycerin)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -381,7 +391,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Amiodarone)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Amiodarone)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -400,7 +410,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Lidocaine)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Lidocaine)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -419,7 +429,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Atropine)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Atropine)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -438,7 +448,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_EACA)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_EACA)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -457,7 +467,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Ketamine)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Ketamine)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -484,7 +494,7 @@ PREP_RECOMPILE_END; "SLIDER", [LLSTRING(SETTING_Chromatic_Aberration_Slider_Ketamine), LLSTRING(SETTING_Chromatic_Aberration_Slider_Ketamine_DESC)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Ketamine)], - [0.1, 10, 1.5, 1], + [0.1, 10, 0.8, 1], true ] call CBA_Settings_fnc_init; @@ -494,7 +504,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Fentanyl)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Fentanyl)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; @@ -521,7 +531,7 @@ PREP_RECOMPILE_END; "SLIDER", [LLSTRING(SETTING_Chromatic_Aberration_Slider_Fentanyl), LLSTRING(SETTING_Chromatic_Aberration_Slider_Fentanyl_DESC)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Fentanyl)], - [0.1, 10, 2, 1], + [0.1, 10, 1, 1], true ] call CBA_Settings_fnc_init; @@ -531,7 +541,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(medLvl_Nalbuphine)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Nalbuphine)], - [[0, 1, 2], [ACELSTRING(advanced_fatigue,Anyone), ACELSTRING(advanced_fatigue,Medics), ACELSTRING(advanced_fatigue,Doctors)], 0], + [[0, 1, 2], [ACELSTRING(medical_treatment,Anyone), ACELSTRING(medical_treatment,Medics), ACELSTRING(medical_treatment,Doctors)], 0], true ] call CBA_Settings_fnc_init; diff --git a/addons/pharma/functions/fnc_fentanylPP.sqf b/addons/pharma/functions/fnc_fentanylPP.sqf new file mode 100644 index 000000000..be3b90910 --- /dev/null +++ b/addons/pharma/functions/fnc_fentanylPP.sqf @@ -0,0 +1,63 @@ +#include "script_component.hpp" +/* + * Author: Miss Heda + * Triggers the fentanyl visual effect. + * + * Arguments: + * 0: Patient + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_fentanylPP; + * + * Public: No + */ + + +/// ChromAberration effect + +if (GVAR(chromatic_aberration_checkbox_pervitin)) then { + [{ + params ["_target"]; + + if !(alive _target) exitWith {}; + ["ChromAberration", 200, [(GVAR(chromatic_aberration_slider_fentanyl)/100), (GVAR(chromatic_aberration_slider_fentanyl)/100), true ], "", _target] spawn { + + params ["_name", "_priority", "_effect", "_handle", "_target"]; + while { + _handle = ppEffectCreate[_name, _priority]; + _handle < 0 + } do { + _priority = _priority + 1; + }; + _handle ppEffectEnable true; + _handle ppEffectAdjust _effect; + _handle ppEffectCommit 360; + + [{ params["_handle"]; + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectAdjust [0.005, 0.005, false]; + _handle ppEffectCommit 480; //lowering until 15m + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectEnable false; + ppEffectDestroy _handle; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + }, + [_handle], 360] call CBA_fnc_waitAndExecute; // wait until 7m for change to lower again + }; + }, + [_target], 60] call CBA_fnc_waitAndExecute; // 60s chroma start +}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf b/addons/pharma/functions/fnc_ketaminePP.sqf similarity index 53% rename from addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf rename to addons/pharma/functions/fnc_ketaminePP.sqf index bfb4dfbf4..2563c7996 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_KetamineLocal.sqf +++ b/addons/pharma/functions/fnc_ketaminePP.sqf @@ -1,6 +1,7 @@ #include "script_component.hpp" /* - * Author: MiszczuZPolski edited by Miss Heda + * Author: Miss Heda + * Triggers the ketamine visual effect. * * Arguments: * 0: Patient @@ -9,7 +10,7 @@ * None * * Example: - * [player] call kat_pharma_fnc_treatmentAdvanced_KetamineLocal; + * [player] call kat_pharma_fnc_ketaminePP; * * Public: No */ @@ -51,4 +52,49 @@ if (GVAR(chromatic_aberration_checkbox_ketamine)) then { }; }, [_patient],120] call CBA_fnc_waitAndExecute; /// chroma start 2m +}; + + +if (GVAR(chromatic_aberration_checkbox_pervitin)) then { + [{ + params ["_target"]; + + if !(alive _target) exitWith {}; + ["ChromAberration", 200, [(GVAR(chromatic_aberration_slider_ketamine)/100), (GVAR(chromatic_aberration_slider_ketamine)/100), true ], "", _target] spawn { + + params ["_name", "_priority", "_effect", "_handle", "_target"]; + while { + _handle = ppEffectCreate[_name, _priority]; + _handle < 0 + } do { + _priority = _priority + 1; + }; + _handle ppEffectEnable true; + _handle ppEffectAdjust _effect; + _handle ppEffectCommit 360; + + [{ params["_handle"]; + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectAdjust [0.005, 0.005, false]; + _handle ppEffectCommit 480; //lowering until 15m + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectEnable false; + ppEffectDestroy _handle; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + }, + [_handle], 360] call CBA_fnc_waitAndExecute; // wait until 7m for change to lower again + }; + }, + [_target], 60] call CBA_fnc_waitAndExecute; // 60s chroma start }; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_pervitinPP.sqf b/addons/pharma/functions/fnc_pervitinPP.sqf new file mode 100644 index 000000000..a3742050d --- /dev/null +++ b/addons/pharma/functions/fnc_pervitinPP.sqf @@ -0,0 +1,76 @@ +#include "script_component.hpp" +/* + * Author: Miss Heda + * Triggers the perivin visual effect. + * + * Arguments: + * 0: Target + * + * + * Return Value: + * None + * + * Example: + * [player] call kat_pharma_fnc_pervitinPP + * + * Public: No + */ + +params ["_target"]; + +if (GVAR(chromatic_aberration_checkbox_pervitin)) then { + [{ + params ["_target"]; + + if !(alive _target) exitWith {}; + ["ChromAberration", 200, [ (GVAR(chromatic_aberration_slider_pervitin)/100), (GVAR(chromatic_aberration_slider_pervitin)/100), true ], "", _target] spawn { + + params ["_name", "_priority", "_effect", "_handle", "_target"]; + while { + _handle = ppEffectCreate[_name, _priority]; + _handle < 0 + } do { + _priority = _priority + 1; + }; + _handle ppEffectEnable true; + _handle ppEffectAdjust _effect; + _handle ppEffectCommit 120; + [LLSTRING(Pervitin_chrom), 2, _target] call ACEFUNC(common,displayTextStructured); + + [{ params["_handle"]; + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectAdjust [0.005, 0.005, false]; + _handle ppEffectCommit 257.5; //lowering until 9m + + [{ params["_handle"]; + ppEffectCommitted _handle + }, + { params["_handle"]; + _handle ppEffectEnable false; + ppEffectDestroy _handle; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + + }, [_handle]] call CBA_fnc_waitUntilAndExecute; + }, + [_handle], 257.5] call CBA_fnc_waitAndExecute; // wait until 4:30m for change to lower again + }; + }, + [_target], 25] call CBA_fnc_waitAndExecute; // 25s chroma start +}; + +// CamShake effect +[{ + if !(alive _target) exitWith {}; + [LLSTRING(Pervitin_chrom2), 2, _target] call ACEFUNC(common,displayTextStructured); + addCamShake[1, 180, 2]; // wearoff after 9m + [{ + [LLSTRING(Pervitin_chrom3), 2, _target] call ACEFUNC(common,displayTextStructured); + }, + [_target], 180] call CBA_fnc_waitAndExecute; +}, +[_target], 360] call CBA_fnc_waitAndExecute; // after 6m start \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_CaffeineLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_CaffeineLocal.sqf index c1540a7c0..c141d8734 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_CaffeineLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_CaffeineLocal.sqf @@ -25,7 +25,7 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { params ["_patient"]; ACEGVAR(advanced_fatigue,anReserve) = ACEGVAR(advanced_fatigue,anReserve) + 1500; }, - [_patient], 5] call CBA_fnc_waitAndExecute; + [_patient], 2.5] call CBA_fnc_waitAndExecute; } else { @@ -33,6 +33,6 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { params ["_patient"]; _patient setStamina(getStamina _patient + 300); }, - [_patient], 5] call CBA_fnc_waitAndExecute; + [_patient], 2.5] call CBA_fnc_waitAndExecute; }; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_Fentanyl.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_Fentanyl.sqf index 9b6b0689a..5be5fdbf0 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_Fentanyl.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_Fentanyl.sqf @@ -26,4 +26,4 @@ params ["_medic", "_patient", "_bodyPart", "_classname", "", "_usedItem"]; [_patient, "activity", ACELSTRING(medical_treatment,Activity_usedItem), [[_medic] call ACEFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call ACEFUNC(medical_treatment,addToLog); [QGVAR(medicationLocal), [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; -[QGVAR(fentanylLocal), _patient, _patient] call CBA_fnc_targetEvent; \ No newline at end of file +[QGVAR(fentanylPP), _patient, _patient] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_FentanylLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_FentanylLocal.sqf deleted file mode 100644 index a0aa928a4..000000000 --- a/addons/pharma/functions/fnc_treatmentAdvanced_FentanylLocal.sqf +++ /dev/null @@ -1,54 +0,0 @@ -#include "script_component.hpp" -/* - * Author: MiszczuZPolski edited by Miss Heda - * - * Arguments: - * 0: Patient - * - * Return Value: - * None - * - * Example: -* [player] call kat_pharma_fnc_treatmentAdvanced_FentanylLocal; - * - * Public: No - */ - - -/// ChromAberration effect - -if (GVAR(chromatic_aberration_checkbox_fentanyl)) then { - [ - { - params ["_patient"]; - - if (ACE_Player != _patient) exitWith {}; - if !(alive _patient) exitWith {}; - ["ChromAberration", 200, [(GVAR(chromatic_aberration_slider_fentanyl)/100), (GVAR(chromatic_aberration_slider_fentanyl)/100), true ], _patient] spawn { - - params["_name", "_priority", "_effect", "_patient"]; - private "_handle"; - while { - _handle = ppEffectCreate[_name, _priority]; - _handle < 0 - } do { - _priority = _priority + 1; - }; - _handle ppEffectEnable true; - _handle ppEffectAdjust _effect; - _handle ppEffectCommit 660; /// Wearoff after 13m (after injection) - - [ - { params ["_handle"]; - ppEffectCommitted _handle; - }, - { params ["_handle"]; - _handle ppEffectEnable false; - ppEffectDestroy _handle; - }, - [_handle] - ] call CBA_fnc_waitUntilAndExecute; - }; - }, - [_patient],120] call CBA_fnc_waitAndExecute; /// chroma start 2m -}; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_Ketamine.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_Ketamine.sqf index c2b2e4ee2..45f93d927 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_Ketamine.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_Ketamine.sqf @@ -26,4 +26,4 @@ params ["_medic", "_patient", "_bodyPart", "_classname", "", "_usedItem"]; [_patient, "activity", ACELSTRING(medical_treatment,Activity_usedItem), [[_medic] call ACEFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call ACEFUNC(medical_treatment,addToLog); [QGVAR(medicationLocal), [_patient, _bodyPart, _classname], _patient] call CBA_fnc_targetEvent; -[QGVAR(ketamineLocal), _patient, _patient] call CBA_fnc_targetEvent; \ No newline at end of file +[QGVAR(ketaminePP), _patient, _patient] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf index a4cb19350..08be8be94 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf @@ -30,6 +30,11 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { ACEGVAR(advanced_fatigue,anReserve) = ACEGVAR(advanced_fatigue,anReserve) + 3000; ["PDF", 0] call ACEFUNC(advanced_fatigue,addDutyFactor); [LLSTRING(Pervitin_start), 2, _patient] call ACEFUNC(common,displayTextStructured); + + if (!isNil QACEGVAR(advanced_fatigue,setAnimExclusions)) then { + ACEGVAR(advanced_fatigue,setAnimExclusions) pushBack "PervitinOverride"; + }; + _patient setAnimSpeedCoef (GVAR(pervitinSpeed)); }, [_patient], 10] call CBA_fnc_waitAndExecute; @@ -40,6 +45,14 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { if !(alive _patient) exitWith {}; ["PDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); [LLSTRING(Pervitin_mid), 2, _patient] call ACEFUNC(common,displayTextStructured); + + _patient setAnimSpeedCoef 1; + if (!isNil QACEGVAR(advanced_fatigue,setAnimExclusions)) then { + _index = ACEGVAR(advanced_fatigue,setAnimExclusions) find "PervitinOverride"; + if (_index != -1) then { + ACEGVAR(advanced_fatigue,setAnimExclusions) deleteAt _index; + }; + }; }, [_patient], 180] call CBA_fnc_waitAndExecute; /// 3m @@ -189,7 +202,7 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { params ["_patient"]; if !(alive _patient) exitWith {}; - _patient setAnimSpeedCoef 1.2; + _patient setAnimSpeedCoef (GVAR(pervitinSpeed)); _patient enableStamina false; [LLSTRING(Pervitin_start), 2, _patient] call ACEFUNC(common,displayTextStructured); }, @@ -221,21 +234,29 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { params ["_patient"]; if !(alive _patient) exitWith {}; - _patient setStamina(getStamina _patient + 150); + _patient setStamina(getStamina _patient + 300); [LLSTRING(Pervitin_mid3), 2, _patient] call ACEFUNC(common,displayTextStructured); }, [_patient], 360] call CBA_fnc_waitAndExecute; /// 6m - [{ params ["_patient"]; if !(alive _patient) exitWith {}; _patient setStamina(getStamina _patient - 60); - [LLSTRING(Pervitin_end), 2, _patient] call ACEFUNC(common,displayTextStructured); + [LLSTRING(Pervitin_mid4), 2, _patient] call ACEFUNC(common,displayTextStructured); }, [_patient], 510] call CBA_fnc_waitAndExecute; /// 8:30m + + [{ + params ["_patient"]; + + if !(alive _patient) exitWith {}; + [LLSTRING(Pervitin_end), 2, _patient] call ACEFUNC(common,displayTextStructured); + }, + [_patient], 600] call CBA_fnc_waitAndExecute; /// 10m + ///Weapon sway normal arma if (GVAR(weapon_sway_pervitin)) then { @@ -246,7 +267,6 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { if !(alive _patient) exitWith {}; _patient setCustomAimCoef 1; _patient setCustomAimCoef(getCustomAimCoef _patient) - 0.7; - [LLSTRING(Pervitin_WeaponSway), 2, _patient] call ACEFUNC(common,displayTextStructured); }, [_patient], 15] call CBA_fnc_waitAndExecute; @@ -293,7 +313,6 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { if !(alive _patient) exitWith {}; _patient setCustomAimCoef(getCustomAimCoef _patient) + 0.3; - [LLSTRING(Pervitin_WeaponSway2), 2, _patient] call ACEFUNC(common,displayTextStructured); }, [_patient], 210] call CBA_fnc_waitAndExecute; @@ -334,62 +353,12 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { if !(alive _patient) exitWith {}; _patient setCustomAimCoef 1; - [LLSTRING(Pervitin_WeaponSway3), 2, _patient] call ACEFUNC(common,displayTextStructured); }, [_patient], 540] call CBA_fnc_waitAndExecute; /// 9m }; }; -/// ChromAberration effect +/// ChromAberration & CamShake effect -if (GVAR(chromatic_aberration_checkbox_pervitin)) then { - [ - { - params ["_patient"]; - - if !(alive _patient) exitWith {}; - ["ChromAberration", 200, [ (GVAR(chromatic_aberration_slider_pervitin)/100), (GVAR(chromatic_aberration_slider_pervitin)/100), true ], _patient] spawn { - - params["_name", "_priority", "_effect", "_patient"]; - private "_handle"; - while { - _handle = ppEffectCreate[_name, _priority]; - _handle < 0 - } do { - _priority = _priority + 1; - }; - _handle ppEffectEnable true; - _handle ppEffectAdjust _effect; - _handle ppEffectCommit 515; /// Wearoff after 9m - [LLSTRING(Pervitin_chrom), 2, _patient] call ACEFUNC(common,displayTextStructured); - - [ - { - params["_name", "_priority", "_effect", "_handle","_patient"]; - - if !(alive _patient) exitWith {}; - [LLSTRING(Pervitin_chrom2), 2, _patient] call ACEFUNC(common,displayTextStructured); - addCamShake[0.7, 240, 2]; /// Wearoff after 9m - [ - { params ["_handle"]; - ppEffectCommitted _handle; - - }, - { params ["_handle", "_patient"]; - [LLSTRING(Pervitin_chrom3), 2, _patient] call ACEFUNC(common,displayTextStructured); - _handle ppEffectEnable false; - ppEffectDestroy _handle; - }, - [_handle, _patient] - ] call CBA_fnc_waitUntilAndExecute; - }, - [_name, _priority, _effect, _handle, _patient], - 275 /// Trigger after 5m - ] call CBA_fnc_waitAndExecute; - }; - }, - [_patient], - 25 ///25s chroma start - ] call CBA_fnc_waitAndExecute; -}; \ No newline at end of file +[QGVAR(pervitinPP), [_patient], _patient] call CBA_fnc_targetEvent; diff --git a/addons/pharma/stringtable.xml b/addons/pharma/stringtable.xml index 75989d0de..47b451c6b 100644 --- a/addons/pharma/stringtable.xml +++ b/addons/pharma/stringtable.xml @@ -1091,6 +1091,14 @@ 페르피틴이 무기의 흔들림에 영향을 미치는지의 여부를 활성화합니다. Attiva se il pervitin debba influenzare l'oscillazione dell'arma + + Pervitin Speed Boost + Pervitin Geschwindigkeits Boost + + + The animation speed that gets set in Stage 1 of Pervitin. (1 = normal, 2 = twice) + Geschindigkeit die in Phase 1 von Pervitin gesetzt wird. (1 = normal, 2 = doppelt) + Enable Chromatic Aberration Aktiviere Chromatische Abweichungen