2022-07-11 05:53:25 +00:00
|
|
|
using System;
|
2022-02-06 04:03:31 +00:00
|
|
|
using System.Collections.Generic;
|
2022-02-05 03:48:35 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
using HeavenStudio.Util;
|
2022-02-03 02:09:50 +00:00
|
|
|
|
2022-04-12 16:14:46 +00:00
|
|
|
namespace HeavenStudio.Games.Loaders
|
|
|
|
{
|
|
|
|
using static Minigames;
|
|
|
|
public static class NtrDjLoader
|
|
|
|
{
|
|
|
|
public static Minigame AddGame(EventCaller eventCaller) {
|
2022-04-12 21:49:00 +00:00
|
|
|
return new Minigame("djSchool", "DJ School", "008c97", false, false, new List<GameAction>()
|
2022-04-12 16:14:46 +00:00
|
|
|
{
|
2022-08-20 23:03:51 +00:00
|
|
|
new GameAction("bop", "Bop")
|
2022-07-08 05:27:10 +00:00
|
|
|
{
|
2022-08-21 23:46:45 +00:00
|
|
|
function = delegate { DJSchool.instance.Bop(eventCaller.currentEntity["toggle"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = 0.5f,
|
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
|
|
|
new Param("toggle", true, "Bop", "Whether both will bop to the beat or not")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("and stop ooh", "And Stop!")
|
2022-04-12 16:14:46 +00:00
|
|
|
{
|
2022-08-21 23:46:45 +00:00
|
|
|
function = delegate { var e = eventCaller.currentEntity; DJSchool.instance.AndStop(e.beat, e["toggle"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = 2.5f,
|
2022-08-21 23:46:45 +00:00
|
|
|
inactiveFunction = delegate { var e = eventCaller.currentEntity; DJSchool.WarnAndStop(e.beat, e["toggle"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
|
|
|
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("break c'mon ooh", "Break, C'mon!")
|
2022-04-12 21:49:00 +00:00
|
|
|
{
|
2022-08-21 23:46:45 +00:00
|
|
|
function = delegate { var e = eventCaller.currentEntity; DJSchool.instance.BreakCmon(e.beat, e["type"], e["toggle"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = 3f,
|
2022-08-21 23:46:45 +00:00
|
|
|
inactiveFunction = delegate { var e = eventCaller.currentEntity; DJSchool.WarnBreakCmon(e.beat, e["type"], e["toggle"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
|
|
|
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
|
|
|
|
new Param("toggle", true, "Ooh", "Whether or not the \"ooh\" sound should be played")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("scratch-o hey", "Scratch-o")
|
2022-04-12 21:49:00 +00:00
|
|
|
{
|
2022-08-21 23:46:45 +00:00
|
|
|
function = delegate { DJSchool.instance.ScratchoHey(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"], eventCaller.currentEntity["toggle"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = 3f,
|
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
|
|
|
new Param("type", DJSchool.DJVoice.Standard, "Voice", "The voice line to play"),
|
|
|
|
new Param("toggle", false, "Fast Hey", "Activate Remix 4 (DS) beat")
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("dj voice lines", "DJ Yellow Banter")
|
2022-07-08 05:27:10 +00:00
|
|
|
{
|
2022-08-21 23:46:45 +00:00
|
|
|
function = delegate { DJSchool.instance.voiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = 2f,
|
2022-08-21 23:46:45 +00:00
|
|
|
inactiveFunction = delegate { DJSchool.WarnDJVoiceLines(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
|
|
|
new Param("type", DJSchool.DJVoiceLines.CheckItOut, "Voice Lines", "The voice line to play"),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
new GameAction("sound FX", "Scratchy Music")
|
2022-07-08 05:27:10 +00:00
|
|
|
{
|
2022-08-21 23:46:45 +00:00
|
|
|
function = delegate { DJSchool.instance.soundFX(eventCaller.currentEntity["toggle"]); },
|
2022-08-20 23:03:51 +00:00
|
|
|
defaultLength = 0.5f,
|
|
|
|
parameters = new List<Param>()
|
|
|
|
{
|
|
|
|
new Param("toggle", false, "Radio FX", "Toggle on and off for Radio Effects")
|
|
|
|
}
|
|
|
|
}
|
2022-06-12 19:32:00 +00:00
|
|
|
},
|
|
|
|
new List<string>() {"ntr", "normal"},
|
|
|
|
"ntrdj", "en",
|
|
|
|
new List<string>(){}
|
|
|
|
);
|
2022-04-12 16:14:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-14 14:21:05 +00:00
|
|
|
namespace HeavenStudio.Games
|
2022-02-03 02:09:50 +00:00
|
|
|
{
|
2022-03-12 04:10:13 +00:00
|
|
|
using Scripts_DJSchool;
|
|
|
|
|
2022-02-03 02:09:50 +00:00
|
|
|
public class DJSchool : Minigame
|
|
|
|
{
|
2022-02-20 17:28:56 +00:00
|
|
|
public enum DJVoice
|
|
|
|
{
|
|
|
|
Standard,
|
|
|
|
Cool,
|
|
|
|
Hyped
|
|
|
|
}
|
|
|
|
|
2022-07-08 05:27:10 +00:00
|
|
|
public enum DJVoiceLines
|
|
|
|
{
|
|
|
|
CheckItOut,
|
|
|
|
LetsGo,
|
|
|
|
OhYeah,
|
|
|
|
OhYeahAlt,
|
|
|
|
Yay
|
2022-07-11 05:53:25 +00:00
|
|
|
}
|
2022-07-08 05:27:10 +00:00
|
|
|
|
2022-02-05 03:48:35 +00:00
|
|
|
[Header("Components")]
|
|
|
|
[SerializeField] private Student student;
|
2022-02-06 04:03:31 +00:00
|
|
|
[SerializeField] private GameObject djYellow;
|
2022-02-09 07:46:49 +00:00
|
|
|
private Animator djYellowAnim;
|
|
|
|
[SerializeField] private SpriteRenderer headSprite;
|
|
|
|
[SerializeField] private Sprite[] headSprites;
|
2022-07-08 05:27:10 +00:00
|
|
|
private float lastReportedBeat = 0f;
|
2022-02-05 03:48:35 +00:00
|
|
|
|
|
|
|
[Header("Properties")]
|
|
|
|
public GameEvent bop = new GameEvent();
|
2022-02-09 07:46:49 +00:00
|
|
|
private bool djYellowHolding;
|
2022-07-08 05:27:10 +00:00
|
|
|
public bool andStop;
|
|
|
|
public bool goBop;
|
|
|
|
public float beatOfInstance;
|
2022-02-05 03:48:35 +00:00
|
|
|
|
2022-02-03 02:09:50 +00:00
|
|
|
public static DJSchool instance { get; private set; }
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
instance = this;
|
2022-02-09 07:46:49 +00:00
|
|
|
djYellowAnim = djYellow.GetComponent<Animator>();
|
2022-03-26 02:08:46 +00:00
|
|
|
student.Init();
|
2022-07-08 05:27:10 +00:00
|
|
|
goBop = true;
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
//For inactive game purposes
|
|
|
|
static float wantBreak = Single.MinValue;
|
|
|
|
static float wantAndStop = Single.MinValue;
|
|
|
|
static float wantDJVoiceLines = Single.MinValue;
|
|
|
|
|
|
|
|
public override void OnGameSwitch(float beat)
|
|
|
|
{
|
|
|
|
if (wantBreak != Single.MinValue)
|
|
|
|
{
|
|
|
|
BreakCmon(wantBreak, 0, false, false);
|
|
|
|
wantBreak = Single.MinValue;
|
|
|
|
}
|
|
|
|
else if(wantAndStop != Single.MinValue)
|
|
|
|
{
|
|
|
|
AndStop(wantAndStop, false, false);
|
|
|
|
wantAndStop = Single.MinValue;
|
|
|
|
}
|
|
|
|
else if(wantDJVoiceLines != Single.MinValue)
|
|
|
|
{
|
|
|
|
voiceLines(wantDJVoiceLines, 0);
|
|
|
|
wantDJVoiceLines = Single.MinValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-05 03:48:35 +00:00
|
|
|
private void Update()
|
|
|
|
{
|
2022-07-08 05:27:10 +00:00
|
|
|
#region old script
|
|
|
|
//var cond = Conductor.instance;
|
|
|
|
|
|
|
|
//if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
|
|
|
|
//{
|
|
|
|
// if (cond.songPositionInBeats >= bop.startBeat && cond.songPositionInBeats < bop.startBeat + bop.length)
|
|
|
|
// {
|
|
|
|
// if (student.anim.IsAnimationNotPlaying())
|
|
|
|
// {
|
|
|
|
// if (student.isHolding)
|
|
|
|
// {
|
|
|
|
// student.anim.Play("HoldBop", 0, 0);
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// student.anim.Play("IdleBop", 0, 0);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (djYellowAnim.IsAnimationNotPlaying())
|
|
|
|
// {
|
|
|
|
// var yellowState = djYellowAnim.GetCurrentAnimatorStateInfo(0);
|
|
|
|
// if (yellowState.IsName("Hey"))
|
|
|
|
// {
|
|
|
|
// PostScratchoFace();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (djYellowHolding)
|
|
|
|
// {
|
|
|
|
// djYellowAnim.Play("HoldBop", 0, 0);
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// // todo: split between left and right bop based on beat
|
|
|
|
// djYellowAnim.Play("IdleBop", 0, 0);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
if (Conductor.instance.ReportBeat(ref lastReportedBeat))
|
2022-02-05 03:48:35 +00:00
|
|
|
{
|
2022-07-08 05:27:10 +00:00
|
|
|
if (goBop)
|
2022-02-05 03:48:35 +00:00
|
|
|
{
|
2022-07-08 05:27:10 +00:00
|
|
|
if (student.isHolding)
|
2022-02-05 03:48:35 +00:00
|
|
|
{
|
2022-07-08 05:27:10 +00:00
|
|
|
student.anim.Play("HoldBop", 0, 0);
|
2022-02-05 03:48:35 +00:00
|
|
|
}
|
2022-07-08 05:27:10 +00:00
|
|
|
else if (!student.swiping && student.anim.IsAnimationNotPlaying())
|
2022-02-09 07:46:49 +00:00
|
|
|
{
|
2022-07-08 05:27:10 +00:00
|
|
|
student.anim.Play("IdleBop", 0, 0);
|
|
|
|
}
|
2022-02-20 17:28:56 +00:00
|
|
|
|
2022-07-08 05:27:10 +00:00
|
|
|
var yellowState = djYellowAnim.GetCurrentAnimatorStateInfo(0);
|
|
|
|
if (yellowState.IsName("Hey"))
|
|
|
|
{
|
|
|
|
PostScratchoFace();
|
|
|
|
}
|
|
|
|
if (!andStop && !djYellowHolding)
|
|
|
|
{
|
|
|
|
djYellowAnim.Play("IdleBop", 0, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (djYellowHolding)
|
|
|
|
{
|
|
|
|
djYellowAnim.Play("HoldBop", 0, 0);
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
2022-02-05 03:48:35 +00:00
|
|
|
}
|
2022-07-08 05:27:10 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
else if (Conductor.instance.songPositionInBeats < lastReportedBeat)
|
|
|
|
{
|
|
|
|
lastReportedBeat = Mathf.Round(Conductor.instance.songPositionInBeats);
|
2022-02-05 03:48:35 +00:00
|
|
|
}
|
2022-07-08 05:27:10 +00:00
|
|
|
|
|
|
|
if(PlayerInput.Pressed() && !IsExpectingInputNow() && !student.isHolding) //Start hold miss
|
|
|
|
{
|
|
|
|
student.OnMissHoldForPlayerInput();
|
|
|
|
student.isHolding = true;
|
|
|
|
}
|
|
|
|
else if(PlayerInput.PressedUp() && !IsExpectingInputNow() && student.isHolding) //Let go during hold
|
|
|
|
{
|
|
|
|
student.UnHold();
|
|
|
|
}
|
|
|
|
//else if(PlayerInput.PressedUp() && !IsExpectingInputNow() && !student.isHolding)
|
|
|
|
//{
|
|
|
|
// student.OnMissSwipeForPlayerInput();
|
|
|
|
//}
|
2022-02-05 03:48:35 +00:00
|
|
|
}
|
|
|
|
|
2022-07-08 05:27:10 +00:00
|
|
|
//public void Bop(float beat, float length)
|
|
|
|
//{
|
|
|
|
// bop.startBeat = beat;
|
|
|
|
// bop.length = length;
|
|
|
|
//}
|
|
|
|
|
|
|
|
public void Bop(bool isBopping)
|
2022-02-05 03:48:35 +00:00
|
|
|
{
|
2022-07-08 05:27:10 +00:00
|
|
|
if (isBopping)
|
|
|
|
{
|
|
|
|
goBop = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
goBop = false;
|
|
|
|
}
|
2022-02-05 03:48:35 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
public void BreakCmon(float beat, int type, bool ooh, bool doSound = true)
|
2022-02-03 02:09:50 +00:00
|
|
|
{
|
2022-02-09 07:46:49 +00:00
|
|
|
if (djYellowHolding) return;
|
|
|
|
|
|
|
|
string[] sounds = new string[] { };
|
|
|
|
|
2022-02-20 17:28:56 +00:00
|
|
|
switch (type)
|
2022-02-09 07:46:49 +00:00
|
|
|
{
|
2022-02-20 17:28:56 +00:00
|
|
|
case 0:
|
|
|
|
sounds = new string[] { "djSchool/breakCmon1", "djSchool/breakCmon2", "djSchool/ooh" };
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sounds = new string[] { "djSchool/breakCmonAlt1", "djSchool/breakCmonAlt2", "djSchool/oohAlt" };
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sounds = new string[] { "djSchool/breakCmonLoud1", "djSchool/breakCmonLoud2", "djSchool/oohLoud" };
|
|
|
|
break;
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
if (doSound)
|
2022-02-03 02:09:50 +00:00
|
|
|
{
|
2022-07-11 05:53:25 +00:00
|
|
|
var sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + 1f, offset: 0.030f),
|
|
|
|
new MultiSound.Sound("", beat + 2f)
|
|
|
|
};
|
2022-03-01 19:44:55 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
if (ooh)
|
|
|
|
sound[2] = new MultiSound.Sound(sounds[2], beat + 2f);
|
2022-03-01 19:44:55 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
MultiSound.Play(sound);
|
|
|
|
}
|
|
|
|
|
2022-02-05 03:48:35 +00:00
|
|
|
|
2022-02-06 04:03:31 +00:00
|
|
|
BeatAction.New(djYellow, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
|
2022-07-08 05:27:10 +00:00
|
|
|
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
|
2022-02-09 07:46:49 +00:00
|
|
|
new BeatAction.Action(beat + 2f, delegate
|
|
|
|
{
|
|
|
|
djYellow.GetComponent<Animator>().Play("Hold", 0, 0);
|
|
|
|
djYellowHolding = true;
|
|
|
|
}),
|
2022-02-06 04:03:31 +00:00
|
|
|
});
|
2022-07-08 05:27:10 +00:00
|
|
|
|
|
|
|
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, student.OnHitHold, student.OnMissHold, student.OnEmpty);
|
2022-02-03 02:09:50 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
|
|
|
|
public void AndStop(float beat, bool ooh, bool doSound = true)
|
2022-02-03 02:09:50 +00:00
|
|
|
{
|
2022-02-09 07:46:49 +00:00
|
|
|
if (djYellowHolding) return;
|
2022-07-11 05:53:25 +00:00
|
|
|
|
|
|
|
if (doSound)
|
2022-02-03 02:09:50 +00:00
|
|
|
{
|
2022-07-11 05:53:25 +00:00
|
|
|
var sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("djSchool/andStop1", beat),
|
|
|
|
new MultiSound.Sound("djSchool/andStop2", beat + .5f, offset: 0.1200f),
|
|
|
|
new MultiSound.Sound("", beat + 1.5f)
|
|
|
|
};
|
2022-03-01 19:44:55 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
if (ooh)
|
|
|
|
sound[2] = new MultiSound.Sound("djSchool/oohAlt", beat + 1.5f);
|
2022-03-01 19:44:55 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
MultiSound.Play(sound);
|
|
|
|
}
|
|
|
|
|
2022-02-09 07:46:49 +00:00
|
|
|
|
|
|
|
BeatAction.New(djYellow, new List<BeatAction.Action>()
|
|
|
|
{
|
2022-07-08 05:27:10 +00:00
|
|
|
new BeatAction.Action(beat + 0.5f, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
|
2022-02-09 07:46:49 +00:00
|
|
|
new BeatAction.Action(beat + 1.5f, delegate
|
|
|
|
{
|
|
|
|
djYellow.GetComponent<Animator>().Play("Hold", 0, 0);
|
|
|
|
djYellowHolding = true;
|
|
|
|
}),
|
|
|
|
});
|
2022-07-08 05:27:10 +00:00
|
|
|
andStop = true;
|
|
|
|
|
|
|
|
ScheduleInput(beat, 1.5f, InputType.STANDARD_DOWN, student.OnHitHold, student.OnMissHold, student.OnEmpty);
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
public void ScratchoHey(float beat, int type, bool remix4)
|
2022-02-09 07:46:49 +00:00
|
|
|
{
|
|
|
|
string[] sounds = new string[] { };
|
|
|
|
|
|
|
|
if (type == 0)
|
|
|
|
{
|
2022-02-12 03:47:13 +00:00
|
|
|
sounds = new string[] { "djSchool/scratchoHey1", "djSchool/scratchoHey2", "djSchool/scratchoHey3", "djSchool/scratchoHey4", "djSchool/hey" };
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
|
|
|
else if (type == 1)
|
|
|
|
{
|
2022-02-12 03:47:13 +00:00
|
|
|
sounds = new string[] { "djSchool/scratchoHeyAlt1", "djSchool/scratchoHeyAlt2", "djSchool/scratchoHeyAlt3", "djSchool/scratchoHeyAlt4", "djSchool/heyAlt" };
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
|
|
|
else if (type == 2)
|
|
|
|
{
|
2022-02-12 03:47:13 +00:00
|
|
|
sounds = new string[] { "djSchool/scratchoHeyLoud1", "djSchool/scratchoHeyLoud2", "djSchool/scratchoHeyLoud3", "djSchool/scratchoHeyLoud4", "djSchool/heyLoud" };
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
float timing = 0f;
|
|
|
|
float beatOffset = 0f;
|
|
|
|
float beatOffset2 = 0f;
|
|
|
|
|
|
|
|
if (!remix4)
|
|
|
|
{
|
|
|
|
timing = 2f;
|
|
|
|
beatOffset = 2f;
|
|
|
|
beatOffset2 = 2.05f;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
timing = 1.5f;
|
|
|
|
beatOffset = 1.5f;
|
|
|
|
beatOffset2 = 1.55f;
|
|
|
|
}
|
|
|
|
|
2022-02-09 07:46:49 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
2022-02-12 03:47:13 +00:00
|
|
|
new MultiSound.Sound(sounds[1], beat + .25f),
|
|
|
|
new MultiSound.Sound(sounds[2], beat + .5f),
|
2022-03-22 18:29:15 +00:00
|
|
|
new MultiSound.Sound(sounds[3], beat + 1f, offset: 0.0500f),
|
2022-07-11 05:53:25 +00:00
|
|
|
new MultiSound.Sound(sounds[4], beat + beatOffset, offset: 0.070f),
|
2022-02-03 02:09:50 +00:00
|
|
|
});
|
2022-02-05 03:48:35 +00:00
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
|
2022-02-06 04:03:31 +00:00
|
|
|
BeatAction.New(djYellow, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); }),
|
2022-07-08 05:27:10 +00:00
|
|
|
new BeatAction.Action(beat + .5f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho2", 0, 0); }),
|
|
|
|
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); }),
|
2022-07-11 05:53:25 +00:00
|
|
|
new BeatAction.Action(beat + beatOffset2, delegate
|
|
|
|
{
|
2022-02-09 07:46:49 +00:00
|
|
|
djYellow.GetComponent<Animator>().Play("Hey", 0, 0);
|
|
|
|
djYellowHolding = false;
|
|
|
|
}),
|
2022-02-06 04:03:31 +00:00
|
|
|
});
|
2022-07-08 05:27:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
beatOfInstance = beat;
|
|
|
|
|
2022-07-11 05:53:25 +00:00
|
|
|
ScheduleInput(beat, timing, InputType.STANDARD_UP, student.OnHitSwipe, student.OnMissSwipe, student.OnEmpty);
|
2022-07-08 05:27:10 +00:00
|
|
|
andStop = false;
|
2022-07-11 05:53:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-21 14:56:10 +00:00
|
|
|
}
|
2022-02-06 04:03:31 +00:00
|
|
|
|
2022-07-08 05:27:10 +00:00
|
|
|
//void SetupCue(float beat, bool swipe)
|
|
|
|
//{
|
|
|
|
// if (swipe)
|
|
|
|
// student.swipeBeat = beat;
|
|
|
|
// else
|
|
|
|
// student.holdBeat = beat;
|
2022-02-21 14:56:10 +00:00
|
|
|
|
2022-07-08 05:27:10 +00:00
|
|
|
// student.eligible = true;
|
|
|
|
// student.ResetState();
|
|
|
|
//}
|
2022-02-09 07:46:49 +00:00
|
|
|
|
2022-02-20 17:28:56 +00:00
|
|
|
public void SetDJYellowHead(int type, bool resetAfterBeats = false)
|
2022-02-09 07:46:49 +00:00
|
|
|
{
|
|
|
|
headSprite.sprite = headSprites[type];
|
2022-02-20 17:28:56 +00:00
|
|
|
|
|
|
|
if (resetAfterBeats)
|
|
|
|
{
|
|
|
|
BeatAction.New(djYellow, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(Mathf.Floor(Conductor.instance.songPositionInBeats) + 2f, delegate
|
|
|
|
{
|
|
|
|
var yellowState = djYellowAnim.GetCurrentAnimatorStateInfo(0);
|
|
|
|
if (yellowState.IsName("Idle")
|
|
|
|
|| yellowState.IsName("IdleBop")
|
|
|
|
|| yellowState.IsName("IdleBop2")
|
|
|
|
|| yellowState.IsName("BreakCmon"))
|
|
|
|
{
|
|
|
|
SetDJYellowHead(0);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void PostScratchoFace()
|
|
|
|
{
|
|
|
|
if (student.missed)
|
|
|
|
{
|
|
|
|
student.missed = false;
|
|
|
|
SetDJYellowHead(3, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SetDJYellowHead(2, true);
|
|
|
|
}
|
2022-02-09 07:46:49 +00:00
|
|
|
}
|
2022-07-08 05:27:10 +00:00
|
|
|
|
|
|
|
public void soundFX(bool toggle)
|
|
|
|
{
|
|
|
|
student.soundFX = toggle;
|
|
|
|
}
|
|
|
|
public void voiceLines(float beat, int type)
|
|
|
|
{
|
|
|
|
string[] sounds;
|
|
|
|
var sound = new MultiSound.Sound[] { };
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sounds = new string[] { "djSchool/checkItOut1", "djSchool/checkItOut2", "djSchool/checkItOut3" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .25f),
|
|
|
|
new MultiSound.Sound(sounds[2], beat + .5f),
|
|
|
|
};
|
|
|
|
|
|
|
|
MultiSound.Play(sound);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
sounds = new string[] { "djSchool/letsGo1", "djSchool/letsGo2" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .5f),
|
|
|
|
};
|
|
|
|
|
|
|
|
MultiSound.Play(sound);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
sounds = new string[] { "djSchool/ohYeah1", "djSchool/ohYeah2" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .5f),
|
|
|
|
};
|
|
|
|
|
|
|
|
MultiSound.Play(sound);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
sounds = new string[] { "djSchool/ohYeahAlt1", "djSchool/ohYeahAlt2", "djSchool/ohYeahAlt3" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .5f),
|
|
|
|
new MultiSound.Sound(sounds[2], beat + 1f),
|
|
|
|
};
|
|
|
|
|
|
|
|
MultiSound.Play(sound);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
Jukebox.PlayOneShotGame("djSchool/yay");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2022-07-11 05:53:25 +00:00
|
|
|
|
|
|
|
#region Inactive Game Commands
|
|
|
|
public static void WarnBreakCmon(float beat, int type, bool ooh)
|
|
|
|
{
|
|
|
|
string[] sounds = new string[] { };
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sounds = new string[] { "djSchool/breakCmon1", "djSchool/breakCmon2", "djSchool/ooh" };
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
sounds = new string[] { "djSchool/breakCmonAlt1", "djSchool/breakCmonAlt2", "djSchool/oohAlt" };
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
sounds = new string[] { "djSchool/breakCmonLoud1", "djSchool/breakCmonLoud2", "djSchool/oohLoud" };
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
var sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + 1f, offset: 0.030f),
|
|
|
|
new MultiSound.Sound("", beat + 2f)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (ooh)
|
|
|
|
sound[2] = new MultiSound.Sound(sounds[2], beat + 2f);
|
|
|
|
|
|
|
|
MultiSound.Play(sound, forcePlay: true);
|
|
|
|
wantBreak = beat;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void WarnAndStop(float beat, bool ooh)
|
|
|
|
{
|
|
|
|
var sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("djSchool/andStop1", beat),
|
|
|
|
new MultiSound.Sound("djSchool/andStop2", beat + .5f, offset: 0.1200f),
|
|
|
|
new MultiSound.Sound("", beat + 1.5f)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (ooh)
|
|
|
|
sound[2] = new MultiSound.Sound("djSchool/oohAlt", beat + 1.5f);
|
|
|
|
|
|
|
|
|
|
|
|
MultiSound.Play(sound, forcePlay: true);
|
|
|
|
wantAndStop = beat;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void WarnDJVoiceLines(float beat, int type)
|
|
|
|
{
|
|
|
|
string[] sounds;
|
|
|
|
var sound = new MultiSound.Sound[] { };
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
sounds = new string[] { "djSchool/checkItOut1", "djSchool/checkItOut2", "djSchool/checkItOut3" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .25f),
|
|
|
|
new MultiSound.Sound(sounds[2], beat + .5f),
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
sounds = new string[] { "djSchool/letsGo1", "djSchool/letsGo2" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .5f),
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
sounds = new string[] { "djSchool/ohYeah1", "djSchool/ohYeah2" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .5f),
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
sounds = new string[] { "djSchool/ohYeahAlt1", "djSchool/ohYeahAlt2", "djSchool/ohYeahAlt3" };
|
|
|
|
sound = new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound(sounds[0], beat),
|
|
|
|
new MultiSound.Sound(sounds[1], beat + .5f),
|
|
|
|
new MultiSound.Sound(sounds[2], beat + 1f),
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
Jukebox.PlayOneShotGame("djSchool/yay");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
MultiSound.Play(sound, forcePlay: true);
|
|
|
|
wantDJVoiceLines = beat;
|
|
|
|
}
|
|
|
|
#endregion
|
2022-02-03 02:09:50 +00:00
|
|
|
}
|
|
|
|
}
|