-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breathing - Re-add sounds for Breathing/Chemical conditions (#658)
**When merged this pull request will:** - Re-adds sounds for breathing and chemical effects ### IMPORTANT - [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied. - Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`. --------- Co-authored-by: MiszczuZPolski <71414303+MiszczuZPolski@users.noreply.github.com>
- Loading branch information
1 parent
dc9dce5
commit 6e5395f
Showing
14 changed files
with
149 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
addons/breathing/functions/fnc_handleBreathingConditions.sqf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Mazinski | ||
* Monitors breathing conditions. | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [player] call kat_breathing_fnc_handleBreathingConcidtions; | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_unit"]; | ||
|
||
[{ | ||
params ["_args", "_idPFH"]; | ||
_args params ["_unit"]; | ||
|
||
private _alive = alive _unit; | ||
|
||
if (!_alive) exitWith { | ||
[_idPFH] call CBA_fnc_removePerFrameHandler; | ||
}; | ||
|
||
private _spo2 = GET_KAT_SPO2(_unit); | ||
|
||
if (GVAR(staminaLossAtLowSPO2)) then { | ||
if (!(_unit getVariable ["ACE_isUnconscious",false]) && {_spo2 <= GVAR(lowSPO2Level)}) then { | ||
if (ACEGVAR(advanced_fatigue,enabled)) then { | ||
["kat_LSDF", 1.5] call ACEFUNC(advanced_fatigue,addDutyFactor); | ||
} else { | ||
_unit setStamina(getStamina _unit - 3); | ||
}; | ||
} else { | ||
["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); | ||
}; | ||
}; | ||
}, 10, [_unit]] call CBA_fnc_addPerFrameHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
PREP(effectBreathingWheeze); | ||
PREP(effectCoughing); | ||
PREP(effectLowSpO2); | ||
PREP(effectOpioid); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Mazinski | ||
* Triggers the wheezing effect. | ||
* | ||
* Arguments: | ||
* 0: Enable <BOOL> | ||
* 1: Intensity <NUMBER> | ||
* 2: Unit <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [true, 0.5, player] call kat_feedback_fnc_effectBreathingWheeze; | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_enable", "_effected", "_unit"]; | ||
if (!_enable || !_effected) exitWith { false }; | ||
|
||
if (!(_unit getVariable [QEGVAR(breathing,PneumoBreathCooldownOn), false])) then { | ||
_unit setVariable [QEGVAR(breathing,PneumoBreathCooldownOn), true, true]; | ||
|
||
private _soundTargets = allPlayers inAreaArray [ASLToAGL getPosASL _unit, 15, 15, 0, false, 15]; | ||
|
||
if !(_soundTargets isEqualTo []) then { | ||
[QEGVAR(breathing,playCough), [_unit], _soundTargets] call CBA_fnc_targetEvent; | ||
}; | ||
|
||
[{ | ||
params["_unit"]; | ||
_unit setVariable [QEGVAR(breathing,PneumoBreathCooldownOn), false, true]; | ||
}, | ||
[_unit], 20] call CBA_fnc_waitAndExecute; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters