From def5bc7cccb5b8e6d664a5d1784d7412376c5c9b Mon Sep 17 00:00:00 2001 From: minenice55 Date: Sat, 13 Aug 2022 22:11:17 -0400 Subject: [PATCH] flow bar reactions --- Assets/Resources/Games/karateman.prefab | 4 ++-- .../Sfx/games/karateman/nori_just.wav.meta | 22 ++++++++++++++++++ .../Sfx/games/karateman/nori_ng.wav.meta | 22 ++++++++++++++++++ .../Sfx/games/karateman/nori_through.wav.meta | 22 ++++++++++++++++++ .../KarateMan/KarateManNoriController.cs | 23 ++++++++++++------- .../Scripts/Games/KarateMan/KarateManPot.cs | 1 + 6 files changed, 84 insertions(+), 10 deletions(-) create mode 100644 Assets/Resources/Sfx/games/karateman/nori_just.wav.meta create mode 100644 Assets/Resources/Sfx/games/karateman/nori_ng.wav.meta create mode 100644 Assets/Resources/Sfx/games/karateman/nori_through.wav.meta diff --git a/Assets/Resources/Games/karateman.prefab b/Assets/Resources/Games/karateman.prefab index 10e8e58e..12013805 100644 --- a/Assets/Resources/Games/karateman.prefab +++ b/Assets/Resources/Games/karateman.prefab @@ -31493,7 +31493,7 @@ SpriteRenderer: m_SortingLayer: 0 m_SortingOrder: 99 m_Sprite: {fileID: 21300000, guid: 8d47d8089ec1a3f40a5873ac60190d2b, type: 3} - m_Color: {r: 0, g: 0, b: 0, a: 0.78431374} + m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -62310,7 +62310,7 @@ SpriteRenderer: m_SortingLayer: 0 m_SortingOrder: 99 m_Sprite: {fileID: 21300000, guid: 8d47d8089ec1a3f40a5873ac60190d2b, type: 3} - m_Color: {r: 0, g: 0, b: 0, a: 0.78431374} + m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 diff --git a/Assets/Resources/Sfx/games/karateman/nori_just.wav.meta b/Assets/Resources/Sfx/games/karateman/nori_just.wav.meta new file mode 100644 index 00000000..7ff43872 --- /dev/null +++ b/Assets/Resources/Sfx/games/karateman/nori_just.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0c60a305e3872c647a8fe99088aba6b0 +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: diff --git a/Assets/Resources/Sfx/games/karateman/nori_ng.wav.meta b/Assets/Resources/Sfx/games/karateman/nori_ng.wav.meta new file mode 100644 index 00000000..67a5de51 --- /dev/null +++ b/Assets/Resources/Sfx/games/karateman/nori_ng.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 1c41c652083944441a5b3844e5920329 +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: diff --git a/Assets/Resources/Sfx/games/karateman/nori_through.wav.meta b/Assets/Resources/Sfx/games/karateman/nori_through.wav.meta new file mode 100644 index 00000000..92b627db --- /dev/null +++ b/Assets/Resources/Sfx/games/karateman/nori_through.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: ef84a567e7fe90b4d84764cafa6887d3 +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: diff --git a/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs b/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs index 4cddcb24..99a5644f 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManNoriController.cs @@ -39,8 +39,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan int noriMode = (int)KarateMan.NoriMode.None; int inputsToSwitch = 0; - //takes 10% of inputs to fill the nori bar - float hitNoriAdd { get { return MaxNori / (inputsToSwitch * 0.15f); } } + //takes 12% of inputs to fill the nori bar + float hitNoriAdd { get { return MaxNori / (inputsToSwitch * 0.12f); } } void Start() @@ -79,7 +79,6 @@ namespace HeavenStudio.Games.Scripts_KarateMan NoriManiaInk01.SetActive(false); inputsToSwitch = KarateMan.CountHitsToEnd(fromBeat); - Debug.Log($"inputs to segment end: {inputsToSwitch}"); break; default: MaxNori = 0; @@ -118,6 +117,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan public void DoHit() { if (noriMode == (int) KarateMan.NoriMode.None) return; + float oldNori = Nori; if (noriMode == (int) KarateMan.NoriMode.Tengoku) { Nori += 1; @@ -127,22 +127,25 @@ namespace HeavenStudio.Games.Scripts_KarateMan } else { - float oldNori = Nori; Nori += hitNoriAdd; if (Nori > MaxNori) Nori = MaxNori; - Debug.Log($"Nori: {Nori}, added {hitNoriAdd}, old nori: {oldNori}"); for (int i = 0; i < MaxNori; i++) { if (i <= (int) Nori && i >= (int) oldNori) NoriHeartAnimators[i].Play("NoriFull", -1, (Time.time * PeriodHigh) % 1f); } } + if (KarateMan.instance.NoriPerformance >= 0.6 && oldNori / MaxNori < 0.6) + { + Jukebox.PlayOneShotGame("karateman/nori_just"); + } UpdateHeartColours(); } public void DoNG() { if (noriMode == (int) KarateMan.NoriMode.None) return; + float oldNori = Nori; if (noriMode == (int) KarateMan.NoriMode.Tengoku) { Nori -= 1; @@ -153,7 +156,6 @@ namespace HeavenStudio.Games.Scripts_KarateMan { Nori -= hitNoriAdd; if (Nori < 0) Nori = 0; - Debug.Log($"Nori: {Nori}, removed {hitNoriAdd}"); if (Nori == 0) { foreach (Animator anim in NoriHeartAnimators) @@ -170,6 +172,10 @@ namespace HeavenStudio.Games.Scripts_KarateMan } } } + if (KarateMan.instance.NoriPerformance < 0.6 && oldNori / MaxNori >= 0.6) + { + Jukebox.PlayOneShotGame("karateman/nori_ng"); + } UpdateHeartColours(); } @@ -178,6 +184,8 @@ namespace HeavenStudio.Games.Scripts_KarateMan if (noriMode == (int) KarateMan.NoriMode.None) return; if (noriMode == (int) KarateMan.NoriMode.Tengoku) { + if (Nori >= MaxNori) + Jukebox.PlayOneShotGame("karateman/nori_through"); Nori = 0; foreach (Animator anim in NoriHeartAnimators) { @@ -188,7 +196,6 @@ namespace HeavenStudio.Games.Scripts_KarateMan { Nori -= hitNoriAdd * 2; if (Nori < 0) Nori = 0; - Debug.Log($"Nori: {Nori}, removed {hitNoriAdd * 4}"); if (Nori == 0) { foreach (Animator anim in NoriHeartAnimators) @@ -243,7 +250,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan { flashPeriod = Mathf.Sin((cond.songPositionInBeats - i / (float) MaxNori) * Mathf.PI); c = NoriColorsMania[2] + (NoriColorsMania[3] * ((1 - flashPeriod * 0.5f) + 0.5f)); - s = Color.HSVToRGB(((cond.songPositionInBeats + 0.5f) * 4) % 1, 1, flashPeriod * 0.75f + 0.25f); + s = Color.HSVToRGB(((cond.songPositionInBeats + 0.5f) * 4) % 1, 1, flashPeriod * 0.6f + 0.4f); } else { diff --git a/Assets/Scripts/Games/KarateMan/KarateManPot.cs b/Assets/Scripts/Games/KarateMan/KarateManPot.cs index 28952cfb..098f11c3 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManPot.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManPot.cs @@ -574,6 +574,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan { if (GameManager.instance.currentGame != "karateman") return; var joe = KarateMan.instance.Joe; + Debug.Log("ItemJustOrNg | accuracy: " + state); if (status == FlyStatus.Fly && !(joe.inCombo || joe.inNuriLock)) { if (state <= -1f || state >= 1f) { bool straight = joe.Punch(ItemPunchHand());