diff --git a/addons/overheating/functions/fnc_checkTemperature.sqf b/addons/overheating/functions/fnc_checkTemperature.sqf index 800171ac55..b2cf0f80c5 100644 --- a/addons/overheating/functions/fnc_checkTemperature.sqf +++ b/addons/overheating/functions/fnc_checkTemperature.sqf @@ -1,4 +1,16 @@ -// by commy2 and CAA-Picard +/* + * Author: Commy2 and CAA-Picard + * + * Make the player check the temperature of his weapon + * + * Arguments: + * 0: _player + * 1: _weapon + * + * Return Values: + * None + * + */ #include "\z\ace\addons\overheating\script_component.hpp" EXPLODE_2_PVT(_this,_player,_weapon); diff --git a/addons/overheating/functions/fnc_clearJam.sqf b/addons/overheating/functions/fnc_clearJam.sqf index 1ae58e0b4f..829ab34811 100644 --- a/addons/overheating/functions/fnc_clearJam.sqf +++ b/addons/overheating/functions/fnc_clearJam.sqf @@ -1,12 +1,21 @@ -// by commy2 +/* + * Author: Commy2 + * + * Clears the jam from a weapon + * + * Argument: + * 0: Last temperature (number) + * 1: Barrel mass (number) + * 2: Time (number) + * + * Return value: + * New temperature (number) + */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_unit", "_weapon", "_skipAnim", "_jammedWeapons"]; - -_unit = _this select 0; -_weapon = _this select 1; -_skipAnim = _this select 2; +EXPLODE_3_PVT(_this,_unit,_weapon,_skipAnim); +private ["_jammedWeapons"]; _jammedWeapons = _unit getVariable [QGVAR(jammedWeapons), []]; if (_weapon in _jammedWeapons) then { diff --git a/addons/overheating/functions/fnc_cooldown.sqf b/addons/overheating/functions/fnc_cooldown.sqf index 014dfbcbfe..13d53c7327 100644 --- a/addons/overheating/functions/fnc_cooldown.sqf +++ b/addons/overheating/functions/fnc_cooldown.sqf @@ -13,15 +13,12 @@ */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_temperature", "_barrelMass", "_totalTime", "_barrelSurface", "_time", "_deltaTime"]; - -_temperature = _this select 0; -_barrelMass = _this select 1; -_totalTime = _this select 2; +EXPLODE_3_PVT(_this,_temperature,_barrelMass,_totalTime); // If a long time passed since the last shot, there's no need to calculate anything; the weapon should be cool if (_totalTime > 1800) exitWith {0}; +private ["_barrelSurface", "_time", "_deltaTime"]; _barrelSurface = _barrelMass / 7850 / 0.003; _time = 0; diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index ba03b0dfc0..e84dbb4a53 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -1,14 +1,23 @@ -// based on KK_fnc_playerWeaponMulfunction from KillzoneKid +/* + * Author: Commy2, based on KK_fnc_playerWeaponMulfunction from KillzoneKid + * + * Jam the weapon + * + * Argument: + * 0: unit + * 1: weapon + * + * Return value: + * None + */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_unit", "_weapon", "_jammedWeapons"]; - -_unit = _this select 0; -_weapon = _this select 1; +EXPLODE_2_PVT(_this,_unit,_weapon); // don't jam a weapon with no rounds left if (_unit ammo _weapon == 0) exitWith {}; +private ["_jammedWeapons"]; _jammedWeapons = _unit getVariable [QGVAR(jammedWeapons), []]; _jammedWeapons pushBack _weapon; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index 889d99c625..05a286cfa2 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -1,14 +1,30 @@ -// by commy2 and CAA-Picard +/* + * Author: Commy2 and CAA-Picard + * + * Heat up the weapon + * + * Argument: + * 0: unit + * 1: weapon + * 2: ammo + * 3: projectile + * 4: velocity + * + * Return value: + * None + */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_unit", "_weapon", "_ammo", "_projectile", "_velocity", "_variableName", "_overheat", "_temperature", "_time", "_energyIncrement", "_barrelMass", "_scaledTemperature"]; - +private ["_unit", "_weapon", "_ammo", "_projectile"]; _unit = _this select 0; _weapon = _this select 1; _ammo = _this select 4; _projectile = _this select 6; + _velocity = velocity _projectile; +private ["_variableName", "_overheat", "_temperature", "_time", "_energyIncrement", "_barrelMass", "_scaledTemperature"]; + // each weapon has it's own variable. Can't store the temperature in the weapon since they are not objects unfortunately. _variableName = format [QGVAR(%1), _weapon]; diff --git a/addons/overheating/functions/fnc_pfhDisplayTemperature.sqf b/addons/overheating/functions/fnc_pfhDisplayTemperature.sqf index 2f13856ee7..1a03069624 100644 --- a/addons/overheating/functions/fnc_pfhDisplayTemperature.sqf +++ b/addons/overheating/functions/fnc_pfhDisplayTemperature.sqf @@ -1,4 +1,16 @@ -// by commy2 and CAA-Picard +/* + * Author: Commy2 and CAA-Picard + * + * PFH that displays the weapon temperature after a slight delay + * + * Arguments: + * 0: _player + * 1: _weapon + * + * Return Values: + * None + * + */ #include "\z\ace\addons\overheating\script_component.hpp" EXPLODE_2_PVT(_this,_params,_pfhId); diff --git a/addons/overheating/functions/fnc_swapBarrel.sqf b/addons/overheating/functions/fnc_swapBarrel.sqf index bf55445752..1b8c75b71f 100644 --- a/addons/overheating/functions/fnc_swapBarrel.sqf +++ b/addons/overheating/functions/fnc_swapBarrel.sqf @@ -1,10 +1,18 @@ -// by commy2 +/* + * Author: Commy2 + * + * Make a unit start swapping it's barrel + * + * Argument: + * 0: unit + * 1: weapon + * + * Return value: + * None + */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_player", "_weapon"]; - -_player = _this select 0; -_weapon = _this select 1; +EXPLODE_2_PVT(_this,_player,_weapon); if (stance _player != "PRONE") then { [_player, "amovpknlmstpsraswrfldnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/overheating/functions/fnc_swapBarrelCallback.sqf b/addons/overheating/functions/fnc_swapBarrelCallback.sqf index cef11852f5..88201dc9f4 100644 --- a/addons/overheating/functions/fnc_swapBarrelCallback.sqf +++ b/addons/overheating/functions/fnc_swapBarrelCallback.sqf @@ -1,10 +1,18 @@ -// by commy2 +/* + * Author: Commy2 + * + * Swap barrel callback + * + * Argument: + * 0: unit + * 1: weapon + * + * Return value: + * None + */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_player", "_weapon"]; - -_player = _this select 0; -_weapon = _this select 1; +EXPLODE_2_PVT(_this,_player,_weapon); // don't consume the barrel, but rotate through them. [localize "STR_ACE_Overheating_SwappedBarrel", QUOTE(PATHTOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture);