Skip to content

Commit

Permalink
Add support for Metroid Prime
Browse files Browse the repository at this point in the history
  • Loading branch information
Go1den committed Mar 20, 2023
1 parent 206bd1c commit 6dba28b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from game import Game
from supportedGames.donkeykong64 import DonkeyKong64
from supportedGames.majorasmask import MajorasMask
from supportedGames.metroidprime import MetroidPrime
from supportedGames.ocarinaoftime import OcarinaOfTime

class MainWindow(QWidget):
Expand All @@ -20,7 +21,8 @@ def __init__(self):
self.games: list[Game] = [
DonkeyKong64(),
OcarinaOfTime(),
MajorasMask()
MajorasMask(),
MetroidPrime()
]

self.game: Game = OcarinaOfTime()
Expand Down
30 changes: 30 additions & 0 deletions supportedGames/metroidprime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from json import load

from game import Game
from hint import Hint

class MetroidPrime(Game):

def __init__(self):
super().__init__()

def getGameNameText(self) -> str:
return "Metroid Prime"

def getHintList(self) -> list[Hint]:
return [
Hint('Artifact Locations')
]

def readFromSpoilerLog(self, f) -> dict:
with open(f) as myFile:
data = load(myFile)
locations = data['game_modifications'][0]['locations']
locationsString = 'Artifact locations: '
for x in locations:
for y in locations.get(x):
if 'Artifact' in locations.get(x).get(y):
locationsString += str(x) + " - " + str(y.split('/')[0]) + " (" + locations.get(x).get(y)[12:] + "), "
result = {'Artifact Locations': locationsString[:-2]}
print(locationsString[:-2])
return result

0 comments on commit 6dba28b

Please sign in to comment.