ACE3/addons/frag/functions/fnc_submunition.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

40 lines
1.2 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: Lambda.Tiger
* This function adds event handlers for submunition fragmentation.
* It begins by confirming fragmentation and submunition fragmentation is
* enabled, requests cached (or live calculated) ammo information array.
* and uses that information to add event handlers as needed to the given
* submunition.
*
* Arguments:
* Inherits from BI SubmunitionCraeted EH
*
* Return Value:
* none
*
* Example:
* ["", _submunitionProjectile] call ace_frag_submunition
*
* Public: No
*/
if (!GVAR(enabled) || {GVAR(enSubMunit) == 0}) exitWith {};
// params ["_projectile", "_submunitionProjectile", "_pos", "_velocity"];
params ["", "_submunitionProjectile"];
private _shouldFrag = GVAR(shouldFragCache) getOrDefaultCall [typeOf _submunitionProjectile, FUNC(shouldFrag), true];
_shouldFrag params ["_doFrag", "_doSubmunit"];
if (_doFrag) then {
_submunitionProjectile addEventHandler ["Explode", {[_this, true] call FUNC(doFrag)}];
};
if (_doSubmunit) then {
_submunitionProjectile addEventHandler ["SubmunitionCreated", {_this call FUNC(submunition)}];
};
#ifdef DEBUG_MODE_FULL
[_submunitionProjectile] call UNC(dev_addRound);
#endif