@rian8337/osu-rebalance-difficulty-calculator 4.0.0-beta.100 → 4.0.0-beta.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -581,34 +581,6 @@ class VariableLengthStrainSkill extends Skill {
581
581
  }
582
582
  }
583
583
 
584
- /**
585
- * An evaluator for calculating osu!droid agility aim difficulty.
586
- */
587
- class DroidAgilityEvaluator {
588
- /**
589
- * Evaluates the difficulty of fast aiming the current object.
590
- *
591
- * @param current The current object.
592
- */
593
- static evaluateDifficultyOf(current) {
594
- if (current.object instanceof osuBase.Spinner) {
595
- return 0;
596
- }
597
- const prev = current.previous(0);
598
- // For objects that are stacked, we want to reduce the agility difficulty slightly by combining delta times
599
- // of both objects together because we can assume that they likely would be done in one movement.
600
- let previousDelta = 0;
601
- if (prev !== null) {
602
- previousDelta = prev.strainTime * osuBase.MathUtils.reverseLerp(prev.lazyJumpDistance, prev.normalizedRadius, 0);
603
- }
604
- const combinedDelta = current.strainTime + previousDelta * this.previousDeltaInfluence;
605
- let difficulty = Math.pow(1000 / combinedDelta, 2);
606
- difficulty *= Math.pow(current.smallCircleBonus, 1.5);
607
- return difficulty;
608
- }
609
- }
610
- DroidAgilityEvaluator.previousDeltaInfluence = 0.5;
611
-
612
584
  /**
613
585
  * An evaluator for calculating osu!droid snap aim difficulty.
614
586
  */
@@ -625,12 +597,10 @@ class DroidSnapAimEvaluator {
625
597
  * @param withSliders Whether to take slider difficulty into account.
626
598
  */
627
599
  static evaluateDifficultyOf(current, withSliders) {
628
- var _a;
629
600
  if (current.object instanceof osuBase.Spinner ||
630
601
  // Exclude overlapping objects that can be tapped at once.
631
602
  current.isOverlapping(true) ||
632
- current.index <= 1 ||
633
- ((_a = current.previous(0)) === null || _a === void 0 ? void 0 : _a.object) instanceof osuBase.Spinner) {
603
+ current.index <= 1) {
634
604
  return 0;
635
605
  }
636
606
  const last = current.previous(0);
@@ -647,11 +617,7 @@ class DroidSnapAimEvaluator {
647
617
  // Start strain with regular velocity.
648
618
  let strain = currentVelocity;
649
619
  strain *= this.calculateVectorAngleRepetition(current, last);
650
- const acuteAngleBonus = this.calculateAcuteAngleBonus(current, last, currentVelocity, prevVelocity);
651
- const wideAngleBonus = this.calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders);
652
- // Add in acute angle bonus or wide angle bonus, whichever is larger.
653
- strain += Math.max(acuteAngleBonus, wideAngleBonus);
654
- strain += this.calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance);
620
+ strain += this.calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders);
655
621
  strain += this.calculateVelocityChangeBonus(withSliders, prevVelocity, currentVelocity, currentDistance, current, last);
656
622
  if (current.object instanceof osuBase.Slider && withSliders) {
657
623
  strain += this.calculateSliderBonus(current);
@@ -661,31 +627,6 @@ class DroidSnapAimEvaluator {
661
627
  strain *= this.highBpmBonus(current.strainTime);
662
628
  return strain;
663
629
  }
664
- static calculateAcuteAngleBonus(current, last, currentVelocity, prevVelocity) {
665
- if (current.angle === null || last.angle === null) {
666
- return 0;
667
- }
668
- // Only reward acute angles when rhythms are the same.
669
- if (Math.max(current.strainTime, last.strainTime) >=
670
- 1.25 * Math.min(current.strainTime, last.strainTime)) {
671
- return 0;
672
- }
673
- let acuteAngleBonus = this.calculateAcuteAngleAcuteness(current.angle);
674
- // Penalize angle repetition. It is important to do it _before_ multiplying by anything because we
675
- // compare raw acuteness here.
676
- acuteAngleBonus *=
677
- 0.08 +
678
- 0.92 *
679
- (1 -
680
- Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleAcuteness(last.angle), 3)));
681
- const velocity = Math.min(currentVelocity, prevVelocity);
682
- // Apply acute angle bonus for BPM above 300 1/2.
683
- acuteAngleBonus *=
684
- velocity *
685
- osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 450) *
686
- osuBase.MathUtils.smootherstep(current.lazyJumpDistance, 0, current.normalizedDiameter * 2);
687
- return acuteAngleBonus * this.acuteAngleMultiplier;
688
- }
689
630
  static calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders) {
690
631
  if (current.angle === null || last.angle === null) {
691
632
  return 0;
@@ -698,14 +639,13 @@ class DroidSnapAimEvaluator {
698
639
  0.75 *
699
640
  (1 -
700
641
  Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleAcuteness(last.angle), 3)));
701
- // Rescale velocity for wide angle bonus.
702
- const wideAngleTimeScale = 1.45;
703
- let wideAngleCurrentVelocity = currentDistance / Math.pow(current.strainTime, wideAngleTimeScale);
704
- const wideAnglePrevVelocity = prevDistance / Math.pow(last.strainTime, wideAngleTimeScale);
642
+ let wideAngleCurrentVelocity = currentDistance /
643
+ Math.pow(current.strainTime, this.wideAngleTimeScale);
644
+ const wideAnglePrevVelocity = prevDistance / Math.pow(last.strainTime, this.wideAngleTimeScale);
705
645
  if (last.object instanceof osuBase.Slider && withSliders) {
706
646
  const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
707
647
  wideAngleCurrentVelocity = Math.max(wideAngleCurrentVelocity, sliderDistance /
708
- Math.pow(current.strainTime, wideAngleTimeScale));
648
+ Math.pow(current.strainTime, this.wideAngleTimeScale));
709
649
  }
710
650
  wideAngleBonus *= Math.min(wideAngleCurrentVelocity, wideAnglePrevVelocity);
711
651
  const last2 = current.previous(2);
@@ -729,6 +669,9 @@ class DroidSnapAimEvaluator {
729
669
  // individual jump and slider path velocities.
730
670
  currentVelocity = currentDistance / current.strainTime;
731
671
  }
672
+ // Cap velocity to at least 1 radius distance to only award snap patterns.
673
+ currentVelocity = Math.max(currentVelocity, current.normalizedDiameter / current.strainTime);
674
+ prevVelocity = Math.max(prevVelocity, last.normalizedDiameter / last.strainTime);
732
675
  // Scale with ratio of difference compared to half the max distance.
733
676
  const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
734
677
  Math.max(prevVelocity, currentVelocity), 0, 1);
@@ -741,25 +684,6 @@ class DroidSnapAimEvaluator {
741
684
  Math.max(current.strainTime, last.strainTime), 3);
742
685
  return velocityChangeBonus * this.velocityChangeMultiplier;
743
686
  }
744
- /**
745
- * Difficulty bonus for "wiggle" patterns - jumps that are [radius, 3*diameter] in distance, with < 110 angle.
746
- * https://www.desmos.com/calculator/dp0v0nvowc
747
- */
748
- static calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance) {
749
- if (current.angle === null || last.angle === null) {
750
- return 0;
751
- }
752
- const radius = current.normalizedRadius;
753
- const diameter = current.normalizedDiameter;
754
- const wiggleBonus = Math.min(currentVelocity, prevVelocity) *
755
- osuBase.MathUtils.smootherstep(currentDistance, radius, diameter) *
756
- Math.pow(osuBase.MathUtils.reverseLerp(currentDistance, diameter * 3, diameter), 1.8) *
757
- osuBase.MathUtils.smootherstep(current.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
758
- osuBase.MathUtils.smootherstep(prevDistance, radius, diameter) *
759
- Math.pow(osuBase.MathUtils.reverseLerp(prevDistance, diameter * 3, diameter), 1.8) *
760
- osuBase.MathUtils.smootherstep(last.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60));
761
- return wiggleBonus * this.wiggleMultiplier;
762
- }
763
687
  static calculateSliderBonus(current) {
764
688
  // Reward sliders based on velocity.
765
689
  let sliderBonus = current.travelDistance / current.travelTime;
@@ -787,13 +711,17 @@ class DroidSnapAimEvaluator {
787
711
  return 1 / (1 - Math.pow(0.03, Math.pow(ms / 1000, 0.65)));
788
712
  }
789
713
  static calculateVectorAngleRepetition(current, prev) {
790
- if (current.angle === null || prev.angle === null) {
714
+ var _a;
715
+ if (current.angle === null ||
716
+ prev.angle === null ||
717
+ prev.object instanceof osuBase.Spinner ||
718
+ ((_a = prev.previous(0)) === null || _a === void 0 ? void 0 : _a.object) instanceof osuBase.Spinner) {
791
719
  return 1;
792
720
  }
793
721
  let constantAngleCount = 0;
794
722
  for (let i = 0; i < this.angleRepetitionNoteLimit; ++i) {
795
723
  const loopObj = current.previous(i);
796
- if (!loopObj) {
724
+ if (!loopObj || loopObj.object instanceof osuBase.Spinner) {
797
725
  break;
798
726
  }
799
727
  // Only consider vectors in the same jump section, as stopping to change rhythm ruins momentum.
@@ -827,10 +755,11 @@ class DroidSnapAimEvaluator {
827
755
  stackFactor, 2);
828
756
  }
829
757
  }
830
- DroidSnapAimEvaluator.wideAngleMultiplier = 9.67;
831
- DroidSnapAimEvaluator.acuteAngleMultiplier = 2.35;
832
- DroidSnapAimEvaluator.sliderMultiplier = 1.5;
833
- DroidSnapAimEvaluator.velocityChangeMultiplier = 0.9;
758
+ DroidSnapAimEvaluator.wideAngleMultiplier = 2.15;
759
+ // Rescale velocity for the wide angle bonus.
760
+ DroidSnapAimEvaluator.wideAngleTimeScale = 1.2;
761
+ DroidSnapAimEvaluator.sliderMultiplier = 1.35;
762
+ DroidSnapAimEvaluator.velocityChangeMultiplier = 0.85;
834
763
  // Increasing this multiplier beyond 1.02 reduces difficulty as distance increases.
835
764
  // Refer to the desmos link above the wiggle bonus calculation.
836
765
  DroidSnapAimEvaluator.wiggleMultiplier = 1.02;
@@ -838,15 +767,55 @@ DroidSnapAimEvaluator.angleRepetitionNoteLimit = 6;
838
767
  DroidSnapAimEvaluator.maximumRepetitionNerf = 0.15;
839
768
  DroidSnapAimEvaluator.maximumVectorInfluence = 0.5;
840
769
 
770
+ /**
771
+ * An evaluator for calculating osu!droid agility aim difficulty.
772
+ */
773
+ class DroidAgilityEvaluator {
774
+ /**
775
+ * Evaluates the difficulty of fast aiming the current object.
776
+ *
777
+ * @param current The current object.
778
+ */
779
+ static evaluateDifficultyOf(current) {
780
+ if (current.object instanceof osuBase.Spinner) {
781
+ return 0;
782
+ }
783
+ const prev = current.previous(0);
784
+ // Assume that the player always uses at least the full great hitwindow for the movement.
785
+ const currentDelta = Math.max(current.strainTime, current.hitWindowFor(osuBase.HitResult.Great));
786
+ // For objects that are stacked, we want to reduce the agility difficulty slightly by combining delta times
787
+ // of both objects together because we can assume that they likely would be done in one movement.
788
+ let previousDelta = 0;
789
+ if (prev !== null) {
790
+ previousDelta = prev.strainTime * osuBase.MathUtils.reverseLerp(prev.lazyJumpDistance, prev.normalizedRadius, 0);
791
+ }
792
+ const combinedDelta = currentDelta + previousDelta * this.previousDeltaInfluence;
793
+ const angleSwitchingBonus = this.calculateAngleSwitchingBonus(current, prev);
794
+ let difficulty = (1 + angleSwitchingBonus) * 10000000 / Math.pow(combinedDelta, 3.1);
795
+ difficulty *= current.smallCircleBonus;
796
+ return difficulty;
797
+ }
798
+ static calculateAngleSwitchingBonus(current, prev) {
799
+ if (current.angle === null || typeof (prev === null || prev === void 0 ? void 0 : prev.angle) !== "number") {
800
+ return 0;
801
+ }
802
+ const acutenessDifference = 1 - Math.min(DroidSnapAimEvaluator.calculateAcuteAngleAcuteness(current.angle), Math.pow(DroidSnapAimEvaluator.calculateAcuteAngleAcuteness(prev.angle), 3));
803
+ const rhythmDifferencePenalty = Math.pow(Math.min(current.strainTime, prev.strainTime) / Math.max(current.strainTime, prev.strainTime), 3);
804
+ return (acutenessDifference *
805
+ rhythmDifferencePenalty *
806
+ osuBase.Interpolation.reverseLerp(prev.lazyJumpDistance, prev.normalizedRadius, prev.normalizedDiameter) *
807
+ this.angleSwitchingBonus);
808
+ }
809
+ }
810
+ DroidAgilityEvaluator.previousDeltaInfluence = 0.5;
811
+ DroidAgilityEvaluator.angleSwitchingBonus = 0.8;
812
+
841
813
  /**
842
814
  * An evaluator for calculating osu!droid flow aim difficulty.
843
815
  */
844
816
  class DroidFlowAimEvaluator {
845
817
  static evaluateDifficultyOf(current, withSliders) {
846
- var _a;
847
- if (current.object instanceof osuBase.Spinner ||
848
- current.index <= 1 ||
849
- ((_a = current.previous(0)) === null || _a === void 0 ? void 0 : _a.object) instanceof osuBase.Spinner) {
818
+ if (current.object instanceof osuBase.Spinner || current.index <= 1) {
850
819
  return 0;
851
820
  }
852
821
  const next = current.next(0);
@@ -858,86 +827,18 @@ class DroidFlowAimEvaluator {
858
827
  const prevDistance = withSliders && !last.is2BSlider
859
828
  ? last.lazyJumpDistance
860
829
  : last.jumpDistance;
861
- let currentVelocity = currentDistance / current.strainTime;
862
- if (last.object instanceof osuBase.Slider && !last.is2BSlider && withSliders) {
863
- // If the last object is a slider, then we extend the travel velocity through the slider into the current object.
864
- const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
865
- currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
866
- }
830
+ const currentVelocity = this.calculateCurrentVelocity(current, last, currentDistance, withSliders);
867
831
  const prevVelocity = prevDistance / last.strainTime;
868
832
  let flowDifficulty = currentVelocity;
869
833
  // Apply high circle size bonus to the base velocity.
870
834
  // We use reduced CS bonus here because the bonus was made for an evaluator with a different d/t scaling.
871
- flowDifficulty *= Math.sqrt(current.smallCircleBonus);
872
- // Rhythm changes are harder to flow.
873
- flowDifficulty *=
874
- 1 +
875
- Math.min(0.1, Math.pow((Math.max(current.strainTime, last.strainTime) -
876
- Math.min(current.strainTime, last.strainTime)) /
877
- 50, 4));
878
- if (current.angle !== null && last.angle !== null) {
879
- // Low angular velocity (consistent angles) is easier to follow than erratic flow.
880
- const angleDifference = Math.abs(current.angle - last.angle);
881
- const angleDifferenceAdjusted = Math.sin(angleDifference / 2) * 180;
882
- const angularVelocity = angleDifferenceAdjusted / (current.strainTime * 0.1);
883
- flowDifficulty *= 0.8 + Math.sqrt(angularVelocity / 270);
884
- }
885
- if (current.angle !== null && next !== null && next.angle !== null) {
886
- const currentAcuteness = DroidSnapAimEvaluator.calculateAcuteAngleAcuteness(current.angle);
887
- const nextAcuteness = DroidSnapAimEvaluator.calculateAcuteAngleAcuteness(next.angle);
888
- let acuteness;
889
- let overlapWeight;
890
- // We want to evaluate flow turns at the center point of the actual turn, but curr.Angle is a prev2-prev-curr angle.
891
- // The issue with changing that to prev-curr-next is that we might evaluate the second note of a flow pattern as snap if prev is acute.
892
- // With min(curr,next) the evaluation (assuming acute affects snap/flow probability enough) behaves roughly like this:
893
- //
894
- // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
895
- // 🡓🡓
896
- // ooo 🡐 flow (prev2-prev-curr evaluates as wide)
897
- // /
898
- // ooo 🡐 snap (prev2-prev-curr evaluates as acute)
899
- // 🡑🡑
900
- // flow (prev-curr-next evaluates as wide)
901
- //
902
- //
903
- // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
904
- // 🡓🡓
905
- // ooo 🡐 flow (prev-curr-next and prev2-prev-curr evaluates as wide)
906
- // \
907
- // ooo 🡐 snap (prev-curr-next evaluates as acute as the center point of the turn)
908
- // 🡑🡑
909
- // flow (prev-curr-next evaluates as wide)
910
- //
911
- // In both examples the first object in a flow pattern is evaluated as acute (likely snap) and the rest are wide (likely flow).
912
- if (currentAcuteness < nextAcuteness) {
913
- acuteness = currentAcuteness;
914
- overlapWeight = this.calculateOverlapWeight(current, last, lastLast);
915
- }
916
- else {
917
- acuteness = nextAcuteness;
918
- overlapWeight = this.calculateOverlapWeight(next, current, last);
919
- }
920
- flowDifficulty += currentVelocity * acuteness * overlapWeight * this.acuteAngleMultiplier;
921
- }
922
- if (Math.max(prevVelocity, currentVelocity)) {
923
- if (withSliders) {
924
- currentVelocity = currentDistance / current.strainTime;
925
- }
926
- // Scale with ratio of difference compared to 0.5 * max distance.
927
- const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
928
- Math.max(prevVelocity, currentVelocity), 0, 1);
929
- // Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing.
930
- const overlapVelocityBuff = Math.min((current.normalizedDiameter * 1.25) /
931
- Math.min(current.strainTime, last.strainTime), Math.abs(prevVelocity - currentVelocity));
932
- flowDifficulty +=
933
- overlapVelocityBuff *
934
- distanceRatio *
935
- this.calculateOverlapWeight(current, last, lastLast) *
936
- this.velocityChangeMultiplier;
937
- }
835
+ flowDifficulty *= Math.pow(current.smallCircleBonus, 0.55);
836
+ flowDifficulty *= this.calculateRhythmChangeBonus(current, last);
837
+ flowDifficulty *= this.calculateAngularVelocityBonus(current, last);
838
+ flowDifficulty += this.calculateAcuteAngleBonus(current, last, lastLast, next, currentVelocity);
839
+ flowDifficulty += this.calculateVelocityChangeBonus(current, last, currentVelocity, prevVelocity, currentDistance, this.calculateOverlapWeight(current, last, lastLast), withSliders);
938
840
  if (current.object instanceof osuBase.Slider && withSliders) {
939
- // Include slider velocity to make velocity more consistent with snap.
940
- flowDifficulty += current.travelDistance / current.travelTime;
841
+ flowDifficulty += this.calculateSliderBonus(current);
941
842
  }
942
843
  // The final velocity is being raised to a power because flow difficulty scales harder with both high
943
844
  // distance and time, and we want to account for that.
@@ -946,6 +847,100 @@ class DroidFlowAimEvaluator {
946
847
  return (flowDifficulty *
947
848
  osuBase.MathUtils.smootherstep(currentDistance, 0, current.normalizedRadius));
948
849
  }
850
+ static calculateRhythmChangeBonus(current, last) {
851
+ const bonus = Math.pow((Math.max(current.strainTime, last.strainTime) -
852
+ Math.min(current.strainTime, last.strainTime)) /
853
+ 50, 4);
854
+ return 1 + Math.min(this.maximumRhythmChangeBonus, bonus);
855
+ }
856
+ /**
857
+ * Scales flow difficulty by angular velocity.
858
+ * This nerfs consistent angles whilst buffing "erratic" flow.
859
+ */
860
+ static calculateAngularVelocityBonus(current, last) {
861
+ if (current.angle === null || last.angle === null) {
862
+ return 1;
863
+ }
864
+ const angleDifference = Math.abs(current.angle - last.angle);
865
+ const angleDifferenceAdjusted = Math.sin(angleDifference / 2) * 180;
866
+ const angularVelocity = angleDifferenceAdjusted / (current.strainTime * 0.1);
867
+ return 0.8 + Math.sqrt(angularVelocity / 270);
868
+ }
869
+ static calculateAcuteAngleBonus(current, prev, prevPrev, next, currentVelocity) {
870
+ if (current.angle === null || typeof (next === null || next === void 0 ? void 0 : next.angle) !== "number") {
871
+ return 0;
872
+ }
873
+ const currentAcuteness = DroidSnapAimEvaluator.calculateAcuteAngleAcuteness(current.angle);
874
+ const nextAcuteness = DroidSnapAimEvaluator.calculateAcuteAngleAcuteness(next.angle);
875
+ let acuteness;
876
+ let overlapWeight;
877
+ // We want to evaluate flow turns at the center point of the actual turn, but current.angle is a prev2-prev-curr angle.
878
+ // The issue with changing that to prev-curr-next is that we might evaluate the second note of a flow pattern as snap if prev is acute.
879
+ // With min(curr,next) the evaluation (assuming acute affects snap/flow probability enough) behaves roughly like this:
880
+ //
881
+ // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
882
+ // 🡓🡓
883
+ // ooo 🡐 flow (prev2-prev-curr evaluates as wide)
884
+ // /
885
+ // ooo 🡐 snap (prev2-prev-curr evaluates as acute)
886
+ // 🡑🡑
887
+ // flow (prev-curr-next evaluates as wide)
888
+ //
889
+ //
890
+ // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
891
+ // 🡓🡓
892
+ // ooo 🡐 flow (prev-curr-next and prev2-prev-curr evaluates as wide)
893
+ // \
894
+ // ooo 🡐 snap (prev-curr-next evaluates as acute as the center point of the turn)
895
+ // 🡑🡑
896
+ // flow (prev-curr-next evaluates as wide)
897
+ //
898
+ // In both examples the first object in a flow pattern is evaluated as acute (likely snap) and the rest are wide (likely flow).
899
+ if (currentAcuteness < nextAcuteness) {
900
+ acuteness = currentAcuteness;
901
+ overlapWeight = this.calculateOverlapWeight(current, prev, prevPrev);
902
+ }
903
+ else {
904
+ acuteness = nextAcuteness;
905
+ overlapWeight = this.calculateOverlapWeight(next, current, prev);
906
+ }
907
+ return (currentVelocity *
908
+ acuteness *
909
+ overlapWeight *
910
+ this.acuteAngleMultiplier);
911
+ }
912
+ static calculateVelocityChangeBonus(current, last, currentVelocity, prevVelocity, currentDistance, overlappedNotesWeight, withSliders) {
913
+ if (Math.max(prevVelocity, currentVelocity) === 0) {
914
+ return 0;
915
+ }
916
+ if (withSliders) {
917
+ currentVelocity = currentDistance / current.strainTime;
918
+ }
919
+ const velocityDistanceCap = current.normalizedDiameter * 1.1;
920
+ currentVelocity = Math.min(currentVelocity, velocityDistanceCap / current.strainTime);
921
+ prevVelocity = Math.min(prevVelocity, velocityDistanceCap / last.strainTime);
922
+ // Scale with ratio of difference compared to 0.5 * max distance.
923
+ const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
924
+ Math.max(prevVelocity, currentVelocity), 0, 1);
925
+ let velocityChangeBonus = Math.abs(prevVelocity - currentVelocity) * distanceRatio;
926
+ velocityChangeBonus *= Math.pow(Math.min(current.strainTime, last.strainTime) /
927
+ Math.max(current.strainTime, last.strainTime), 3);
928
+ return (velocityChangeBonus *
929
+ overlappedNotesWeight *
930
+ this.velocityChangeMultiplier);
931
+ }
932
+ static calculateSliderBonus(current) {
933
+ return current.travelDistance / current.travelTime;
934
+ }
935
+ static calculateCurrentVelocity(current, prev, currentDistance, withSliders) {
936
+ let currentVelocity = currentDistance / current.strainTime;
937
+ if (prev.object instanceof osuBase.Slider && !prev.is2BSlider && withSliders) {
938
+ // If the last object is a slider, then we extend the travel velocity through the slider into the current object.
939
+ const sliderDistance = prev.lazyTravelDistance + current.lazyJumpDistance;
940
+ currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
941
+ }
942
+ return currentVelocity;
943
+ }
949
944
  // If all three notes overlap, do not reward bonuses as there is no required additional movement.
950
945
  static calculateOverlapWeight(first, second, third) {
951
946
  const o1 = this.calculateOverlapFactor(first, second);
@@ -959,8 +954,26 @@ class DroidFlowAimEvaluator {
959
954
  return osuBase.MathUtils.clamp(1 - Math.pow(Math.max(distance - radius, 0) / radius, 2), 0, 1);
960
955
  }
961
956
  }
962
- DroidFlowAimEvaluator.velocityChangeMultiplier = 0.55;
963
- DroidFlowAimEvaluator.acuteAngleMultiplier = 1.3;
957
+ DroidFlowAimEvaluator.velocityChangeMultiplier = 1.9;
958
+ DroidFlowAimEvaluator.maximumRhythmChangeBonus = 0.1;
959
+ DroidFlowAimEvaluator.acuteAngleMultiplier = 0.9;
960
+
961
+ class DroidSpinnerEvaluator {
962
+ /**
963
+ * Evaluates difficulty of spinning.
964
+ *
965
+ * @param current The current {@link DroidDifficultyHitObject} to evaluate.
966
+ */
967
+ static evaluateDifficultyOf(current) {
968
+ if (!(current.object instanceof osuBase.Spinner) || current.object.spinsRequired <= 0) {
969
+ return 0;
970
+ }
971
+ const duration = current.object.duration / 1000;
972
+ const rps = current.object.spinsRequired / duration;
973
+ // The longer the spinner the more lenient spinning requirements are.
974
+ return rps / duration;
975
+ }
976
+ }
964
977
 
965
978
  /**
966
979
  * Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
@@ -968,12 +981,14 @@ DroidFlowAimEvaluator.acuteAngleMultiplier = 1.3;
968
981
  class DroidAim extends VariableLengthStrainSkill {
969
982
  constructor(mods, withSliders) {
970
983
  super(mods);
984
+ this.withSliders = withSliders;
971
985
  this.currentStrain = 0;
972
- this.skillMultiplierSnap = 71;
973
- this.skillMultiplierAgility = 1.63;
974
- this.skillMultiplierFlow = 247;
986
+ this.skillMultiplierSnap = 78.3;
987
+ this.skillMultiplierAgility = 32.5;
988
+ this.skillMultiplierFlow = 251;
989
+ this.skillMultiplierSpinner = 22;
975
990
  this.skillMultiplierTotal = 1.12;
976
- this.combinedSnapNormExponent = 1.2;
991
+ this.combinedSnapNormExponent = 1.5;
977
992
  /**
978
993
  * The number of sections with the highest strains, which the peak strain reductions will apply to.
979
994
  * This is done in order to decrease their impact on the overall difficulty of the beatmap.
@@ -985,7 +1000,6 @@ class DroidAim extends VariableLengthStrainSkill {
985
1000
  this.reducedStrainBaseline = 0.727;
986
1001
  this.sliderStrains = [];
987
1002
  this.maxSliderStrain = 0;
988
- this.withSliders = withSliders;
989
1003
  }
990
1004
  /**
991
1005
  * Obtains the amount of sliders that are considered difficult in terms of relative strain.
@@ -1042,6 +1056,9 @@ class DroidAim extends VariableLengthStrainSkill {
1042
1056
  }
1043
1057
  }
1044
1058
  calculateAdjustedDifficulty(current) {
1059
+ if (current.object instanceof osuBase.Spinner) {
1060
+ return DroidSpinnerEvaluator.evaluateDifficultyOf(current) * this.skillMultiplierSpinner;
1061
+ }
1045
1062
  const snapDifficulty = DroidSnapAimEvaluator.evaluateDifficultyOf(current, this.withSliders) * this.skillMultiplierSnap;
1046
1063
  const agilityDifficulty = DroidAgilityEvaluator.evaluateDifficultyOf(current) *
1047
1064
  this.skillMultiplierAgility;
@@ -1058,8 +1075,11 @@ class DroidAim extends VariableLengthStrainSkill {
1058
1075
  const pFlow = 1 - pSnap;
1059
1076
  // Invert rating summation to obtain a more accurate TD adjustment.
1060
1077
  snapDifficulty =
1061
- Math.pow(0.02275 * Math.pow(10, 0.63), (0.8 - 1) / 0.63) *
1062
- Math.pow(snapDifficulty, 0.8);
1078
+ Math.pow(0.02275 * Math.pow(10, 0.63), (0.93 - 1) / 0.63) *
1079
+ Math.pow(snapDifficulty, 0.93);
1080
+ agilityDifficulty =
1081
+ Math.pow(0.02275 * Math.pow(10, 0.63), (0.89 - 1) / 0.63) *
1082
+ Math.pow(agilityDifficulty, 0.89);
1063
1083
  combinedSnapDifficulty = osuBase.MathUtils.norm(this.combinedSnapNormExponent, snapDifficulty, agilityDifficulty);
1064
1084
  if (this.mods.has(osuBase.ModRelax)) {
1065
1085
  combinedSnapDifficulty *= 0.75;
@@ -1172,9 +1192,8 @@ class DroidFlashlightEvaluator {
1172
1192
  */
1173
1193
  static evaluateDifficultyOf(current, mods) {
1174
1194
  var _a;
1175
- if (current.object instanceof osuBase.Spinner ||
1176
- // Exclude overlapping objects that can be tapped at once.
1177
- current.isOverlapping(true)) {
1195
+ // Exclude overlapping objects that can be tapped at once.
1196
+ if (current.isOverlapping(true)) {
1178
1197
  return 0;
1179
1198
  }
1180
1199
  const scalingFactor = 52 / current.object.radius;
@@ -1190,9 +1209,8 @@ class DroidFlashlightEvaluator {
1190
1209
  for (let i = 0; i < Math.min(current.index, 10); ++i) {
1191
1210
  const currentObject = current.previous(i);
1192
1211
  cumulativeStrainTime += last.strainTime;
1193
- if (!(currentObject.object instanceof osuBase.Spinner) &&
1194
- // Exclude overlapping objects that can be tapped at once.
1195
- !currentObject.isOverlapping(false)) {
1212
+ // Exclude overlapping objects that can be tapped at once.
1213
+ if (!currentObject.isOverlapping(false)) {
1196
1214
  const jumpDistance = current.object.stackedPosition.subtract(currentObject.object.stackedEndPosition).length;
1197
1215
  // We want to nerf objects that can be easily seen within the Flashlight circle radius.
1198
1216
  if (i === 0) {
@@ -1970,7 +1988,7 @@ class DroidTapEvaluator {
1970
1988
  */
1971
1989
  static evaluateDifficultyOf(current, considerCheesability) {
1972
1990
  if (current.index < 0 ||
1973
- current.object instanceof osuBase.Spinner ||
1991
+ (current.object instanceof osuBase.Spinner && current.object.spinsRequired <= 0) ||
1974
1992
  // Exclude overlapping objects that can be tapped at once.
1975
1993
  current.isOverlapping(false)) {
1976
1994
  return 0;
@@ -2158,7 +2176,7 @@ class DroidPerformanceCalculator extends PerformanceCalculator {
2158
2176
  }
2159
2177
  handleOptions(options) {
2160
2178
  var _a, _b;
2161
- this._tapPenalty = osuBase.MathUtils.clamp((_a = options === null || options === void 0 ? void 0 : options.tapPenalty) !== null && _a !== void 0 ? _a : 1, 0, 1);
2179
+ this._tapPenalty = Math.max((_a = options === null || options === void 0 ? void 0 : options.tapPenalty) !== null && _a !== void 0 ? _a : 1, 1);
2162
2180
  this._sliderCheesePenalty = osuBase.MathUtils.clamp((_b = options === null || options === void 0 ? void 0 : options.sliderCheesePenalty) !== null && _b !== void 0 ? _b : 1, 0, 1);
2163
2181
  this._totalScore =
2164
2182
  (options === null || options === void 0 ? void 0 : options.totalScore) !== undefined
@@ -2832,6 +2850,8 @@ class DifficultyHitObject {
2832
2850
  }
2833
2851
  /**
2834
2852
  * Retrieves the full rate-adjusted hit window for a {@link HitResult}.
2853
+ *
2854
+ * This is **not** safe to use for {@link Spinner}s, as they do not have hit windows and will always return 0.
2835
2855
  */
2836
2856
  hitWindowFor(result) {
2837
2857
  return (2 * this.rawHitWindow.hitWindowFor(result)) / this.clockRate;
@@ -2855,10 +2875,10 @@ class DifficultyHitObject {
2855
2875
  this.travelTime = Math.max(this.lazyTravelTime / clockRate, DifficultyHitObject.minDeltaTime);
2856
2876
  }
2857
2877
  this.minimumJumpTime = this.strainTime;
2858
- // We don't need to calculate either angle or distance when one of the last->curr objects is a spinner.
2878
+ // Skip angle/distance calculation for instant spinners.
2859
2879
  if (!this.lastObject ||
2860
- this.object instanceof osuBase.Spinner ||
2861
- this.lastObject instanceof osuBase.Spinner) {
2880
+ (this.object instanceof osuBase.Spinner && this.object.spinsRequired <= 0) ||
2881
+ (this.lastObject instanceof osuBase.Spinner && this.lastObject.spinsRequired <= 0)) {
2862
2882
  return;
2863
2883
  }
2864
2884
  // We will scale distances by this factor, so we can assume a uniform circle size among beatmaps.
@@ -3062,7 +3082,7 @@ class DroidDifficultyHitObject extends DifficultyHitObject {
3062
3082
  return this.normalizedRadius * 2;
3063
3083
  }
3064
3084
  get smallCircleBonus() {
3065
- return 1 + Math.pow(Math.max(0, 62.5 - this.object.radius) / 30, 1.5);
3085
+ return 1 + Math.pow(Math.max(0, 62.5 - this.object.radius) / 32.5, 1.5);
3066
3086
  }
3067
3087
  opacityAt(time, mods) {
3068
3088
  // Traceable hides the primary piece of a hit circle (that is, its body), so consider it as fully invisible.
@@ -3545,14 +3565,12 @@ class DroidScoreUtils {
3545
3565
  // For scores that were set in a higher refresh rate, this estimation will underestimate
3546
3566
  // the actual maximum spinner bonus.
3547
3567
  const maximumRotationsPerSecond = (Math.PI / 2) * 120;
3548
- // Taken from https://github.com/osudroid/osu-droid/blob/45ae4d66ce275382c5de037245ceca8704b3ae75/src/ru/nsu/ccfit/zuev/osu/game/GameScene.java#L1640.
3549
- const minimumRotationsPerSecond = 2 + (2 * playableBeatmap.difficulty.od) / 10;
3550
3568
  for (const obj of hitObjects.objects) {
3551
3569
  if (!(obj instanceof osuBase.Spinner)) {
3552
3570
  continue;
3553
3571
  }
3554
3572
  const secondsDuration = obj.duration / 1000;
3555
- const spinsRequiredBeforeBonus = secondsDuration * minimumRotationsPerSecond;
3573
+ const spinsRequiredBeforeBonus = obj.spinsRequired;
3556
3574
  const totalPossibleSpins = secondsDuration * maximumRotationsPerSecond;
3557
3575
  // In osu!droid, spinner bonus points are awarded for each full rotation every nth spin after the required spins.
3558
3576
  // For example, if a spinner requires 5.6 spins before bonus, the first bonus will be awarded at 6 spins instead
@@ -3806,124 +3824,6 @@ class DroidDifficultyCalculator extends DifficultyCalculator {
3806
3824
  }
3807
3825
  }
3808
3826
 
3809
- /**
3810
- * An evaluator for calculating osu!standard agility aim difficulty.
3811
- */
3812
- class OsuAgilityEvaluator {
3813
- /**
3814
- * Evaluates the difficulty of fast aiming the current object.
3815
- *
3816
- * @param current The current object.
3817
- */
3818
- static evaluateDifficultyOf(current) {
3819
- if (current.object instanceof osuBase.Spinner) {
3820
- return 0;
3821
- }
3822
- const prev = current.previous(0);
3823
- // For objects that are stacked, we want to reduce the agility difficulty slightly by combining delta times
3824
- // of both objects together because we can assume that they likely would be done in one movement.
3825
- let previousDelta = 0;
3826
- if (prev !== null) {
3827
- previousDelta = prev.strainTime * osuBase.MathUtils.reverseLerp(prev.lazyJumpDistance, prev.normalizedRadius, 0);
3828
- }
3829
- const combinedDelta = current.strainTime + previousDelta * this.previousDeltaInfluence;
3830
- let difficulty = Math.pow(1000 / combinedDelta, 2);
3831
- difficulty *= Math.pow(current.smallCircleBonus, 1.5);
3832
- return difficulty;
3833
- }
3834
- }
3835
- OsuAgilityEvaluator.previousDeltaInfluence = 0.5;
3836
-
3837
- /**
3838
- * An evaluator for calculating osu!standard Flashlight skill.
3839
- */
3840
- class OsuFlashlightEvaluator {
3841
- /**
3842
- * Evaluates the difficulty of memorizing and hitting the current object, based on:
3843
- *
3844
- * - distance between a number of previous objects and the current object,
3845
- * - the visual opacity of the current object,
3846
- * - the angle made by the current object,
3847
- * - length and speed of the current object (for sliders),
3848
- * - and whether Hidden mod is enabled.
3849
- *
3850
- * @param current The current object.
3851
- * @param mods The mods used.
3852
- */
3853
- static evaluateDifficultyOf(current, mods) {
3854
- var _a;
3855
- if (current.object instanceof osuBase.Spinner) {
3856
- return 0;
3857
- }
3858
- const scalingFactor = 52 / current.object.radius;
3859
- let smallDistNerf = 1;
3860
- let cumulativeStrainTime = 0;
3861
- let result = 0;
3862
- let last = current;
3863
- let angleRepeatCount = 0;
3864
- // Hidden's fade-out only affects opacity when the "only fade approach circles" setting is off.
3865
- const opacityMods = ((_a = mods.get(osuBase.ModHidden)) === null || _a === void 0 ? void 0 : _a.onlyFadeApproachCircles.value)
3866
- ? undefined
3867
- : mods;
3868
- for (let i = 0; i < Math.min(current.index, 10); ++i) {
3869
- const currentObject = current.previous(i);
3870
- cumulativeStrainTime += last.strainTime;
3871
- if (!(currentObject.object instanceof osuBase.Spinner)) {
3872
- const jumpDistance = current.object.stackedPosition.subtract(currentObject.object.stackedEndPosition).length;
3873
- // We want to nerf objects that can be easily seen within the Flashlight circle radius.
3874
- if (i === 0) {
3875
- smallDistNerf = Math.min(1, jumpDistance / 75);
3876
- }
3877
- // We also want to nerf stacks so that only the first object of the stack is accounted for.
3878
- const stackNerf = Math.min(1, currentObject.lazyJumpDistance / scalingFactor / 25);
3879
- // Bonus based on how visible the object is.
3880
- const opacityBonus = 1 +
3881
- this.maxOpacityBonus *
3882
- (1 -
3883
- current.opacityAt(currentObject.object.startTime, opacityMods));
3884
- result +=
3885
- (stackNerf * opacityBonus * scalingFactor * jumpDistance) /
3886
- cumulativeStrainTime;
3887
- if (currentObject.angle !== null && current.angle !== null) {
3888
- // Objects further back in time should count less for the nerf.
3889
- if (Math.abs(currentObject.angle - current.angle) < 0.02) {
3890
- angleRepeatCount += Math.max(0, 1 - 0.1 * i);
3891
- }
3892
- }
3893
- }
3894
- last = currentObject;
3895
- }
3896
- result = Math.pow(smallDistNerf * result, 2);
3897
- // Additional bonus for Hidden due to there being no approach circles.
3898
- if (mods.has(osuBase.ModHidden)) {
3899
- result *= 1 + this.hiddenBonus;
3900
- }
3901
- // Nerf patterns with repeated angles.
3902
- result *=
3903
- this.minAngleMultiplier +
3904
- (1 - this.minAngleMultiplier) / (angleRepeatCount + 1);
3905
- let sliderBonus = 0;
3906
- if (current.object instanceof osuBase.Slider) {
3907
- // Invert the scaling factor to determine the true travel distance independent of circle size.
3908
- const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
3909
- // Reward sliders based on velocity.
3910
- sliderBonus = Math.pow(Math.max(0, pixelTravelDistance / current.travelTime - this.minVelocity), 0.5);
3911
- // Longer sliders require more memorization.
3912
- sliderBonus *= pixelTravelDistance;
3913
- // Nerf sliders with repeats, as less memorization is required.
3914
- if (current.object.repeatCount > 0)
3915
- sliderBonus /= current.object.repeatCount + 1;
3916
- }
3917
- result += sliderBonus * this.sliderMultiplier;
3918
- return result;
3919
- }
3920
- }
3921
- OsuFlashlightEvaluator.maxOpacityBonus = 0.4;
3922
- OsuFlashlightEvaluator.hiddenBonus = 0.2;
3923
- OsuFlashlightEvaluator.minVelocity = 0.5;
3924
- OsuFlashlightEvaluator.sliderMultiplier = 1.3;
3925
- OsuFlashlightEvaluator.minAngleMultiplier = 0.2;
3926
-
3927
3827
  /**
3928
3828
  * An evaluator for calculating osu!standard snap aim difficulty.
3929
3829
  */
@@ -3940,12 +3840,11 @@ class OsuSnapAimEvaluator {
3940
3840
  * @param withSliders Whether to take slider difficulty into account.
3941
3841
  */
3942
3842
  static evaluateDifficultyOf(current, withSliders) {
3943
- const last = current.previous(0);
3944
3843
  if (current.object instanceof osuBase.Spinner ||
3945
- current.index <= 1 ||
3946
- last.object instanceof osuBase.Spinner) {
3844
+ current.index <= 1) {
3947
3845
  return 0;
3948
3846
  }
3847
+ const last = current.previous(0);
3949
3848
  const currentDistance = withSliders
3950
3849
  ? current.lazyJumpDistance
3951
3850
  : current.jumpDistance;
@@ -3958,11 +3857,7 @@ class OsuSnapAimEvaluator {
3958
3857
  let strain = currentVelocity;
3959
3858
  // Penalize angle repetition.
3960
3859
  strain *= this.calculateVectorAngleRepetition(current, last);
3961
- const acuteAngleBonus = this.calculateAcuteAngleBonus(current, last, currentDistance, currentVelocity, prevVelocity);
3962
- const wideAngleBonus = this.calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders);
3963
- // Add in acute angle bonus or wide angle bonus, whichever is larger.
3964
- strain += Math.max(acuteAngleBonus, wideAngleBonus);
3965
- strain += this.calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance);
3860
+ strain += this.calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders);
3966
3861
  strain += this.calculateVelocityChangeBonus(withSliders, prevVelocity, currentVelocity, currentDistance, current, last);
3967
3862
  if (current.object instanceof osuBase.Slider && withSliders) {
3968
3863
  strain += this.calculateSliderBonus(current);
@@ -3972,31 +3867,6 @@ class OsuSnapAimEvaluator {
3972
3867
  strain *= this.highBpmBonus(current.strainTime);
3973
3868
  return strain;
3974
3869
  }
3975
- static calculateAcuteAngleBonus(current, last, currentDistance, currentVelocity, prevVelocity) {
3976
- if (current.angle === null || last.angle === null) {
3977
- return 0;
3978
- }
3979
- // Only reward acute angles when rhythms are the same.
3980
- if (Math.max(current.strainTime, last.strainTime) >=
3981
- 1.25 * Math.min(current.strainTime, last.strainTime)) {
3982
- return 0;
3983
- }
3984
- let acuteAngleBonus = this.calculateAcuteAngleAcuteness(current.angle);
3985
- // Penalize angle repetition. It is important to do it _before_ multiplying by anything because we
3986
- // compare raw acuteness here.
3987
- acuteAngleBonus *=
3988
- 0.08 +
3989
- 0.92 *
3990
- (1 -
3991
- Math.min(acuteAngleBonus, Math.pow(this.calculateAcuteAngleAcuteness(last.angle), 3)));
3992
- const velocity = Math.min(currentVelocity, prevVelocity);
3993
- // Apply acute angle bonus for BPM above 300 1/2 and distance more than one diameter.
3994
- acuteAngleBonus *=
3995
- velocity *
3996
- osuBase.MathUtils.smootherstep(osuBase.MathUtils.millisecondsToBPM(current.strainTime, 2), 300, 400) *
3997
- osuBase.MathUtils.smootherstep(currentDistance, 0, current.normalizedDiameter * 2);
3998
- return acuteAngleBonus * this.acuteAngleMultiplier;
3999
- }
4000
3870
  static calculateWideAngleBonus(current, last, currentDistance, prevDistance, withSliders) {
4001
3871
  if (current.angle === null || last.angle === null) {
4002
3872
  return 0;
@@ -4009,14 +3879,12 @@ class OsuSnapAimEvaluator {
4009
3879
  0.75 *
4010
3880
  (1 -
4011
3881
  Math.min(wideAngleBonus, Math.pow(this.calculateWideAngleAcuteness(last.angle), 3)));
4012
- // Rescale velocity for the wide angle bonus.
4013
- const wideAngleTimeScale = 1.45;
4014
- let currentRescaledVelocity = currentDistance / Math.pow(current.strainTime, wideAngleTimeScale);
4015
- const prevRescaledVelocity = prevDistance / Math.pow(last.strainTime, wideAngleTimeScale);
3882
+ let currentRescaledVelocity = currentDistance / Math.pow(current.strainTime, this.wideAngleTimeScale);
3883
+ const prevRescaledVelocity = prevDistance / Math.pow(last.strainTime, this.wideAngleTimeScale);
4016
3884
  if (last.object instanceof osuBase.Slider && withSliders) {
4017
3885
  const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
4018
3886
  currentRescaledVelocity = Math.max(currentRescaledVelocity, sliderDistance /
4019
- Math.pow(current.strainTime, wideAngleTimeScale));
3887
+ Math.pow(current.strainTime, this.wideAngleTimeScale));
4020
3888
  }
4021
3889
  wideAngleBonus *= Math.min(currentRescaledVelocity, prevRescaledVelocity);
4022
3890
  const last2 = current.previous(2);
@@ -4039,6 +3907,9 @@ class OsuSnapAimEvaluator {
4039
3907
  // We want to use just the object jump without slider velocity when awarding differences.
4040
3908
  currentVelocity = currentDistance / current.strainTime;
4041
3909
  }
3910
+ // Cap velocity to at least 1 radius distance to only award snap patterns.
3911
+ currentVelocity = Math.max(currentVelocity, current.normalizedDiameter / current.strainTime);
3912
+ prevVelocity = Math.max(prevVelocity, last.normalizedDiameter / last.strainTime);
4042
3913
  // Scale with ratio of difference compared to half the max distance.
4043
3914
  const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
4044
3915
  Math.max(prevVelocity, currentVelocity), 0, 1);
@@ -4051,25 +3922,6 @@ class OsuSnapAimEvaluator {
4051
3922
  Math.max(current.strainTime, last.strainTime), 3);
4052
3923
  return velocityChangeBonus * this.velocityChangeMultiplier;
4053
3924
  }
4054
- /**
4055
- * Difficulty bonus for "wiggle" patterns - jumps that are [radius, 3*diameter] in distance, with < 110 angle.
4056
- * https://www.desmos.com/calculator/dp0v0nvowc
4057
- */
4058
- static calculateWiggleBonus(current, last, currentVelocity, prevVelocity, currentDistance, prevDistance) {
4059
- if (current.angle === null || last.angle === null) {
4060
- return 0;
4061
- }
4062
- const radius = current.normalizedRadius;
4063
- const diameter = current.normalizedDiameter;
4064
- const wiggleBonus = Math.min(currentVelocity, prevVelocity) *
4065
- osuBase.MathUtils.smootherstep(currentDistance, radius, diameter) *
4066
- Math.pow(osuBase.MathUtils.reverseLerp(currentDistance, diameter * 3, diameter), 1.8) *
4067
- osuBase.MathUtils.smootherstep(current.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60)) *
4068
- osuBase.MathUtils.smootherstep(prevDistance, radius, diameter) *
4069
- Math.pow(osuBase.MathUtils.reverseLerp(prevDistance, diameter * 3, diameter), 1.8) *
4070
- osuBase.MathUtils.smootherstep(last.angle, osuBase.MathUtils.degreesToRadians(110), osuBase.MathUtils.degreesToRadians(60));
4071
- return wiggleBonus * this.wiggleMultiplier;
4072
- }
4073
3925
  static calculateSliderBonus(current) {
4074
3926
  // Reward sliders based on velocity.
4075
3927
  const sliderBonus = current.travelDistance / current.travelTime;
@@ -4096,13 +3948,17 @@ class OsuSnapAimEvaluator {
4096
3948
  return 1 / (1 - Math.pow(0.03, Math.pow(ms / 1000, 0.65)));
4097
3949
  }
4098
3950
  static calculateVectorAngleRepetition(current, prev) {
4099
- if (current.angle === null || prev.angle === null) {
3951
+ var _a;
3952
+ if (current.angle === null ||
3953
+ prev.angle === null ||
3954
+ prev.object instanceof osuBase.Spinner ||
3955
+ ((_a = prev.previous(0)) === null || _a === void 0 ? void 0 : _a.object) instanceof osuBase.Spinner) {
4100
3956
  return 1;
4101
3957
  }
4102
3958
  let constantAngleCount = 0;
4103
3959
  for (let i = 0; i < this.angleRepetitionNoteLimit; ++i) {
4104
3960
  const loopObj = current.previous(i);
4105
- if (!loopObj) {
3961
+ if (!loopObj || loopObj.object instanceof osuBase.Spinner) {
4106
3962
  break;
4107
3963
  }
4108
3964
  // Only consider vectors in the same jump section, as stopping to change rhythm ruins momentum.
@@ -4136,26 +3992,150 @@ class OsuSnapAimEvaluator {
4136
3992
  stackFactor, 2);
4137
3993
  }
4138
3994
  }
4139
- OsuSnapAimEvaluator.wideAngleMultiplier = 9.67;
4140
- OsuSnapAimEvaluator.acuteAngleMultiplier = 2.35;
4141
- OsuSnapAimEvaluator.sliderMultiplier = 1.5;
4142
- OsuSnapAimEvaluator.velocityChangeMultiplier = 0.9;
4143
- // Increasing this multiplier beyond 1.02 reduces difficulty as distance increases.
4144
- // Refer to the desmos link above the wiggle bonus calculation.
4145
- OsuSnapAimEvaluator.wiggleMultiplier = 1.02;
3995
+ OsuSnapAimEvaluator.wideAngleMultiplier = 2.15;
3996
+ // Rescale velocity for the wide angle bonus.
3997
+ OsuSnapAimEvaluator.wideAngleTimeScale = 1.2;
3998
+ OsuSnapAimEvaluator.sliderMultiplier = 1.35;
3999
+ OsuSnapAimEvaluator.velocityChangeMultiplier = 0.85;
4146
4000
  OsuSnapAimEvaluator.angleRepetitionNoteLimit = 6;
4147
4001
  OsuSnapAimEvaluator.maximumRepetitionNerf = 0.15;
4148
4002
  OsuSnapAimEvaluator.maximumVectorInfluence = 0.5;
4149
4003
 
4004
+ /**
4005
+ * An evaluator for calculating osu!standard agility aim difficulty.
4006
+ */
4007
+ class OsuAgilityEvaluator {
4008
+ /**
4009
+ * Evaluates the difficulty of fast aiming the current object.
4010
+ *
4011
+ * @param current The current object.
4012
+ */
4013
+ static evaluateDifficultyOf(current) {
4014
+ if (current.object instanceof osuBase.Spinner) {
4015
+ return 0;
4016
+ }
4017
+ const prev = current.previous(0);
4018
+ // Assume that the player always uses at least the full great hitwindow for the movement.
4019
+ const currentDelta = Math.max(current.strainTime, current.hitWindowFor(osuBase.HitResult.Great));
4020
+ // For objects that are stacked, we want to reduce the agility difficulty slightly by combining delta times
4021
+ // of both objects together because we can assume that they likely would be done in one movement.
4022
+ let previousDelta = 0;
4023
+ if (prev !== null) {
4024
+ previousDelta = prev.strainTime * osuBase.MathUtils.reverseLerp(prev.lazyJumpDistance, prev.normalizedRadius, 0);
4025
+ }
4026
+ const combinedDelta = currentDelta + previousDelta * this.previousDeltaInfluence;
4027
+ const angleSwitchingBonus = this.calculateAngleSwitchingBonus(current, prev);
4028
+ let difficulty = (1 + angleSwitchingBonus) * 10000000 / Math.pow(combinedDelta, 3.1);
4029
+ difficulty *= current.smallCircleBonus;
4030
+ return difficulty;
4031
+ }
4032
+ static calculateAngleSwitchingBonus(current, prev) {
4033
+ if (current.angle === null || typeof (prev === null || prev === void 0 ? void 0 : prev.angle) !== "number") {
4034
+ return 0;
4035
+ }
4036
+ const acutenessDifference = 1 - Math.min(OsuSnapAimEvaluator.calculateAcuteAngleAcuteness(current.angle), Math.pow(OsuSnapAimEvaluator.calculateAcuteAngleAcuteness(prev.angle), 3));
4037
+ const rhythmDifferencePenalty = Math.pow(Math.min(current.strainTime, prev.strainTime) / Math.max(current.strainTime, prev.strainTime), 3);
4038
+ return (acutenessDifference *
4039
+ rhythmDifferencePenalty *
4040
+ osuBase.Interpolation.reverseLerp(prev.lazyJumpDistance, prev.normalizedRadius, prev.normalizedDiameter) *
4041
+ this.angleSwitchingBonus);
4042
+ }
4043
+ }
4044
+ OsuAgilityEvaluator.previousDeltaInfluence = 0.5;
4045
+ OsuAgilityEvaluator.angleSwitchingBonus = 0.8;
4046
+
4047
+ /**
4048
+ * An evaluator for calculating osu!standard Flashlight skill.
4049
+ */
4050
+ class OsuFlashlightEvaluator {
4051
+ /**
4052
+ * Evaluates the difficulty of memorizing and hitting the current object, based on:
4053
+ *
4054
+ * - distance between a number of previous objects and the current object,
4055
+ * - the visual opacity of the current object,
4056
+ * - the angle made by the current object,
4057
+ * - length and speed of the current object (for sliders),
4058
+ * - and whether Hidden mod is enabled.
4059
+ *
4060
+ * @param current The current object.
4061
+ * @param mods The mods used.
4062
+ */
4063
+ static evaluateDifficultyOf(current, mods) {
4064
+ var _a;
4065
+ const scalingFactor = 52 / current.object.radius;
4066
+ let smallDistNerf = 1;
4067
+ let cumulativeStrainTime = 0;
4068
+ let result = 0;
4069
+ let last = current;
4070
+ let angleRepeatCount = 0;
4071
+ // Hidden's fade-out only affects opacity when the "only fade approach circles" setting is off.
4072
+ const opacityMods = ((_a = mods.get(osuBase.ModHidden)) === null || _a === void 0 ? void 0 : _a.onlyFadeApproachCircles.value)
4073
+ ? undefined
4074
+ : mods;
4075
+ for (let i = 0; i < Math.min(current.index, 10); ++i) {
4076
+ const currentObject = current.previous(i);
4077
+ cumulativeStrainTime += last.strainTime;
4078
+ const jumpDistance = current.object.stackedPosition.subtract(currentObject.object.stackedEndPosition).length;
4079
+ // We want to nerf objects that can be easily seen within the Flashlight circle radius.
4080
+ if (i === 0) {
4081
+ smallDistNerf = Math.min(1, jumpDistance / 75);
4082
+ }
4083
+ // We also want to nerf stacks so that only the first object of the stack is accounted for.
4084
+ const stackNerf = Math.min(1, currentObject.lazyJumpDistance / scalingFactor / 25);
4085
+ // Bonus based on how visible the object is.
4086
+ const opacityBonus = 1 +
4087
+ this.maxOpacityBonus *
4088
+ (1 -
4089
+ current.opacityAt(currentObject.object.startTime, opacityMods));
4090
+ result +=
4091
+ (stackNerf * opacityBonus * scalingFactor * jumpDistance) /
4092
+ cumulativeStrainTime;
4093
+ if (currentObject.angle !== null && current.angle !== null) {
4094
+ // Objects further back in time should count less for the nerf.
4095
+ if (Math.abs(currentObject.angle - current.angle) < 0.02) {
4096
+ angleRepeatCount += Math.max(0, 1 - 0.1 * i);
4097
+ }
4098
+ }
4099
+ last = currentObject;
4100
+ }
4101
+ result = Math.pow(smallDistNerf * result, 2);
4102
+ // Additional bonus for Hidden due to there being no approach circles.
4103
+ if (mods.has(osuBase.ModHidden)) {
4104
+ result *= 1 + this.hiddenBonus;
4105
+ }
4106
+ // Nerf patterns with repeated angles.
4107
+ result *=
4108
+ this.minAngleMultiplier +
4109
+ (1 - this.minAngleMultiplier) / (angleRepeatCount + 1);
4110
+ let sliderBonus = 0;
4111
+ if (current.object instanceof osuBase.Slider) {
4112
+ // Invert the scaling factor to determine the true travel distance independent of circle size.
4113
+ const pixelTravelDistance = current.lazyTravelDistance / scalingFactor;
4114
+ // Reward sliders based on velocity.
4115
+ sliderBonus = Math.pow(Math.max(0, pixelTravelDistance / current.travelTime - this.minVelocity), 0.5);
4116
+ // Longer sliders require more memorization.
4117
+ sliderBonus *= pixelTravelDistance;
4118
+ // Nerf sliders with repeats, as less memorization is required.
4119
+ if (current.object.repeatCount > 0)
4120
+ sliderBonus /= current.object.repeatCount + 1;
4121
+ }
4122
+ result += sliderBonus * this.sliderMultiplier;
4123
+ return result;
4124
+ }
4125
+ }
4126
+ OsuFlashlightEvaluator.maxOpacityBonus = 0.4;
4127
+ OsuFlashlightEvaluator.hiddenBonus = 0.2;
4128
+ OsuFlashlightEvaluator.minVelocity = 0.5;
4129
+ OsuFlashlightEvaluator.sliderMultiplier = 1.3;
4130
+ OsuFlashlightEvaluator.minAngleMultiplier = 0.2;
4131
+
4150
4132
  /**
4151
4133
  * An evaluator for calculating osu!standard flow aim difficulty.
4152
4134
  */
4153
4135
  class OsuFlowAimEvaluator {
4154
4136
  static evaluateDifficultyOf(current, withSliders) {
4155
- var _a;
4156
4137
  if (current.object instanceof osuBase.Spinner ||
4157
- current.index <= 1 ||
4158
- ((_a = current.previous(0)) === null || _a === void 0 ? void 0 : _a.object) instanceof osuBase.Spinner) {
4138
+ current.index <= 1) {
4159
4139
  return 0;
4160
4140
  }
4161
4141
  const next = current.next(0);
@@ -4167,86 +4147,18 @@ class OsuFlowAimEvaluator {
4167
4147
  const prevDistance = withSliders
4168
4148
  ? last.lazyJumpDistance
4169
4149
  : last.jumpDistance;
4170
- let currentVelocity = currentDistance / current.strainTime;
4171
- if (last.object instanceof osuBase.Slider && withSliders) {
4172
- // If the last object is a slider, then we extend the travel velocity through the slider into the current object.
4173
- const sliderDistance = last.lazyTravelDistance + current.lazyJumpDistance;
4174
- currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
4175
- }
4150
+ const currentVelocity = this.calculateCurrentVelocity(current, last, currentDistance, withSliders);
4176
4151
  const prevVelocity = prevDistance / last.strainTime;
4177
4152
  let flowDifficulty = currentVelocity;
4178
4153
  // Apply high circle size bonus to the base velocity.
4179
4154
  // We use reduced CS bonus here because the bonus was made for an evaluator with a different d/t scaling.
4180
- flowDifficulty *= Math.sqrt(current.smallCircleBonus);
4181
- // Rhythm changes are harder to flow.
4182
- flowDifficulty *=
4183
- 1 +
4184
- Math.min(0.1, Math.pow((Math.max(current.strainTime, last.strainTime) -
4185
- Math.min(current.strainTime, last.strainTime)) /
4186
- 50, 4));
4187
- if (current.angle !== null && last.angle !== null) {
4188
- // Low angular velocity (consistent angles) is easier to follow than erratic flow.
4189
- const angleDifference = Math.abs(current.angle - last.angle);
4190
- const angleDifferenceAdjusted = Math.sin(angleDifference / 2) * 180;
4191
- const angularVelocity = angleDifferenceAdjusted / (current.strainTime * 0.1);
4192
- flowDifficulty *= 0.8 + Math.sqrt(angularVelocity / 270);
4193
- }
4194
- if (current.angle !== null && next !== null && next.angle !== null) {
4195
- const currentAcuteness = OsuSnapAimEvaluator.calculateAcuteAngleAcuteness(current.angle);
4196
- const nextAcuteness = OsuSnapAimEvaluator.calculateAcuteAngleAcuteness(next.angle);
4197
- let acuteness;
4198
- let overlapWeight;
4199
- // We want to evaluate flow turns at the center point of the actual turn, but curr.Angle is a prev2-prev-curr angle.
4200
- // The issue with changing that to prev-curr-next is that we might evaluate the second note of a flow pattern as snap if prev is acute.
4201
- // With min(curr,next) the evaluation (assuming acute affects snap/flow probability enough) behaves roughly like this:
4202
- //
4203
- // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
4204
- // 🡓🡓
4205
- // ooo 🡐 flow (prev2-prev-curr evaluates as wide)
4206
- // /
4207
- // ooo 🡐 snap (prev2-prev-curr evaluates as acute)
4208
- // 🡑🡑
4209
- // flow (prev-curr-next evaluates as wide)
4210
- //
4211
- //
4212
- // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
4213
- // 🡓🡓
4214
- // ooo 🡐 flow (prev-curr-next and prev2-prev-curr evaluates as wide)
4215
- // \
4216
- // ooo 🡐 snap (prev-curr-next evaluates as acute as the center point of the turn)
4217
- // 🡑🡑
4218
- // flow (prev-curr-next evaluates as wide)
4219
- //
4220
- // In both examples the first object in a flow pattern is evaluated as acute (likely snap) and the rest are wide (likely flow).
4221
- if (currentAcuteness < nextAcuteness) {
4222
- acuteness = currentAcuteness;
4223
- overlapWeight = this.calculateOverlapWeight(current, last, lastLast);
4224
- }
4225
- else {
4226
- acuteness = nextAcuteness;
4227
- overlapWeight = this.calculateOverlapWeight(next, current, last);
4228
- }
4229
- flowDifficulty += currentVelocity * acuteness * overlapWeight * this.acuteAngleMultiplier;
4230
- }
4231
- if (Math.max(prevVelocity, currentVelocity)) {
4232
- if (withSliders) {
4233
- currentVelocity = currentDistance / current.strainTime;
4234
- }
4235
- // Scale with ratio of difference compared to 0.5 * max distance.
4236
- const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
4237
- Math.max(prevVelocity, currentVelocity), 0, 1);
4238
- // Reward for % distance up to 125 / strainTime for overlaps where velocity is still changing.
4239
- const overlapVelocityBuff = Math.min((current.normalizedDiameter * 1.25) /
4240
- Math.min(current.strainTime, last.strainTime), Math.abs(prevVelocity - currentVelocity));
4241
- flowDifficulty +=
4242
- overlapVelocityBuff *
4243
- distanceRatio *
4244
- this.calculateOverlapWeight(current, last, lastLast) *
4245
- this.velocityChangeMultiplier;
4246
- }
4155
+ flowDifficulty *= Math.pow(current.smallCircleBonus, 0.55);
4156
+ flowDifficulty *= this.calculateRhythmChangeBonus(current, last);
4157
+ flowDifficulty *= this.calculateAngularVelocityBonus(current, last);
4158
+ flowDifficulty += this.calculateAcuteAngleBonus(current, last, lastLast, next, currentVelocity);
4159
+ flowDifficulty += this.calculateVelocityChangeBonus(current, last, currentVelocity, prevVelocity, currentDistance, this.calculateOverlapWeight(current, last, lastLast), withSliders);
4247
4160
  if (current.object instanceof osuBase.Slider && withSliders) {
4248
- // Include slider velocity to make velocity more consistent with snap.
4249
- flowDifficulty += current.travelDistance / current.travelTime;
4161
+ flowDifficulty += this.calculateSliderBonus(current);
4250
4162
  }
4251
4163
  // The final velocity is being raised to a power because flow difficulty scales harder with both high
4252
4164
  // distance and time, and we want to account for that.
@@ -4255,6 +4167,96 @@ class OsuFlowAimEvaluator {
4255
4167
  return (flowDifficulty *
4256
4168
  osuBase.MathUtils.smootherstep(currentDistance, 0, current.normalizedRadius));
4257
4169
  }
4170
+ static calculateRhythmChangeBonus(current, last) {
4171
+ const bonus = Math.pow((Math.max(current.strainTime, last.strainTime) -
4172
+ Math.min(current.strainTime, last.strainTime)) / 50, 4);
4173
+ return 1 + Math.min(this.maximumRhythmChangeBonus, bonus);
4174
+ }
4175
+ /**
4176
+ * Scales flow difficulty by angular velocity.
4177
+ * This nerfs consistent angles whilst buffing "erratic" flow.
4178
+ */
4179
+ static calculateAngularVelocityBonus(current, last) {
4180
+ if (current.angle === null || last.angle === null) {
4181
+ return 1;
4182
+ }
4183
+ const angleDifference = Math.abs(current.angle - last.angle);
4184
+ const angleDifferenceAdjusted = Math.sin(angleDifference / 2) * 180;
4185
+ const angularVelocity = angleDifferenceAdjusted / (current.strainTime * 0.1);
4186
+ return 0.8 + Math.sqrt(angularVelocity / 270);
4187
+ }
4188
+ static calculateAcuteAngleBonus(current, prev, prevPrev, next, currentVelocity) {
4189
+ if (current.angle === null || typeof (next === null || next === void 0 ? void 0 : next.angle) !== "number") {
4190
+ return 0;
4191
+ }
4192
+ const currentAcuteness = OsuSnapAimEvaluator.calculateAcuteAngleAcuteness(current.angle);
4193
+ const nextAcuteness = OsuSnapAimEvaluator.calculateAcuteAngleAcuteness(next.angle);
4194
+ let acuteness;
4195
+ let overlapWeight;
4196
+ // We want to evaluate flow turns at the center point of the actual turn, but current.angle is a prev2-prev-curr angle.
4197
+ // The issue with changing that to prev-curr-next is that we might evaluate the second note of a flow pattern as snap if prev is acute.
4198
+ // With min(curr,next) the evaluation (assuming acute affects snap/flow probability enough) behaves roughly like this:
4199
+ //
4200
+ // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
4201
+ // 🡓🡓
4202
+ // ooo 🡐 flow (prev2-prev-curr evaluates as wide)
4203
+ // /
4204
+ // ooo 🡐 snap (prev2-prev-curr evaluates as acute)
4205
+ // 🡑🡑
4206
+ // flow (prev-curr-next evaluates as wide)
4207
+ //
4208
+ //
4209
+ // flow (prev-curr-next and prev2-prev-curr evaluates as wide)
4210
+ // 🡓🡓
4211
+ // ooo 🡐 flow (prev-curr-next and prev2-prev-curr evaluates as wide)
4212
+ // \
4213
+ // ooo 🡐 snap (prev-curr-next evaluates as acute as the center point of the turn)
4214
+ // 🡑🡑
4215
+ // flow (prev-curr-next evaluates as wide)
4216
+ //
4217
+ // In both examples the first object in a flow pattern is evaluated as acute (likely snap) and the rest are wide (likely flow).
4218
+ if (currentAcuteness < nextAcuteness) {
4219
+ acuteness = currentAcuteness;
4220
+ overlapWeight = this.calculateOverlapWeight(current, prev, prevPrev);
4221
+ }
4222
+ else {
4223
+ acuteness = nextAcuteness;
4224
+ overlapWeight = this.calculateOverlapWeight(next, current, prev);
4225
+ }
4226
+ return currentVelocity * acuteness * overlapWeight * this.acuteAngleMultiplier;
4227
+ }
4228
+ static calculateVelocityChangeBonus(current, last, currentVelocity, prevVelocity, currentDistance, overlappedNotesWeight, withSliders) {
4229
+ if (Math.max(prevVelocity, currentVelocity) === 0) {
4230
+ return 0;
4231
+ }
4232
+ if (withSliders) {
4233
+ currentVelocity = currentDistance / current.strainTime;
4234
+ }
4235
+ const velocityDistanceCap = current.normalizedDiameter * 1.1;
4236
+ currentVelocity = Math.min(currentVelocity, velocityDistanceCap / current.strainTime);
4237
+ prevVelocity = Math.min(prevVelocity, velocityDistanceCap / last.strainTime);
4238
+ // Scale with ratio of difference compared to 0.5 * max distance.
4239
+ const distanceRatio = osuBase.MathUtils.smoothstep(Math.abs(prevVelocity - currentVelocity) /
4240
+ Math.max(prevVelocity, currentVelocity), 0, 1);
4241
+ let velocityChangeBonus = Math.abs(prevVelocity - currentVelocity) * distanceRatio;
4242
+ velocityChangeBonus *= Math.pow(Math.min(current.strainTime, last.strainTime) /
4243
+ Math.max(current.strainTime, last.strainTime), 3);
4244
+ return (velocityChangeBonus *
4245
+ overlappedNotesWeight *
4246
+ this.velocityChangeMultiplier);
4247
+ }
4248
+ static calculateSliderBonus(current) {
4249
+ return current.travelDistance / current.travelTime;
4250
+ }
4251
+ static calculateCurrentVelocity(current, prev, currentDistance, withSliders) {
4252
+ let currentVelocity = currentDistance / current.strainTime;
4253
+ if (prev.object instanceof osuBase.Slider && withSliders) {
4254
+ // If the last object is a slider, then we extend the travel velocity through the slider into the current object.
4255
+ const sliderDistance = prev.lazyTravelDistance + current.lazyJumpDistance;
4256
+ currentVelocity = Math.max(currentVelocity, sliderDistance / current.strainTime);
4257
+ }
4258
+ return currentVelocity;
4259
+ }
4258
4260
  // If all three notes overlap, do not reward bonuses as there is no required additional movement.
4259
4261
  static calculateOverlapWeight(first, second, third) {
4260
4262
  const o1 = this.calculateOverlapFactor(first, second);
@@ -4268,8 +4270,9 @@ class OsuFlowAimEvaluator {
4268
4270
  return osuBase.MathUtils.clamp(1 - Math.pow(Math.max(distance - radius, 0) / radius, 2), 0, 1);
4269
4271
  }
4270
4272
  }
4271
- OsuFlowAimEvaluator.velocityChangeMultiplier = 0.55;
4272
- OsuFlowAimEvaluator.acuteAngleMultiplier = 1.3;
4273
+ OsuFlowAimEvaluator.velocityChangeMultiplier = 1.9;
4274
+ OsuFlowAimEvaluator.maximumRhythmChangeBonus = 0.1;
4275
+ OsuFlowAimEvaluator.acuteAngleMultiplier = 0.9;
4273
4276
 
4274
4277
  /**
4275
4278
  * Evaluator for reading difficulty in osu!standard.
@@ -4696,9 +4699,6 @@ class OsuSpeedEvaluator {
4696
4699
  * @param current The current object.
4697
4700
  */
4698
4701
  static evaluateDifficultyOf(current) {
4699
- if (current.object instanceof osuBase.Spinner) {
4700
- return 0;
4701
- }
4702
4702
  const doubletapness = 1 - current.getDoubletapness(current.next(0));
4703
4703
  let difficulty = osuBase.MathUtils.millisecondsToBPM(current.strainTime);
4704
4704
  difficulty *= this.calculateSpeedBonus(current);
@@ -4726,6 +4726,23 @@ class OsuSpeedEvaluator {
4726
4726
  // ~200 1/4 BPM streams
4727
4727
  OsuSpeedEvaluator.minSpeedBonus = 200;
4728
4728
 
4729
+ class OsuSpinnerEvaluator {
4730
+ /**
4731
+ * Evaluates difficulty of spinning.
4732
+ */
4733
+ static evaluateDifficultyOf(current) {
4734
+ if (!(current.object instanceof osuBase.Spinner) || current.object.spinsRequired <= 0) {
4735
+ return 0;
4736
+ }
4737
+ // This duration is *not* rate scaled because spinners work by applying rates on rotations.
4738
+ // This means spinning difficulty remains constant for a spinner, regardless of the applied rate.
4739
+ const duration = current.object.duration / current.clockRate / 1000;
4740
+ const rps = current.object.spinsRequired / duration;
4741
+ // The longer the spinner the more lenient spinning requirements are.
4742
+ return rps / duration;
4743
+ }
4744
+ }
4745
+
4729
4746
  /**
4730
4747
  * Represents the skill required to correctly aim at every object in the map with a uniform CircleSize and normalized distances.
4731
4748
  */
@@ -4733,11 +4750,12 @@ class OsuAim extends VariableLengthStrainSkill {
4733
4750
  constructor(mods, withSliders) {
4734
4751
  super(mods);
4735
4752
  this.currentStrain = 0;
4736
- this.skillMultiplierSnap = 71;
4737
- this.skillMultiplierAgility = 1.63;
4738
- this.skillMultiplierFlow = 247;
4753
+ this.skillMultiplierSnap = 78.3;
4754
+ this.skillMultiplierAgility = 32.5;
4755
+ this.skillMultiplierFlow = 251;
4756
+ this.skillMultiplierSpinner = 22;
4739
4757
  this.skillMultiplierTotal = 1.12;
4740
- this.combinedSnapNormExponent = 1.2;
4758
+ this.combinedSnapNormExponent = 1.5;
4741
4759
  /**
4742
4760
  * The number of sections with the highest strains, which the peak strain reductions will apply to.
4743
4761
  * This is done in order to decrease their impact on the overall difficulty of the beatmap.
@@ -4806,6 +4824,9 @@ class OsuAim extends VariableLengthStrainSkill {
4806
4824
  }
4807
4825
  }
4808
4826
  calculateAdjustedDifficulty(current) {
4827
+ if (current.object instanceof osuBase.Spinner) {
4828
+ return OsuSpinnerEvaluator.evaluateDifficultyOf(current) * this.skillMultiplierSpinner;
4829
+ }
4809
4830
  const snapDifficulty = OsuSnapAimEvaluator.evaluateDifficultyOf(current, this.withSliders) * this.skillMultiplierSnap;
4810
4831
  const agilityDifficulty = OsuAgilityEvaluator.evaluateDifficultyOf(current) *
4811
4832
  this.skillMultiplierAgility;
@@ -5545,7 +5566,7 @@ class OsuDifficultyHitObject extends DifficultyHitObject {
5545
5566
  this.mode = osuBase.Modes.Osu;
5546
5567
  }
5547
5568
  get smallCircleBonus() {
5548
- return Math.max(1, 1 + (30 - this.object.radius) / 70);
5569
+ return Math.max(1, 1 + (30 - this.object.radius) / 75);
5549
5570
  }
5550
5571
  get overallDifficulty() {
5551
5572
  const hitWindowGreat = this.hitWindowFor(osuBase.HitResult.Great) / 2;
@@ -5654,8 +5675,12 @@ class OsuFlashlight extends OsuSkill {
5654
5675
  else if (this.mods.has(osuBase.ModAutopilot)) {
5655
5676
  difficulty *= 0.4;
5656
5677
  }
5657
- difficulty *=
5658
- 0.985 + Math.pow(Math.max(0, current.overallDifficulty), 2) / 4000;
5678
+ // Spinner OD is a special case wherein we don't want to apply rates, and the available hit windows on the object itself are all empty.
5679
+ // Trying to account for this is more effort than its worth, so skip OD scaling.
5680
+ if (!(current.object instanceof osuBase.Spinner)) {
5681
+ difficulty *=
5682
+ 0.985 + Math.pow(Math.max(0, current.overallDifficulty), 2) / 4000;
5683
+ }
5659
5684
  return difficulty;
5660
5685
  }
5661
5686
  strainDecay(ms) {