Skip to content

Commit 5e37545

Browse files
committed
fix: Fix osu-native fc pp
1 parent 3a32554 commit 5e37545

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

packages/tosu/src/states/gameplay.ts

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,9 @@ export class Gameplay extends AbstractState {
644644
this.statistics.meh -
645645
this.statistics.miss,
646646
countPerfect: this.statistics.perfect,
647-
countSliderTailHit: this.statistics.sliderTailHit,
647+
countSliderTailHit:
648+
this.statistics.sliderTailHit ||
649+
currentDifficulty.attributes.sliderCount,
648650
// smallTickHits: this.statistics.smallTickHit,
649651
countLargeTickMiss: this.statistics.largeTickMiss
650652
};
@@ -679,22 +681,42 @@ export class Gameplay extends AbstractState {
679681
delete calcOptions.countSliderTailHit;
680682
calcOptions.accuracy = this.accuracy / 100; // FIXME: implement per mode fc accuracy
681683
} else {
684+
delete calcOptions.legacyScore;
682685
calcOptions.countGreat =
683-
this.statistics.great + this.statistics.miss;
686+
maxJudgementsAmount -
687+
this.statistics.ok -
688+
this.statistics.meh -
689+
this.statistics.miss;
684690
calcOptions.maxCombo =
685691
beatmapPP.calculatedMapAttributes.maxCombo;
686692
calcOptions.countSliderTailHit =
687-
this.maximumStatistics.sliderTailHit;
693+
beatmapPP.attributes.sliderCount;
688694
// calcOptions.smallTickHits =
689695
// this.performanceAttributes.state?.osuSmallTickHits;
690696
calcOptions.countLargeTickMiss =
691697
this.maximumStatistics.largeTickMiss;
692698
calcOptions.countMiss = 0;
699+
700+
calcOptions.accuracy =
701+
calculateAccuracy({
702+
isLazer: commonParams.lazer,
703+
704+
mode: this.mode,
705+
mods: commonParams.mods,
706+
statistics: {
707+
perfect: calcOptions.countPerfect || 0,
708+
great: calcOptions.countGreat || 0,
709+
good: calcOptions.countGood || 0,
710+
ok: calcOptions.countOk || 0,
711+
meh: calcOptions.countMeh || 0,
712+
miss: calcOptions.countMiss || 0
713+
}
714+
}) / 100;
693715
}
694716

695717
const fcPerformance = beatmapPP.performanceCalculator.calculate(
696718
calcOptions,
697-
currentDifficulty.attributes
719+
beatmapPP.attributes
698720
);
699721

700722
beatmapPP.currAttributes.fcPP = fcPerformance.total;

0 commit comments

Comments
 (0)