CALORIE SYSTEM
This commit is contained in:
13
helpers.py
13
helpers.py
@@ -4,12 +4,17 @@ def apply_rr(rank: str, rr: int, change: int):
|
||||
rr += change
|
||||
idx = VALORANT_RANKS.index(rank)
|
||||
|
||||
# Prevent negative RR
|
||||
if rr < 0:
|
||||
rr = 0
|
||||
|
||||
# Rank up: 100 RR or more
|
||||
while rr >= 100 and idx < len(VALORANT_RANKS) - 1:
|
||||
rr -= 100
|
||||
idx += 1
|
||||
|
||||
# Rank down: negative RR
|
||||
while rr < 0 and idx > 0:
|
||||
rr += 100
|
||||
idx -= 1
|
||||
|
||||
# Clamp RR to 0-99 range
|
||||
rr = max(0, min(99, rr))
|
||||
|
||||
return VALORANT_RANKS[idx], rr
|
||||
|
||||
Reference in New Issue
Block a user