ACE3/addons/medical/XEH_postInit.sqf
Grim cc26f00df3
Common/Adv. Fatigue/Medical - Add unified sway calculation (#9226)
* fix adv fatigue sway interaction with medical

* change medical sway scaling

* move to common

* function header

* number tweaks

* baseline is always at least 1

* Add error msgs and warn if using old ACE_setCustomAimCoef

* Update addons/common/functions/fnc_addSwayFactor.sqf

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-02 18:09:19 -04:00

23 lines
762 B
Plaintext

// #define DEBUG_MODE_FULL
#include "script_component.hpp"
[QEGVAR(medical,setUnconscious), LINKFUNC(setUnconscious)] call CBA_fnc_addEventHandler;
if (!hasInterface) exitWith {};
// Fractures affect base sway, pain makes it worse
["baseline", {
ACE_player getVariable [QEGVAR(medical_engine,aimFracture), 0]
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
// Max pain = 5x sway
["multiplier", {
1 + (GET_PAIN_PERCEIVED(ACE_player) * 4)
}, QUOTE(ADDON)] call EFUNC(common,addSwayFactor);
#ifdef DEBUG_MODE_FULL
call compile preprocessFileLineNumbers QPATHTOF(dev\reportSettings.sqf);
call compile preprocessFileLineNumbers QPATHTOF(dev\watchVariable.sqf);
call compile preprocessFileLineNumbers QPATHTOF(dev\debugDisplay.sqf);
#endif