mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Grenades - Flashbang events (#9796)
This commit is contained in:
parent
d6eb6b981c
commit
1002dfe31b
@ -63,6 +63,7 @@ _affected = _affected - [ACE_player];
|
|||||||
if (_flashReactionDebounce < CBA_missionTime) then {
|
if (_flashReactionDebounce < CBA_missionTime) then {
|
||||||
// Not used interally but could be useful for other mods
|
// Not used interally but could be useful for other mods
|
||||||
_unit setVariable [QGVAR(flashStrength), _strength, true];
|
_unit setVariable [QGVAR(flashStrength), _strength, true];
|
||||||
|
[QGVAR(flashbangedAI), [_unit, _strength, _grenadePosASL]] call CBA_fnc_localEvent;
|
||||||
{
|
{
|
||||||
_unit setSkill [_x, (_unit skill _x) / 50];
|
_unit setSkill [_x, (_unit skill _x) / 50];
|
||||||
} forEach SUBSKILLS;
|
} 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 _maxFlinch = linearConversion [0.2, 1, _strength, 0, 95, true];
|
||||||
private _flinch = (_minFlinch + random (_maxFlinch - _minFlinch)) * selectRandom [-1, 1];
|
private _flinch = (_minFlinch + random (_maxFlinch - _minFlinch)) * selectRandom [-1, 1];
|
||||||
ACE_player setDir (getDir ACE_player + _flinch);
|
ACE_player setDir (getDir ACE_player + _flinch);
|
||||||
|
|
||||||
|
[QGVAR(flashbangedPlayer), [_strength, _grenadePosASL]] call CBA_fnc_localEvent;
|
||||||
};
|
};
|
||||||
true
|
true
|
||||||
|
@ -68,3 +68,13 @@ The average amount of time in seconds, after `explosionTime` has passed, between
|
|||||||
### 2.4 ace_grenades_flashbangIntervalMaxDeviation
|
### 2.4 ace_grenades_flashbangIntervalMaxDeviation
|
||||||
|
|
||||||
The amount of randomness in the fuse time.
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user