mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Scale grenade torque depending on throw mode (#5845)
This commit is contained in:
parent
e0ae842ff0
commit
2e9b195021
@ -49,10 +49,20 @@ if (!(_unit getVariable [QGVAR(primed), false])) then {
|
|||||||
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
_newVelocity = _newVelocity vectorAdd (velocity (vehicle _unit));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Calculate torque of thrown grenade
|
||||||
private _config = configFile >> "CfgAmmo" >> typeOf _activeThrowable;
|
private _config = configFile >> "CfgAmmo" >> typeOf _activeThrowable;
|
||||||
private _torqueDir = getArray (_config >> QGVAR(torqueDirection));
|
private _torqueDir = getArray (_config >> QGVAR(torqueDirection));
|
||||||
_torqueDir = if (_torqueDir isEqualTypeArray [0,0,0]) then { vectorNormalized _torqueDir } else { [0,0,0] };
|
_torqueDir = if (_torqueDir isEqualTypeArray [0,0,0]) then { vectorNormalized _torqueDir } else { [0,0,0] };
|
||||||
private _torqueMag = getNumber (_config >> QGVAR(torqueMagnitude));
|
private _torqueMag = getNumber (_config >> QGVAR(torqueMagnitude));
|
||||||
|
|
||||||
|
if (_dropMode) then {
|
||||||
|
_torqueMag = _torqueMag * THROWSTYLE_DROP_TORQUE_COEF;
|
||||||
|
} else {
|
||||||
|
if (_throwType == "high") then {
|
||||||
|
_torqueMag = _torqueMag * THROWSTYLE_HIGH_TORQUE_COEF;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
private _torque = _torqueDir vectorMultiply _torqueMag;
|
private _torque = _torqueDir vectorMultiply _torqueMag;
|
||||||
|
|
||||||
// Drop if unit dies during throw process
|
// Drop if unit dies during throw process
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#define THROWSTYLE_HIGH_DIR [0, 200, 500]
|
#define THROWSTYLE_HIGH_DIR [0, 200, 500]
|
||||||
#define THROWSTYLE_HIGH_VEL_COEF 2
|
#define THROWSTYLE_HIGH_VEL_COEF 2
|
||||||
#define THROWSTYLE_DROP_VEL 2
|
#define THROWSTYLE_DROP_VEL 2
|
||||||
|
#define THROWSTYLE_HIGH_TORQUE_COEF .6
|
||||||
|
#define THROWSTYLE_DROP_TORQUE_COEF .2
|
||||||
|
|
||||||
#define THROW_TYPE_DEFAULT "normal"
|
#define THROW_TYPE_DEFAULT "normal"
|
||||||
#define THROW_SPEED_DEFAULT 18
|
#define THROW_SPEED_DEFAULT 18
|
||||||
|
Loading…
Reference in New Issue
Block a user