From 60ab0203c16788bba7799479a0d5883c97d83ef3 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Tue, 24 Jan 2023 22:52:01 -0500 Subject: [PATCH] implement forced miss scoring to some games --- Assets/Scripts/GameManager.cs | 4 +- .../Games/ClappyTrio/ClappyTrioPlayer.cs | 1 + Assets/Scripts/Games/CropStomp/Farmer.cs | 5 ++ Assets/Scripts/Games/DJSchool/DJSchool.cs | 1 + Assets/Scripts/Games/FanClub/NtrIdolFan.cs | 2 + .../Scripts/Games/KarateMan/KarateManJoe.cs | 1 + Assets/Scripts/Games/Lockstep/Lockstep.cs | 1 + .../Games/MarchingOrders/MarchingOrders.cs | 1 + Assets/Scripts/Games/Minigame.cs | 2 +- .../Games/PajamaParty/CtrPillowPlayer.cs | 2 + Assets/Scripts/Games/PlayerActionEvent.cs | 4 -- .../Scripts/Games/RhythmSomen/RhythmSomen.cs | 62 ++++++++++--------- .../Games/SamuraiSliceNtr/NtrSamuraiObject.cs | 12 ++-- Assets/Scripts/Games/Tambourine/Tambourine.cs | 2 + 14 files changed, 58 insertions(+), 42 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 27be2f87f..88f5eea12 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -207,6 +207,8 @@ namespace HeavenStudio { totalInputs += weight; totalPlayerAccuracy += accuracy * weight; + + // push the hit event to the timing display } public void SeekAheadAndPreload(double start, float seekTime = 8f) @@ -391,7 +393,7 @@ namespace HeavenStudio totalInputs = 0; totalPlayerAccuracy = 0; - + StartCoroutine(PlayCo(beat)); onBeatChanged?.Invoke(beat); } diff --git a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs index f4466c28d..b7eabdfed 100644 --- a/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs +++ b/Assets/Scripts/Games/ClappyTrio/ClappyTrioPlayer.cs @@ -28,6 +28,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) { Clap(false); + game.ScoreMiss(); } } diff --git a/Assets/Scripts/Games/CropStomp/Farmer.cs b/Assets/Scripts/Games/CropStomp/Farmer.cs index 7bbb9f4e1..8745f8229 100644 --- a/Assets/Scripts/Games/CropStomp/Farmer.cs +++ b/Assets/Scripts/Games/CropStomp/Farmer.cs @@ -28,7 +28,10 @@ namespace HeavenStudio.Games.Scripts_CropStomp if (stomp == null && cond.isPlaying) { if (GameManager.instance.currentGame == "cropStomp") + { stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + stomp.countsForAccuracy = false; + } } if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) @@ -52,6 +55,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp nextStompBeat += 2f; stomp?.Disable(); stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + stomp.countsForAccuracy = false; } private void Out(PlayerActionEvent caller) {} @@ -73,6 +77,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp nextStompBeat += 2f; stomp?.Disable(); stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); + stomp.countsForAccuracy = false; } } } diff --git a/Assets/Scripts/Games/DJSchool/DJSchool.cs b/Assets/Scripts/Games/DJSchool/DJSchool.cs index 659602380..96829580f 100644 --- a/Assets/Scripts/Games/DJSchool/DJSchool.cs +++ b/Assets/Scripts/Games/DJSchool/DJSchool.cs @@ -232,6 +232,7 @@ namespace HeavenStudio.Games { student.OnMissHoldForPlayerInput(); student.isHolding = true; + ScoreMiss(); } else if(PlayerInput.PressedUp() && !IsExpectingInputNow() && student.isHolding) //Let go during hold { diff --git a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs index 117aca86f..5f6738971 100644 --- a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs +++ b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs @@ -102,6 +102,7 @@ namespace HeavenStudio.Games.Scripts_FanClub if (!FanClub.instance.IsExpectingInputNow(InputType.STANDARD_DOWN)) { ClapStart(false); + FanClub.instance.ScoreMiss(); } } if (PlayerInput.Pressing()) @@ -118,6 +119,7 @@ namespace HeavenStudio.Games.Scripts_FanClub if (clappingStartTime != Single.MinValue && cond.songPositionInBeats > clappingStartTime + 2f && stopCharge && !FanClub.instance.IsExpectingInputNow(InputType.STANDARD_UP)) { JumpStart(false); + FanClub.instance.ScoreMiss(); } else { diff --git a/Assets/Scripts/Games/KarateMan/KarateManJoe.cs b/Assets/Scripts/Games/KarateMan/KarateManJoe.cs index 3529a7812..6ae31f3a6 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManJoe.cs @@ -152,6 +152,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan { //start a forced-fail combo sequence ForceFailCombo(cond.songPositionInBeats); + KarateMan.instance.ScoreMiss(2); } } else if (PlayerInput.AltPressedUp()) diff --git a/Assets/Scripts/Games/Lockstep/Lockstep.cs b/Assets/Scripts/Games/Lockstep/Lockstep.cs index 5eea7f812..fc7f1a9ca 100644 --- a/Assets/Scripts/Games/Lockstep/Lockstep.cs +++ b/Assets/Scripts/Games/Lockstep/Lockstep.cs @@ -156,6 +156,7 @@ namespace HeavenStudio.Games var stepPlayerAnim = (beatAnimCheck % 2 != 0 ? "OffbeatMarch" : "OnbeatMarch"); Jukebox.PlayOneShotGame("lockstep/miss"); stepswitcherP.DoScaledAnimationAsync(stepPlayerAnim, 0.5f); + ScoreMiss(); } } diff --git a/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs b/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs index ba87b782b..431a9ee6e 100644 --- a/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs +++ b/Assets/Scripts/Games/MarchingOrders/MarchingOrders.cs @@ -154,6 +154,7 @@ namespace HeavenStudio.Games Jukebox.PlayOneShot("miss"); Sarge.DoScaledAnimationAsync("Anger", 0.5f); Steam.DoScaledAnimationAsync("Steam", 0.5f); + ScoreMiss(); marchPlayerCount += 1; var marchPlayerAnim = (marchPlayerCount % 2 != 0 ? "MarchR" : "MarchL"); diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs index c505302bc..a9a41552a 100644 --- a/Assets/Scripts/Games/Minigame.cs +++ b/Assets/Scripts/Games/Minigame.cs @@ -251,7 +251,7 @@ namespace HeavenStudio.Games return null; } - public void ScoreMiss(double weight) + public void ScoreMiss(double weight = 1f) { GameManager.instance.ScoreInputAccuracy(0, true, weight); } diff --git a/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs b/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs index 9ed247a0f..aa6106bea 100644 --- a/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs +++ b/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs @@ -53,6 +53,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty { Jukebox.PlayOneShot("miss"); PlayerJump(cond.songPositionInBeats, true, false); + PajamaParty.instance.ScoreMiss(); } if (PlayerInput.AltPressed() && canCharge) { @@ -62,6 +63,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty { Jukebox.PlayOneShot("miss"); EndCharge(cond.songPositionInBeats, false, false); + PajamaParty.instance.ScoreMiss(); } // mako jumping logic diff --git a/Assets/Scripts/Games/PlayerActionEvent.cs b/Assets/Scripts/Games/PlayerActionEvent.cs index 53e7d56e8..fa51f17a7 100644 --- a/Assets/Scripts/Games/PlayerActionEvent.cs +++ b/Assets/Scripts/Games/PlayerActionEvent.cs @@ -76,10 +76,6 @@ namespace HeavenStudio.Games if (state.perfect) { Hit(stateProg, normalizedTime); - if (normalizedTime >= Minigame.AceStartTime() && normalizedTime <= Minigame.AceEndTime()) - { - // push an ace event - } } else if (state.early && !perfectOnly) { diff --git a/Assets/Scripts/Games/RhythmSomen/RhythmSomen.cs b/Assets/Scripts/Games/RhythmSomen/RhythmSomen.cs index 28a4a837e..4ebb2d875 100644 --- a/Assets/Scripts/Games/RhythmSomen/RhythmSomen.cs +++ b/Assets/Scripts/Games/RhythmSomen/RhythmSomen.cs @@ -8,23 +8,24 @@ namespace HeavenStudio.Games.Loaders using static Minigames; public static class PcoSomenLoader { - public static Minigame AddGame(EventCaller eventCaller) { + public static Minigame AddGame(EventCaller eventCaller) + { return new Minigame("rhythmSomen", "Rhythm Sōmen", "99CC34", false, false, new List() { new GameAction("crane (far)", "Far Crane") { - function = delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); }, - defaultLength = 4.0f, + function = delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); }, + defaultLength = 4.0f, }, new GameAction("crane (close)", "Close Crane") { - function = delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); }, - defaultLength = 3.0f, + function = delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); }, + defaultLength = 3.0f, }, new GameAction("crane (both)", "Both Cranes") { - function = delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); }, - defaultLength = 4.0f, + function = delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); }, + defaultLength = 4.0f, }, new GameAction("offbeat bell", "Offbeat Warning") { @@ -66,14 +67,15 @@ namespace HeavenStudio.Games var cond = Conductor.instance; if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1)) { - SomenPlayer.Play("HeadBob", -1, 0); + SomenPlayer.Play("HeadBob", -1, 0); } if (PlayerInput.Pressed() && !IsExpectingInputNow()) { - Jukebox.PlayOneShotGame("rhythmSomen/somen_mistake"); - FrontArm.Play("ArmPluck", -1, 0); - EffectSweat.Play("BlobSweating", -1, 0); + Jukebox.PlayOneShotGame("rhythmSomen/somen_mistake"); + FrontArm.Play("ArmPluck", -1, 0); + EffectSweat.Play("BlobSweating", -1, 0); + ScoreMiss(); } } @@ -87,7 +89,7 @@ namespace HeavenStudio.Games new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f), }); - BeatAction.New(Player, new List() + BeatAction.New(Player, new List() { new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}), new BeatAction.Action(beat + 1.0f, delegate { FarCrane.Play("Open", -1, 0);}), @@ -106,7 +108,7 @@ namespace HeavenStudio.Games new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f), }); - BeatAction.New(Player, new List() + BeatAction.New(Player, new List() { new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}), new BeatAction.Action(beat + 1.0f, delegate { CloseCrane.Play("OpenClose", -1, 0);}), @@ -115,7 +117,7 @@ namespace HeavenStudio.Games } - public void DoBothCrane(float beat) + public void DoBothCrane(float beat) { //Both Drop Multisound ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty); @@ -127,7 +129,7 @@ namespace HeavenStudio.Games new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f), }); - BeatAction.New(Player, new List() + BeatAction.New(Player, new List() { new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}), new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}), @@ -139,33 +141,33 @@ namespace HeavenStudio.Games } - public void DoBell(float beat) - { - //Bell Sound lol - Jukebox.PlayOneShotGame("rhythmSomen/somen_bell"); + public void DoBell(float beat) + { + //Bell Sound lol + Jukebox.PlayOneShotGame("rhythmSomen/somen_bell"); - BeatAction.New(Player, new List() + BeatAction.New(Player, new List() { new BeatAction.Action(beat, delegate { EffectExclam.Play("ExclamAppear", -1, 0);}), }); - } + } - public void CatchSuccess(PlayerActionEvent caller, float state) - { + public void CatchSuccess(PlayerActionEvent caller, float state) + { Jukebox.PlayOneShotGame("rhythmSomen/somen_catch"); FrontArm.Play("ArmPluck", -1, 0); EffectHit.Play("HitAppear", -1, 0); - } + } - public void CatchMiss(PlayerActionEvent caller) - { + public void CatchMiss(PlayerActionEvent caller) + { EffectShock.Play("ShockAppear", -1, 0); - } + } - public void CatchEmpty(PlayerActionEvent caller) - { + public void CatchEmpty(PlayerActionEvent caller) + { - } + } } } \ No newline at end of file diff --git a/Assets/Scripts/Games/SamuraiSliceNtr/NtrSamuraiObject.cs b/Assets/Scripts/Games/SamuraiSliceNtr/NtrSamuraiObject.cs index 856c1ae66..014e1ebe5 100644 --- a/Assets/Scripts/Games/SamuraiSliceNtr/NtrSamuraiObject.cs +++ b/Assets/Scripts/Games/SamuraiSliceNtr/NtrSamuraiObject.cs @@ -84,9 +84,9 @@ namespace HeavenStudio.Games.Scripts_NtrSamurai launchProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat, 2f, InputType.STANDARD_ALT_DOWN, LaunchSuccess, LaunchMiss, LaunchThrough); //autoplay: launch anim - SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat, 2f, InputType.STANDARD_ALT_DOWN, DoLaunchAutoplay, LaunchThrough, LaunchThrough); + SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat, 2f, InputType.STANDARD_ALT_DOWN, DoLaunchAutoplay, LaunchThrough, LaunchThrough).countsForAccuracy = false; //autoplay: unstep - SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat, 1.75f, InputType.STANDARD_ALT_UP, DoUnStepAutoplay, LaunchThrough, LaunchThrough); + SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat, 1.75f, InputType.STANDARD_ALT_UP, DoUnStepAutoplay, LaunchThrough, LaunchThrough).countsForAccuracy = false; currentCurve = SamuraiSliceNtr.instance.InCurve; transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (360f * startBeat)); @@ -216,9 +216,9 @@ namespace HeavenStudio.Games.Scripts_NtrSamurai { flyProg = 2; launchProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat + 2f, 2f, InputType.STANDARD_ALT_DOWN, LaunchSuccess, LaunchMiss, LaunchThrough); - SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 2f, InputType.STANDARD_ALT_DOWN, DoLaunchAutoplay, LaunchThrough, LaunchThrough); + SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 2f, InputType.STANDARD_ALT_DOWN, DoLaunchAutoplay, LaunchThrough, LaunchThrough).countsForAccuracy = false; //autoplay: unstep - SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 1.75f, InputType.STANDARD_ALT_UP, DoUnStepAutoplay, LaunchThrough, LaunchThrough); + SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 1.75f, InputType.STANDARD_ALT_UP, DoUnStepAutoplay, LaunchThrough, LaunchThrough).countsForAccuracy = false; currentCurve = null; Jukebox.PlayOneShotGame("samuraiSliceNtr/holy_mackerel" + UnityEngine.Random.Range(1, 4), pitch: UnityEngine.Random.Range(0.95f, 1.05f), volume: 0.8f); @@ -227,13 +227,13 @@ namespace HeavenStudio.Games.Scripts_NtrSamurai case (int) SamuraiSliceNtr.ObjectType.Demon: flyProg = 1; hitProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat + 2f, 4f, InputType.STANDARD_DOWN, HitSuccess, HitMiss, LaunchThrough); - SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 4f, InputType.STANDARD_DOWN, DoSliceAutoplay, LaunchThrough, LaunchThrough); + SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 4f, InputType.STANDARD_DOWN, DoSliceAutoplay, LaunchThrough, LaunchThrough).countsForAccuracy = false; currentCurve = SamuraiSliceNtr.instance.LaunchHighCurve; break; default: flyProg = 1; hitProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat + 2f, 2f, InputType.STANDARD_DOWN, HitSuccess, HitMiss, LaunchThrough); - SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 2f, InputType.STANDARD_DOWN, DoSliceAutoplay, LaunchThrough, LaunchThrough); + SamuraiSliceNtr.instance.ScheduleAutoplayInput(startBeat + 2f, 2f, InputType.STANDARD_DOWN, DoSliceAutoplay, LaunchThrough, LaunchThrough).countsForAccuracy = false; currentCurve = SamuraiSliceNtr.instance.LaunchCurve; break; } diff --git a/Assets/Scripts/Games/Tambourine/Tambourine.cs b/Assets/Scripts/Games/Tambourine/Tambourine.cs index f0b165a9a..7c67fd520 100644 --- a/Assets/Scripts/Games/Tambourine/Tambourine.cs +++ b/Assets/Scripts/Games/Tambourine/Tambourine.cs @@ -162,6 +162,7 @@ namespace HeavenStudio.Games Jukebox.PlayOneShotGame($"tambourine/player/shake/{UnityEngine.Random.Range(1, 6)}"); sweatAnimator.Play("Sweating", 0, 0); SummonFrog(); + ScoreMiss(); if (!intervalStarted) { sadFace.SetActive(true); @@ -173,6 +174,7 @@ namespace HeavenStudio.Games Jukebox.PlayOneShotGame($"tambourine/player/hit/{UnityEngine.Random.Range(1, 6)}"); sweatAnimator.Play("Sweating", 0, 0); SummonFrog(); + ScoreMiss(); if (!intervalStarted) { sadFace.SetActive(true);