Skip to content

Commit

Permalink
Implemented activator notes
Browse files Browse the repository at this point in the history
  • Loading branch information
EscapeNumber001 committed Apr 17, 2023
1 parent 538433f commit 1f91d12
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Assets/Script/Data/NoteInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ public class NoteInfo : AbstractInfo {
/// </summary>
public bool hopo;

/// <summary>
/// Overdrive activator note on drums.
/// </summary>
public bool isActivator;

/// <summary>
/// Whether or not this HOPO is automatic.<br/>
/// Used for difficulty downsampling.
Expand Down
6 changes: 5 additions & 1 deletion Assets/Script/Input/DrumsInputStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public override void UpdatePlayerMode() {
}

// Constantly activate starpower
CallStarpowerEvent();
//CallStarpowerEvent();
}

public override void UpdateBotMode(object rawChart, float songTime) {
Expand All @@ -93,6 +93,10 @@ public override void UpdateBotMode(object rawChart, float songTime) {
}

// Constantly activate starpower
//CallStarpowerEvent();
}

public void ActivateStarpower() {
CallStarpowerEvent();
}

Expand Down
19 changes: 18 additions & 1 deletion Assets/Script/PlayMode/DrumsTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ protected override void UpdateTrack() {
continue;
}

if (player.track.FillSection?.EndTime > player.track.RelativeTime) {
noteInfo.isActivator = true;
}

SpawnNote(noteInfo, RelativeTime);
visualChartIndex++;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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") {
Expand Down
5 changes: 5 additions & 0 deletions Assets/Script/Pools/NoteComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1f91d12

Please sign in to comment.