Bladeren bron

Begin to add actual logic

master
Noëlle Anthony 5 jaren geleden
bovenliggende
commit
864d169dba
1 gewijzigde bestanden met toevoegingen van 24 en 13 verwijderingen
  1. 24
    13
      metroidgen.py

+ 24
- 13
metroidgen.py Bestand weergeven

self.locations = ["Brinstar", "Norfair", "Kraid's Lair", "Ridley's Lair", "Tourian"] self.locations = ["Brinstar", "Norfair", "Kraid's Lair", "Ridley's Lair", "Tourian"]
self.startLocation = 0 self.startLocation = 0


def toggleItem(itm):
def toggleItem(self, itm):
if itm in self.itemsCollected.keys(): if itm in self.itemsCollected.keys():
self.itemsCollected[itm] = not self.itemsCollected[itm] self.itemsCollected[itm] = not self.itemsCollected[itm]
self.samusHas[itm] = not self.samusHas[itm] self.samusHas[itm] = not self.samusHas[itm]
else: else:
print("Couldn't find item: {}".format(str(itm))) print("Couldn't find item: {}".format(str(itm)))
def toggleMissileTank(num):
def toggleMissileTank(self, num):
try: try:
num = int(num) num = int(num)
except: except:
else: else:
print("Couldn't find missile tank: {}".format(num)) print("Couldn't find missile tank: {}".format(num))
def toggleEnergyTank(num):
def toggleEnergyTank(self, num):
try: try:
num = int(num) num = int(num)
except: except:
else: else:
print("Couldn't find energy tank: {}".format(num)) print("Couldn't find energy tank: {}".format(num))
def toggleZebetite(num):
def toggleZebetite(self, num):
try: try:
num = int(num) num = int(num)
except: except:
else: else:
print("Couldn't find Zebetite: {}".format(num)) print("Couldn't find Zebetite: {}".format(num))


def toggleKraid():
def toggleKraid(self):
self.kraidKilled = not self.kraidKilled self.kraidKilled = not self.kraidKilled
self.kraidStatue = self.kraidKilled self.kraidStatue = self.kraidKilled


def toggleKraidStatue():
def toggleKraidStatue(self):
self.kraidStatue = not self.kraidStatue self.kraidStatue = not self.kraidStatue
if self.kraidKilled and not self.kraidStatue: if self.kraidKilled and not self.kraidStatue:
print("WARNING: Kraid has been killed but his statue has not been raised.") print("WARNING: Kraid has been killed but his statue has not been raised.")


def toggleRidley():
def toggleRidley(self):
self.ridleyKilled = not self.ridleyKilled self.ridleyKilled = not self.ridleyKilled
self.ridleyStatue = self.ridleyKilled self.ridleyStatue = self.ridleyKilled


def toggleRidleyStatue():
def toggleRidleyStatue(self):
self.ridleyStatue = not self.ridleyStatue self.ridleyStatue = not self.ridleyStatue
if self.ridleyKilled and not self.ridleyStatue: if self.ridleyKilled and not self.ridleyStatue:
print("WARNING: Ridley has been killed but his statue has not been raised.") print("WARNING: Ridley has been killed but his statue has not been raised.")
def toggleMotherBrain():
def toggleMotherBrain(self):
self.motherBrainKilled = not self.motherBrainKilled self.motherBrainKilled = not self.motherBrainKilled


def toggleDoor(area, door) {
def toggleDoor(self, area, door) {
try: try:
area = str(area) area = str(area)
door = int(door) door = int(door)
print("Couldn't find door {} in area {}".format(door, area)) print("Couldn't find door {} in area {}".format(door, area))
} }


def toggleSwimsuit():
def toggleSwimsuit(self):
self.swimsuit = not self.swimsuit self.swimsuit = not self.swimsuit


def newLocation(loc):
def newLocation(self, loc):
try: try:
loc = str(loc) loc = str(loc)
except: except:
else: else:
print("Couldn't find location: {}".format(loc)) print("Couldn't find location: {}".format(loc))


def uncollectedItems(self):
o = []
for k,v in self.itemsCollected.items():
if v == True:
o.append(k)
return ", ".join(o)

def toString(self):
ic = "Items Collected: {}".format(self.uncollectedItems())
def main(): def main():
pass
gs = MetroidState()



if __name__ == "__main__": if __name__ == "__main__":
main() main()

Laden…
Annuleren
Opslaan