def look(self): self.visible = True room = eng.getCurrentRoom() if 'butler' in room.items: return self.descriptions['awakeDesc'] else: return self.descriptions['desc']
def look(self): self.visible = True currRoom = eng.getCurrentRoom() mTrap = eng.getItemByName('mousetrap') if mTrap is not None: mTrap.visible = True return self.descriptions['desc']
def talk(self, about): if about is None: if self.properties['hasBeer']: martini = eng.getItemByName('martini') if eng.inInventory(martini): return "Margaret:\n\"Hello there. I'm Margaret. It's nice to meet you. Isn't this stuff so cool? They were about to run out of beer so I grabbed two glasses. I would offer you one, but it looks like you already have a martini.\"" else: return "Margaret:\n\"Hello there. I'm Margaret. It's nice to meet you. Isn't this stuff so cool? They were about to run out of beer so I grabbed two glasses. Take one if you want it.\"" else: return "Margaret:\n\"Wow, it must have taken them years to collect this stuff.\"" elif about.name == 'artifacts': if 'mummy\'s curse' in eng.getCurrentRoom().items: return "Margaret:\n\"I recognize this one. It's an amulet from ancient Egypt. It's said that any mortal who possesses it would be cursed. Haha, if you believe such a thing!" else: return "Margaret:\n\"So many interesting things here.\"" elif about.name == 'beer': if self.properties['hasBeer']: martini = eng.getItemByName('martini') if eng.inInventory(martini): return "Margaret:\n\"They were almost out at the bar, so I took the last two. I would offer you one, but it looks like you already have a martini.\"" else: beer = eng.getItemByName('beer') eng.addToInventory(beer) self.properties['hasBeer'] = False return "Mararet:\n\"Here, take one! I'm happy to share.\"" else: return "Margaret:\n\"That's the last beer that they had. Enjoy!\"" else: return "She pretends not to hear you. Evidentally she doesn't want to talk about that."
def investigate(self): #if self.properties['looked']: currRoom = eng.getCurrentRoom() bonekey = eng.getItemByName('bone key') if bonekey is not None: bonekey.visible = True return self.descriptions['searched']
def take(self): #First time user tries to take the took it is in a closed tank with hungry sharks currRoom = eng.getCurrentRoom() sharks = eng.getItemByName('sharks') tank = eng.getItemByName('sharktank') if self.properties['had'] == False and tank.properties[ 'opened'] and sharks.properties['hungry'] == False: self.properties['have'] = True self.properties['had'] = True eng.addToInventory( self) # adds to inventory and removes from current room character = eng.getItemByName('self') character.properties['placesOpened'] += 1 if character.properties['placesOpened'] == 3: tank.properties['hasPlans'] = True currRoom.items.append('secret plans') currRoom.items.remove('emerald') return self.descriptions['secretPlans'] else: emerald = eng.getItemByName('emerald') emerald.visible = True return self.descriptions['underTooth'] #Must have had the tooth once elif self.properties['have'] == False and self.properties['had']: eng.addToInventory( self) # adds to inventory and removes from current room return self.descriptions['takeTooth'] elif self.properties['have']: return self.descriptions['alreadyHave'] else: return self.descriptions['cant']
def look(self): self.visible = True currRoom = eng.getCurrentRoom() rDuck = eng.getItemByName('rubber duck') if rDuck is not None: rDuck.visible = True return self.descriptions['desc']
def go(self): office = eng.getRoomByName('Office') hall = eng.getRoomByName('Hallway') currRoom = eng.getCurrentRoom() if currRoom == office: return eng.goToRoom(hall) else: return eng.goToRoom(office)
def go(self): ballroom = eng.getRoomByName('Ballroom') bathroom = eng.getRoomByName('Bathroom') currRoom = eng.getCurrentRoom() if currRoom == ballroom: return eng.goToRoom(bathroom) else: return eng.goToRoom(ballroom)
def go(self): foyer = eng.getRoomByName('Foyer') frontPorch = eng.getRoomByName('Front Porch') currRoom = eng.getCurrentRoom() if currRoom == foyer: return eng.goToRoom(frontPorch) else: return eng.goToRoom(foyer)
def go(self): plateau = eng.getRoomByName("plateau") dungeon = eng.getRoomByName("dungeon") currentRoom = eng.getCurrentRoom() if currentRoom == plateau: return eng.goToRoom(dungeon) else: return eng.goToRoom(plateau)
def go(self): masterBed = eng.getRoomByName('Master Bedroom') masterBath = eng.getRoomByName('Master Bathroom') currRoom = eng.getCurrentRoom() if currRoom == masterBed: return eng.goToRoom(masterBath) else: return eng.goToRoom(masterBed)
def go(self): gallery = eng.getRoomByName('Portrait Gallery') billiardRoom = eng.getRoomByName('Billiard Room') currRoom = eng.getCurrentRoom() if currRoom == gallery: return eng.goToRoom(billiardRoom) else: return eng.goToRoom(gallery)
def go(self): conservatory = eng.getRoomByName('Conservatory') gardens = eng.getRoomByName('Gardens') currRoom = eng.getCurrentRoom() if currRoom == conservatory: return eng.goToRoom(gardens) else: return eng.goToRoom(conservatory)
def go(self): library = eng.getRoomByName('Library') study = eng.getRoomByName('Study') currRoom = eng.getCurrentRoom() if currRoom == library: return eng.goToRoom(study) else: return eng.goToRoom(library)
def go(self): ballroom = eng.getRoomByName('Ballroom') foyer = eng.getRoomByName('Foyer') currRoom = eng.getCurrentRoom() if currRoom == ballroom: return eng.goToRoom(foyer) else: return eng.goToRoom(ballroom)
def go(self): bar = eng.getRoomByName('Bar') gardens = eng.getRoomByName('Gardens') currRoom = eng.getCurrentRoom() if currRoom == bar: return eng.goToRoom(gardens) else: return eng.goToRoom(bar)
def go(self): library = eng.getRoomByName('Library') billiardRoom = eng.getRoomByName('Billiard Room') currRoom = eng.getCurrentRoom() if currRoom == library: return eng.goToRoom(billiardRoom) else: return eng.goToRoom(library)
def go(self): foyer = eng.getRoomByName('Foyer') gallery = eng.getRoomByName('Portrait Gallery') currRoom = eng.getCurrentRoom() if currRoom == foyer: return eng.goToRoom(gallery) else: return eng.goToRoom(foyer)
def go(self): bedroom = eng.getRoomByName('Second Bedroom') hall = eng.getRoomByName('Hallway') currRoom = eng.getCurrentRoom() if currRoom == bedroom: return eng.goToRoom(hall) else: return eng.goToRoom(bedroom)
def go(self): billiardRoom = eng.getRoomByName('Billiard Room') conservatory = eng.getRoomByName('Conservatory') currRoom = eng.getCurrentRoom() if currRoom == billiardRoom: return eng.goToRoom(conservatory) else: return eng.goToRoom(billiardRoom)
def use(self): if self.properties['lightsOff']: return "Better not turn the lights back on or they might come back to finish the game." else: self.properties['lightsOff'] = True room = eng.getCurrentRoom() room.items.remove('billiard players') return "You inconspicuously flip the light switch and the lights above the table turn off.\nWillie:\n\"Hmm, they must have blown a circuit. What do you say, should we call it a draw?\"\n\nJake:\n\"A draw!? You never stood a chance. Whatever. Let's go grab another drink\"\n\nBoth men exit. Time to take a closer look around."
def go(self): bar = eng.getRoomByName('Bar') gallery = eng.getRoomByName('Portrait Gallery') currRoom = eng.getCurrentRoom() if currRoom == bar: return eng.goToRoom(gallery) else: return eng.goToRoom(bar)
def go(self): foyer = eng.getRoomByName('Foyer') library = eng.getRoomByName('Library') currRoom = eng.getCurrentRoom() if currRoom == foyer: return eng.goToRoom(library) else: return eng.goToRoom(foyer)
def go(self): kitchen = eng.getRoomByName('Kitchen') ballroom = eng.getRoomByName('Ballroom') currRoom = eng.getCurrentRoom() if currRoom == kitchen: return eng.goToRoom(ballroom) else: return eng.goToRoom(kitchen)
def touch(self): currRoom = eng.getCurrentRoom() tank = eng.getItemByName('sharktank') if self.properties['hungry']: return self.descriptions['crazy'] elif tank.properties['opened'] == False: return tank.descriptions['closedDesc'] else: return self.descriptions['swim']
def look(self): self.visible = True currRoom = eng.getCurrentRoom() mouse = eng.getItemByName('mouse') mouse.visible = True if 'mouse' in currRoom.items: return self.descriptions['desc'] else: return self.descriptions['noMouse']
def look(self): if self.properties['opened'] == True: currRoom = eng.getCurrentRoom() if 'spare key' in currRoom.items: # means key has not been picked up/moved, so it's in the drawer return self.descriptions['keyDesc'] else: return self.descriptions['noKeyDesc'] else: return self.descriptions['closedDesc']
def _printContents(self): currRoom = eng.getCurrentRoom() if 'strop' in currRoom.items and 'toothpaste' in currRoom.items: return self.descriptions['stropAndToothpaste'] elif 'strop' in currRoom.items: return self.descriptions['onlyStrop'] elif 'toothpaste' in currRoom.items: return self.descriptions['onlyToothpaste'] else: return self.descriptions['noItems']
def take(self): if eng.inInventory(self): return "You already have some cake." else: eng.addToInventory(self) currRoom = eng.getCurrentRoom() if currRoom.name == 'Kitchen': if not 'cake' in currRoom.items: currRoom.items.append('cake') return self.descriptions['takeCake']
def open(self): currRoom = eng.getCurrentRoom() mouse = eng.getItemByName('mouse') if 'mouse' in currRoom.items: mouse.visible = True eng.addToInventory( mouse) # adds to inventory and removes from current room return self.descriptions['openMT'] else: return self.descriptions['openEmpty']