-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explosives - Improve Support for custom IED ringtones #10731
Open
tuntematonjr
wants to merge
18
commits into
acemod:master
Choose a base branch
from
tuntematonjr:ied-ringtones
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+36
−21
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ae0f15b
Add default ringtone
tuntematonjr ed5d971
add ringtone hashmap
tuntematonjr 81c8b0e
Add config support for different ied ringtones
tuntematonjr b5b4f50
Fix macros
tuntematonjr d2169f0
_code is unused param
tuntematonjr 35f24e3
not update base class
tuntematonjr e0357fd
add documentation
tuntematonjr 58778bb
remove tabs
tuntematonjr 657023a
Update addons/explosives/functions/fnc_dialPhone.sqf
tuntematonjr 302e078
Update addons/explosives/functions/fnc_dialingPhone.sqf
tuntematonjr c3703e2
Update addons/explosives/functions/fnc_dialingPhone.sqf
tuntematonjr 3c2ee81
Update docs/wiki/framework/explosives-framework.md
tuntematonjr b47d365
Update addons/explosives/functions/fnc_dialPhone.sqf
tuntematonjr 5e2f120
Update addons/explosives/functions/fnc_dialPhone.sqf
tuntematonjr 73d2d63
Update addons/explosives/functions/fnc_dialPhone.sqf
tuntematonjr b157c4b
Remove caching
tuntematonjr 9feadab
adding the pitch, volume and distance to the config
tuntematonjr a8810ce
fix typo
tuntematonjr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
/* | ||
* Author: Garth 'L-H' de Wet | ||
* Dials the number passed and detonates the explosive. | ||
* | ||
* Arguments: | ||
* 0: Unit to do dialing <OBJECT> | ||
* 1: Code to dial <STRING> | ||
|
@@ -15,9 +14,7 @@ | |
* | ||
* Public: Yes | ||
*/ | ||
|
||
params ["_unit", "_code"]; | ||
TRACE_2("params",_unit,_code); | ||
Comment on lines
-18
to
-20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same. |
||
|
||
if (_unit getVariable [QGVAR(Dialing),false]) exitWith {}; | ||
if !(alive _unit) exitWith {}; | ||
|
@@ -28,22 +25,34 @@ private _arr = []; | |
for "_i" from 1 to _ran do { | ||
_arr = _arr + ['.','..','...','']; | ||
}; | ||
|
||
private _explosive = [_code] call FUNC(getSpeedDialExplosive); | ||
|
||
private _ringtone = getArray (configOf (_explosive select 0) >> QGVAR(ringtones)); | ||
if (_ringtone isEqualTo []) then { _ringtone = [[QPATHTOF(Data\Audio\Cellphone_Ring.wss), 0.75, 3.16228, 1, 75]] }; | ||
//support random ringtones | ||
tuntematonjr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_ringtone = selectRandom _ringtone; | ||
_ringtone params ["_ringtonePath", "_ringtoneLength", "_volume", "_soundPitch", "_distance"]; | ||
|
||
//Calculate the ringtone duration before detonation with slight randomness | ||
private _ringtoneDuration = round(count _arr - (_ringtoneLength + (random 1.5)- 0.75) / 0.25) max 4; | ||
|
||
TRACE_2("ringtone",_ringtone,_ringtoneDuration); | ||
if (_unit == ace_player) then { | ||
ctrlSetText [1400,"Calling"]; | ||
[LINKFUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); | ||
[LINKFUNC(dialingPhone), 0.25, [_unit,4,_arr,_explosive,_ringtonePath,_ringtoneDuration,_volume,_soundPitch,_distance]] call CALLSTACK(CBA_fnc_addPerFrameHandler); | ||
} else { | ||
private _explosive = [_code] call FUNC(getSpeedDialExplosive); | ||
if ((count _explosive) > 0) then { | ||
private _waitTime = 0.25 * _ringtoneDuration; | ||
[{ | ||
params ["_unit", "_item"]; | ||
|
||
params ["_unit", "_item", "_ringtonePath"]; | ||
if ([_unit, -1, (_item # 0), (_item # 2), "ACE_Cellphone"] call FUNC(checkDetonateHandlers)) then { | ||
playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)), objNull, false, (getPosASL (_item # 0)), 3.16228, 1, 75]; | ||
playSound3D [_ringtonePath, objNull, false, (getPosASL (_item # 0)), _volume, _soundPitch, _distance]; | ||
}; | ||
|
||
_unit setVariable [QGVAR(Dialing), false, true]; | ||
}, [_unit, _explosive], 0.25 * (count _arr - 4)] call CBA_fnc_waitAndExecute; | ||
}, [_unit, _explosive, _ringtonePath], _waitTime] call CBA_fnc_waitAndExecute; | ||
|
||
[_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2), "ACE_Cellphone", _unit] call FUNC(startTimer); | ||
[_explosive select 0,(_waitTime + 2) + (_explosive select 2), "ACE_Cellphone", _unit] call FUNC(startTimer); | ||
}; | ||
}; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rogue change.