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"
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."
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"
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']
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"
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."
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']
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."
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']
def touch(self): if self.properties['suspicious']: masterBedroom = eng.getRoomByName('Master Bedroom') score = eng.getScore() eng.setScore(score - 10) eng.goToRoom(masterBedroom) # Caught start over at Master Bedroom return self.descriptions['suspiciousTalk'] else: self.properties['suspicious'] = True return self.descriptions['shock']
def drop(self): if self.properties['have'] == False: return self.descriptions['dontHave'] else: self.properties['have'] = False eng.removeFromInventory(self) eng.dropItem(self) score = eng.getScore() eng.setScore(score - 100) return self.descriptions['droppedJewel']
def take(self): if self.visible: if self.properties['have'] == False: eng.addToInventory(self) score = eng.getScore() eng.setScore(score + 100) self.properties['have'] = True return self.descriptions['takeJewel'] else: return self.descriptions['alreadyHave'] else: return self.descriptions['huh']
def take(self): if self.properties['read'] == False: return self.descriptions['warning'] if self.properties['read'] == True and self.properties['have'] == False: self.properties['have'] = True eng.addToInventory(self) # adds to inventory and removes from current room #increase score score = eng.getScore() eng.setScore(score + 30) return self.descriptions['takeBible'] else: return self.descriptions['alreadyHave']
def give(self, item): if item is None: return "Give it to whom?" elif item.name == 'smokers': eng.removeFromInventory(self) item.properties['eating'] = True cigars = eng.getItemByName('cigars') cigars.visible = True eng.addToInventory(cigars) score = eng.getScore() eng.setScore(score + 50) return self.descriptions['giveCake'] return self.descriptions['wrongPerson']
def take(self): if eng.inInventory(self): return self.descriptions['alreadyTakenSP'] else: billiardTable = eng.getItemByName('billiard table') billiardTable.properties['hasPlans'] = False tank = eng.getItemByName('sharktank') tank.properties['hasPlans'] = False eng.addToInventory(self) # adds to inventory and removes from current room eng.setScore(eng.getScore() + 120) foyer = eng.getRoomByName('Foyer') porch = eng.getRoomByName('Front Porch') foyer.items.remove('old lady') porch.items.append('old lady') return self.descriptions['desc'] + self.descriptions['takeSP']
def drop(self): butler = eng.getItemByName("butler") if eng.inInventory(self) == False: return self.descriptions['dropNoHold'] elif butler.properties['dead'] == True: eng.removeFromInventory(self) return self.descriptions['dropButlerDead'] else: currRoom = eng.getCurrentRoom() if currRoom.name == "Guest Bedroom": hlwy = eng.getRoomByName("Hallway") hlwy.items.remove('butler') eng.dropItem(butler) butler.properties['withMaid'] = True currRoom.properties['maidAsleep'] = False eng.removeFromInventory(self) score = eng.getScore() eng.setScore(score + 50) return self.descriptions['dropYes'] else: return self.descriptions['dropNo']
def drop(self): if eng.inInventory(self) == False: return self.descriptions['dropNoHold'] else: here = eng.getCurrentRoom() if here.name == 'Guest Bedroom': score = eng.getScore() eng.setScore(score + 20) eng.removeFromInventory(self) eng.dropItem(self) self.properties['bodyHidden'] = True return self.descriptions['dropGuest'] elif here.name == 'Office': score = eng.getScore() eng.setScore(score + 40) eng.removeFromInventory(self) eng.dropItem(self) self.properties['bodyHidden'] = True return self.descriptions['dropOffice'] elif here.name == 'Second Bedroom': return self.descriptions['dropSecond'] elif here.name == 'Master Bedroom': score = eng.getScore() eng.setScore(score + 30) eng.removeFromInventory(self) eng.dropItem(self) self.properties['bodyHidden'] = True return self.descriptions['dropMaster'] elif here.name == 'Master Bathroom': score = eng.getScore() eng.setScore(score + 10) eng.removeFromInventory(self) eng.dropItem(self) self.properties['bodyHidden'] = True return self.descriptions['dropBathroom'] elif here.name == 'Hallway': eng.removeFromInventory(self) eng.dropItem(self) return self.descriptions['dropHallway'] else: # default behavior; this should never happen normally eng.removeFromInventory(self) eng.dropItem(self) return self.descriptions['dropButler']