16 lines
323 B
Python
16 lines
323 B
Python
from constants import VALORANT_RANKS
|
|
|
|
def apply_rr(rank: str, rr: int, change: int):
|
|
rr += change
|
|
idx = VALORANT_RANKS.index(rank)
|
|
|
|
# Prevent negative RR
|
|
if rr < 0:
|
|
rr = 0
|
|
|
|
while rr >= 100 and idx < len(VALORANT_RANKS) - 1:
|
|
rr -= 100
|
|
idx += 1
|
|
|
|
return VALORANT_RANKS[idx], rr
|