Added generic Applause sound

Cleaned up Mr. Upbeat and Drumming Practice sounds as a result
This commit is contained in:
Carson Kompon 2022-03-07 12:10:50 -05:00
parent bc24be8a95
commit 6f2f8b13bd
7 changed files with 60 additions and 15 deletions

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0a36856eb4188e9448f3daeb02632748 guid: c86bb199b366fb345b66a429c88e7bbf
AudioImporter: AudioImporter:
externalObjects: {} externalObjects: {}
serializedVersion: 6 serializedVersion: 6

View file

@ -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:

View file

@ -33,7 +33,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice
{ {
if (player && PlayerInput.Pressed()) if (player && PlayerInput.Pressed())
{ {
Hit(false); Hit(false, false);
} }
} }
@ -57,8 +57,16 @@ namespace RhythmHeavenMania.Games.DrummingPractice
animator.Play("PrepareRight", 0, 0); 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 (!hitting)
{ {
if (count % 2 == 0) if (count % 2 == 0)
@ -67,18 +75,29 @@ namespace RhythmHeavenMania.Games.DrummingPractice
animator.Play("HitRight", 0, 0); animator.Play("HitRight", 0, 0);
count++; count++;
if (player) if (player && !force)
{ {
if (hit) if (hit)
Jukebox.PlayOneShotGame("drummingPractice/hit"); HitSound(applause);
else else
Jukebox.PlayOneShotGame("drummingPractice/miss"); MissSound();
} }
hitting = true; 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() public void EndHit()
{ {
hitting = false; hitting = false;

View file

@ -9,6 +9,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice
public class DrummerHit : PlayerActionObject public class DrummerHit : PlayerActionObject
{ {
public float startBeat; public float startBeat;
public bool applause = true;
private bool hit = false; private bool hit = false;
private bool hasHit = false; private bool hasHit = false;
@ -35,8 +36,8 @@ namespace RhythmHeavenMania.Games.DrummingPractice
if (!hit && Conductor.instance.GetPositionFromBeat(startBeat, 1) >= 1) if (!hit && Conductor.instance.GetPositionFromBeat(startBeat, 1) >= 1)
{ {
Jukebox.PlayOneShotGame("drummingPractice/drum"); Jukebox.PlayOneShotGame("drummingPractice/drum");
DrummingPractice.instance.leftDrummer.Hit(true); DrummingPractice.instance.leftDrummer.Hit(true, false);
DrummingPractice.instance.rightDrummer.Hit(true); DrummingPractice.instance.rightDrummer.Hit(true, false);
hit = true; hit = true;
if (hasHit) CleanUp(); if (hasHit) CleanUp();
} }
@ -60,7 +61,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice
{ {
if (!hasHit) if (!hasHit)
{ {
DrummingPractice.instance.player.Hit(_hit); DrummingPractice.instance.player.Hit(_hit, applause, true);
DrummingPractice.instance.SetFaces(_hit ? 1 : 2); DrummingPractice.instance.SetFaces(_hit ? 1 : 2);
hasHit = true; hasHit = true;

View file

@ -70,7 +70,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice
rightDrummer.Bop(); rightDrummer.Bop();
} }
public void Prepare(float beat) public void Prepare(float beat, bool applause)
{ {
int type = count % 2; int type = count % 2;
player.Prepare(type); player.Prepare(type);
@ -86,6 +86,7 @@ namespace RhythmHeavenMania.Games.DrummingPractice
hit.SetActive(true); hit.SetActive(true);
DrummerHit h = hit.GetComponent<DrummerHit>(); DrummerHit h = hit.GetComponent<DrummerHit>();
h.startBeat = beat; h.startBeat = beat;
h.applause = applause;
} }
public void SetFaces(int type) public void SetFaces(int type)

View file

@ -84,10 +84,9 @@ namespace RhythmHeavenMania.Games.MrUpbeat
public void Ding(bool applause) 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) public void Beat(float beat)

View file

@ -391,7 +391,10 @@ namespace RhythmHeavenMania
new Minigame("drummingPractice", "Drumming Practice", "2BCF33", false, false, new List<GameAction>() new Minigame("drummingPractice", "Drumming Practice", "2BCF33", false, false, new List<GameAction>()
{ {
new GameAction("bop", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetBop(e.beat, e.length); }, 0.5f, true), 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<Param>()
{
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<Param>() new GameAction("set mii", delegate { var e = eventCaller.currentEntity; DrummingPractice.instance.SetMiis(e.type, e.toggle); }, 0.5f, parameters: new List<Param>()
{ {
new Param("type", DrummingPractice.MiiType.GuestA, "Mii", "The Mii that the player will control"), new Param("type", DrummingPractice.MiiType.GuestA, "Mii", "The Mii that the player will control"),