Skip to content

Commit

Permalink
Merge pull request #8 from jamuwu/patch-1
Browse files Browse the repository at this point in the history
Implement recent pp changes
  • Loading branch information
The-CJ authored Feb 22, 2021
2 parents 3faca74 + 18b2db9 commit 30184c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion oppadc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
osu! performance points and difficulty calculator (oppadc)
##########################################################
"""
__version__ = "1.0"
__version__ = "1.1"

from .osumap import OsuMap
from .osumod import OsuModIndex
27 changes: 16 additions & 11 deletions oppadc/osupp.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,25 @@ def calc(self, version:int=1, accuracy:float=100, combo:int=None, misses:int=0,
if amount_hitobjects > 2000:
length_bonus += math.log10(amount_objects_ober_2k) * 0.5

miss_penality:float = 0.97 ** misses
miss_penality_aim:float = 0.97 * pow(1 - pow(misses / amount_hitobjects, 0.775), misses)
miss_penality_speed:float = 0.97 * pow(1 - pow(misses / amount_hitobjects, 0.775), pow(misses, 0.875))
combo_break:float = (combo**0.8) / (max_combo**0.8)

# ar bonus
ar_bonus:float = 1.0
ar_bonus:float = 0.0
if Difficulty.ar > 10.33:
ar_bonus += 0.3 * (Difficulty.ar - 10.33)
ar_bonus += 0.4 * (Difficulty.ar - 10.33)

elif Difficulty.ar < 8.0:
ar_bonus += 0.1 * (8.0 - Difficulty.ar)

# aim pp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
self.aim_pp = self.getBasePP(Stats.aim)
self.aim_pp *= length_bonus
self.aim_pp *= miss_penality
if misses > 0:
self.aim_pp *= miss_penality_aim
self.aim_pp *= combo_break
self.aim_pp *= ar_bonus
self.aim_pp *= (1 + min(ar_bonus, ar_bonus * (amount_hitobjects / 1000)))

# hd bonus
hd_bonus:float = 1.0
Expand Down Expand Up @@ -142,19 +144,22 @@ def calc(self, version:int=1, accuracy:float=100, combo:int=None, misses:int=0,
# speed pp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
self.speed_pp = self.getBasePP(Stats.speed)
self.speed_pp *= length_bonus
self.speed_pp *= miss_penality
if misses > 0:
self.speed_pp *= miss_penality_speed
self.speed_pp *= combo_break

# high ar bonus
if Difficulty.ar > 10.33:
self.speed_pp *= ar_bonus
self.speed_pp *= 1 + min(ar_bonus, ar_bonus * (amount_hitobjects / 1000))

# hd bonus
self.speed_pp *= hd_bonus

# more stuff added
self.speed_pp *= (0.02 + accuracy)
self.speed_pp *= (0.96 + (od_squared / 1600))
self.speed_pp *= (0.95 + od_squared / 750)
self.speed_pp *= accuracy ** ((14.5 - max(Difficulty.od, 8)) / 2)
if n50 >= amount_hitobjects / 500:
self.speed_pp *= 0.98 ** (n50 - amount_hitobjects / 500)

# acc pp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
self.acc_pp = (1.52163 ** Difficulty.od) * (real_acc ** 24) * 2.83
Expand All @@ -172,10 +177,10 @@ def calc(self, version:int=1, accuracy:float=100, combo:int=None, misses:int=0,
final_multiplier:float = 1.12

if Difficulty.mods_value & MOD_NF:
final_multiplier *= 0.9
final_multiplier *= max(0.9, 1 - 0.2 * misses)

if Difficulty.mods_value & MOD_SO:
final_multiplier *= 0.95
final_multiplier *= 1 - (self.Map.amount_spinner / amount_hitobjects) ** 0.85

self.total_pp = (( (self.aim_pp**1.1) + (self.speed_pp**1.1) + (self.acc_pp**1.1) ) ** (1.0/1.1)) * final_multiplier
# set the vars we calculated with
Expand Down

0 comments on commit 30184c7

Please sign in to comment.