Пример #1
0
 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."
Пример #2
0
 def hit(self):
     if eng.inInventory(self):
         eng.removeFromInventory(self)
         eng.setScore(eng.getScore() + 5)
         return "You manage to break the amulet and free yourself from the curse"
     else:
         return "You don't have it. If I were you, I wouldn't even pick it up"
Пример #3
0
 def drop(self):
     if eng.inInventory(self):
         eng.dropItem(self)
         eng.setScore(eng.getScore() - 1000000)
         return "There was no way you were going to get that out of here anyway. You prop it against a wall."
     else:
         return "You aren't holding it"
Пример #4
0
 def drop(self):
     if eng.inInventory(self) == False:
         return self.descriptions['dropNoHold']
     else:
         eng.dropItem(self)
         self.properties['wearing'] = False
         return self.descriptions['dropPF']
Пример #5
0
	def drop(self):
		if eng.inInventory(self) == False:
			return self.descriptions['dropNoHold']
		else:
			eng.setScore(eng.getScore() - 100)
			eng.dropItem(self)
			return self.descriptions['drop']
Пример #6
0
	def take(self):
		if eng.inInventory(self):
			return self.descriptions['alreadyTakenGS']
		else:
			eng.setScore(eng.getScore() + 100)
			eng.addToInventory(self) # adds to inventory and removes from current room 
			return self.descriptions['takeGS']
Пример #7
0
 def take(self):
     if eng.inInventory(self):
         return "You already have it"
     else:
         eng.addToInventory(self)
         eng.setScore(eng.getScore() + 1000000)
         return "You take the painting. It's a true masterpiece and must be worth a fortune. Unfortunately, it's way too big to conceal. You should probably drop it before heading into the party."
Пример #8
0
 def _printShortDesc(self):
     purse = eng.getItemByName('purse')
     if eng.inInventory(purse):
         return self.descriptions['shortDesc']
     else:
         return self.descriptions['shortDesc'] + self.descriptions[
             'purseDesc']
Пример #9
0
 def take(self):
     if eng.inInventory(self):
         return self.descriptions['alreadyTakenBP']
     else:
         eng.addToInventory(
             self)  # adds to inventory and removes from current room
         return self.descriptions['takeBP']
Пример #10
0
 def drop(self):
     if eng.inInventory(self):
         eng.setScore(eng.getScore() - 100)
         eng.dropItem(self)
         return "You set the ruby down in a place that you'll remember"
     else:
         return "You don't have it"
Пример #11
0
 def take(self):
     if eng.inInventory(self):
         return "You already have it"
     else:
         eng.addToInventory(self)
         eng.setScore(eng.getScore() - 5)
         return "You put the amulet in your pocket without drawing too much attention to yourself. A chill goes down your spine. You should not have done that."
Пример #12
0
 def look(self):
     suit = eng.getItemByName('suit')
     gown = eng.getItemByName('gown')
     flower = eng.getItemByName('pink flower')
     if eng.inInventory(suit):
         description = "You look like a fine gentleman. "
         if not eng.inInventory(flower):
             description += "You would look even better with a boutonniere. Maybe there's a flower somewhere around here."
         return description
     elif eng.inInventory(gown):
         description = "You look like a fine lady. "
         if not eng.inInventory(flower):
             description += "You would look even better with an accessory. Maybe there's a flower somewhere around here."
         return description
     else:
         return "You check yourself out in a mirror. You look good dressed in all black. You look like you're ready for anything... except a party that is."
Пример #13
0
 def drop(self):
     if eng.inInventory(self) == False:
         return self.descriptions['dropNoHold']
     else:
         eng.removeFromInventory(self)
         eng.dropItem(self)
         return self.descriptions['dropBP']
Пример #14
0
 def take(self):
     if eng.inInventory(self):
         return "You already have it"
     else:
         eng.setScore(eng.getScore() + 100)
         eng.addToInventory(self)
         eng.getItemByName('billiard table').properties['hasRuby'] = False
         return "What a find! You slip it into your pocket. The boss will be happy to see this! Or maybe you'll just keep it to yourself. You don't get paid enough for this anyway."
Пример #15
0
 def take(self):
     if eng.inInventory(self):
         return "You already have it"
     else:
         eng.addToInventory(self)
         chest = eng.getItemByName("chest")
         chest.properties["hasKey"] = False
         return "You picked up the door key"
Пример #16
0
	def look(self):
		self.visible = True
		if eng.inInventory(self):
			return self.descriptions['descHolding']
		elif self.properties['dead']:
			return self.descriptions['descDead']
		else:
			return self.descriptions['descAlive']
Пример #17
0
 def take(self):
     eng.addToInventory(self)
     suit = eng.getItemByName('suit')
     score = eng.getScore()
     eng.setScore(score + 50)
     if eng.inInventory(suit):
         return self.descriptions['take'] + self.descriptions['pocketSuit']
     else:
         return self.descriptions['take'] + self.descriptions['purseGown']
Пример #18
0
 def take(self):
     if eng.inInventory(self):
         return "You already have it"
     else:
         eng.addToInventory(self)
         dungeon = eng.getRoomByName("dungeon")
         dungeon.items.remove(self.name)
         hole = eng.getItemByName("hole")
         hole.properties["hasKey"] = False
         return "You picked up the key. Maybe this is your way out"
Пример #19
0
	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']
Пример #20
0
 def use(self, other):
     if eng.inInventory(self):
         if other is None:
             return "Use it on what?"
         elif other.name == 'masterBedDoor':
             return other.open(self)
         else:
             return "That didn't work"
     else:
         return "You don't have it. Try taking it."
Пример #21
0
 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
Пример #22
0
	def take(self):
		if self.properties['bodyHidden']:
			return self.descriptions['takeHidden']
		if eng.inInventory(self):
			return self.descriptions['alreadyTakenButler']
		else:
			if self.properties['dead']:
				eng.addToInventory(self) # adds to inventory and removes from current room 
				return self.descriptions['takeButlerDead']
			else:
				return self.descriptions['takeButlerAlive']
Пример #23
0
 def go(self):
     foyer = eng.getRoomByName('Foyer')
     hall = eng.getRoomByName('Hallway')
     bt = eng.getItemByName("butler")
     if "butler" in hall.items:
         if bt.properties['dead']:
             return self.descriptions['butlerDead']
         else:
             return self.descriptions['butlerAlive']
     elif eng.inInventory(bt):
         return self.descriptions['butlerHeld']
     else:
         currRoom = eng.getCurrentRoom()
         if currRoom == foyer:
             return eng.goToRoom(hall)
         else:
             # Can't go downstairs holding the masterpiece from the hallway
             masterpiece = eng.getItemByName('masterpiece')
             if eng.inInventory(masterpiece):
                 return "Going downstairs to the party while holding this huge stolen painting isn't the best idea you've had. You should drop it."
             return eng.goToRoom(foyer)
Пример #24
0
 def sharpen(self, otherThing):
     if otherThing is None:
         strop = eng.getItemByName('strop')
         if eng.inInventory(strop):
             self.properties['sharp'] = True
             return self.descriptions['sharpenSuccessLO']
         return self.descriptions['sharpenFailLO']
     elif otherThing.name == 'strop':
         self.properties['sharp'] = True
         return self.descriptions['sharpenSuccessLO']
     else:
         return self.descriptions['sharpenWrongLO']
Пример #25
0
 def give(self, recipient):
     if eng.inInventory(self):
         if recipient is None:
             return "Give it to whom?"
         elif recipient.name == 'craftsman':
             eng.removeFromInventory(self)
             recipient.properties['hasBeer'] = True
             return recipient.talk(None)
         else:
             return "\"Thank you, but I don't want that.\""
     else:
         return "You don't have it, so you can't give it to anyone now can you?"
Пример #26
0
 def take(self):
     martini = eng.getItemByName('martini')
     if eng.inInventory(martini):
         return "Margaret:\n\"I would be happy to share one, but they're all out at the bar and it looks like you already have a martini.\""
     else:
         margaret = eng.getItemByName('margaret')
         if margaret.properties['hasBeer']:
             eng.addToInventory(self)
             margaret.properties['hasBeer'] = False
             return "Margaret:\n\"Here you go. Enjoy!\""
         else:
             return "You already took it."
Пример #27
0
 def use(self, ind=None):
     if not eng.inInventory(self):
         return "You don't have it"
     if ind == None:
         return "Use it on what?"
     door = eng.getItemByName("wooden door")
     chest = eng.getItemByName("chest")
     if ind == door:
         return "You try the silver key from the hole, but it doesn't fit"
     elif ind == chest:
         return chest.open(self)
     else:
         return "Thad didn't work"
Пример #28
0
 def open(self, otherThing):
     if self.properties['locked']:
         if otherThing is None:
             key = eng.getItemByName('spare key')
             if eng.inInventory(key):
                 return self._unlockDoor()
             else:
                 return self.descriptions['unlockFail']
         if otherThing.name == 'spare key':
             return self._unlockDoor()
         else:
             return self.descriptions['unlockFail']
     else:
         return self.descriptions['alreadyOpen']
Пример #29
0
	def drop(self):
		if eng.inInventory(self):
			currRoom = eng.getCurrentRoom()
			if currRoom.name == 'Kitchen':
				eng.removeFromInventory(self)
				return "You put the cake back in the refrigerator with the rest of it."
			elif 'cake' in currRoom.droppedItems:
				eng.removeFromInventory(self)
				return "You put the cake with the other cake. My goodness, that's a lot of cake."
			else:
				eng.dropItem(self)
				return "You set the cake down. "
		else:
			return "You're not holding any cake. "
Пример #30
0
    def talk(self):
        if self.properties['taskStarted'] == False:
            self.properties['taskStarted'] = True
            return self.descriptions['firstConversation']
        else:
            # check whether you've already given them food
            if self.properties['eating']:
                return self.descriptions['information']

            # if you have an item they want
            cake = eng.getItemByName('cake')
            if eng.inInventory(cake):
                return cake.give(self)
            else:
                return self.descriptions['noGiftConversation']