Advertisement
Guest User

Untitled

a guest
Feb 28th, 2021
10,855
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.11 KB | None | 0 0
  1. #Version 1.0 by nissan for f95zone.to
  2.  
  3.  
  4. """
  5. HOWTO:
  6.  
  7. 1) Download Jython at https://www.jython.org/download
  8. 2) Download latest TOA.jar and save it to some folder (e.g. `TOADirectory`)
  9. 3) copy extractor.py to `TOADirectory`
  10. 4) run extractor.py with `jython extractor.py`
  11. 5) move generated `profile.json` file to a folder `.toa-data`
  12. 6) start the game and enjoy fully unlocked gallery (to start the game from a command line run  `java -jar TalesOfAndrogynyV0.3.03.4.jar` , replace the filename with corresponding .jar)
  13. """
  14.  
  15.  
  16. import glob
  17. import sys
  18. import json
  19. import string
  20.  
  21. toa = glob.glob("*.jar")[0]
  22. sys.path.append(toa)
  23.  
  24. import com.majalis.character.CharacterEnum
  25. import com.majalis.save.Achievement
  26. import com.majalis.asset.AssetEnum
  27. import com.majalis.asset.AnimationEnum
  28.  
  29.  
  30. chars = com.majalis.character.CharacterEnum.values()
  31. achievements = com.majalis.save.Achievement.values()
  32. cgseen = com.majalis.asset.AssetEnum.values()
  33. animations = com.majalis.asset.AnimationEnum.values()
  34.  
  35. achievements_section = {"achievements": dict.fromkeys(map(str, achievements), 1)}
  36. char_section = {"enemyKnowledge": dict.fromkeys(map(lambda x: string.capwords(str(x), "_").replace("_", " "), chars), 1)}
  37. cgscreen_section = {"cgSeen": dict.fromkeys(map(str, cgseen), 1)}
  38. animatedscreen_section = {"animatedCgSeen": dict.fromkeys(map(str, animations), 1)}
  39.  
  40. # I don't care to fix special cases that aren't present in the arrays
  41.  
  42. char_section["enemyKnowledge"]["Goblin (Male)"] = char_section["enemyKnowledge"].pop("Goblin Male")
  43. char_section["enemyKnowledge"]["Beast Mistress"] = char_section["enemyKnowledge"].pop("Beastmistress")
  44. char_section["enemyKnowledge"].update({"Quetzal Goddess": 1})
  45. char_section["enemyKnowledge"].update({"Feral Wereslut": 1})
  46. char_section["enemyKnowledge"].update({"Puca": 1})
  47. char_section["enemyKnowledge"].update({"Arachne": 1})
  48.  
  49.  
  50. profile = {}
  51. profile.update(achievements_section)
  52. profile.update(char_section)
  53. profile.update(cgscreen_section)
  54. profile.update(animatedscreen_section)
  55.  
  56. profilejson = json.dumps(profile, indent=4)
  57. with open("profile.json", "w") as f:
  58.         f.write(profilejson)
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement