diff --git a/Assets/Resources/Sfx/applause.ogg b/Assets/Resources/Sfx/applause.ogg new file mode 100644 index 00000000..4d3902bb Binary files /dev/null and b/Assets/Resources/Sfx/applause.ogg differ diff --git a/Assets/Resources/Sfx/games/drummingPractice/hit.ogg.meta b/Assets/Resources/Sfx/applause.ogg.meta similarity index 91% rename from Assets/Resources/Sfx/games/drummingPractice/hit.ogg.meta rename to Assets/Resources/Sfx/applause.ogg.meta index dd9e1eed..3c087a76 100644 --- a/Assets/Resources/Sfx/games/drummingPractice/hit.ogg.meta +++ b/Assets/Resources/Sfx/applause.ogg.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0a36856eb4188e9448f3daeb02632748 +guid: c86bb199b366fb345b66a429c88e7bbf AudioImporter: externalObjects: {} serializedVersion: 6 diff --git a/Assets/Resources/Sfx/games/drummingPractice/hit.ogg b/Assets/Resources/Sfx/games/drummingPractice/hit.ogg deleted file mode 100644 index 86d716d4..00000000 Binary files a/Assets/Resources/Sfx/games/drummingPractice/hit.ogg and /dev/null differ diff --git a/Assets/Resources/Sfx/games/drummingPractice/hit.wav b/Assets/Resources/Sfx/games/drummingPractice/hit.wav new file mode 100644 index 00000000..f198800b Binary files /dev/null and b/Assets/Resources/Sfx/games/drummingPractice/hit.wav differ diff --git a/Assets/Resources/Sfx/games/drummingPractice/hit.wav.meta b/Assets/Resources/Sfx/games/drummingPractice/hit.wav.meta new file mode 100644 index 00000000..f622f460 --- /dev/null +++ b/Assets/Resources/Sfx/games/drummingPractice/hit.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 9a2262c26722c574bb3f347bdb19f534 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Games/DrummingPractice/Drummer.cs b/Assets/Scripts/Games/DrummingPractice/Drummer.cs index 0ea2d27a..f6a7c38e 100644 --- a/Assets/Scripts/Games/DrummingPractice/Drummer.cs +++ b/Assets/Scripts/Games/DrummingPractice/Drummer.cs @@ -33,7 +33,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice { if (player && PlayerInput.Pressed()) { - Hit(false); + Hit(false, false); } } @@ -57,8 +57,16 @@ namespace RhythmHeavenMania.Games.DrummingPractice animator.Play("PrepareRight", 0, 0); } - public void Hit(bool hit) + public void Hit(bool hit, bool applause, bool force = false) { + if(player && force) + { + if (hit) + HitSound(applause); + else + MissSound(); + } + if (!hitting) { if (count % 2 == 0) @@ -67,18 +75,29 @@ namespace RhythmHeavenMania.Games.DrummingPractice animator.Play("HitRight", 0, 0); count++; - if (player) + if (player && !force) { if (hit) - Jukebox.PlayOneShotGame("drummingPractice/hit"); + HitSound(applause); else - Jukebox.PlayOneShotGame("drummingPractice/miss"); + MissSound(); } hitting = true; } } + private void HitSound(bool applause) + { + Jukebox.PlayOneShotGame("drummingPractice/hit"); + if (applause) Jukebox.PlayOneShot("applause"); + } + + private void MissSound() + { + Jukebox.PlayOneShotGame("drummingPractice/miss"); + } + public void EndHit() { hitting = false; diff --git a/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs b/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs index 47ef89d1..f2c957ac 100644 --- a/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs +++ b/Assets/Scripts/Games/DrummingPractice/DrummerHit.cs @@ -9,6 +9,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice public class DrummerHit : PlayerActionObject { public float startBeat; + public bool applause = true; private bool hit = false; private bool hasHit = false; @@ -35,8 +36,8 @@ namespace RhythmHeavenMania.Games.DrummingPractice if (!hit && Conductor.instance.GetPositionFromBeat(startBeat, 1) >= 1) { Jukebox.PlayOneShotGame("drummingPractice/drum"); - DrummingPractice.instance.leftDrummer.Hit(true); - DrummingPractice.instance.rightDrummer.Hit(true); + DrummingPractice.instance.leftDrummer.Hit(true, false); + DrummingPractice.instance.rightDrummer.Hit(true, false); hit = true; if (hasHit) CleanUp(); } @@ -60,7 +61,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice { if (!hasHit) { - DrummingPractice.instance.player.Hit(_hit); + DrummingPractice.instance.player.Hit(_hit, applause, true); DrummingPractice.instance.SetFaces(_hit ? 1 : 2); hasHit = true; diff --git a/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs b/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs index 58c58d8e..f6fb732d 100644 --- a/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs +++ b/Assets/Scripts/Games/DrummingPractice/DrummingPractice.cs @@ -70,7 +70,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice rightDrummer.Bop(); } - public void Prepare(float beat) + public void Prepare(float beat, bool applause) { int type = count % 2; player.Prepare(type); @@ -86,6 +86,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice hit.SetActive(true); DrummerHit h = hit.GetComponent(); h.startBeat = beat; + h.applause = applause; } public void SetFaces(int type) diff --git a/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs b/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs index ac60d8c6..0d01d119 100644 --- a/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs +++ b/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs @@ -84,10 +84,9 @@ namespace RhythmHeavenMania.Games.MrUpbeat public void Ding(bool applause) { - if(applause) - Jukebox.PlayOneShotGame("mrUpbeat/applause"); - else - Jukebox.PlayOneShotGame("mrUpbeat/ding"); + Jukebox.PlayOneShotGame("mrUpbeat/ding"); + if (applause) + Jukebox.PlayOneShot("applause"); } public void Beat(float beat) diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index f500d665..fbb0ca66 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -391,7 +391,10 @@ namespace RhythmHeavenMania new Minigame("drummingPractice", "Drumming Practice", "2BCF33", false, false, new List() { new GameAction("bop", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetBop(e.beat, e.length); }, 0.5f, true), - new GameAction("drum", delegate { DrummingPractice.instance.Prepare(eventCaller.currentEntity.beat); }, 2f), + new GameAction("drum", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.Prepare(e.beat, e.toggle); }, 2f, parameters: new List() + { + new Param("toggle", true, "Applause", "Whether or not an applause should be played on a successful hit") + }), new GameAction("set mii", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetMiis(e.type, e.toggle); }, 0.5f, parameters: new List() { new Param("type", DrummingPractice.MiiType.GuestA, "Mii", "The Mii that the player will control"),