.FIX. Add taiko to getRank

This commit is contained in:
russelg 2016-06-19 07:13:00 +08:00 committed by Nyo
parent ee621906a4
commit d29bb0b732
1 changed files with 20 additions and 24 deletions

View File

@ -70,47 +70,43 @@ def getRank(gameMode, __mods, acc, c300, c100, c50, cmiss):
total = c300 + c100 + c50 + cmiss total = c300 + c100 + c50 + cmiss
hdfl = (__mods & mods.Hidden > 0) or (__mods & mods.Flashlight > 0) hdfl = (__mods & mods.Hidden > 0) or (__mods & mods.Flashlight > 0)
def ss(): ss = "sshd" if hdfl else "ss"
return "sshd" if hdfl else "ss" s = "shd" if hdfl else "s"
def s(): if gameMode == 0 or gameMode == 1:
return "shd" if hdfl else "s" # osu!std / taiko
ratio300 = c300 / total
if gameMode == 0: ratio50 = c50 / total
# osu!std
if acc == 100: if acc == 100:
return ss() return ss
if c300 / total > 0.90 and c50 / total < 0.1 and cmiss == 0: if ratio300 > 0.90 and ratio50 < 0.1 and cmiss == 0:
return s() return s
if (c300 / total > 0.80 and cmiss == 0) or (c300 / total > 0.90): if (ratio300 > 0.80 and cmiss == 0) or (ratio300 > 0.90):
return "a" return "a"
if (c300 / total > 0.70 and cmiss == 0) or (c300 / total > 0.80): if (ratio300 > 0.70 and cmiss == 0) or (ratio300 > 0.80):
return "b" return "b"
if c300 / total > 0.60: if ratio300 > 0.60:
return "c" return "c"
return "d" return "d"
elif gameMode == 1:
# taiko not implemented as of yet.
return "a"
elif gameMode == 2: elif gameMode == 2:
# CtB # CtB
if acc == 100: if acc == 100:
return ss() return ss
if acc >= 98.01 and acc <= 99.99: if acc > 98:
return s() return s
if acc >= 94.01 and acc <= 98.00: if acc > 94:
return "a" return "a"
if acc >= 90.01 and acc <= 94.00: if acc > 90:
return "b" return "b"
if acc >= 98.01 and acc <= 90.00: if acc > 85:
return "c" return "c"
return "d" return "d"
elif gameMode == 3: elif gameMode == 3:
# osu!mania # osu!mania
if acc == 100: if acc == 100:
return ss() return ss
if acc > 95: if acc > 95:
return s() return s
if acc > 90: if acc > 90:
return "a" return "a"
if acc > 80: if acc > 80: