From 1f91d125cf33d209fc81d20a917c581934555985 Mon Sep 17 00:00:00 2001 From: EscapeNumber001 Date: Mon, 17 Apr 2023 18:09:45 -0400 Subject: [PATCH] Implemented activator notes --- Assets/Script/Data/NoteInfo.cs | 5 +++++ Assets/Script/Input/DrumsInputStrategy.cs | 6 +++++- Assets/Script/PlayMode/DrumsTrack.cs | 19 ++++++++++++++++++- Assets/Script/Pools/NoteComponent.cs | 5 +++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Assets/Script/Data/NoteInfo.cs b/Assets/Script/Data/NoteInfo.cs index 00ab78108..725ae8141 100644 --- a/Assets/Script/Data/NoteInfo.cs +++ b/Assets/Script/Data/NoteInfo.cs @@ -9,6 +9,11 @@ public class NoteInfo : AbstractInfo { /// public bool hopo; + /// + /// Overdrive activator note on drums. + /// + public bool isActivator; + /// /// Whether or not this HOPO is automatic.
/// Used for difficulty downsampling. diff --git a/Assets/Script/Input/DrumsInputStrategy.cs b/Assets/Script/Input/DrumsInputStrategy.cs index 41f87f810..229dd7507 100644 --- a/Assets/Script/Input/DrumsInputStrategy.cs +++ b/Assets/Script/Input/DrumsInputStrategy.cs @@ -73,7 +73,7 @@ public override void UpdatePlayerMode() { } // Constantly activate starpower - CallStarpowerEvent(); + //CallStarpowerEvent(); } public override void UpdateBotMode(object rawChart, float songTime) { @@ -93,6 +93,10 @@ public override void UpdateBotMode(object rawChart, float songTime) { } // Constantly activate starpower + //CallStarpowerEvent(); + } + + public void ActivateStarpower() { CallStarpowerEvent(); } diff --git a/Assets/Script/PlayMode/DrumsTrack.cs b/Assets/Script/PlayMode/DrumsTrack.cs index 18526a03d..e52dbecc4 100644 --- a/Assets/Script/PlayMode/DrumsTrack.cs +++ b/Assets/Script/PlayMode/DrumsTrack.cs @@ -137,6 +137,10 @@ protected override void UpdateTrack() { continue; } + if (player.track.FillSection?.EndTime > player.track.RelativeTime) { + noteInfo.isActivator = true; + } + SpawnNote(noteInfo, RelativeTime); visualChartIndex++; } @@ -173,8 +177,14 @@ private void UpdateInput() { var missedChord = expectedHits.Dequeue(); // Call miss for each component - Combo = 0; foreach (var hit in missedChord) { + // The player should not be penalized for missing activator notes + if (hit.isActivator) { + continue; + } + + Combo = 0; + hitChartIndex++; notePool.MissNote(hit); StopAudio = true; @@ -227,6 +237,13 @@ private void DrumHitAction(int drum, bool cymbal) { // Check if a drum was hit NoteInfo hit = null; foreach (var note in chord) { + if (note.isActivator) { + Debug.Log("Activator hit"); + (input as DrumsInputStrategy).ActivateStarpower(); + hit = note; + break; + } + // Check if correct cymbal was hit bool cymbalHit = note.hopo == cymbal; if (player.chosenInstrument == "drums") { diff --git a/Assets/Script/Pools/NoteComponent.cs b/Assets/Script/Pools/NoteComponent.cs index 62f9a6adf..bde15b9a4 100644 --- a/Assets/Script/Pools/NoteComponent.cs +++ b/Assets/Script/Pools/NoteComponent.cs @@ -37,6 +37,11 @@ private Color ColorCache { return Color.white; } + // DEBUG: Temporary test code + if (pool.player.track.FillSection?.EndTime > pool.player.track.RelativeTime) { + return Color.magenta; + } + return _colorCache; } set => _colorCache = value;