nmarkro

shrine money reward pseudocode

Apr 22nd, 2019
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.23 KB | None | 0 0
  1. # shrine money reward pseudocode
  2. # shrine odds for money are a flat 10% always
  3.  
  4. def money_reward():
  5.     money = get_money()
  6.  
  7.     if money > 1000000:
  8.         rand = get_random_number(20)
  9.     elif money > 500000:
  10.         rand = get_random_number(30)
  11.     elif money > 100000:
  12.         rand = get_random_number(40)
  13.     else:
  14.         rand = get_random_number(50)
  15.  
  16.     if rand < 21:
  17.         # 100% with more than 1m
  18.         # 66.7% with less than 1m but more than 500k
  19.         # 50% with less than 500k but more than 100k
  20.         # 40% with less than 100k
  21.         money += money * 0.2
  22.     elif rand < 31:
  23.         # 0% with more than 1m
  24.         # 33.3% with less than 1m but more than 500k
  25.         # 25% with less than 500k but more than 100k
  26.         # 20% with less than 100k
  27.         money += money * 0.5
  28.     elif rand < 41:
  29.         # 0% with more than 1m
  30.         # 0% with less than 1m but more than 500k
  31.         # 25% with less than 500k but more than 100k
  32.         # 20% with less than 100k
  33.         money += money * 1
  34.     else:
  35.         # 0% with more than 1m
  36.         # 0% with less than 1m but more than 500k
  37.         # 0% with less than 500k but more than 100k
  38.         # 20% with less than 100k
  39.         money += money * 2
Add Comment
Please, Sign In to add comment