ACE3/addons/frag/functions/fnc_shouldSpall.sqf
lambdatiger 3c1e912787 Initial commit:
- Added new ammo cfg types
 - Added new caching functions
 - Added dev functions
 - Transfered core system to vanilla projectile EHs
 - Added stringtable sub categories
 - Reworked fragmenting and spalling to us submunitions
   - Frag
     - Implemented system around chance to hit
     - Switched from hitbox estimation to hitting specific HPs
     - Updated chance to miss method based on solid angle hit chance
     - Split random & targeted frag to their own subfunctions
   - Spall
     - Uses a system of estimated momentum changes to generate spall
2024-01-08 15:22:52 -06:00

31 lines
832 B
Plaintext

#include "script_component.hpp"
/*
* Author: Lambda.Tiger
* This function checks whether an ammunition type should cause spalling
*
*
* Arguments:
* 0: _ammo <STRING> - cfgAmmo type of ammo to check
*
* Return Value:
* Whether the round type would spall when hitting an object <BOOL>
*
* Example:
* ["B_556x45_Ball"] call ace_frag_fnc_shouldSpall;
*
* Public: No
*/
params ["_ammo"];
private _shouldSpall = GVAR(spallCahche) get _ammo;
if !(isNil "_shouldSpall") exitWith {_shouldSpall};
private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber");
private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive");
private _idH = getNumber (configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange");
_shouldSpall = (_caliber >= 2.5 || _explosive > 0 && _idh >= 1);
_shouldSpall