Advertisement
Kovitikus

Skill Level Rank Bonus Calculation (Finalized)

Aug 7th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.10 KB | None | 0 0
  1. def skill_level(rank, difficulty):
  2.     '''
  3.    RANK += RANK BONUS PER RANK
  4.    --------------------------
  5.    1 to 10 += 3
  6.    11 to 30 += 2
  7.    31 to 50 += 1
  8.    51 to 100 += 0.5
  9.    101 to 150 += 0.25
  10.    151 to 200 += 0.125
  11.    201 to 500 += 0.0625
  12.    501 to 1,000 += 0.025
  13.    1,001 to infinity += 0.01
  14.    '''
  15.     #Temp Values
  16.     rb = 0
  17.     rank = 100
  18.  
  19.     #Formula
  20.     if rank:
  21.         r = rank if rank < 10 else 10
  22.         rb += (3 * r)
  23.         if rank >= 11:
  24.             r = rank - 10 if rank < 30 else 10
  25.             rb += (2 * r)
  26.             if rank >= 31:
  27.                 r = rank - 30 if rank < 50 else 20
  28.                 rb += (1 * r)
  29.                 if rank >= 51:
  30.                     r = rank - 50 if rank < 100 else 50
  31.                     rb += (0.5 * r)
  32.                     if rank >= 101:
  33.                         r = rank - 100 if rank < 150 else 50
  34.                         rb += (0.25 * r)
  35.                         if rank >= 151:
  36.                             r = rank - 150 if rank < 200 else 50
  37.                             rb += (0.125 * r)
  38.                             if rank >= 201:
  39.                                 r = rank - 200 if rank < 500 else 300
  40.                                 rb += (0.0625 * r)
  41.                                 if rank >= 501:
  42.                                     r = rank - 500 if rank < 1000 else 500
  43.                                     rb += (0.025 * r)
  44.                                     if rank >= 1001:
  45.                                         r = rank - 1000
  46.                                         rb += (0.01 * r)
  47.         '''
  48.        15% RB loss per difficulty.
  49.        At rank 100:
  50.        Easy(100%) 115 RB
  51.        Average(85%) 97.75 RB
  52.        Difficult(70%) 80.5 RB
  53.        Impossible(55%) 63.25 RB
  54.        '''
  55.         if difficulty == 'easy':
  56.             rb *= 1
  57.         elif difficulty == 'average':
  58.             rb *= 0.85
  59.         elif difficulty == 'difficult':
  60.             rb *= 0.7
  61.         elif difficulty == 'impossible':
  62.             rb *= 0.55
  63.         return rb # Return if any rank.
  64.     return None # Return if no rank.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement