Add gem calc

This commit is contained in:
Donald Burr 2016-03-05 21:18:47 -08:00
parent 5037361052
commit f7b0cf4739

View file

@ -30,25 +30,29 @@ import getopt
from math import floor
# algorithm from: http://decaf.kouhi.me/lovelive/index.php?title=Gameplay#Ranks
def calc(game_version, starting_rank, starting_exp, desired_rank):
def calc(game_version, starting_rank, starting_exp, desired_rank, half_exp):
required_exp = 0
for rank in range(starting_rank, desired_rank):
required_exp_for_next_rank = round(34.45 * rank - 551)
# account for half EXP on JP (only if rank < 100)
if game_version == "JP" and rank < 100:
if half_exp and rank < 100:
required_exp_for_next_rank = required_exp_for_next_rank // 2
#print "AT RANK %d NEED %d EXP" % (rank, required_exp_for_next_rank)
required_exp = required_exp + required_exp_for_next_rank
# account for exp we already have
required_exp = required_exp - starting_exp
print "To get from rank %d (with %d EXP) to rank %d on %s requires %d EXP." % (starting_rank, starting_exp, desired_rank, game_version, required_exp)
print "Equivalent to playing the following number of songs of difficulty level:"
# round up because you can't play half of a song (although you can play a song half-assedly :P and I often do :P)
easy_count = (required_exp // 12) + 1
normal_count = (required_exp // 26) + 1
hard_count = (required_exp // 46) + 1
ex_count = (required_exp // 83) + 1
print "EASY (%d) NORMAL (%d) HARD (%d) EXPERT (%d)" % (easy_count, normal_count, hard_count, ex_count)
easy_3x_count = (required_exp // (12*3)) + 1
normal_3x_count = (required_exp // (26*3)) + 1
hard_3x_count = (required_exp // (46*3)) + 1
ex_3x_count = (required_exp // (83*3)) + 1
easy_3xb_count = (required_exp // (12*3)) + 1
normal_3xb_count = (required_exp // (26*3)) + 1
hard_3xb_count = (required_exp // (46*3)) + 1
ex_3xb_count = (required_exp // (83*3)) + 1
# calc LP
LP = 25 + floor(min(desired_rank, 300) / 2) + floor(max(desired_rank - 300, 0) / 3)
# calc friend slots