HeavenStudioPlus/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs

340 lines
12 KiB
C#
Raw Normal View History

2022-08-13 01:06:41 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
using Jukebox;
2022-08-13 01:06:41 +00:00
using HeavenStudio.Util;
namespace HeavenStudio.Games.Scripts_KarateMan
{
public class KarateManNoriController : MonoBehaviour
{
public GameObject NoriController;
public GameObject NoriHeart;
public Transform NoriHolderTengoku;
public Transform NoriHolderMania00;
public Transform NoriHolderMania01;
public GameObject NoriManiaInk00;
public GameObject NoriManiaInk01;
2022-08-13 01:06:41 +00:00
public Material NoriMaterial;
2022-08-13 02:06:43 +00:00
public Color[] NoriColorsTengoku;
public Color[] NoriColorsMania;
2022-08-13 01:06:41 +00:00
public float Nori;
public int MaxNori;
Animator[] NoriHeartAnimators;
Material[] NoriHeartMaterials;
Transform NoriHolder;
2022-08-13 01:06:41 +00:00
static Vector2 HeartScale = new Vector2(60, 52);
static float ScaleFactorTengoku = 1 / 46f;
static float ScaleFactorMania = 1 / 72f;
2022-08-13 01:06:41 +00:00
static float CameraOffset = 10;
static float PeriodLow = 24 / 60f;
static float PeriodHigh = 15 / 60f;
int noriMode = (int)KarateMan.NoriMode.None;
bool playedJust = false;
2022-08-13 01:06:41 +00:00
int inputsToSwitch = 0;
2022-08-14 02:11:17 +00:00
//takes 12% of inputs to fill the nori bar
float hitNoriAdd { get { return MaxNori / (inputsToSwitch * 0.12f); } }
2022-08-13 01:06:41 +00:00
void Start()
{
}
public void SetNoriMode(double fromBeat, int mode, int startingNori = 0)
2022-08-13 01:06:41 +00:00
{
float scaleFactor = 0f;
//clear all children of the holder
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
if (NoriHolder != null) {
foreach (Transform child in NoriHolder) {
Destroy(child.gameObject);
}
2022-08-13 01:06:41 +00:00
}
switch (mode)
{
case (int) KarateMan.NoriMode.Tengoku:
MaxNori = 5;
Nori = Mathf.Clamp(startingNori, 0, MaxNori);
scaleFactor = ScaleFactorTengoku;
NoriHolder = NoriHolderTengoku;
NoriManiaInk00.SetActive(false);
NoriManiaInk01.SetActive(false);
playedJust = false;
2022-08-13 01:06:41 +00:00
break;
case (int) KarateMan.NoriMode.Mania:
MaxNori = 10;
Nori = Mathf.Clamp(startingNori, 0, MaxNori);
scaleFactor = ScaleFactorMania;
NoriHolder = NoriHolderMania00;
NoriManiaInk00.SetActive(true);
NoriManiaInk01.SetActive(false);
playedJust = false;
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
inputsToSwitch = CountHitsToEnd(fromBeat);
2022-08-13 01:06:41 +00:00
break;
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
case (int) KarateMan.NoriMode.ManiaHorizontal:
MaxNori = 10;
Nori = Mathf.Clamp(startingNori, 0, MaxNori);
scaleFactor = ScaleFactorMania;
NoriHolder = NoriHolderMania01;
NoriManiaInk00.SetActive(true);
NoriManiaInk01.SetActive(true);
playedJust = false;
inputsToSwitch = CountHitsToEnd(fromBeat);
break;
default: //KarateMan.NoriMode.None
2022-08-13 01:06:41 +00:00
MaxNori = 0;
Nori = 0;
NoriManiaInk00.SetActive(false);
NoriManiaInk01.SetActive(false);
playedJust = false;
2022-08-13 01:06:41 +00:00
return;
}
NoriHeartAnimators = new Animator[MaxNori];
NoriHeartMaterials = new Material[MaxNori];
noriMode = mode;
if (mode == (int) KarateMan.NoriMode.None) return;
//add the label?
for (int i = 0; i < MaxNori; i++)
{
GameObject h = GameObject.Instantiate(NoriHeart, NoriHolder);
h.SetActive(true);
Material m_Material = Instantiate(NoriMaterial);
NoriHeartMaterials[i] = m_Material;
h.GetComponent<Image>().material = m_Material;
RectTransform hrect = h.GetComponent<RectTransform>();
hrect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, HeartScale.x * scaleFactor);
hrect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, HeartScale.y * scaleFactor);
NoriHeartAnimators[i] = h.GetComponent<Animator>();
NoriHeartAnimators[i].Play(i <= (int) (startingNori - 1) ? "NoriFull" : "NoriNone", -1, (Time.time * PeriodLow) % 1f);
}
}
public void DoHit()
{
if (noriMode == (int) KarateMan.NoriMode.None) return;
2022-08-19 21:00:55 +00:00
if (MaxNori <= 0) return;
2022-08-14 02:11:17 +00:00
float oldNori = Nori;
2022-08-13 01:06:41 +00:00
if (noriMode == (int) KarateMan.NoriMode.Tengoku)
{
Nori += 1;
if (Nori > MaxNori) Nori = MaxNori;
if (Nori - 1 >= 0)
NoriHeartAnimators[(int) Nori - 1].Play("NoriFull", -1, (Time.time * PeriodHigh) % 1f);
}
else
{
Nori += hitNoriAdd;
if (Nori > MaxNori) Nori = MaxNori;
for (int i = 0; i < MaxNori; i++)
{
if (i <= (int) Nori && i >= (int) oldNori)
NoriHeartAnimators[i].Play("NoriFull", -1, (Time.time * PeriodHigh) % 1f);
}
2022-08-13 01:06:41 +00:00
}
if (KarateMan.instance.NoriPerformance >= 0.6f && oldNori / MaxNori < 0.6f && !playedJust)
2022-08-14 02:11:17 +00:00
{
playedJust = true;
SoundByte.PlayOneShotGame("karateman/nori_just");
2022-08-14 02:11:17 +00:00
}
UpdateHeartColours();
2022-08-13 01:06:41 +00:00
}
public void DoNG()
{
if (noriMode == (int) KarateMan.NoriMode.None) return;
2022-08-19 21:00:55 +00:00
if (MaxNori <= 0) return;
2022-08-14 02:11:17 +00:00
float oldNori = Nori;
2022-08-13 01:06:41 +00:00
if (noriMode == (int) KarateMan.NoriMode.Tengoku)
{
Nori -= 1;
if (Nori < 0) Nori = 0;
NoriHeartAnimators[(int)Nori].Play("NoriNone", -1, (Time.time * PeriodLow) % 1f);
2022-08-13 01:06:41 +00:00
}
else
{
Nori -= hitNoriAdd;
if (Nori < 0) Nori = 0;
if (Nori == 0)
{
foreach (Animator anim in NoriHeartAnimators)
{
anim.Play("NoriNone", -1, (Time.time * PeriodLow) % 1f);
}
}
else
{
for (int i = 0; i < MaxNori; i++)
{
if (i > (int) Nori)
NoriHeartAnimators[i].Play("NoriNone", -1, (Time.time * PeriodLow) % 1f);
}
}
}
2022-08-19 21:00:55 +00:00
if (KarateMan.instance.NoriPerformance < 0.6f && oldNori / MaxNori >= 0.6f)
2022-08-14 02:11:17 +00:00
{
playedJust = false;
SoundByte.PlayOneShotGame("karateman/nori_ng");
2022-08-14 02:11:17 +00:00
}
UpdateHeartColours();
2022-08-13 01:06:41 +00:00
}
public void DoThrough()
{
if (noriMode == (int) KarateMan.NoriMode.None) return;
2022-08-19 21:00:55 +00:00
if (MaxNori <= 0) return;
2022-08-13 01:06:41 +00:00
if (noriMode == (int) KarateMan.NoriMode.Tengoku)
{
2022-08-14 02:11:17 +00:00
if (Nori >= MaxNori)
SoundByte.PlayOneShotGame("karateman/nori_through");
playedJust = false;
2022-08-13 01:06:41 +00:00
Nori = 0;
foreach (Animator anim in NoriHeartAnimators)
{
anim.Play("NoriNone", -1, (Time.time * PeriodLow) % 1f);
}
}
else
{
Nori -= hitNoriAdd * 2;
if (Nori < 0) Nori = 0;
if (Nori == 0)
{
foreach (Animator anim in NoriHeartAnimators)
{
anim.Play("NoriNone", -1, (Time.time * PeriodLow) % 1f);
}
}
else
{
for (int i = 0; i < MaxNori; i++)
{
if (i > (int) Nori)
NoriHeartAnimators[i].Play("NoriNone", -1, (Time.time * PeriodLow) % 1f);
}
}
}
if (KarateMan.instance.NoriPerformance < 0.6f)
playedJust = false;
UpdateHeartColours();
2022-08-13 01:06:41 +00:00
}
2022-08-13 02:06:43 +00:00
void UpdateHeartColours()
{
var cond = Conductor.instance;
2022-08-13 02:06:43 +00:00
if (noriMode == (int) KarateMan.NoriMode.None) return;
2022-08-19 21:00:55 +00:00
if (MaxNori <= 0) return;
float flashPeriod;
for (int i = 0; i < NoriHeartMaterials.Length; i++)
2022-08-13 02:06:43 +00:00
{
Material mat = NoriHeartMaterials[i];
if (noriMode == (int) KarateMan.NoriMode.Tengoku)
2022-08-13 02:06:43 +00:00
{
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
if (Nori == MaxNori) {
2022-08-13 02:06:43 +00:00
mat.SetColor("_ColorAlpha", NoriColorsTengoku[3]);
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
} else if (KarateMan.instance.NoriPerformance < 0.6) {
mat.SetColor("_ColorAlpha", NoriColorsTengoku[0]);
} else if (i < 2) {
mat.SetColor("_ColorAlpha", NoriColorsTengoku[1]);
} else {
mat.SetColor("_ColorAlpha", NoriColorsTengoku[2]);
2022-08-13 02:06:43 +00:00
}
}
else
{
Color c = NoriColorsMania[0];
Color s = Color.black;
if (Nori == MaxNori)
{
flashPeriod = Mathf.Sin((cond.songPositionInBeats - i / (float) MaxNori) * Mathf.PI);
c = NoriColorsMania[2] + (NoriColorsMania[3] * ((1 - flashPeriod * 0.5f) + 0.5f));
2022-08-14 02:11:17 +00:00
s = Color.HSVToRGB(((cond.songPositionInBeats + 0.5f) * 4) % 1, 1, flashPeriod * 0.6f + 0.4f);
}
else
{
flashPeriod = Mathf.Sin(cond.songPositionInBeats * Mathf.PI);
if (KarateMan.instance.NoriPerformance < 0.6)
c = NoriColorsMania[0];
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
else if (i < MaxNori - 2) {
c = NoriColorsMania[1];
} else {
c = NoriColorsMania[2];
}
c *= (flashPeriod * 0.5f) + 1f;
}
mat.SetColor("_ColorAlpha", c);
mat.SetColor("_AddColor", s);
}
2022-08-13 02:06:43 +00:00
}
}
2022-08-13 01:06:41 +00:00
void Update()
{
Transform target = GameCamera.instance.transform;
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
Vector3 displacement = target.forward * CameraOffset;
2022-08-13 01:06:41 +00:00
transform.position = target.position + displacement;
transform.rotation = target.rotation;
2022-08-13 02:06:43 +00:00
UpdateHeartColours();
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
float inkRot = (Conductor.instance.songPositionInBeats / 8f) % 1f;
NoriManiaInk00.transform.localRotation = Quaternion.Euler(0, 0, inkRot * 360);
NoriManiaInk01.transform.localRotation = Quaternion.Euler(0, 0, inkRot * 360);
2022-08-13 01:06:41 +00:00
}
Karate Man Additions Part 1 (#559) * starting out with adding so many things * voiceless kicks and combos (that one was easy) * queuing objects/specials * starting on cutting out the voice -i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice * got rid of basically all of the static variables in favor of checking the last color blocks -also means that the bg and object colors getting held over between remixes shouldn't happen anymore * removed all of the super backwards compatibility -im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues * convert karateman to karateMan * conversion stuff start * voice cutting fully works and is consistent now color conversion isn't working, but ill fix it eventually background color isn't working rn either, and moving to the new system has caused a lot of errors * it compiles now this Background Appearance block got hands :bangbang: working on converting everything to the new bg color system this will be so annoying to build a RiqUpdater for. * bunch of small stuff i got this done while i was at a cabin * bg still broken :( * unconvert karateman from karateMan, bg finally works well. bg ALMOST finally works i'll be doing the fx stuff after, and ill combine it with the flow block * bg nearly done * i just might give up on bg compatibility i tried for like an hour and a half to convert it but i couldn't. minenice might be able to but idk. * background + lightbulb stuffs * FINALLY got old bg blocks updating + better bulb sfx store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys. bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley: moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list camera bug fixed (call update in awake and start) recolorable barrels lol * and with that, it's finished! added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector * fixed a bug the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block * oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
public int CountHitsToEnd(double fromBeat)
{
List<RiqEntity> allHits = EventCaller.GetAllInGameManagerList("karateman", new string[] { "hit", "bulb", "kick", "combo" });
List<RiqEntity> allEnds = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame", "end" });
allHits.Sort((x, y) => x.beat.CompareTo(y.beat));
allEnds.Sort((x, y) => x.beat.CompareTo(y.beat));
double endBeat = double.MaxValue;
//get the beat of the closest end event
foreach (var end in allEnds) {
if (end.beat > fromBeat) {
endBeat = end.beat;
break;
}
}
//count each hit event beginning from our current beat to the beat of the closest game switch or end
int count = 0;
string type;
for (int i = 0; i < allHits.Count; i++)
{
RiqEntity h = allHits[i];
if (h.beat >= fromBeat)
{
if (h.beat < endBeat) {
//kicks and combos count for 2 hits
type = h.datamodel.Split('/')[1];
count += (type is "kick" or "combo") ? 2 : 1;
} else {
break;
}
}
}
return count;
}
2022-08-13 01:06:41 +00:00
}
}