diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 792e1bbe..8d428d3e 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -9563,7 +9563,7 @@ MonoBehaviour: gridGameSelector: {fileID: 1154875947} IntegerP: {fileID: 396879232} FloatP: {fileID: 345301789} - BooleanP: {fileID: 0} + BooleanP: {fileID: 755586977} DropdownP: {fileID: 184838087} ColorP: {fileID: 1443721746} entity: diff --git a/Assets/Scripts/Games/DJSchool/DJSchool.cs b/Assets/Scripts/Games/DJSchool/DJSchool.cs index 0f99c631..3976eb71 100644 --- a/Assets/Scripts/Games/DJSchool/DJSchool.cs +++ b/Assets/Scripts/Games/DJSchool/DJSchool.cs @@ -84,7 +84,7 @@ namespace RhythmHeavenMania.Games.DJSchool bop.length = length; } - public void BreakCmon(float beat, int type) + public void BreakCmon(float beat, int type, bool ooh) { if (djYellowHolding) return; @@ -103,12 +103,17 @@ namespace RhythmHeavenMania.Games.DJSchool break; } - MultiSound.Play(new MultiSound.Sound[] + var sound = new MultiSound.Sound[] { new MultiSound.Sound(sounds[0], beat), new MultiSound.Sound(sounds[1], beat + 1f - (0.030f/Conductor.instance.secPerBeat)*Conductor.instance.musicSource.pitch), - new MultiSound.Sound(sounds[2], beat + 2f), - }); + new MultiSound.Sound("", beat + 2f) + }; + + if (ooh) + sound[2] = new MultiSound.Sound(sounds[2], beat + 2f); + + MultiSound.Play(sound); BeatAction.New(djYellow, new List() { @@ -122,16 +127,21 @@ namespace RhythmHeavenMania.Games.DJSchool }); } - public void AndStop(float beat) + public void AndStop(float beat, bool ooh) { if (djYellowHolding) return; - MultiSound.Play(new MultiSound.Sound[] + var sound = new MultiSound.Sound[] { new MultiSound.Sound("djSchool/andStop1", beat), new MultiSound.Sound("djSchool/andStop2", beat + .5f - (0.1200f/Conductor.instance.secPerBeat)*Conductor.instance.musicSource.pitch), - new MultiSound.Sound("djSchool/oohAlt", beat + 1.5f), - }); + new MultiSound.Sound("", beat + 1.5f) + }; + + if (ooh) + sound[2] = new MultiSound.Sound("djSchool/oohAlt", beat + 1.5f); + + MultiSound.Play(sound); BeatAction.New(djYellow, new List() { diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifter.cs b/Assets/Scripts/Games/ForkLifter/ForkLifter.cs index 3226a37a..ea12cef2 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifter.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifter.cs @@ -10,6 +10,15 @@ namespace RhythmHeavenMania.Games.ForkLifter { public class ForkLifter : Minigame { + + public enum FlickType + { + Pea, + TopBun, + Burger, + BottomBun + } + public static ForkLifter instance; [Header("References")] diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 32779c30..95b645b6 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -121,113 +121,71 @@ namespace RhythmHeavenMania }), new Minigame("countIn", "Count-Ins", "", false, true, new List() { - new GameAction("4 beat count-in", delegate + new GameAction("4 beat count-in", delegate { var e = eventCaller.currentEntity; SoundEffects.FourBeatCountIn(e.beat, e.length / 4f, e.type); }, 4f, true, new List() { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("count-ins/one1", eventCaller.currentEntity.beat), - new MultiSound.Sound("count-ins/two1", eventCaller.currentEntity.beat + 1f), - new MultiSound.Sound("count-ins/three1", eventCaller.currentEntity.beat + 2f), - new MultiSound.Sound("count-ins/four1", eventCaller.currentEntity.beat + 3f) - }, false); - }, 4f), - new GameAction("4 beat count-in (alt)", delegate + new Param("type", SoundEffects.CountInType.Normal, "Type") + }), + new GameAction("8 beat count-in", delegate { var e = eventCaller.currentEntity; SoundEffects.EightBeatCountIn(e.beat, e.length / 8f, e.type); }, 8f, true, new List() { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("count-ins/one2", eventCaller.currentEntity.beat), - new MultiSound.Sound("count-ins/two2", eventCaller.currentEntity.beat + 1f), - new MultiSound.Sound("count-ins/three2", eventCaller.currentEntity.beat + 2f), - new MultiSound.Sound("count-ins/four2", eventCaller.currentEntity.beat + 3f) - }, false); - }, 4f), - new GameAction("4 beat count-in (cowbell)", delegate + new Param("type", SoundEffects.CountInType.Normal, "Type") + }), + new GameAction("count", delegate { var e = eventCaller.currentEntity; SoundEffects.Count(e.type, e.toggle); }, 1f, false, new List() { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 1f), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 2f), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 3f) - }, false); - }, 4f), - new GameAction("8 beat count-in", delegate + new Param("type", SoundEffects.CountNumbers.One, "Number"), + new Param("toggle", false, "Alt") + }), + new GameAction("cowbell", delegate { SoundEffects.Cowbell(); }, 1f), + new GameAction("ready!", delegate { var e = eventCaller.currentEntity; SoundEffects.Ready(e.beat, e.length / 2f); }, 2f, true), + new GameAction("and", delegate {SoundEffects.And(); }, 0.5f), + new GameAction("go!", delegate { SoundEffects.Go(eventCaller.currentEntity.toggle); }, 1f, false, new List() { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("count-ins/one1", eventCaller.currentEntity.beat), - new MultiSound.Sound("count-ins/two1", eventCaller.currentEntity.beat + 2f), - new MultiSound.Sound("count-ins/one1", eventCaller.currentEntity.beat + 4f), - new MultiSound.Sound("count-ins/two1", eventCaller.currentEntity.beat + 5f), - new MultiSound.Sound("count-ins/three1", eventCaller.currentEntity.beat + 6f), - new MultiSound.Sound("count-ins/four1", eventCaller.currentEntity.beat + 7f) - }, false); - }, 8f), - new GameAction("8 beat count-in (alt)", delegate - { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("count-ins/one2", eventCaller.currentEntity.beat), - new MultiSound.Sound("count-ins/two2", eventCaller.currentEntity.beat + 2f), - new MultiSound.Sound("count-ins/one2", eventCaller.currentEntity.beat + 4f), - new MultiSound.Sound("count-ins/two2", eventCaller.currentEntity.beat + 5f), - new MultiSound.Sound("count-ins/three2", eventCaller.currentEntity.beat + 6f), - new MultiSound.Sound("count-ins/four2", eventCaller.currentEntity.beat + 7f) - }, false); - }, 8f), - new GameAction("8 beat count-in (cowbell)", delegate - { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 2f), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 4f), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 5f), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 6f), - new MultiSound.Sound("count-ins/cowbell", eventCaller.currentEntity.beat + 7f) - }, false); - }, 8f), - new GameAction("cowbell", delegate { Jukebox.PlayOneShot("count-ins/cowbell"); }, 1f), - new GameAction("one", delegate { Jukebox.PlayOneShot("count-ins/one1"); }, 1f), - new GameAction("one (alt)", delegate { Jukebox.PlayOneShot("count-ins/one2"); }, 1f), - new GameAction("two", delegate { Jukebox.PlayOneShot("count-ins/two1"); }, 1f), - new GameAction("two (alt)", delegate { Jukebox.PlayOneShot("count-ins/two2"); }, 1f), - new GameAction("three", delegate { Jukebox.PlayOneShot("count-ins/three1"); }, 1f), - new GameAction("three (alt)", delegate { Jukebox.PlayOneShot("count-ins/three2"); }, 1f), - new GameAction("four", delegate { Jukebox.PlayOneShot("count-ins/four1"); }, 1f), - new GameAction("four (alt)", delegate { Jukebox.PlayOneShot("count-ins/four2"); }, 1f), - new GameAction("and", delegate { Jukebox.PlayOneShot("count-ins/and"); }, 0.5f), - new GameAction("go!", delegate { Jukebox.PlayOneShot("count-ins/go1"); }, 1f), - new GameAction("go! (alt)", delegate { Jukebox.PlayOneShot("count-ins/go2"); }, 1f), - new GameAction("ready!", delegate - { - MultiSound.Play(new MultiSound.Sound[] - { - new MultiSound.Sound("count-ins/ready1", eventCaller.currentEntity.beat), - new MultiSound.Sound("count-ins/ready2", eventCaller.currentEntity.beat + 1f), - }, false); - }, 2f), + new Param("toggle", false, "Alt") + }), + // These are still here for backwards-compatibility but are hidden in the editor + new GameAction("4 beat count-in (alt)", delegate { var e = eventCaller.currentEntity; SoundEffects.FourBeatCountIn(e.beat, e.length, 1); }, 4f, hidden: true), + new GameAction("4 beat count-in (cowbell)", delegate { var e = eventCaller.currentEntity; SoundEffects.FourBeatCountIn(e.beat, e.length, 2); }, 4f, hidden: true), + new GameAction("8 beat count-in (alt)", delegate { var e = eventCaller.currentEntity; SoundEffects.EightBeatCountIn(e.beat, e.length, 1); }, 4f, hidden: true), + new GameAction("8 beat count-in (cowbell)", delegate { var e = eventCaller.currentEntity; SoundEffects.EightBeatCountIn(e.beat, e.length, 2); }, 4f, hidden: true), + new GameAction("one", delegate { SoundEffects.Count(0, false); }, 1f, hidden: true), + new GameAction("one (alt)", delegate { SoundEffects.Count(0, true); }, 1f, hidden: true), + new GameAction("two", delegate { SoundEffects.Count(1, false); }, 1f, hidden: true), + new GameAction("two (alt)", delegate { SoundEffects.Count(1, true); }, 1f, hidden: true), + new GameAction("three", delegate { SoundEffects.Count(2, false); }, 1f, hidden: true), + new GameAction("three (alt)", delegate { SoundEffects.Count(2, true); }, 1f, hidden: true), + new GameAction("four", delegate { SoundEffects.Count(3, false); }, 1f, hidden: true), + new GameAction("four (alt)", delegate { SoundEffects.Count(3, true); }, 1f, hidden: true), + new GameAction("go! (alt)", delegate { SoundEffects.Go(true); }, 1f, hidden: true), }), new Minigame("forkLifter", "Fork Lifter", "FFFFFF", false, false, new List() { - new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); }, 3), - new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); }, 3), - new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); }, 3), - new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); }, 3), + new GameAction("flick", delegate { var e = eventCaller.currentEntity; ForkLifter.instance.Flick(e.beat, e.type); }, 3, false, new List() + { + new Param("type", ForkLifter.FlickType.Pea, "Object") + }), new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f), new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }), - new GameAction("sigh", delegate { Jukebox.PlayOneShot("games/forkLifter/sigh"); }) + new GameAction("sigh", delegate { Jukebox.PlayOneShot("games/forkLifter/sigh"); }), + // These are still here for backwards-compatibility but are hidden in the editor + new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 0); }, 3, hidden: true), + new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 1); }, 3, hidden: true), + new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 2); }, 3, hidden: true), + new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentEntity.beat, 3); }, 3, hidden: true), + }), new Minigame("clappyTrio", "The Clappy Trio", "29E7FF", false, false, new List() { new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 3, true), new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentEntity.beat); } ), - new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ), - new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ), + new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(eventCaller.currentEntity.toggle ? 3 : 0); }, parameters: new List() + { + new Param("toggle", false, "Alt") + }), new GameAction("change lion count", delegate { ClappyTrio.instance.ChangeLionCount((int)eventCaller.currentEntity.valA); }, 0.5f, false, new List() { new Param("valA", new EntityTypes.Integer(1, 8, 3), "Lion Count") }), + // This is still here for backwards-compatibility but is hidden in the editor + new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); }, hidden: true), }), new Minigame("spaceball", "Spaceball", "00A518", false, false, new List() { @@ -321,10 +279,14 @@ namespace RhythmHeavenMania new Minigame("djSchool", "DJ School", "008c97", false, false, new List() { new GameAction("bop", delegate { DJSchool.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true), - new GameAction("and stop ooh", delegate { DJSchool.instance.AndStop(eventCaller.currentEntity.beat); }, 2.5f), - new GameAction("break c'mon ooh", delegate { DJSchool.instance.BreakCmon(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 3f, false, new List() + new GameAction("and stop ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.AndStop(e.beat, e.toggle); }, 2.5f, false, new List() + { + new Param("toggle", true, "Ooh") + }), + new GameAction("break c'mon ooh", delegate { var e = eventCaller.currentEntity; DJSchool.instance.BreakCmon(e.beat, e.type, e.toggle); }, 3f, false, new List() { new Param("type", DJSchool.DJVoice.Standard, "Voice"), + new Param("toggle", true, "Ooh") }), new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity.type); }, 3f, false, new List() { diff --git a/Assets/Scripts/SoundEffects.cs b/Assets/Scripts/SoundEffects.cs new file mode 100644 index 00000000..c61dd450 --- /dev/null +++ b/Assets/Scripts/SoundEffects.cs @@ -0,0 +1,104 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using RhythmHeavenMania.Util; + +namespace RhythmHeavenMania +{ + public class SoundEffects : MonoBehaviour + { + + public enum CountNumbers { One, Two, Three, Four } + public static string[] countNames = { "one", "two", "three", "four" }; + public static void Count(int type, bool alt) + { + string sound = countNames[type]; + if (!alt) + sound += "1"; + else + sound += "2"; + Jukebox.PlayOneShot("count-ins/" + sound); + } + + public enum CountInType { Normal, Alt, Cowbell } + public static string[] GetCountInSounds(string[] sounds, CountInType type) + { + for (int i = 0; i < sounds.Length; i++) + { + switch (type) + { + case CountInType.Normal: + sounds[i] += "1"; + break; + case CountInType.Alt: + sounds[i] += "2"; + break; + case CountInType.Cowbell: + sounds[i] = "cowbell"; + break; + } + } + return sounds; + } + public static void FourBeatCountIn(float beat, float length, int type) + { + string[] sounds = { "one", "two", "three", "four" }; + sounds = GetCountInSounds(sounds, (CountInType)type); + + MultiSound.Play(new MultiSound.Sound[] + { + new MultiSound.Sound("count-ins/" + sounds[0], beat), + new MultiSound.Sound("count-ins/" + sounds[1], beat + 1f * length), + new MultiSound.Sound("count-ins/" + sounds[2], beat + 2f * length), + new MultiSound.Sound("count-ins/" + sounds[3], beat + 3f * length) + }, false); + } + + public static void EightBeatCountIn(float beat, float length, int type) + { + string[] sounds = { "one", "two", "one", "two", "three", "four" }; + sounds = GetCountInSounds(sounds, (CountInType)type); + + MultiSound.Play(new MultiSound.Sound[] + { + new MultiSound.Sound("count-ins/" + sounds[0], beat), + new MultiSound.Sound("count-ins/" + sounds[1], beat + 2f * length), + new MultiSound.Sound("count-ins/" + sounds[2], beat + 4f * length), + new MultiSound.Sound("count-ins/" + sounds[3], beat + 5f * length), + new MultiSound.Sound("count-ins/" + sounds[4], beat + 6f * length), + new MultiSound.Sound("count-ins/" + sounds[5], beat + 7f * length) + }, false); + } + + public static void Cowbell() + { + Jukebox.PlayOneShot("count-ins/cowbell"); + } + + public static void Ready(float beat, float length) + { + MultiSound.Play(new MultiSound.Sound[] + { + new MultiSound.Sound("count-ins/ready1", beat), + new MultiSound.Sound("count-ins/ready2", beat + 1f * length), + }, false); + } + + public static void And() + { + Jukebox.PlayOneShot("count-ins/and"); + } + + public static void Go(bool alt) + { + string sound = "count-ins/go"; + if (!alt) + sound += "1"; + else + sound += "2"; + Jukebox.PlayOneShot(sound); + } + } + +} \ No newline at end of file diff --git a/Assets/Scripts/SoundEffects.cs.meta b/Assets/Scripts/SoundEffects.cs.meta new file mode 100644 index 00000000..f8daef52 --- /dev/null +++ b/Assets/Scripts/SoundEffects.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2f8829b764160148b6dbf3947ea9df3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: