mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
37 lines
1.0 KiB
Plaintext
37 lines
1.0 KiB
Plaintext
/*
|
|
* Author: Commy2 and CAA-Picard
|
|
* Handle weapon fire, heat up the weapon
|
|
*
|
|
* Argument:
|
|
* 0: Unit <OBJECT>
|
|
* 1: Weapon <STRING>
|
|
* 3: Muzzle <STRING>
|
|
* 4: Ammo <STRING>
|
|
* 5: Magazine <STRING>
|
|
* 6: Projectile <OBJECT>
|
|
*
|
|
* Return value:
|
|
* None
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "\z\ace\addons\overheating\script_component.hpp"
|
|
|
|
private ["_unit", "_weapon", "_ammo", "_projectile"];
|
|
_unit = _this select 0;
|
|
_weapon = _this select 1;
|
|
_ammo = _this select 4;
|
|
_projectile = _this select 6;
|
|
|
|
private ["_bulletMass","_energyIncrement"];
|
|
|
|
// Get physical parameters
|
|
_bulletMass = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ACE_BulletMass");
|
|
if (_bulletMass == 0) then {
|
|
// If the bullet mass is not configured, estimate it
|
|
_bulletMass = 3.4334 + 0.5171 * (getNumber (configFile >> "CfgAmmo" >> _ammo >> "hit") + getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber"));
|
|
};
|
|
_energyIncrement = 0.75 * 0.0005 * _bulletMass * (vectorMagnitudeSqr velocity _projectile);
|
|
|
|
[_unit, _weapon, _energyIncrement] call FUNC(updateTemperature)
|