2015-07-10 22:09:20 +00:00
|
|
|
/*
|
|
|
|
* Author: joko // Jonas
|
|
|
|
* Handle fire of local launchers
|
|
|
|
*
|
2015-08-30 05:35:58 +00:00
|
|
|
* Arguments:
|
|
|
|
* 0: Unit that fired <OBJECT>
|
|
|
|
* 1: Weapon fired <STRING>
|
|
|
|
* 2: Muzzle <STRING>
|
|
|
|
* 3: Mode <STRING>
|
|
|
|
* 4: Ammo <STRING>
|
|
|
|
* 5: Magazine <STRING>
|
|
|
|
* 6: Projectile <OBJECT>
|
2015-07-10 22:09:20 +00:00
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* None
|
2016-01-16 14:04:22 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, "launch_RPG32_F", "launch_RPG32_F", "Single", "R_PG32V_F", "RPG32_F", projectile] call ace_overpressure_fnc_firedEHBB;
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-07-10 22:09:20 +00:00
|
|
|
*/
|
2015-08-30 05:49:12 +00:00
|
|
|
#include "script_component.hpp"
|
2016-01-16 14:04:22 +00:00
|
|
|
|
|
|
|
params ["_firer", "_weapon", "", "", "_ammo", "_magazine", ""];
|
|
|
|
|
|
|
|
// Prevent AI from causing backblast damage (fast exit to only run for local players)
|
|
|
|
if (_firer != ACE_player) exitWith {};
|
2015-08-30 05:35:58 +00:00
|
|
|
|
2015-08-30 22:05:55 +00:00
|
|
|
// Bake variable name and check if the variable exists, call the caching function otherwise
|
2016-01-16 14:04:22 +00:00
|
|
|
private _varName = format [QGVAR(values%1%2%3), _weapon, _ammo, _magazine];
|
|
|
|
private _damage = if (isNil _varName) then {
|
2015-08-30 21:40:53 +00:00
|
|
|
([_weapon, _ammo, _magazine] call FUNC(cacheOverPressureValues)) select 2;
|
2015-08-30 05:35:58 +00:00
|
|
|
} else {
|
|
|
|
(missionNameSpace getVariable _varName) select 2;
|
|
|
|
};
|
|
|
|
|
2015-08-30 21:40:53 +00:00
|
|
|
if (_damage > 0) then {
|
2015-07-10 22:09:20 +00:00
|
|
|
_this call DFUNC(fireLauncherBackblast)
|
2015-08-30 05:35:58 +00:00
|
|
|
};
|