Exemple #1
0
        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)
Exemple #2
0
    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)
Exemple #3
0
    }
    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)
Exemple #4
0
           "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)
Exemple #5
0
    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)
Exemple #6
0
    }
    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)
Exemple #7
0
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))
Exemple #8
0
	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) 
Exemple #9
0
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())
Exemple #10
0
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())
Exemple #11
0
        '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)
Exemple #12
0
        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)
Exemple #13
0
           "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)
Exemple #14
0
    }
    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)
Exemple #15
0
    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)
Exemple #16
0
            "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)
Exemple #17
0
    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)
Exemple #18
0
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())
Exemple #19
0
        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)
Exemple #20
0
    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)
Exemple #21
0
			
	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) 
Exemple #22
0
	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)