|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- class MetroidState:
- def __init__(self):
- self.itemsCollected = {
- "Maru Mari": False,
- "Bombs": False,
- "Long Beam": False,
- "Ice Beam": False,
- "Wave Beam": False,
- "High Jump Boots": False,
- "Varia": False,
- "Screw Attack": False
- }
- self.samusHas = {
- "Maru Mari": False,
- "Bombs": False,
- "Long Beam": False,
- "Ice Beam": False,
- "Wave Beam": False,
- "High Jump Boots": False,
- "Varia": False,
- "Screw Attack": False
- }
- self.missileTanks = {
- 1: False,
- 2: False,
- 3: False,
- 4: False,
- 5: False,
- 6: False,
- 7: False,
- 8: False,
- 9: False,
- 10: False,
- 11: False,
- 12: False,
- 13: False,
- 14: False,
- 15: False,
- 16: False,
- 17: False,
- 18: False,
- 19: False,
- 20: False,
- 21: False
- }
- self.energyTanks = {
- 1: False,
- 2: False,
- 3: False,
- 4: False,
- 5: False,
- 6: False,
- 7: False,
- 8: False
- }
- self.zebetitesDestroyed {
- 1: False,
- 2: False,
- 3: False,
- 4: False,
- 5: False
- }
- self.doors {
- "Brinstar": {
- 1: False,
- 2: False,
- 3: False,
- 4: False,
- 5: False
- }, "Norfair": {
- 1: False,
- 2: False,
- 3: False,
- 4: False
- }, "Kraid": {
- 1: False,
- 2: False,
- 3: False,
- 4: False,
- 5: False
- }, "Ridley": {
- 1: False,
- 2: False
- }, "Tourian" {
- 1: False,
- 2: False,
- 3: False
- }
- }
- self.kraidKilled = False
- self.ridleyKilled = False
- self.motherBrainKilled = False
- self.kraidStatue = False
- self.ridleyStatue = False
- self.swimsuit = False
- self.missileCount = 0
- self.gameAge = 0
- self.locations = ["Brinstar", "Norfair", "Kraid's Lair", "Ridley's Lair", "Tourian"]
- self.startLocation = 0
-
- def toggleItem(itm):
- if itm in self.itemsCollected.keys():
- self.itemsCollected[itm] = not self.itemsCollected[itm]
- self.samusHas[itm] = not self.samusHas[itm]
- else:
- print("Couldn't find item: {}".format(str(itm)))
-
- def toggleMissileTank(num):
- try:
- num = int(num)
- except:
- print("{} is not a number".format(num))
- return
- if num in self.missileTanks.keys():
- self.missileTanks[num] = not self.missileTanks[num]
- else:
- print("Couldn't find missile tank: {}".format(num))
-
- def toggleEnergyTank(num):
- try:
- num = int(num)
- except:
- print("{} is not a number".format(num))
- return
- if num in self.energyTanks.keys():
- self.energyTanks[num] = not self.energyTanks[num]
- else:
- print("Couldn't find energy tank: {}".format(num))
-
- def toggleZebetite(num):
- try:
- num = int(num)
- except:
- print("{} is not a number".format(num))
- return
- if num in self.zebetitesDestroyed.keys():
- self.zebetitesDestroyed[num] = not self.zebetitesDestroyed[num]
- else:
- print("Couldn't find Zebetite: {}".format(num))
-
- def toggleKraid():
- self.kraidKilled = not self.kraidKilled
- self.kraidStatue = self.kraidKilled
-
- def toggleKraidStatue():
- self.kraidStatue = not self.kraidStatue
- if self.kraidKilled and not self.kraidStatue:
- print("WARNING: Kraid has been killed but his statue has not been raised.")
-
- def toggleRidley():
- self.ridleyKilled = not self.ridleyKilled
- self.ridleyStatue = self.ridleyKilled
-
- def toggleRidleyStatue():
- self.ridleyStatue = not self.ridleyStatue
- if self.ridleyKilled and not self.ridleyStatue:
- print("WARNING: Ridley has been killed but his statue has not been raised.")
-
- def toggleMotherBrain():
- self.motherBrainKilled = not self.motherBrainKilled
-
- def toggleDoor(area, door) {
- try:
- area = str(area)
- door = int(door)
- except:
- print("Area must be string, door must be a positive integer")
- return
- if area in self.doors.keys() and int(door) in self.doors[area].keys():
- self.doors[area][door] = not self.doors[area][door]
- else:
- print("Couldn't find door {} in area {}".format(door, area))
- }
-
- def toggleSwimsuit():
- self.swimsuit = not self.swimsuit
-
- def newLocation(loc):
- try:
- loc = str(loc)
- except:
- print("Location must be a string")
- return
- if loc in self.locations:
- self.startLocation = self.locations.index(loc)
- else:
- print("Couldn't find location: {}".format(loc))
-
- def main():
- pass
-
- if __name__ == "__main__":
- main()
|