Grenades - Flashbang events (#9796)

This commit is contained in:
BrettMayson 2024-02-12 11:01:24 -06:00 committed by GitHub
parent d6eb6b981c
commit 1002dfe31b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -63,6 +63,7 @@ _affected = _affected - [ACE_player];
if (_flashReactionDebounce < CBA_missionTime) then {
// Not used interally but could be useful for other mods
_unit setVariable [QGVAR(flashStrength), _strength, true];
[QGVAR(flashbangedAI), [_unit, _strength, _grenadePosASL]] call CBA_fnc_localEvent;
{
_unit setSkill [_x, (_unit skill _x) / 50];
} forEach SUBSKILLS;
@ -162,5 +163,7 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then {
private _maxFlinch = linearConversion [0.2, 1, _strength, 0, 95, true];
private _flinch = (_minFlinch + random (_maxFlinch - _minFlinch)) * selectRandom [-1, 1];
ACE_player setDir (getDir ACE_player + _flinch);
[QGVAR(flashbangedPlayer), [_strength, _grenadePosASL]] call CBA_fnc_localEvent;
};
true

View File

@ -68,3 +68,13 @@ The average amount of time in seconds, after `explosionTime` has passed, between
### 2.4 ace_grenades_flashbangIntervalMaxDeviation
The amount of randomness in the fuse time.
## 3. Events
### 3.1 Listenable
Event Name | Description | Passed Parameter(s) | Locality
---------- | ----------- | ------------------- | --------
`ace_flashbangExploded` | A flashbang exploded | `[_grenadePosASL]` | Global
`ace_grenades_flashbangedAI` | A local AI was affected by a flashbang | `[_unit, _strength, _grenadePosASL]` | Local
`ace_grenades_flashbangedPlayer` | The local player was affected by a flashbang | `[_strength, _grenadePosASL]` | Local