mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
added fnc_initRound
This commit is contained in:
parent
c6ba93a26d
commit
bfb3fa851c
@ -10,10 +10,13 @@ PREP(dev_drawTrace);
|
||||
PREP(dev_clearTraces);
|
||||
PREP(dev_switchUnitHandle);
|
||||
|
||||
// Base
|
||||
PREP(fired);
|
||||
PREP(initRound);
|
||||
|
||||
// Frag
|
||||
PREP(addBlackList);
|
||||
PREP(initBlackList);
|
||||
PREP(fired);
|
||||
PREP(submunition);
|
||||
PREP(shouldFrag);
|
||||
PREP(fragInfo);
|
||||
@ -25,8 +28,6 @@ PREP(doFragRandom);
|
||||
PREP(shouldSpall);
|
||||
PREP(doSpall);
|
||||
PREP(doSpallMomentum);
|
||||
|
||||
// * Other */
|
||||
//PREP(spallHP); Look at me !*!
|
||||
|
||||
// Explosive Reflection
|
||||
|
@ -7,13 +7,13 @@
|
||||
[] call FUNC(initBlackList);
|
||||
};
|
||||
|
||||
if (hasInterface) then {
|
||||
/*if (hasInterface) then {
|
||||
["ace_firedPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler;
|
||||
["ace_firedPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler;
|
||||
};
|
||||
|
||||
["ace_firedNonPlayer", LINKFUNC(fired)] call CBA_fnc_addEventHandler;
|
||||
["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler;
|
||||
["ace_firedNonPlayerVehicle", LINKFUNC(fired)] call CBA_fnc_addEventHandler;*/
|
||||
|
||||
// Debug info
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
|
62
addons/frag/functions/fnc_initRound.sqf
Normal file
62
addons/frag/functions/fnc_initRound.sqf
Normal file
@ -0,0 +1,62 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: Lambda.Tiger
|
||||
* This function checks whether an ammunition type should cause fragmentation
|
||||
* and whether any submunitions exist
|
||||
*
|
||||
* Arguments:
|
||||
* 0: _ammo <STRING> - cfgAmmo type of ammo to check
|
||||
*
|
||||
* Return Value:
|
||||
* _shouldFrag <ARRAY>
|
||||
* 0 - Should the specific round fragment
|
||||
* 1 - Does the munition have a child submunition
|
||||
*
|
||||
* Example:
|
||||
* ["B_556x45_Ball"] call ace_frag_fnc_shouldFrag;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_projectile"];
|
||||
private _ammo = typeOf _proj;
|
||||
systemChat (str _ammo + " " + str _projectile);
|
||||
if (isNil "_ammo" ||
|
||||
{_ammo isEqualTo "" ||
|
||||
{isNil "_projectile" ||
|
||||
{isNull _projectile}}}) exitWith {
|
||||
WARNING("bad ammo or projectile");
|
||||
};
|
||||
|
||||
/******* _shouldFrag format *****/
|
||||
// 0: doFragmnent - will the piece fragment
|
||||
// 1: hasSubmuntion - will the round create submunitions
|
||||
private _shouldFrag = _ammo call FUNC(shouldFrag);
|
||||
_shouldFrag params ["_doFrag", "_doSubmunit"];
|
||||
|
||||
if (_doFrag) then {
|
||||
// wait for frag damage to kill units before spawning fragments
|
||||
_projectile addEventHandler ["Explode", {
|
||||
if (isServer) then {
|
||||
[FUNC(doFrag), [_this]] call CBA_fnc_execNextFrame;
|
||||
} else {
|
||||
[QGVAR(frag_eh), [_this]] call CBA_fnc_serverEvent;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
if (_doSubmunit && {GVAR(enSubMunit)> 0}) then {
|
||||
_projectile addEventHandler ["SubmunitionCreated", {_this call FUNC(submunition)}];
|
||||
};
|
||||
|
||||
private _shouldSpall = _ammo call FUNC(shouldSpall);
|
||||
|
||||
if (GVAR(spallEnabled) && {_shouldSpall}) then
|
||||
{_projectile addEventHandler [
|
||||
"HitPart",
|
||||
{
|
||||
[LINKFUNC(doSpallMomentum), _this] call CBA_fnc_execNextFrame;
|
||||
[QGVAR(spall_eh), [_this]] call CBA_fnc_serverEvent;
|
||||
}
|
||||
];
|
||||
};
|
Loading…
Reference in New Issue
Block a user