mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 13:47:38 +02:00
Added generic Applause sound
Cleaned up Mr. Upbeat and Drumming Practice sounds as a result
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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<DrummerHit>();
|
||||
h.startBeat = beat;
|
||||
h.applause = applause;
|
||||
}
|
||||
|
||||
public void SetFaces(int type)
|
||||
|
@ -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)
|
||||
|
@ -391,7 +391,10 @@ namespace RhythmHeavenMania
|
||||
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("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 Param("type", DrummingPractice.MiiType.GuestA, "Mii", "The Mii that the player will control"),
|
||||
|
Reference in New Issue
Block a user