return description def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True description = self.descriptions['longDesc'] if 'old lady' in self.items: description += self.descriptions['bethal'] return description def enterRoom(self): description = "" if (self.visited == True): description = self._printShortDesc() else: self.visited = True description = self._printLongDesc() martini = eng.getItemByName('martini') description += "\n\n" + self.descriptions['drink'] eng.addToInventory(martini) return description # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() foyer = Foyer() eng.setupRoom(foyer)
def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True description = self.descriptions['longDesc'] if 'billiard players' in self.items: description += self.descriptions['players'] else: description += self.descriptions['noPlayers'] return description def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() billiardRoom = BilliardRoom() eng.setupRoom(billiardRoom)
} items = [ 'The Hobbit', 'Dracula', 'Great Expectations', 'Charles Winston', 'button', 'Nathaniel Winston', 'bookshelf' ] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() library = Library() eng.setupRoom(library)
"The only thing that makes it different from the other bedroom is a dresser in the corner " \ "and three children playing and talking next to the window. " \ "The only exit is back out to the hallway to the east."} doors = {'east': 'secondBedDoor'} items = ['mousetrap', 'mouse', 'dresser', 'children'] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() secondBedroom = SecondBedroom() eng.setupRoom(secondBedroom)
def _printShortDesc(self): description = self.descriptions['shortDesc'] if 'old lady' in self.items: description += self.descriptions['bethal'] return description def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True description = self.descriptions['longDesc'] if 'old lady' in self.items: description += self.descriptions['bethal'] return description def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() frontPorch = FrontPorch() eng.setupRoom(frontPorch)
} items = [ 'craftsman', 'billiardTableTopic', 'conservatory windows', 'highball glass', 'mahogany table' ] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() conservatory = Conservatory() eng.setupRoom(conservatory)
class dungeon: name = "dungeon" items = ["torch", "hole", "silver key", "dungeon walls"] doors = {"north": "wooden door", "east": "bridge"} visible = True longDescription = "You're in a dark dungeon and need to find a way out. It's a large room, awful smelling room. There's a lit torch on the north wall illuminating a wooden door" shortDescription = "The room you started in" lightDescription = "With torch in hand, you explore the room. There's a narrow bridge on the east side and a hole in the ground" def enterRoom(self): if self.visited: return self.shortDescription else: return self.longDescription def look(self): torch = eng.getItemByName("torch") if eng.inInventory(torch): hole = eng.getItemByName("hole") bridge = eng.getItemByName("bridge") hole.visible = True bridge.visible = True return self.lightDescription else: return self.longDescription dungeon = dungeon() eng.setupRoom(dungeon) print(eng.goToRoom(dungeon))
items = ['emerald', 'sharktank', 'sharks', 'megalodon tooth'] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() secretRoom = SecretRoom() eng.setupRoom(secretRoom)
import eng class endRoom: name = "endRoom" #this room doesn't have any doors so you can't get out def look(self): return "This is the end" def enterRoom(self): return "You're out! Congratulations" eng.setupRoom(endRoom())
import eng class plateau: name = "plateau" items = ["chest", "door key"] doors = {"west": "bridge"} longDescription = "You made your way across the bridge to a small plateau with no exits but the way you came. The only thing here is a chest. This isn't the way out. You better go back west across the bridge" shortDescriptoin = "You're back on the plateau with the chest. Only way back is the bridge to the west" def look(self): return self.longDescription def enterRoom(self): if self.visited: return self.shortDescriptoin else: return self.longDescription eng.setupRoom(plateau())
'south': 'barGalleryDoor' } items = ['Catholic Priest', 'bartender', 'counter', 'bone key'] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True gardens = eng.getRoomByName('Gardens') gardens.visible = True # Bar description talks about outside, so it should be labeled visible return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() bar = Bar() eng.setupRoom(bar)
return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True sayMe = self.descriptions['longDesc'] if 'female critic' in self.items: sayMe = sayMe + self.descriptions['criticFragmentB'] if 'male critic' in self.items: sayMe = sayMe + self.descriptions['criticFragmentA'] sayMe += self.descriptions['exits'] return sayMe def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() portraitGallery = PortraitGallery() eng.setupRoom(portraitGallery)
"The only exit seems to be the east door you just came in. "} doors = {'east': 'libraryStudyDoor'} items = [ 'longDesk', 'Bible', 'margaret', 'beer', 'artifacts', 'mummy\'s curse' ] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() study = Study() eng.setupRoom(study)
} items = [ 'rodin statue', 'dancing couple', 'sitting couple', 'CharlesWinston4', 'Yamazaki', 'business card' ] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] + self.descriptions['doorDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] + self.descriptions['doorDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() ballroom = Ballroom() eng.setupRoom(ballroom)
def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True description = self.descriptions['longDesc'] if 'butler' in self.items: description += self.descriptions['butlerLocation'] description += self.descriptions['doorLocations'] if 'masterpiece' in self.items: description += '\n' + self.descriptions['painting'] return description def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() hallway = Hallway() eng.setupRoom(hallway)
"It's not like the master bathroom is the most interesting room in the house. " \ "The only exit is back south to the master bedroom. ", 'longDesc': "You've stepped into the master bathroom. It's remarkably clean, compared " \ "to the disgusting state you leave your own bathroom in at home. There " \ "doesn't appear to be anything valuable in view, which I guess can be expected. " \ "There's a vanity sitting between the sink and the bathtub."} doors = {'south': 'masterBathDoor'} items = ['bathtub', 'sink', 'vanity', 'rubber duck', 'strop', 'toothpaste'] properties = {} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() masterBathroom = MasterBathroom() eng.setupRoom(masterBathroom)
def _printShortDesc(self): if self.properties['maidAsleep'] == True: return self.descriptions['shortDescA'] else: return self.descriptions['shortDescB'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True if self.properties['maidAsleep']: return self.descriptions['longDescA'] else: return self.descriptions['longDescB'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() guestBed = GuestBedroom() eng.setupRoom(guestBed)
import eng # Outside the conservatory. Get here only when you win the game class Outside: name = 'outside' visible = False doors = {'west': 'escape'} def enterRoom(self): return "" # never shown def look(self): return "CONGRATULATIONS! You completed your mission. Big Al will be quite pleased. Type \"quit\" to end the game" eng.setupRoom(Outside())
if eng.inInventory(purse): return self.descriptions['shortDesc'] else: return self.descriptions['shortDesc'] + self.descriptions[ 'purseDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True purse = eng.getItemByName('purse') purse.visible = True window = eng.getItemByName('bathroomWindow') window.visible = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() bathroom = Bathroom() eng.setupRoom(bathroom)
doors = {'north': 'officeDoor'} items = [ 'desk', 'letter opener', 'fountain pen', 'filing cabinet', 'top drawer', 'bottom drawer', 'blueprints', 'gold statue', 'drawers' ] properties = {'initialized': False} def _printShortDesc(self): return self.descriptions['shortDesc'] def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() office = Office() eng.setupRoom(office)
def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True desc = self.descriptions['longDesc'] smokersTask = eng.getItemByName('smokers') if smokersTask.properties['taskStarted']: desc += self.descriptions['smokersDesc'] return desc #self.descriptions['longDesc'] def enterRoom(self): fridge = eng.getItemByName('fridge') fridge.visible = True if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() kitchen = Kitchen() eng.setupRoom(kitchen)
def _printLongDesc(self): if self.properties['initialized'] == False: self.properties['initialized'] = True return self.descriptions['longDesc'] def enterRoom(self): smokers = eng.getItemByName('smokers') smokers.visible = True # Can see into bar and conservatory, so make sure they are labeled visible bar = eng.getRoomByName('Bar') bar.visible = True conservatory = eng.getRoomByName('Conservatory') conservatory.visible = True if (self.visited == True): return self._printShortDesc() else: self.visited = True return self._printLongDesc() # Per game requirements, look should reprint long description def look(self): return self._printLongDesc() gardens = Gardens() eng.setupRoom(gardens)