You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
3.6 KiB

  1. #!/usr/bin/env python3
  2. import toml
  3. episodes = ['ep1', 'ep2', 'ep4']
  4. difficulties = ['normal', 'hard', 'veryhard', 'ultimate']
  5. sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill']
  6. base_dir = '../data/drops' # assumes script is running from /path/to/elseware/tools
  7. def get_area_percents():
  8. for episode in episodes:
  9. print('episode: {}'.format(episode))
  10. for difficulty in difficulties:
  11. print('difficulty: {}'.format(difficulty))
  12. for sectionid in sectionids:
  13. #print('sectionid: {}'.format(sectionid))
  14. area_toml = toml.load('{}/{}/{}/{}/area_percent_pattern.toml'.format(base_dir, episode, difficulty, sectionid))
  15. keys = list(area_toml.keys())
  16. attrs1 = [0,0,0,0,0,0,0,0,0,0]
  17. attrs2 = [0,0,0,0,0,0,0,0,0,0]
  18. attrs3 = [0,0,0,0,0,0,0,0,0,0]
  19. for i in range(0, len(keys)):
  20. if 'attribute1' in area_toml[keys[i]]:
  21. attrs1[i] = area_toml[keys[i]]['attribute1']
  22. if 'attribute2' in area_toml[keys[i]]:
  23. attrs2[i] = area_toml[keys[i]]['attribute2']
  24. if 'attribute3' in area_toml[keys[i]]:
  25. attrs3[i] = area_toml[keys[i]]['attribute3']
  26. #print('episode: {}, difficulty: {}, sectionid: {}'.format(episode, difficulty, sectionid))
  27. print('{}\n{}\n{}'.format(attrs1,attrs2,attrs3))
  28. print('\n\n')
  29. # print('episode: {}, difficulty: {}, sectionid: {}, key: {}\ntoml: {}'.format(episode, difficulty, sectionid, key, area_toml[key]))
  30. # if 'attribute1' in area_toml[key]:
  31. # print('attribute1,{}'.format(area_toml[key]['attribute1']), sep=',', end=',')
  32. # if 'attribute2' in area_toml[key]:
  33. # print('attribute2,{}'.format(area_toml[key]['attribute2']), sep=',', end=',')
  34. # if 'attribute3' in area_toml[key]:
  35. # print('attribute3,{}'.format(area_toml[key]['attribute3']), sep=',', end='')
  36. # print()
  37. def get_percent_patterns():
  38. for episode in episodes:
  39. # print('episode: {}'.format(episode))
  40. for difficulty in difficulties:
  41. # print('difficulty: {}'.format(difficulty))
  42. for sectionid in sectionids:
  43. print('{}, {}, {}'.format(episode, difficulty, sectionid))
  44. percent_toml = toml.load('{}/{}/{}/{}/percent_rate.toml'.format(base_dir, episode, difficulty, sectionid))
  45. keys = list(percent_toml.keys())
  46. for key in percent_toml.keys():
  47. print('percent_toml[{}]: '.format(key), sep='', end='')
  48. for p in range(5,95,5):
  49. print(' p{}: {}'.format(p, percent_toml[key]['p' + str(p)] / 100.0), sep=',', end=',')
  50. print()
  51. print()
  52. pattern1 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
  53. pattern2 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
  54. pattern3 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
  55. pattern4 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
  56. pattern5 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
  57. pattern6 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
  58. pass
  59. def main():
  60. #get_area_percents()
  61. get_percent_patterns()
  62. if __name__ == '__main__':
  63. main()