Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addons/recoil/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "script_component.hpp"

// This is too niche to be a setting, but making it not just hardcoded is good
GVAR(extraLauncherShake) = 25.0;
Comment thread
some-evil-kitty marked this conversation as resolved.
Outdated

// Register fire event handler
["ace_firedPlayer", LINKFUNC(camShake)] call CBA_fnc_addEventHandler;
12 changes: 11 additions & 1 deletion addons/recoil/functions/fnc_camshake.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ private _recoil = GVAR(recoilCache) getOrDefaultCall [_weapon + _muzzle, {
_recoil = [0, 0];
};

private _customShakeCoef = if (isNumber (configFile >> "CfgRecoils" >> _recoil >> QGVAR(customShakeCoef))) then {
Comment thread
some-evil-kitty marked this conversation as resolved.
Outdated
getNumber (configFile >> "CfgRecoils" >> _recoil >> QGVAR(customShakeCoef))
} else {
1
};



_recoil = _recoil vectorMultiply _customShakeCoef;

TRACE_3("Caching Recoil config",_weapon,_muzzle,_recoil);

// Ensure format is correct
Expand All @@ -62,7 +72,7 @@ private _powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil sel
if (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07};
if (isWeaponDeployed _unit) then {_powerMod = _powerMod - 0.11};
if (_weapon isEqualTo secondaryWeapon _unit) then {
_powerCoef = _powerCoef + 25.0;
_powerCoef = _powerCoef + GVAR(extraLauncherShake);
};

private _camshake = [
Expand Down
Loading