Skip to content

Commit

Permalink
Merge branch 'score-tuning-solo-base' into score-tuning-ch-scale
Browse files Browse the repository at this point in the history
  • Loading branch information
muskit committed May 8, 2023
2 parents eb4a974 + f55cab3 commit 684f38d
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Assets/Script/PlayMode/StarScoreKeeper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,41 @@ public StarScoreKeeper(List<NoteInfo> chart, ScoreKeeper scoreKeeper, string ins
instances.Add(this);
this.scoreKeeper = scoreKeeper;

// solo sections
List<EventInfo> soloEvents = new();
foreach (var ev in Play.Instance.chart.events) {
if (ev.name == $"solo_{instrument}") {
soloEvents.Add(ev);
}
}

// calculate and store base score
BaseScore = 0;
foreach (var note in chart) {
BaseScore += ptPerNote;
if (note.length > .2f) {
BaseScore += ptSusPerBeat * Util.Utils.InfoLengthInBeats(note, Play.Instance.chart.beats);
}
}

// add solo bonus
foreach (var ev in soloEvents) {
if (ev.time <= note.time && note.time < ev.EndTime) {
// solo notes get double score, effectively
BaseScore += ptPerNote;
goto leaveSoloLoop;
}
}
leaveSoloLoop:;
}
SetupScoreThreshold(instrument);
}

public StarScoreKeeper(ScoreKeeper scoreKeeper, string instrument, int noteCount, int ptPerNote) {
public StarScoreKeeper(ScoreKeeper scoreKeeper, string instrument, int noteCount, int ptPerNote, int soloNotes = 0) {
instances.Add(this);
this.scoreKeeper = scoreKeeper;

BaseScore = noteCount * ptPerNote;
// solo notes get double score, effectively
BaseScore = (noteCount + soloNotes) * ptPerNote;

SetupScoreThreshold(instrument);
}
Expand Down

0 comments on commit 684f38d

Please sign in to comment.