fork download
  1. #!/bin/python3
  2. # Pokemon size calculator
  3. # now including formes
  4.  
  5. # v1 ideone ID: ibEXCG
  6.  
  7. # obviously, if a mon already has one of these forms, then you use
  8. # the offical numbers in place of the min/average/max
  9.  
  10. # List of pokemon sizes, from Bulbapedia
  11. # ( normal size, new size )
  12. mega = [
  13. (2.0,2.4),
  14. (1.7,1.7),
  15. (1.6,1.6),
  16. (1.5,1.2),
  17. (1.5,1.4),
  18. (2.2,2.2),
  19. (1.5,1.7),
  20. (6.5,6.5),
  21. (1.8,2.1),
  22. (2.0,2.3),
  23. (2.0,1.5),
  24. (1.4,1.4),
  25. (1.8,2.0),
  26. (1.5,1.7),
  27. (1.4,1.9),
  28. (2.0,2.5),
  29. (1.9,1.9),
  30. (1.6,1.6),
  31. (0.6,1.0),
  32. (2.1,2.2),
  33. (1.3,1.3),
  34. (1.5,1.8),
  35. (1.1,1.2),
  36. (1.2,1.2),
  37. (1.9,1.9),
  38. (1.2,1.3),
  39. (2.2,2.7),
  40. (1.0,1.4),
  41. (1.5,2.2),
  42. (1.6,2.0),
  43. (9.2,10.5),
  44. (1.7,1.9),
  45. (1.5,1.9),
  46. (0.5,0.5),
  47. (1.8,2.5),
  48. (1.9,2.5),
  49. (1.1,1.5),
  50. (1.5,2.1),
  51. (1.5,1.8),
  52. (1.6,2.5),
  53. (1.4,1.8),
  54. (2.0,2.3),
  55. (7.0,10.8),
  56. (1.2,1.3),
  57. (1.6,1.6),
  58. (1.1,1.5),
  59. (0.7,1.1)
  60. ]
  61.  
  62. alolan=[
  63. (0.7,0.7),
  64. (0.8,0.7),
  65. (1.0,1.2),
  66. (0.6,0.6),
  67. (0.7,0.7),
  68. (1.0,1.1),
  69. (1.0,1.0),
  70. (1.4,1.7),
  71. (1.2,1.0),
  72. (1.0,1.0)
  73. ]
  74.  
  75. totem = [
  76. (0.7,1.4),
  77. (1.0,1.7),
  78. (0.7,1.4),
  79. (1.5,2.6),
  80. (0.2,0.4),
  81. (1.8,3.1),
  82. (0.9,1.5),
  83. (1.2,2.1),
  84. (0.3,0.6),
  85. (0.2,0.4),
  86. (1.6,2.4)
  87. ]
  88.  
  89. # lots of legendaries here
  90. formes = [
  91. (4.5, 6.9), # giratina
  92. (0.2, 0.4), # shaymin
  93. (1.5, 1.4), # tornadus
  94. (1.5, 3.0), # thundurus
  95. (1.5, 1.3), # landorus
  96. (3.0, 3.6), # white kyurem
  97. (3.0, 3.3), # black kyurem
  98. (0.4, 0.3), # pumpkaboo small
  99. (0.4, 0.5), # pumpkaboo large
  100. (0.4, 0.8), # pumpkaboo giant
  101. (0.9, 0.7), # gourgeist small
  102. (0.9, 1.1), # gourgeist large
  103. (0.9, 1.7), # gourgeist giant
  104. # (5.0, 1.2), # zygarde 10% # coordinate system changed between forms
  105. # (5.0, 4.5), # zygarde C # coordinate system changed between forms
  106. (0.8, 1.1), # lycanroc midnight
  107. (1.1, 0.8), # lycanroc midday (both are technically correct)
  108. (2.4, 3.8), # DM Necrozma
  109. (2.4, 4.2), # DW Necrozma
  110. (2.4, 7.5) # U Necrozma
  111. ]
  112.  
  113. def add_outliers():
  114. global totem
  115. global alolan
  116. global mega
  117. global formes
  118. # these are pretty much all intentionally huge for one reason or another
  119. formes.append( (0.2, 8.2) ) # wishiwashi school (41x)
  120. formes.append( (0.5, 6.5) ) # hoopa unbound (13x)
  121. alolan.append( (2.0,10.9) ) # alolan exeggutor (5.45x)
  122.  
  123. def calc_size(tabl):
  124. _min = 1000.0
  125. _max = -1000.0
  126. _avg = 0
  127. temp = tabl
  128. for t in temp:
  129. a = t[1]/t[0]
  130. if a > _max: _max = a
  131. if a < _min: _min = a
  132. _avg += a
  133. _avg = _avg / len(temp)
  134. return (_min,_max,_avg)
  135.  
  136. def print_size2(s):
  137. _min = s[0]
  138. _avg = s[2]
  139. _max = s[1]
  140. return "min %.3f average %.3f max %.3f" % (_min, _avg, _max)
  141.  
  142. def print_stats():
  143. totem_stat = calc_size(totem)
  144. mega_stat = calc_size(mega)
  145. alolan_stat = calc_size(alolan)
  146. forme_stat = calc_size(formes)
  147. print("Size differences:")
  148. print("LGPE sizes " + print_size2((0.6,1.4,1.0)) )
  149. print("totems " + print_size2(totem_stat) )
  150. print("mega evos " + print_size2(mega_stat) )
  151. print("alolan forms " + print_size2(alolan_stat) )
  152. print("formes " + print_size2(forme_stat) )
  153. print("")
  154.  
  155. size_max = totem_stat[1] * mega_stat[1] * alolan_stat[1] * forme_stat[1] * 1.4
  156. size_avg = totem_stat[2] * mega_stat[2] * alolan_stat[2] * forme_stat[2]
  157. print( "Averages multiplied: %7.2fx" % size_avg )
  158. print( "Maximums multiplied: %7.2fx" % size_max )
  159. print("------------------------------------------------------")
  160.  
  161. print("------------------------------------------------------")
  162. print_stats()
  163. add_outliers()
  164. print("With special case outliers")
  165. print_stats()
  166.  
Success #stdin #stdout 0.02s 27704KB
stdin
Standard input is empty
stdout
------------------------------------------------------
Size differences:
LGPE sizes   min 0.600   average 1.000   max 1.400
totems       min 1.500   average 1.825   max 2.000
mega evos    min 0.750   average 1.174   max 1.667
alolan forms min 0.833   average 1.022   max 1.214
formes       min 0.727   average 1.449   max 3.125

Averages multiplied:    3.17x
Maximums multiplied:   17.71x
------------------------------------------------------
With special case outliers
Size differences:
LGPE sizes   min 0.600   average 1.000   max 1.400
totems       min 1.500   average 1.825   max 2.000
mega evos    min 0.750   average 1.174   max 1.667
alolan forms min 0.833   average 1.425   max 5.450
formes       min 0.727   average 4.004   max 41.000

Averages multiplied:   12.22x
Maximums multiplied: 1042.77x
------------------------------------------------------