implement forced miss scoring to some games

This commit is contained in:
minenice55 2023-01-24 22:52:01 -05:00
parent b8df0d1a26
commit 60ab0203c1
14 changed files with 58 additions and 42 deletions

View file

@ -207,6 +207,8 @@ namespace HeavenStudio
{ {
totalInputs += weight; totalInputs += weight;
totalPlayerAccuracy += accuracy * weight; totalPlayerAccuracy += accuracy * weight;
// push the hit event to the timing display
} }
public void SeekAheadAndPreload(double start, float seekTime = 8f) public void SeekAheadAndPreload(double start, float seekTime = 8f)
@ -391,7 +393,7 @@ namespace HeavenStudio
totalInputs = 0; totalInputs = 0;
totalPlayerAccuracy = 0; totalPlayerAccuracy = 0;
StartCoroutine(PlayCo(beat)); StartCoroutine(PlayCo(beat));
onBeatChanged?.Invoke(beat); onBeatChanged?.Invoke(beat);
} }

View file

@ -28,6 +28,7 @@ namespace HeavenStudio.Games.Scripts_ClappyTrio
if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN))
{ {
Clap(false); Clap(false);
game.ScoreMiss();
} }
} }

View file

@ -28,7 +28,10 @@ namespace HeavenStudio.Games.Scripts_CropStomp
if (stomp == null && cond.isPlaying) if (stomp == null && cond.isPlaying)
{ {
if (GameManager.instance.currentGame == "cropStomp") if (GameManager.instance.currentGame == "cropStomp")
{
stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out);
stomp.countsForAccuracy = false;
}
} }
if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN)) if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN))
@ -52,6 +55,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
nextStompBeat += 2f; nextStompBeat += 2f;
stomp?.Disable(); stomp?.Disable();
stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out);
stomp.countsForAccuracy = false;
} }
private void Out(PlayerActionEvent caller) {} private void Out(PlayerActionEvent caller) {}
@ -73,6 +77,7 @@ namespace HeavenStudio.Games.Scripts_CropStomp
nextStompBeat += 2f; nextStompBeat += 2f;
stomp?.Disable(); stomp?.Disable();
stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out); stomp = game.ScheduleUserInput(nextStompBeat - 1f, 1f, InputType.STANDARD_DOWN, Just, Miss, Out);
stomp.countsForAccuracy = false;
} }
} }
} }

View file

@ -232,6 +232,7 @@ namespace HeavenStudio.Games
{ {
student.OnMissHoldForPlayerInput(); student.OnMissHoldForPlayerInput();
student.isHolding = true; student.isHolding = true;
ScoreMiss();
} }
else if(PlayerInput.PressedUp() && !IsExpectingInputNow() && student.isHolding) //Let go during hold else if(PlayerInput.PressedUp() && !IsExpectingInputNow() && student.isHolding) //Let go during hold
{ {

View file

@ -102,6 +102,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
if (!FanClub.instance.IsExpectingInputNow(InputType.STANDARD_DOWN)) if (!FanClub.instance.IsExpectingInputNow(InputType.STANDARD_DOWN))
{ {
ClapStart(false); ClapStart(false);
FanClub.instance.ScoreMiss();
} }
} }
if (PlayerInput.Pressing()) 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)) if (clappingStartTime != Single.MinValue && cond.songPositionInBeats > clappingStartTime + 2f && stopCharge && !FanClub.instance.IsExpectingInputNow(InputType.STANDARD_UP))
{ {
JumpStart(false); JumpStart(false);
FanClub.instance.ScoreMiss();
} }
else else
{ {

View file

@ -152,6 +152,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan
{ {
//start a forced-fail combo sequence //start a forced-fail combo sequence
ForceFailCombo(cond.songPositionInBeats); ForceFailCombo(cond.songPositionInBeats);
KarateMan.instance.ScoreMiss(2);
} }
} }
else if (PlayerInput.AltPressedUp()) else if (PlayerInput.AltPressedUp())

View file

@ -156,6 +156,7 @@ namespace HeavenStudio.Games
var stepPlayerAnim = (beatAnimCheck % 2 != 0 ? "OffbeatMarch" : "OnbeatMarch"); var stepPlayerAnim = (beatAnimCheck % 2 != 0 ? "OffbeatMarch" : "OnbeatMarch");
Jukebox.PlayOneShotGame("lockstep/miss"); Jukebox.PlayOneShotGame("lockstep/miss");
stepswitcherP.DoScaledAnimationAsync(stepPlayerAnim, 0.5f); stepswitcherP.DoScaledAnimationAsync(stepPlayerAnim, 0.5f);
ScoreMiss();
} }
} }

View file

@ -154,6 +154,7 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShot("miss"); Jukebox.PlayOneShot("miss");
Sarge.DoScaledAnimationAsync("Anger", 0.5f); Sarge.DoScaledAnimationAsync("Anger", 0.5f);
Steam.DoScaledAnimationAsync("Steam", 0.5f); Steam.DoScaledAnimationAsync("Steam", 0.5f);
ScoreMiss();
marchPlayerCount += 1; marchPlayerCount += 1;
var marchPlayerAnim = (marchPlayerCount % 2 != 0 ? "MarchR" : "MarchL"); var marchPlayerAnim = (marchPlayerCount % 2 != 0 ? "MarchR" : "MarchL");

View file

@ -251,7 +251,7 @@ namespace HeavenStudio.Games
return null; return null;
} }
public void ScoreMiss(double weight) public void ScoreMiss(double weight = 1f)
{ {
GameManager.instance.ScoreInputAccuracy(0, true, weight); GameManager.instance.ScoreInputAccuracy(0, true, weight);
} }

View file

@ -53,6 +53,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
{ {
Jukebox.PlayOneShot("miss"); Jukebox.PlayOneShot("miss");
PlayerJump(cond.songPositionInBeats, true, false); PlayerJump(cond.songPositionInBeats, true, false);
PajamaParty.instance.ScoreMiss();
} }
if (PlayerInput.AltPressed() && canCharge) if (PlayerInput.AltPressed() && canCharge)
{ {
@ -62,6 +63,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
{ {
Jukebox.PlayOneShot("miss"); Jukebox.PlayOneShot("miss");
EndCharge(cond.songPositionInBeats, false, false); EndCharge(cond.songPositionInBeats, false, false);
PajamaParty.instance.ScoreMiss();
} }
// mako jumping logic // mako jumping logic

View file

@ -76,10 +76,6 @@ namespace HeavenStudio.Games
if (state.perfect) if (state.perfect)
{ {
Hit(stateProg, normalizedTime); Hit(stateProg, normalizedTime);
if (normalizedTime >= Minigame.AceStartTime() && normalizedTime <= Minigame.AceEndTime())
{
// push an ace event
}
} }
else if (state.early && !perfectOnly) else if (state.early && !perfectOnly)
{ {

View file

@ -8,23 +8,24 @@ namespace HeavenStudio.Games.Loaders
using static Minigames; using static Minigames;
public static class PcoSomenLoader 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<GameAction>() return new Minigame("rhythmSomen", "Rhythm Sōmen", "99CC34", false, false, new List<GameAction>()
{ {
new GameAction("crane (far)", "Far Crane") new GameAction("crane (far)", "Far Crane")
{ {
function = delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); }, function = delegate { RhythmSomen.instance.DoFarCrane(eventCaller.currentEntity.beat); },
defaultLength = 4.0f, defaultLength = 4.0f,
}, },
new GameAction("crane (close)", "Close Crane") new GameAction("crane (close)", "Close Crane")
{ {
function = delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); }, function = delegate { RhythmSomen.instance.DoCloseCrane(eventCaller.currentEntity.beat); },
defaultLength = 3.0f, defaultLength = 3.0f,
}, },
new GameAction("crane (both)", "Both Cranes") new GameAction("crane (both)", "Both Cranes")
{ {
function = delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); }, function = delegate { RhythmSomen.instance.DoBothCrane(eventCaller.currentEntity.beat); },
defaultLength = 4.0f, defaultLength = 4.0f,
}, },
new GameAction("offbeat bell", "Offbeat Warning") new GameAction("offbeat bell", "Offbeat Warning")
{ {
@ -66,14 +67,15 @@ namespace HeavenStudio.Games
var cond = Conductor.instance; var cond = Conductor.instance;
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1)) if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
{ {
SomenPlayer.Play("HeadBob", -1, 0); SomenPlayer.Play("HeadBob", -1, 0);
} }
if (PlayerInput.Pressed() && !IsExpectingInputNow()) if (PlayerInput.Pressed() && !IsExpectingInputNow())
{ {
Jukebox.PlayOneShotGame("rhythmSomen/somen_mistake"); Jukebox.PlayOneShotGame("rhythmSomen/somen_mistake");
FrontArm.Play("ArmPluck", -1, 0); FrontArm.Play("ArmPluck", -1, 0);
EffectSweat.Play("BlobSweating", -1, 0); EffectSweat.Play("BlobSweating", -1, 0);
ScoreMiss();
} }
} }
@ -87,7 +89,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f), new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
}); });
BeatAction.New(Player, new List<BeatAction.Action>() BeatAction.New(Player, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}), new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}),
new BeatAction.Action(beat + 1.0f, delegate { FarCrane.Play("Open", -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), new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
}); });
BeatAction.New(Player, new List<BeatAction.Action>() BeatAction.New(Player, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}), new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}),
new BeatAction.Action(beat + 1.0f, delegate { CloseCrane.Play("OpenClose", -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 //Both Drop Multisound
ScheduleInput(beat, 2f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty); 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), new MultiSound.Sound("rhythmSomen/somen_woosh", beat + 1.5f),
}); });
BeatAction.New(Player, new List<BeatAction.Action>() BeatAction.New(Player, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}), new BeatAction.Action(beat, delegate { CloseCrane.Play("DropClose", -1, 0);}),
new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}), new BeatAction.Action(beat, delegate { FarCrane.Play("Drop", -1, 0);}),
@ -139,33 +141,33 @@ namespace HeavenStudio.Games
} }
public void DoBell(float beat) public void DoBell(float beat)
{ {
//Bell Sound lol //Bell Sound lol
Jukebox.PlayOneShotGame("rhythmSomen/somen_bell"); Jukebox.PlayOneShotGame("rhythmSomen/somen_bell");
BeatAction.New(Player, new List<BeatAction.Action>() BeatAction.New(Player, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat, delegate { EffectExclam.Play("ExclamAppear", -1, 0);}), 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"); Jukebox.PlayOneShotGame("rhythmSomen/somen_catch");
FrontArm.Play("ArmPluck", -1, 0); FrontArm.Play("ArmPluck", -1, 0);
EffectHit.Play("HitAppear", -1, 0); EffectHit.Play("HitAppear", -1, 0);
} }
public void CatchMiss(PlayerActionEvent caller) public void CatchMiss(PlayerActionEvent caller)
{ {
EffectShock.Play("ShockAppear", -1, 0); EffectShock.Play("ShockAppear", -1, 0);
} }
public void CatchEmpty(PlayerActionEvent caller) public void CatchEmpty(PlayerActionEvent caller)
{ {
} }
} }
} }

View file

@ -84,9 +84,9 @@ namespace HeavenStudio.Games.Scripts_NtrSamurai
launchProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat, 2f, InputType.STANDARD_ALT_DOWN, LaunchSuccess, LaunchMiss, LaunchThrough); launchProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat, 2f, InputType.STANDARD_ALT_DOWN, LaunchSuccess, LaunchMiss, LaunchThrough);
//autoplay: launch anim //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 //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; currentCurve = SamuraiSliceNtr.instance.InCurve;
transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (360f * startBeat)); transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (360f * startBeat));
@ -216,9 +216,9 @@ namespace HeavenStudio.Games.Scripts_NtrSamurai
{ {
flyProg = 2; flyProg = 2;
launchProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat + 2f, 2f, InputType.STANDARD_ALT_DOWN, LaunchSuccess, LaunchMiss, LaunchThrough); 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 //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; currentCurve = null;
Jukebox.PlayOneShotGame("samuraiSliceNtr/holy_mackerel" + UnityEngine.Random.Range(1, 4), pitch: UnityEngine.Random.Range(0.95f, 1.05f), volume: 0.8f); 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: case (int) SamuraiSliceNtr.ObjectType.Demon:
flyProg = 1; flyProg = 1;
hitProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat + 2f, 4f, InputType.STANDARD_DOWN, HitSuccess, HitMiss, LaunchThrough); 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; currentCurve = SamuraiSliceNtr.instance.LaunchHighCurve;
break; break;
default: default:
flyProg = 1; flyProg = 1;
hitProg = SamuraiSliceNtr.instance.ScheduleInput(startBeat + 2f, 2f, InputType.STANDARD_DOWN, HitSuccess, HitMiss, LaunchThrough); 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; currentCurve = SamuraiSliceNtr.instance.LaunchCurve;
break; break;
} }

View file

@ -162,6 +162,7 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame($"tambourine/player/shake/{UnityEngine.Random.Range(1, 6)}"); Jukebox.PlayOneShotGame($"tambourine/player/shake/{UnityEngine.Random.Range(1, 6)}");
sweatAnimator.Play("Sweating", 0, 0); sweatAnimator.Play("Sweating", 0, 0);
SummonFrog(); SummonFrog();
ScoreMiss();
if (!intervalStarted) if (!intervalStarted)
{ {
sadFace.SetActive(true); sadFace.SetActive(true);
@ -173,6 +174,7 @@ namespace HeavenStudio.Games
Jukebox.PlayOneShotGame($"tambourine/player/hit/{UnityEngine.Random.Range(1, 6)}"); Jukebox.PlayOneShotGame($"tambourine/player/hit/{UnityEngine.Random.Range(1, 6)}");
sweatAnimator.Play("Sweating", 0, 0); sweatAnimator.Play("Sweating", 0, 0);
SummonFrog(); SummonFrog();
ScoreMiss();
if (!intervalStarted) if (!intervalStarted)
{ {
sadFace.SetActive(true); sadFace.SetActive(true);