From bde9746c88761a827347d905a307c8afbd8b02c0 Mon Sep 17 00:00:00 2001 From: Ada Werefox Date: Wed, 28 Feb 2024 12:40:21 -0600 Subject: [PATCH] Initial commit. --- .gitignore | 3 +++ README.md | 53 ++++++++++++++++++++++++++++++++++++++ requirements.txt | 0 spoiler_translations.toml | 54 +++++++++++++++++++++++++++++++++++++++ start.py | 25 ++++++++++++++++++ 5 files changed, 135 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 requirements.txt create mode 100644 spoiler_translations.toml create mode 100755 start.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c95686 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +**/.venv/** +**/__pycache__/** +*.pyc \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c2b46a1 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +# Tunic Tracker Redux +``` + _________ ___ ___ ________ ________ +|\___ ___\\ \|\ \|\ ___ \|\ ____\ +\|___ \ \_\ \ \\\ \ \ \\ \ \ \ \___| + \ \ \ \ \ \\\ \ \ \\ \ \ \ \ + \ \ \ \ \ \\\ \ \ \\ \ \ \ \____ + \ \__\ \ \_______\ \__\\ \__\ \_______\ + \|__| \|_______|\|__| \|__|\|_______| + _________ ________ ________ ________ ___ __ _______ ________ +|\___ ___\\ __ \|\ __ \|\ ____\|\ \|\ \ |\ ___ \ |\ __ \ +\|___ \ \_\ \ \|\ \ \ \|\ \ \ \___|\ \ \/ /|\ \ __/|\ \ \|\ \ + \ \ \ \ \ _ _\ \ __ \ \ \ \ \ ___ \ \ \_|/_\ \ _ _\ + \ \ \ \ \ \\ \\ \ \ \ \ \ \____\ \ \\ \ \ \ \_|\ \ \ \\ \| + \ \__\ \ \__\\ _\\ \__\ \__\ \_______\ \__\\ \__\ \_______\ \__\\ _\ + \|__| \|__|\|__|\|__|\|__|\|_______|\|__| \|__|\|_______|\|__|\|__| + ________ _______ ________ ___ ___ ___ ___ +|\ __ \|\ ___ \ |\ ___ \|\ \|\ \ |\ \ / /| +\ \ \|\ \ \ __/|\ \ \_|\ \ \ \\\ \ \ \ \/ / / + \ \ _ _\ \ \_|/_\ \ \ \\ \ \ \\\ \ \ \ / / + \ \ \\ \\ \ \_|\ \ \ \_\\ \ \ \\\ \ / \/ + \ \__\\ _\\ \_______\ \_______\ \_______\/ /\ \ + \|__|\|__|\|_______|\|_______|\|_______/__/ /\ __\ + |__|/ \|__| +``` + +I think we can do better with Tunic tracking so I'm gonna make something and if it works out that's awesome but for now I just wanna make it. + +## Requirements + +You'll need `python` to use this for now, so make sure you have that installed. + +## Setup + +Install necessary modules with: + +`pip install -r requirements.txt` + +Consider making a venv for this. + +`python -m venv "./.venv"` + +## Usage + +Make sure that the saved filepath in the script matches your filepath. It defaults to where *my* spoiler log is. + +``` +def import_entrances(spoiler_log='/path/to/Spoiler.log'): +``` + +Then run it with: + +`python start.py` \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/spoiler_translations.toml b/spoiler_translations.toml new file mode 100644 index 0000000..16641b1 --- /dev/null +++ b/spoiler_translations.toml @@ -0,0 +1,54 @@ +[spoiler_log_entrances] +"Overworld Redux" = "Overworld" +"CubeRoom" = "Overworld (Cube Room)" +"Sword Cave" = "Overworld (Stick Cave)" +"EastFiligreeCache" = "Overworld (Fire Sword Cave)" +"Overworld Cave" = "Overworld (Caustic Light Fairy Cave)" +"Ruins Passage" = "Overworld (Ruins Passage)" +"PatrolCave" = "Overworld (Patrol Fairy Cave)" +"Waterfall" = "Overworld (Secret Gathering Place)" +"Ruined Shop" = "Overworld (Ruined Shop)" +"Town_FiligreeRoom" = "Overworld (Holy Cross Door Cave)" +"Changing Room" = "Overworld (Changing Room)" +"Town Basement" = "Overworld (Hourglass Room)" +"Overworld Interiors" = "Overworld (Old House)" +"Maze Room" = "Overworld (Maze Room)" +"Furnace" = "Overworld (West Belltower)" +"ShopSpecial" = "Overworld (Special Shop)" +"Temple" = "Sealed Temple" +"Transit" = "Far Shore" +"Shop" = "Shop" +"Trinket Well" = "Trinket Well" +"Forest Belltower" = "East Forest (East Belltower)" +"East Forest Redux" = "East Forest" +"Sword Access" = "East Forest (Path to Hero's Grave)" +"East Forest Redux Interior" = "East Forest (Guardhouse 2)" +"East Forest Redux Laddercave" = "East Forest (Guardhouse 1)" +"Sewer" = "Beneath the Well" +"Sewer_Boss" = "Beneath the Well (Boss Room)" +"Crypt Redux" = "Dark Tomb" +"Archipelagos Redux" = "West Garden" +"archipelagos_house" = "West Garden (Ice Dagger Cave)" +"Atoll Redux" = "Ruined Atoll" +"frog cave main" = "Frog's Domain" +"Library Hall" = "Library (Hall)" +"Library Lab" = "Library (Lab)" +"Library Arena" = "Library (Librarian)" +"Fortress Courtyard" = "Eastern Vault Fortress (Fortress Courtyard)" +"Fortress Basement" = "Beneath the Eastern Vault" +"Fortress Main" = "Eastern Vault Fortress" +"Fortress East" = "Eastern Vault Fortress (Shortcut Path)" +"Fortress Reliquary" = "Eastern Vault Fortress (Path to Hero's Grave)" +"Dusty" = "Eastern Vault Fortress (Dusty)" +"Fortress Arena" = "Siege Engine" +"Mountain" = "Mountaintop" +"Mountaintop" = "Mountaintop" +"Quarry Redux" = "Quarry" +"Monastery" = "Monastery" +"ziggurat2020_1" = "Rooted Ziggurat Upper" +"ziggurat2020_2" = "Rooted Ziggurat Tower" +"ziggurat2020_3" = "Rooted Ziggurat Lower" +"Swamp Redux 2" = "Swamp" +"Cathedral Redux" = "Cathedral" +"Cathedral Arena" = "Cathedral (Gauntlet)" +"RelicVoid" = "Hero's Grave" \ No newline at end of file diff --git a/start.py b/start.py new file mode 100755 index 0000000..4ee29ea --- /dev/null +++ b/start.py @@ -0,0 +1,25 @@ +#!/usr/bin/python + +import logging +import re + +log = logging.getLogger(__name__) +entrances_map = '' + + +def import_entrances(spoiler_log='/home/alice/Games/steam/steamapps/compatdata/553420/pfx/drive_c/users/steamuser/AppData/LocalLow/Andrew Shouldice/Secret Legend/Randomizer/Spoiler.log'): + """A function to import the entrance mappings from the user's spoiler log. + + Args: + spoiler_log (str, optional): The filepath of the spoiler log. Defaults to '/home/alice/Games/steam/steamapps/compatdata/553420/pfx/drive_c/users/steamuser/AppData/LocalLow/Andrew Shouldice/Secret Legend/Randomizer/Spoiler.log'. + """ + + try: + with open(spoiler_log, 'r') as f: + spoiler_text = f.read() + entrances_map = re.findall('\s+- (.+) -- (.+)\n', spoiler_text) + except: + print(f'Could not find spoiler log from path: {spoiler_log}') + + for l in entrances_map: + print(f'{l[0]} <---> {l[1]}')