2015-01-16 02:36:31 +00:00
|
|
|
/*
|
|
|
|
* Author: Commy2
|
|
|
|
* Make a unit start swapping it's barrel
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2016-03-06 02:33:30 +00:00
|
|
|
* 0: Unit initiating the action <OBJECT>
|
|
|
|
* 1: Unit that has the weapon <OBJECT>
|
|
|
|
* 2: Weapon <STRING>
|
2015-01-16 02:36:31 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-01-16 02:36:31 +00:00
|
|
|
* None
|
2015-02-08 22:54:12 +00:00
|
|
|
*
|
2015-12-15 07:09:26 +00:00
|
|
|
* Example:
|
2016-03-06 02:33:30 +00:00
|
|
|
* [cursorTarget, player, currentWeapon player] call ace_overheating_fnc_swapBarrel
|
2015-12-15 07:09:26 +00:00
|
|
|
*
|
2015-02-08 22:54:12 +00:00
|
|
|
* Public: No
|
2015-01-16 02:36:31 +00:00
|
|
|
*/
|
2015-12-15 07:09:26 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-13 03:23:14 +00:00
|
|
|
|
2016-03-06 02:33:30 +00:00
|
|
|
params ["_assistant", "_gunner", "_weapon"];
|
|
|
|
TRACE_3("params",_assistant,_gunner,_weapon);
|
2015-01-13 03:23:14 +00:00
|
|
|
|
2016-01-20 18:19:46 +00:00
|
|
|
// Make the standing player kneel down
|
2016-03-06 02:33:30 +00:00
|
|
|
if (stance _gunner != "PRONE") then {
|
|
|
|
[_gunner, "amovpknlmstpsraswrfldnon", 1] call EFUNC(common,doAnimation);
|
2015-01-13 03:23:14 +00:00
|
|
|
};
|
2016-01-20 18:19:46 +00:00
|
|
|
|
|
|
|
// Barrel dismount gesture
|
2016-03-06 02:33:30 +00:00
|
|
|
_gunner playActionNow QGVAR(GestureDismountMuzzle);
|
2015-01-13 03:23:14 +00:00
|
|
|
playSound "ACE_BarrelSwap";
|
|
|
|
|
2016-03-06 02:33:30 +00:00
|
|
|
private _duration = 3.0;
|
|
|
|
if (_assistant isEqualTo _gunner) then {
|
|
|
|
_duration = 5.0;
|
|
|
|
};
|
|
|
|
|
|
|
|
[_duration, [_assistant,_gunner,_weapon], {(_this select 0) call FUNC(swapBarrelCallback)}, {}, (localize LSTRING(SwappingBarrel))] call EFUNC(common,progressBar);
|