Пример #1
0
    def drop(self):
        if self.properties['have'] == False:
            return self.descriptions['dontHave']
        else:
            self.properties['have'] = False
            eng.removeFromInventory(self)
            eng.dropItem(self)
            return self.descriptions['droppedTuna']

    # give tuna to hungry leopard sharks
    def give(self, item):
        #check if item is leopard sharks
        if item is None:
            return "Give it to whom?"
        if item.name == 'sharks':
            eng.removeFromInventory(self)
            item.properties['hungry'] = False
            return self.descriptions['giveTuna']
        return self.descriptions['nothingToGive']

    def eat(self):
        if self.properties['triedEat'] == False:
            self.properties['triedEat'] = True
            return self.descriptions['eat']
        else:
            return self.descriptions['aBite']


tuna = Tuna()
eng.setupItem(tuna)
Пример #2
0
import eng


# Server in the foyer hands you a drink when you first enter, then seems to disappear
class DrinkServer:
    name = 'drink server'
    aliases = ['server']
    descriptions = {
        'talk':
        "You look around for the server who handed you a martini, but he's nowhere to be found.",
        'attack':
        "The martini tasted like garbage, so you decide to take matters into your own hands. Hellbent on revenge, you look for the server to give him a piece of your mind. Alas, he's nowhere to be found."
    }

    def look(self):
        return self.descriptions['talk']

    def talk(self):
        return self.descriptions['talk']

    def hit(self):
        return self.descriptions['attack']

    def kill(self):
        return self.descriptions['attack']


eng.setupItem(DrinkServer())
Пример #3
0
        return self.descriptions['touchMC']

    def talk(self, aboutMe):
        if aboutMe is None:
            gown = eng.getItemByName("gown")
            suit = eng.getItemByName("suit")
            flower = eng.getItemByName("pink flower")
            if flower.properties['wearing']:
                currRoom = eng.getCurrentRoom()
                currRoom.items.remove('female critic')
                return self.descriptions['talkNoneWithFlower']
            else:
                if suit.properties['wearing']:
                    return self.descriptions['talkNoneWithoutFlowerSuit']
                elif gown.properties['wearing']:
                    return self.descriptions['talkNoneWithoutFlowerGown']
        elif aboutMe is portraits:
            return self.descriptions['talkPortraits']
        elif aboutMe is landscape:
            return self.descriptions['talkLandscape']
        elif aboutMe is stillLife:
            return self.descriptions['talkStillLife']
        elif aboutMe is rodinStatue:
            return self.descriptions['talkMcGuffin']
        else:
            return self.descriptions['talkDefault']


femaleCritic = FemaleCritic()
eng.setupItem(femaleCritic)
Пример #4
0
    def touch(self):
        return "You feel a special connection to this piece of art, but touching it reminds you that it's just simple paint on a canvas."

    def eat(self):
        return "Well, that's one way to get it out of here, but it probably won't taste good"

    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() + 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 hit(self):
        return "That's not a good idea"

    def give(self):
        return "You better not try to give this to anyone since you clearly stole it."


eng.setupItem(Masterpiece())
Пример #5
0
    def twist(self):
        if self.properties['used']:
            return "You twist it again, but nothing happened."
        else:
            room = eng.getCurrentRoom()
            if 'billiard players' in room.items:
                return "You can't get up to it because the players are in the way"
            else:
                self.properties['used'] = True
                description = "With a great amount of force, you twist the lever and it opens a panel on the side of the pool table. "
                table = eng.getItemByName('billiard table')
                table.properties['open'] = True
                character = eng.getItemByName('self')
                character.properties['placesOpened'] += 1
                if character.properties['placesOpened'] == 3:
                    room.items.append('secret plans')
                    table.properties['hasPlans'] = True
                    description += "\n\nThere are some papers hidden inside!"
                else:
                    table.properties['hasRuby'] = True
                    ruby = eng.getItemByName('Ruby')
                    ruby.visible = True
                    description += "\n\nA giant ruby is inside!"
                return description

    def hit(self):
        return "You don't want to break the lever off just in case it's of some importance. There must be a secret to it..."


eng.setupItem(TableLever())
Пример #6
0
		self.visible = True
		return self.descriptions['desc']


	def open(self):
		if self.properties['open']:
			return self.descriptions['alreadyOpen']
		else:
			self.properties['open'] = True
			return self.descriptions['openSink']


	def touch(self):
		return self.descriptions['touchSink']


	def use(self):
		return self.descriptions['touchSink']


	def kill(self):
		return self.descriptions['hitSink']


	def hit(self):
		return self.descriptions['hitSink']
			

sink = Sink()
eng.setupItem(sink)
Пример #7
0
        else:
            self.properties['have'] = True
            eng.addToInventory(
                self)  # adds to inventory and removes from current room
            currRoom = eng.getCurrentRoom()
            button = eng.getItemByName('button')
            if button is not None:
                button.visible = True
                return self.descriptions['takeBook']

    # drop the book , if player is has it
    def drop(self):
        if self.properties['have'] == False:
            return self.descriptions['dontHave']
        else:
            self.properties['have'] = False
            eng.removeFromInventory(self)
            eng.dropItem(self)
            return self.descriptions['droppedBook']

    def read(self):
        if self.properties['read'] == False:
            self.properties['read'] = True
            return self.descriptions['read']
        else:
            return self.descriptions['readMore']


booknathaniel = Booknathaniel()
eng.setupItem(booknathaniel)
Пример #8
0
	def take(self):
		return self.descriptions['takeMaid']


	def use(self):
		return self.descriptions['touchMaid']


	def touch(self):
		return self.descriptions['touchMaid']


	def eat(self):
		return self.descriptions['eatMaid']


	def kill(self):
		return self.descriptions['killMaid']


	def hit(self):
		return self.descriptions['killMaid']


	def talk(self):
		return self.descriptions['talkMaid']
			

maid = Maid()
eng.setupItem(maid)
Пример #9
0
        return self.descriptions['desc']

    #def take(self):
    #	if eng.inInventory(self):
    #		return self.descriptions['alreadyTakenSI']
    #	else:
    #		eng.addToInventory(self) # adds to inventory and removes from current room
    #		return self.descriptions['takeSI']

    #def touch(self):
    #	return self.descriptions['touchSI']

    #def drop(self):
    #	if eng.inInventory(self) == False:
    #		return self.descriptions['dropNoHold']
    #	else:
    #		eng.removeFromInventory(self)
    #		eng.dropItem(self)
    #		return self.descriptions['drop']

    #def eat(self, otherThing):
    #	if otherThing is None:
    #		return self.descriptions['eatFailSI']
    #	else:
    #		self.sharp = True
    #		return self.descriptions['eatSuccessSI']


rodinStatue = RodinStatue()
eng.setupItem(rodinStatue)
Пример #10
0
    properties = {}

    def look(self):
        self.visible = True
        return self.descriptions['desc']

    def hit(self):
        return self.descriptions['hitRA']

    def give(self):
        return self.descriptions['giveRA']

    def take(self):
        return self.descriptions['takeRA']

    def kill(self):
        return self.descriptions['killRA']

    def talk(self):
        return self.descriptions['talkRA']

    def touch(self):
        return self.descriptions['touchRA']

    def eat(self):
        return self.descriptions['eatRA']


dancingCouple = DancingCouple()
eng.setupItem(dancingCouple)
Пример #11
0
import eng


class BathroomWindow:
    name = 'bathroomWindow'
    visible = False
    aliases = ['window']
    descriptions = {'desc': "There's a small window on the outside wall of the bathroom. Could this be an escape route?",
        'noExit': "You go to climb through the window, but notice that you're in full view of the front porch once you open it. " \
            "You definitely can't get out this way without making a scene."}
    properties = {}

    def go(self):
        return self.descriptions['noExit']

    def look(self):
        return self.descriptions['desc']


bathroomWindow = BathroomWindow()
eng.setupItem(bathroomWindow)
Пример #12
0
            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 give(self, recipient):
        if eng.inInventory(self):
            return "You try to give away the amulet, but an unseen force prevents you from taking it out of your pocket."
        else:
            return "You don't have it. If I were you, I wouldn't even pick it up"

    def drop(self):
        if eng.inInventory(self):
            return "An unseen force prevents you from taking out of your pocket. You're cursed."
        else:
            return "You don't have it. If I were you, I wouldn't even pick it up"

    def eat(self):
        if eng.inInventory(self):
            return "You're only going to make things worse."
        else:
            return "You don't have it. If I were you, I wouldn't even pick it up"

    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"

eng.setupItem(Amulet())
Пример #13
0
        if self.visible == True:
            if self.properties['have'] == True:
                return self.descriptions['alreadyHave']
            else:
                self.properties['have'] = True
                currRoom = eng.getCurrentRoom()
                bonekey = eng.getItemByName('bone key')
                if bonekey is not None:
                    eng.addToInventory(self)
                    return self.descriptions['takeKey']

    # drop the bone key, if player is has it
    def drop(self):
        if self.properties['have'] == False:
            return self.descriptions['dontHave']
        else:
            self.properties['have'] = False
            eng.removeFromInventory(self)
            eng.dropItem(self)
            return self.descriptions['droppedKey']

    def use(self, item):
        if item is None:
            return "Use it on what?"
        if item.name == 'librarySecretRoomDoor':
            return item.open(self)


bonekey = BoneKey()
eng.setupItem(bonekey)
Пример #14
0
            if 'blueprints' in currRoom.items:
                return self.descriptions['closedDesc'] + self.descriptions[
                    'fullDesc']
            else:
                return self.descriptions['closedDesc'] + self.descriptions[
                    'emptyDesc']
        else:
            return self.descriptions['closedDesc']

    def open(self):
        if self.properties['opened']:
            return self.descriptions['alreadyOpened']
        else:
            blueprints = eng.getItemByName('blueprints')
            if blueprints is not None:
                blueprints.visible = True
            return self.descriptions['openMe']

    def take(self):
        return self.descriptions['takeOnMe']

    def touch(self):
        return self.descriptions['touchMe']

    def eat(self):
        return self.descriptions['eatMe']


bottomDrawer = BottomDrawer()
eng.setupItem(bottomDrawer)
Пример #15
0
	properties = {'hungry': True}
	
	
	def look(self):
		if self.properties['hungry']:
			return self.descriptions['desc']
		else:
			return self.descriptions['docileDesc']

	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 hit(self):
		return self.touch()

	def kill(self):
		return self.touch()

	def take(self):
		return self.descriptions['takeSharks']

sharks = Sharks()
eng.setupItem(sharks)
Пример #16
0
import eng


class LightSwitch:
    name = 'light switch'
    aliases = ['switch', 'lightswitch']
    properties = {'lightsOff': False}

    def look(self):
        return "A light switch is concealed by the plants."

    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 hit(self):
        return self.use()

    def touch(self):
        return "You gently caress the light switch behind the plants as your favorite Metallica song plays in your head. \"Hit the lights!\""


eng.setupItem(LightSwitch())
Пример #17
0
import eng


class HighballGlass:
    name = 'highball glass'
    aliases = ['glass']

    def look(self, other):
        return "A full drink in a highball glass sits on the table. The ice has melted and it doesn't look like it's been touched."

    def take(self, other):
        return "You reach for the glass.\n\nHank:\n\"Oh, that's mine but I guess you can have it. Wasn't gonna drink it anyways. You know if anyone around here has any beer? That would really hit the spot\"\n\n You leave the glass on the table. You don't need to be taking other people's drinks."

    def eat(self, other):
        return self.take(None)


eng.setupItem(HighballGlass())
Пример #18
0
import eng


class torch:
    name = "torch"
    aliases = ["lit torch"]

    def look(self):
        return "A convenient, but small torch"

    def take(self):
        if eng.inInventory(self):
            return "You already have it"
        else:
            eng.addToInventory(self)
            return "You take the torch off the wall. Your visibility has improved"

    def use(self):
        if eng.inInventory(self):
            room = eng.getCurrentRoom()
            return room.look()
        else:
            return "You can't use it while it's still on the wall"


eng.setupItem(torch())
Пример #19
0
            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 hit(self):
        return "Didn't your mother ever teach you not to hit a woman?"

    def kill(self):
        return "And what purpose would that serve?"

    def touch(self):
        return "You reach out and touch her sholder.\n\nMargaret:\n\"Uh, did you need something?\""


eng.setupItem(Margaret())
Пример #20
0
        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']
        elif self.properties['conversation']:
            self.properties['suspicious'] = True
            return self.descriptions['converse']
        else:
            self.properties['conversation'] = True
            return self.descriptions['intro']

    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 listen(self):
        return self.descriptions['sharks']


charleswin = CharlesWinston4()
eng.setupItem(charleswin)
Пример #21
0
        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."

    def eat(self):
        return "Something tells you that you have a better use for it"

    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?"


eng.setupItem(Beer())
Пример #22
0
        "Not sure if you've heard this from anyone else, but it's rumored that there's a secret room somewhere in the house. I bet this guy has some really valuable stuff in there! ",
        'noGiftConversation':
        "I see you're back without any cake for us. Why don't you just bring us some cake and then we can talk? ",
        'alreadyWearing': "You're already wearing the suit!"
    }
    properties = {'eating': False, 'taskStarted': False}

    def look(self):
        self.visible = True
        return self.descriptions['desc']

    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']


smokers = Smokers()
eng.setupItem(smokers)
Пример #23
0
import eng


# Putting this in the conservatory so you can talk about it
class BilliardTableTopic:
    name = 'billiardTableTopic'
    aliases = [
        'billiard table', 'pool table', 'billiards table', 'lever',
        'table lever', 'billiard lever'
    ]

    def look(self):
        return "You mean the billiard table in the other room? I wonder if this guy knows anything about it."


eng.setupItem(BilliardTableTopic())
Пример #24
0
class Counter:
    name = 'counter'
    #type = 'Item'
    visible = True
    aliases = ['marble counter']
    descriptions = {
        'desc':
        "Bar counter stretches most of the length of the room. The counter top is of fine marble. There are taps with five selections of craft beer. Maybe I should investigate the bar counter.",
        'searched':
        "Searching under the marble counter top you feel something. Feels like a bone, or maybe a key. Or both!? "
    }
    properties = {'looked': False}

    def look(self):
        self.properties['looked'] = True
        return self.descriptions['desc']

    #search bar counter to find bone key
    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']


barcounter = Counter()
eng.setupItem(barcounter)
Пример #25
0
			return self.descriptions['alreadyHave']
		
		
	# drop the Bible, if player is has it 
	def drop(self):
		if self.properties['have'] == False:
			return self.descriptions['dontHave']
		else:
			self.properties['have'] = False
			eng.removeFromInventory(self)
			eng.dropItem(self)
			#reduce score		
			score = eng.getScore()
			eng.setScore(score - 30)
			return self.descriptions['droppedBible']


	def open(self):
		return self.read()


	def read(self):
		if self.properties['read'] == False:
			self.properties['read'] = True
			return self.descriptions['read']
		else:
			return self.descriptions['readMore']
		
bible = Bible()
eng.setupItem(bible)
Пример #26
0
    def close(self):
        if self.properties['broken']:
            return "You already broke the window. There's no putting it back together."
        else:
            if self.properties['opened']:
                self.properties['opened'] = False
                escape = eng.getItemByName('escape')
                escape.visible = False
                return "You close the windows. They were letting in too much fresh air anyway."
            else:
                return "The windows are already closed."

    def hit(self):
        if self.properties['broken']:
            return "You already broke a window. "
        else:
            self.properties['broken'] = True
            escape = eng.getItemByName('escape')
            escape.visible = True
            return "You smash one of the windows. Shards of glass scatter across the floor."

    def go(self):
        if self.properties['broken'] or self.properties['opened']:
            escape = eng.getItemByName('escape')
            return escape.go()
        else:
            return "You can't go though a closed window."


eng.setupItem(ConservatoryWindows())
Пример #27
0
    properties = {'initialized': False}
    descriptions = {
        'initial':
        "Willie:\n\"You just got lucky on the break. There's no way you can beat me again. What do you say - double or nothing?\"\n\nJake:\n\"Why can't you admit defeat? You're just embarrasing yourself. I'll beat you again if that's what you want. You can even break this time.\"",
        'other':
        "They mumble to themselves as they take turns scuffing up the table. Neither of them are any good."
    }

    def look(self):
        if self.properties['initialized']:
            return self.descriptions['other']
        else:
            self.properties['initialized'] = True
            return self.descriptions['initial']

    def talk(self):
        conversation = self.look()
        return conversation + "\n\nThey're focused on their game and probably don't want to talk."

    def touch(self):
        return "You awkwardly touch one of the players as he lines up a shot. He didn't seem to notice, but there doesn't seem to be anything valuable in his pockets."

    def hit(self):
        return "\"Hey! Can't you see we're in the middle of something? I'm not in the mood for a fight.\""

    def kill(self):
        return self.hit()


eng.setupItem(BilliardPlayers())
Пример #28
0
    def look(self):
        self.visible = True
        return self.descriptions['desc']

    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']

    def touch(self):
        return self.descriptions['touchBP']

    def drop(self):
        if eng.inInventory(self) == False:
            return self.descriptions['dropNoHold']
        else:
            eng.removeFromInventory(self)
            eng.dropItem(self)
            return self.descriptions['dropBP']

    def eat(self, otherThing):
        return self.descriptions['eatBP']


blueprints = Blueprints()
eng.setupItem(blueprints)
Пример #29
0
import eng


class DecorativePlants:
    name = 'decorative plants'
    aliases = ['artificial plants', 'plant', 'plants', 'potted plants']

    def look(self):
        eng.getItemByName('light switch').visible = True
        return "A few artificial potted plants are lined up along the south wall. There's a light switch hidden behind them. "

    def eat(self):
        return "You break off a leaf and eat it. As you swallow, you come to terms with the fact that you just ate a plastic leaf from a clearly artificial plant. If you're that hungry, why don't you see if they have anything in the refrigerator. "

    def take(self):
        eng.getItemByName('light switch').visible = True
        return "You bend over and try to lift one of the potted plants. You can barely get it off the ground. However, you notice a light switch hidden behind it."


eng.setupItem(DecorativePlants())
Пример #30
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."

    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 eat(self):
        if eng.inInventory(self):
            return "Down the hatch! You try swallowing it, but it's too big"
        else:
            return "You don't have it"

    def give(self, recipient):
        if eng.inInventory(self):
            return "Are you crazy? You should keep that for yourself"
        else:
            return "You don't have it"

eng.setupItem(Ruby())