Skip to content

Commit ab2e287

Browse files
committed
fix: Fix osu-native fc pp
1 parent 6b73196 commit ab2e287

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
@@ -653,7 +653,9 @@ export class Gameplay extends AbstractState {
653653
this.statistics.meh -
654654
this.statistics.miss,
655655
countPerfect: this.statistics.perfect,
656-
countSliderTailHit: this.statistics.sliderTailHit,
656+
countSliderTailHit:
657+
this.statistics.sliderTailHit ||
658+
currentDifficulty.attributes.sliderCount,
657659
// smallTickHits: this.statistics.smallTickHit,
658660
countLargeTickMiss: this.statistics.largeTickMiss
659661
};
@@ -688,22 +690,42 @@ export class Gameplay extends AbstractState {
688690
delete calcOptions.countSliderTailHit;
689691
calcOptions.accuracy = this.accuracy / 100; // FIXME: implement per mode fc accuracy
690692
} else {
693+
delete calcOptions.legacyScore;
691694
calcOptions.countGreat =
692-
this.statistics.great + this.statistics.miss;
695+
maxJudgementsAmount -
696+
this.statistics.ok -
697+
this.statistics.meh -
698+
this.statistics.miss;
693699
calcOptions.maxCombo =
694700
beatmapPP.calculatedMapAttributes.maxCombo;
695701
calcOptions.countSliderTailHit =
696-
this.maximumStatistics.sliderTailHit;
702+
beatmapPP.attributes.sliderCount;
697703
// calcOptions.smallTickHits =
698704
// this.performanceAttributes.state?.osuSmallTickHits;
699705
calcOptions.countLargeTickMiss =
700706
this.maximumStatistics.largeTickMiss;
701707
calcOptions.countMiss = 0;
708+
709+
calcOptions.accuracy =
710+
calculateAccuracy({
711+
isLazer: commonParams.lazer,
712+
713+
mode: this.mode,
714+
mods: commonParams.mods,
715+
statistics: {
716+
perfect: calcOptions.countPerfect || 0,
717+
great: calcOptions.countGreat || 0,
718+
good: calcOptions.countGood || 0,
719+
ok: calcOptions.countOk || 0,
720+
meh: calcOptions.countMeh || 0,
721+
miss: calcOptions.countMiss || 0
722+
}
723+
}) / 100;
702724
}
703725

704726
const fcPerformance = beatmapPP.performanceCalculator.calculate(
705727
calcOptions,
706-
currentDifficulty.attributes
728+
beatmapPP.attributes
707729
);
708730

709731
beatmapPP.currAttributes.fcPP = fcPerformance.total;

0 commit comments

Comments
 (0)