-
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.
Chemical - Change Chemical Detector Sound (#659)
**When merged this pull request will:** - Changes the JCAD sound to multiple chimes which change with intensity - Adds ACE Interact option to turn off chimes ### 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}`.
- Loading branch information
1 parent
da58eb5
commit 0d926d1
Showing
16 changed files
with
210 additions
and
32 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
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
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Mazinski | ||
* Enables the audio on the Chemical Detector. | ||
* | ||
* Arguments: | ||
* None | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* call kat_chemical_enableChemDetector | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_unit"]; | ||
|
||
_unit setVariable [QGVAR(detectorEnabled), true, true]; | ||
|
||
[{ | ||
params ["_args", "_idPFH"]; | ||
_args params ["_unit"]; | ||
|
||
private _alive = alive _unit; | ||
|
||
if (!_alive) exitWith { | ||
[_idPFH] call CBA_fnc_removePerFrameHandler; | ||
}; | ||
|
||
if !("KAT_ChemicalDetector" in assignedItems _unit) exitWith { | ||
_unit setVariable [QGVAR(detectorEnabled), false, true]; | ||
_pfhID call CBA_fnc_removePerFrameHandler; | ||
}; | ||
|
||
private _detectorSound = _unit getVariable [QGVAR(detectorSound), false]; | ||
private _intensity = _unit getVariable [QGVAR(areaIntensity), 0]; | ||
|
||
if (_detectorSound) then { | ||
switch true do { | ||
case (_intensity > 0.9): { [QGVAR(playTone), [_unit, QGVAR(chemTone)], _unit] call CBA_fnc_targetEvent; }; | ||
case (_intensity > 0.7): { [QGVAR(playTone), [_unit, QGVAR(chemRapidChime)], _unit] call CBA_fnc_targetEvent; }; | ||
case (_intensity > 0.5): { [QGVAR(playTone), [_unit, QGVAR(chemFastChime)], _unit] call CBA_fnc_targetEvent; }; | ||
case (_intensity > 0.3): { [QGVAR(playTone), [_unit, QGVAR(chemNormalChime)], _unit] call CBA_fnc_targetEvent; }; | ||
case (_intensity > 0): { [QGVAR(playTone), [_unit, QGVAR(chemSlowChime)], _unit] call CBA_fnc_targetEvent; }; | ||
default { [QGVAR(playTone), [_unit, QGVAR(chemBaseChime)], _unit] call CBA_fnc_targetEvent; }; | ||
}; | ||
}; | ||
}, 5, [_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
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,24 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: DiGii | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* 1: Target <OBJECT> | ||
* | ||
* Return Value: | ||
* Bool | ||
* | ||
* Example: | ||
* [player, cursorTarget] call kat_chemical_fnc_hasGasmask; | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_unit"]; | ||
|
||
if ("KAT_ChemicalDetector" in assignedItems _unit) exitWith { | ||
true | ||
}; | ||
|
||
false |
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