Example #1
0
def enter(the_player):

    the_player.location = 'Longer street'
    the_player.directions = ['Another street', 'Row of houses']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        print "You're back at %s." % the_player.location
        print "You still hear the dog barking."
    else:
        the_player.visited.append(the_player.location)

        print "Just another street."
        print "There is a street with row of houses ahead."
        print "On your right there's a patch of flowers"
        print "that isn't on other lawns."
        print "You hear barking from afar."

    while True:
        action = prompt.standard(the_player)

        if action == "another street":
            return 'Suburb 1'
        elif 'row' in action or 'houses' in action:
            return 'Suburb 5'
        elif action == "patch of flowers" or action == "flower":
            print "You smell the flowers. They smell nice."
            print "You look inside the house where the flowers"
            print "are but there's nothing special about it."
        else:
            custom_error.errortype(3)
Example #2
0
def enter(the_player):

    the_player.location = 'Another street'
    the_player.directions = ['Suburbs', 'Longer street']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        print "You're back at %s." % the_player.location
    else:
        the_player.visited.append(the_player.location)

        print "Just another street with rows of houses."
        print "Only difference is a slightly more"
        print "red mailbox next to one of the houses."
        print "There is a longer street up ahead."

    while True:
        action = prompt.standard(the_player)

        if action == "suburbs":
            return 'Suburbs'
        elif action == "longer street":
            return 'Suburb 3'
        elif action == "red mailbox" or action == "mailbox":
            print "You inspect the house but nothing of"
            print "interest is inside."
        else:
            custom_error.errortype(3)
Example #3
0
def enter(the_player):

    the_player.location = 'A very long street'
    the_player.directions = ['Suburbs', 'Street with small houses']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        print "You're back at %s." % the_player.location
    else:
        the_player.visited.append(the_player.location)

        print "Nothing special about this street"
        print "except that it's really long."
        print "When you get to the end you"
        print "get a familiar sight in front of you."

    while True:
        action = prompt.standard(the_player)

        if action == "suburbs":
            return 'Suburbs'
        elif action == "street with small houses" or 'small houses' in action:
            return 'Street with small houses'
        else:
            custom_error.errortype(3)
Example #4
0
def enter(the_player):

    the_player.location = 'Street with large mansion'

    if 'Wanda' in the_player.visited:
        the_player.directions = ['Suburb Junction', 'Wanda\'s house']
    else:
        the_player.directions = ['Suburb Junction', 'Mansion']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        print "You're back at %s." % the_player.location
    else:
        the_player.visited.append(the_player.location)

        print "Dog barking gets louder and you can"
        print "tell the sound is coming from a large"
        print "house at the end of the street."

    while True:
        action = prompt.standard(the_player)

        if action == "suburb junction" or action == "junction":
            return 'Suburb Junction'
        elif 'house' in action or 'mansion' in action:
            return 'Wandas House'
        else:
            custom_error.errortype(3)
Example #5
0
def enter(the_player):

	the_player.location = 'Street with large mansion'

	if 'Wanda' in the_player.visited:
		the_player.directions = ['Suburb Junction','Wanda\'s house']
	else:
		the_player.directions = ['Suburb Junction','Mansion']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
	else:
		the_player.visited.append(the_player.location)

		print "Dog barking gets louder and you can"
		print "tell the sound is coming from a large"
		print "house at the end of the street."

	while True:
		action = prompt.standard(the_player)

		if action == "suburb junction" or action == "junction":
			return 'Suburb Junction'
		elif 'house' in action or 'mansion' in action:
			return 'Wandas House'
		else:
			custom_error.errortype(3)
Example #6
0
def enter(the_player):

	the_player.location = 'Warehouse'
	the_player.directions = ['Motor Shop']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:
		print "You're back at the warehouse of B&D Motor shop."

	else:
		the_player.visited.append(the_player.location)

		print "The door says 'Warehouse' and you"
		print "carefully approach it and open it."
		print "Inside is a large area that was intended"
		print "as a storage facility."
		print "You see multiple columns of shelves"
		print "with letters and numbers on them."

	while True:
		
		print "\nYou stand in front of the shelves, behind you"
		print "is a door leading to %s." % the_player.directions[0]
		
		action = prompt.standard(the_player)

		if action == "shelf" or action == "shelves":
			shelf(the_player)
		elif action == "motor" or action == "motor shop":
			return 'Motor Shop'
		else:
			custom_error.errortype(3)
Example #7
0
def enter(the_player):

	the_player.location = 'Shorter street'
	the_player.directions = ['Regular street','Street with a tree','House with pirate flag']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
		print "There's the house with the pirate flag."
	else:
		the_player.visited.append(the_player.location)

		print "The street is very similar to the one"
		print "You came from, except that you notice"
		print "there's a pirate flag on one of the"
		print "houses."
		print "You hear a distant dog bark."
		print "Up ahead you see that there's a tree"
		print "in next street."


	while True:
		action = prompt.standard(the_player)

		if action == "regular street":
			return 'Suburb 2'
		elif action == "street with a tree" or 'tree' in action:
			return 'Suburb 6'
		elif 'pirate' in action or 'flag' in action:
			return 'House with pirate flag'
		else:
			custom_error.errortype(3)
Example #8
0
def type(death_id, the_player):

		death_dict = {
			1: "\nYou're so old you barely survived the first wave of zombie attack. Just as you get out of the bed you feel pain chest. Seconds later you fall to the ground and die",
			2: "\n'Baba.. da-ba'. You're just a baby unable to do anything really. You starve to death and die.",
			3: "\nYou reached zero/negative hitpoints. You die.",
			4: "\nYou're an old fart. You get heart attack from push ups and die seconds later.",
			5: "\nYou exhaust yourself and later a zombie approaches you. Your lack of strength is unable to deal with it. You're dead now... and sort of alive but the game is over now.",
			6: "\nYou reached zero/negative hitpoints and got killed by your enemy.",
			7: "\nYou get bitten by zombie and eventually turn dead. You die.",
			8: "\nLast thing you see is a barrel of shotgun and sparks in slow motion. 'F****r' you hear old man mumbling.",
			9: "\nYou feel a pinch on your finger as you turn cylinders on the lock again. Seconds later you stop breathing and you die.",
			10: "\n'What a stupid answer.' You think to yourself as you feel the bullet coming through you.",
			11: "\nAs you keep going the cracking sound gets louder. Eventually the bridge collapses and you lose conscience when you fall into river, drowning to death.",
			12: "\nYou lose balance for a little while and you slip. A lone glass shrapnel hanging from the window impales you."
			}

		get_death_type = death_dict.get(death_id)
		print get_death_type
		print "Your score is %d." % the_player.score

		custom_error.errortype(4)
		splashscreen.score_board(the_player)
		custom_error.errortype(4)
		exit(1)
Example #9
0
def enter(the_player):

	the_player.location = 'Another street'
	the_player.directions = ['Suburbs','Longer street']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
	else:
		the_player.visited.append(the_player.location)

		print "Just another street with rows of houses."
		print "Only difference is a slightly more"
		print "red mailbox next to one of the houses."
		print "There is a longer street up ahead."


	while True:
		action = prompt.standard(the_player)

		if action == "suburbs":
			return 'Suburbs'
		elif action == "longer street":
			return 'Suburb 3'
		elif action == "red mailbox" or action == "mailbox":
			print "You inspect the house but nothing of"
			print "interest is inside."
		else:
			custom_error.errortype(3)
Example #10
0
def enter(the_player):

	the_player.location = 'Street with a tree'
	the_player.directions = ['Shorter street','Suburb Junction']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
		print "The tree is still standing there"
		print "so nothing's changed."

	else:
		the_player.visited.append(the_player.location)

		print "You come to another street, again it's"
		print "very suburbish but you take a note"
		print "of an oak tree on side of the road."
		print "This street ends with a left turn."


	while True:
		action = prompt.standard(the_player)

		if action == "shorter street":
			return 'Suburb 4'
		elif action == "suburb junction" or action == "junction":
			return 'Suburb Junction'
		elif 'tree' in action:
			print "You come to the tree and see W + D carved into it."
		else:
			custom_error.errortype(3)
Example #11
0
def enter(the_player):

	the_player.location = 'Row of houses'
	the_player.directions = ['Longer street','Suburb Junction']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
	else:
		the_player.visited.append(the_player.location)

		print "Just another street with rows of houses."
		print "This street ends with a right turn."


	while True:
		action = prompt.standard(the_player)

		if action == "longer street":
			return 'Suburb 3'
		elif action == "suburb junction" or 'junction' in action:
			return 'Suburb Junction'
		else:
			custom_error.errortype(3)
Example #12
0
def enter(the_player):

	the_player.location = 'Foreman Ave'
	the_player.directions = ['Junction','Commercial Building', 'Car barricade']
	glass = random.randint(1,4)

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:
		print "You're back at %s." % the_player.location
		print "There are waste containers on the side"
		print "of the road."
		print "Building with broken shop window is next to them."

	else:
		the_player.visited.append(the_player.location)

		print "You come to wide street with various shops"
		print "on each side and garbage everywhere."
		print "There are seven green waste containers on the right"
		print "side of the road that are stuffed"
		print "with various things."
		print "You see a commercial building, probably a shop"
		print "with broken front shop window."
		print "The street ends with a huge barricade made out of"
		print "cars."

	while True:

		action = prompt.standard(the_player)

		if action == "junction":
			return 'Junction'
		elif 'waste' in action or 'container' in action:
			container(the_player)
		elif 'window' in action or 'commercial' in action or 'building' in action:
			if glass == 1:
				death.type(12,the_player)
			else:
				print "You lose balance while stepping to the shop,"
				print "you almost impale yourself on glass shrapnel."
				print "Don't try that again!"
				score.calculate(the_player,'glass')
		elif 'cars' in action or 'barricade' in action or 'car' in action:

			print "You try to climb the car barricade but"
			print "you fail, falling to the ground."
	
			if 'car barricade' not in the_player.visited:
				encounter = fight.Encounter(the_player,'random')
				print "Somehow, a zombie crawls from one of the cars."
				
				custom_error.errortype(4)
				encounter.start(the_player)
				the_player.visited.append('car barricade')
			else:
				pass
		else:
			custom_error.errortype(3)
Example #13
0
def enter(the_player):

    the_player.location = 'Row of houses'
    the_player.directions = ['Longer street', 'Suburb Junction']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        print "You're back at %s." % the_player.location
    else:
        the_player.visited.append(the_player.location)

        print "Just another street with rows of houses."
        print "This street ends with a right turn."

    while True:
        action = prompt.standard(the_player)

        if action == "longer street":
            return 'Suburb 3'
        elif action == "suburb junction" or 'junction' in action:
            return 'Suburb Junction'
        else:
            custom_error.errortype(3)
Example #14
0
def enter(the_player):

    the_player.location = 'Street with a tree'
    the_player.directions = ['Shorter street', 'Suburb Junction']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        print "You're back at %s." % the_player.location
        print "The tree is still standing there"
        print "so nothing's changed."

    else:
        the_player.visited.append(the_player.location)

        print "You come to another street, again it's"
        print "very suburbish but you take a note"
        print "of an oak tree on side of the road."
        print "This street ends with a left turn."

    while True:
        action = prompt.standard(the_player)

        if action == "shorter street":
            return 'Suburb 4'
        elif action == "suburb junction" or action == "junction":
            return 'Suburb Junction'
        elif 'tree' in action:
            print "You come to the tree and see W + D carved into it."
        else:
            custom_error.errortype(3)
Example #15
0
def enter(the_player):

	the_player.location = 'Longer street'
	the_player.directions = ['Another street','Row of houses']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
		print "You still hear the dog barking."
	else:
		the_player.visited.append(the_player.location)

		print "Just another street."
		print "There is a street with row of houses ahead."
		print "On your right there's a patch of flowers"
		print "that isn't on other lawns."
		print "You hear barking from afar."


	while True:
		action = prompt.standard(the_player)

		if action == "another street":
			return 'Suburb 1'
		elif 'row' in action or 'houses' in action:
			return 'Suburb 5'
		elif action == "patch of flowers" or action == "flower":
			print "You smell the flowers. They smell nice."
			print "You look inside the house where the flowers"
			print "are but there's nothing special about it."
		else:
			custom_error.errortype(3)
def enter(the_player):

	the_player.location = 'A very long street'
	the_player.directions = ['Suburbs','Street with small houses']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
	else:
		the_player.visited.append(the_player.location)

		print "Nothing special about this street"
		print "except that it's really long."
		print "When you get to the end you"
		print "get a familiar sight in front of you."

	while True:
		action = prompt.standard(the_player)

		if action == "suburbs":
			return 'Suburbs'
		elif action == "street with small houses" or 'small houses' in action:
			return 'Street with small houses'
		else:
			custom_error.errortype(3)
Example #17
0
def enter(the_player):

	the_player.location = 'Street with small houses'
	the_player.directions = ['Suburb Junction','A very long street']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
	else:
		the_player.visited.append(the_player.location)

		print "You come to street that has a lot"
		print "of small houses on both sides."
		print "It's uncanny how similar they are."
		print "There's a long street coming up ahead, Junction"
		print "behind you."

	while True:
		action = prompt.standard(the_player)

		if action == "suburb junction" or action == "junction":
			return 'Suburb Junction'
		elif action == "a very long street" or 'long' in action:
			return 'A very long street'
		else:
			custom_error.errortype(3)
Example #18
0
def conversation():

    while True:
        try:
            user_input = int(raw_input("\nSelect answer (number) > "))
            return user_input
        except ValueError:
            custom_error.errortype(1)
Example #19
0
def menu():

    while True:
        try:
            user_input = int(raw_input("\nType a number > "))
            return user_input
        except ValueError:
            custom_error.errortype(1)
Example #20
0
def menu():

	while True:
		try:
			user_input = int(raw_input("\nType a number > "))
			return user_input
		except ValueError:
			custom_error.errortype(1)
Example #21
0
def conversation():

	while True:
		try:
			user_input = int(raw_input("\nSelect answer (number) > "))
			return user_input
		except ValueError:
			custom_error.errortype(1)
Example #22
0
def single_shelf(shelf_id, the_player):

	compartments = []

	for item in range(1,6):
		compartment = shelf_id
		compartments.append((compartment, item))

	print "You come to shelf %s and see compartmens marked as:" % shelf_id.upper()
	
	for compartment in compartments:
		print compartment[0].upper() + str(compartment[1])

	while True:
		select = str(raw_input("Type letter and number to look into container, 0 to go back > ")).lower()

		if select == "0":
			break
		elif len(select) == 1:
			print "Please specify container."
		elif select == "t1" and shelf_id == "t" and 'motor' in the_player.inventory.keys():
			print "There is nothing else in that container."
		elif select == "t1" and shelf_id == "t":
			print "\nYou found the motor!"
			score.calculate(the_player, 'find motor')
			the_player.inventory['motor'] = 1
			
			if 'cart' in the_player.inventory.keys():
				print "You put the motor in the cart. You're ready to go!"
			else:
				print "You can carry the motor for few meters but it is very heavy."
				print "You're gonna need something for carrying it."
			custom_error.errortype(4)
			return 'Warehouse'
		elif select == "a2" and shelf_id == "a" and 'gun' in the_player.inventory.keys():
	
			if 'warehouse bullets' not in the_player.visited:
				bullets = random.randint(3,7)
				print "\nYou found %d bullets for gun." % bullets
				score.calculate(the_player,'bullets')
				the_player.inventory['gun'] = the_player.inventory['gun'] + bullets
				the_player.visited.append('warehouse bullets')
			else:
				print "\nThere is nothing else inside."
		elif select == "h4" and shelf_id == "h":
			print "You find a note:"
			print "'PUSH UP' to be the best."
			score.calculate(the_player,'easter egg')
			return 'Warehouse'
		elif select == "q2" and shelf_id == "q":
			print "You find a note:"
			print "'I wish I could write better code...' - author."
			score.calculate(the_player,'easter egg')
		elif shelf_id not in select:
			print "That container is not here."
		else:
			print random.choice(["It's empty.","There's some random junk inside","A weird steel thing!", "Nothing of interest."])
Example #23
0
def select_weapon():

	while True:
		try:
			user_input = int(raw_input("\nSelect weapon (number) > "))
			return user_input
		except ValueError:
			custom_error.errortype(1)
		except IndexError:
			return None
Example #24
0
def select_weapon():

    while True:
        try:
            user_input = int(raw_input("\nSelect weapon (number) > "))
            return user_input
        except ValueError:
            custom_error.errortype(1)
        except IndexError:
            return None
Example #25
0
def enter(the_player):

	the_player.location = 'House with pirate flag'

	if the_player.location in the_player.visited and 'dog in pirate house' in the_player.visited:
		the_player.directions = ['Shorter street','Room with dead dog','Kitchen','Basement']
	elif the_player.location in the_player.visited and 'dog in pirate house' not in the_player.visited:
		the_player.directions = ['Shorter street','Left door','Right door','Stairs']
	else:
		the_player.directions = ['Shorter street','Left Door','Kitchen','Stairs']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
		print "There's a %s on your left, %s on your right" % (the_player.directions[1], the_player.directions[2])
		print "and stairs leading to %s." % the_player.directions[3]
	else:
		the_player.visited.append(the_player.location)

		print "It smells really bad in here. From where"
		print "you stand you see two doors, one on the"
		print "right and one on the left."
		print "You hear loud barking coming from behind"
		print "the left door."
		print "There are stairs leading down at the end"
		print "of the hall."
		print "Door behind you leads out to the street."


	while True:
		action = prompt.standard(the_player)

		if action == "shorter street" or 'shorter' in action or 'out' in action:
			return 'Suburb 4'
		elif 'left' in action or 'dog' in action:
			if 'dog in pirate house' not in the_player.visited:
				print "You open the wooden doors and angry dog jumps at you!"

				encounter = fight.Encounter(the_player,'infected dog')
				encounter.start(the_player)
				the_player.visited.append('dog in pirate house')

				print "There is nothing interesting in that room so you go out."
			else:
				print "Nothing here just the dead dog. You return to the hall."
		elif 'stairs' in action or 'basement' in action:
			return 'Basement'
		elif 'right' in action or 'kitchen' in action:
			return 'Kitchen'
		else:
			custom_error.errortype(3)
Example #26
0
def load_menu():

    while True:
        try:
            user_input = int(raw_input("\nType a number or type 0 to QUIT > "))

            if user_input == 0:
                exit(1)
            else:
                return user_input
        except ValueError:
            custom_error.errortype(1)
Example #27
0
def load_menu():

		while True:
			try:
				user_input = int(raw_input("\nType a number or type 0 to QUIT > "))

				if user_input == 0:
					exit(1)
				else:
					return user_input
			except ValueError:
				custom_error.errortype(1)
Example #28
0
    def check_for_name(self, name):

        saved_games = glob.glob('*.sav')

        save_file = [name + '.sav']

        if save_file[0] in saved_games:
            custom_error.errortype(6)
            custom_error.errortype(2)
            self.generate()
        else:
            return name
Example #29
0
	def check_for_name(self, name):

		saved_games = glob.glob('*.sav')

		save_file = [name + '.sav']

		if save_file[0] in saved_games:
			custom_error.errortype(6)
			custom_error.errortype(2)
			self.generate()
		else:
			return name
Example #30
0
def load_game():

	while True:
		try:
			user_input = str(raw_input("\nLoad this character? Y/N > ")).lower()

			if user_input == "y" or user_input == "n":
				return user_input
			else:
				custom_error.errortype(5)
		except ValueError:
			custom_error.errortype(3)
Example #31
0
def load_game():

    while True:
        try:
            user_input = str(
                raw_input("\nLoad this character? Y/N > ")).lower()

            if user_input == "y" or user_input == "n":
                return user_input
            else:
                custom_error.errortype(5)
        except ValueError:
            custom_error.errortype(3)
Example #32
0
def enter(the_player):

	the_player.location = 'March Street'
	the_player.directions = ['Junction','Old building','Harrington River']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You come back to %s. You've been here before." % the_player.location
		print "Old building is on your left side, ahead is Junction"
		print "of Curling Street"

		if 'charlie sleepover' in the_player.visited:
			print "You hear a very distant noise, probably coming"
			print "from Junction of Curling Street."
		else:
			pass

	else:
		the_player.visited.append(the_player.location)

		print "You leave junction of Curling Street behind"
		print "and turn right to %s." % the_player.location
		print "You see something moving towards you and feel"
		print "uneasiness and chill in your spine."

		encounter = fight.Encounter(the_player, 'child zombie')
		encounter.start(the_player)

		print "You successfully killed the enemy. Now you can safely"
		print "look around."
		print "Just by the sidewalk is an old building with grey walls."
		print "It is a three story building and there's a little light"
		print "coming out of the top window."
		print "Most of the windows, especially in ground floor are boarded up."
		print "If you continue walking you will end up near Harrington River."
		print "You can also turn back to Junction of Curling Street."

	while True:
		action = prompt.standard(the_player)

		if action == "junction":
			return 'Junction'
		elif action == "old building":
			return 'Old Building'
		elif action == "harrington river":
			return 'Harrington River'
		else:
			custom_error.errortype(3)
Example #33
0
def enter(the_player):

	the_player.location = 'Kitchen'

	the_player.directions = ['Hallway of the house']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:
		print "You're back at %s." % the_player.location
		print "There are several shelves and four cupboards"
		print "above the sink."

	else:
		the_player.visited.append(the_player.location)

		print "You step into a kitchen. It looks like"
		print "it's been raided."

		if 'Wanda' in the_player.visited:
			print "Wanda: 'We've been here before with"
			print "Dave to get some food.'"
		else:
			pass
		
		print "There are several shelves and four cupboards"
		print "above the sink."

	cupboard = 1

	while True:
		
		action = prompt. standard(the_player)

		if 'house' in action or 'out' in action or 'hallway' in action:
			return 'House with pirate flag'
		elif 'cupboard' in action:
			print "You search one of the cupboards..."
			cupboard = cupboard + 1
			if cupboard == 4 and 'gun' in the_player.inventory.keys():
				print "You find some bullets for the gun!"
				the_player.inventory['gun'] = the_player.inventory['gun'] + 5
				score.calculate(the_player,'bullets')
			else:
				print "...and nothing. Maybe try looking in the other one?"
		elif 'shelves' in action or 'shelf' in action:
			print "Nothing in the shelves."
		else:
			custom_error.errortype(3)
Example #34
0
def enter(the_player):

    the_player.location = 'Kitchen'

    the_player.directions = ['Hallway of the house']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:
        print "You're back at %s." % the_player.location
        print "There are several shelves and four cupboards"
        print "above the sink."

    else:
        the_player.visited.append(the_player.location)

        print "You step into a kitchen. It looks like"
        print "it's been raided."

        if 'Wanda' in the_player.visited:
            print "Wanda: 'We've been here before with"
            print "Dave to get some food.'"
        else:
            pass

        print "There are several shelves and four cupboards"
        print "above the sink."

    cupboard = 1

    while True:

        action = prompt.standard(the_player)

        if 'house' in action or 'out' in action or 'hallway' in action:
            return 'House with pirate flag'
        elif 'cupboard' in action:
            print "You search one of the cupboards..."
            cupboard = cupboard + 1
            if cupboard == 4 and 'gun' in the_player.inventory.keys():
                print "You find some bullets for the gun!"
                the_player.inventory['gun'] = the_player.inventory['gun'] + 5
                score.calculate(the_player, 'bullets')
            else:
                print "...and nothing. Maybe try looking in the other one?"
        elif 'shelves' in action or 'shelf' in action:
            print "Nothing in the shelves."
        else:
            custom_error.errortype(3)
def enter(the_player):

	the_player.location = 'Suburb Junction'

	if 'Wanda' in the_player.visited:
		the_player.directions = ['Street with a tree',
								'Row of houses',
								'Street with small houses',
								'Wanda\'s house street']

	else:
		the_player.directions = ['Street with a tree',
								'Row of houses',
								'Street with small houses',
								'Street with large mansion']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You're back at %s." % the_player.location
		print "Everything looks normal here."
	else:
		the_player.visited.append(the_player.location)

		print "You enter a junction with the same houses"
		print "around. You can go to:"
		print "%s." % ','.join(the_player.directions)
		print "You're not sure where to go but you hear"
		print "louder dog barking from the direction"
		print "of Street with a large mansion."

	while True:
		action = prompt.standard(the_player)

		if action == "street with a tree" or 'tree' in action:
			return 'Suburb 6'
		elif action == "row of houses" or 'row' in action:
			return 'Suburb 5'
		elif action == "street with small houses" or 'small houses' in action:
			return 'Small houses'
		elif action == "street with large mansion" or 'mansion' in action or 'wanda' in action:
			return 'Cherry trees'
		else:
			custom_error.errortype(3)
Example #36
0
def enter(the_player):

    the_player.location = 'Suburb Junction'

    if 'Wanda' in the_player.visited:
        the_player.directions = [
            'Street with a tree', 'Row of houses', 'Street with small houses',
            'Wanda\'s house street'
        ]

    else:
        the_player.directions = [
            'Street with a tree', 'Row of houses', 'Street with small houses',
            'Street with large mansion'
        ]

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        print "You're back at %s." % the_player.location
        print "Everything looks normal here."
    else:
        the_player.visited.append(the_player.location)

        print "You enter a junction with the same houses"
        print "around. You can go to:"
        print "%s." % ','.join(the_player.directions)
        print "You're not sure where to go but you hear"
        print "louder dog barking from the direction"
        print "of Street with a large mansion."

    while True:
        action = prompt.standard(the_player)

        if action == "street with a tree" or 'tree' in action:
            return 'Suburb 6'
        elif action == "row of houses" or 'row' in action:
            return 'Suburb 5'
        elif action == "street with small houses" or 'small houses' in action:
            return 'Small houses'
        elif action == "street with large mansion" or 'mansion' in action or 'wanda' in action:
            return 'Cherry trees'
        else:
            custom_error.errortype(3)
Example #37
0
def enter(the_player):

	the_player.location = 'Restroom'
	the_player.directions = ['Maintenance room']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:
		print "At restroom again."

	else:
		the_player.visited.append(the_player.location)

		print "You're in very little room with toilet"
		print "and sink in it. It is pretty crammed in"
		print "here."

	if 'broom' in the_player.inventory.keys():
		print "The door behind you lead back to %s." % the_player.directions[0]

	elif 'broom' not in the_player.inventory.keys():
		print "There's an old broom with steel handle"
		print "leaning on the wall."


	while True:
		

		action = prompt.standard(the_player)

		if action == "maintenance room" or action == "maintenance" or 'out' in action:
			return 'Maintenance room'
		elif "broom" in action:
			if 'broom' not in the_player.inventory.keys():
				print "You take the broom, it looks like it might"
				print "be useful for something."

				the_player.inventory['broom'] = 1
			else:
				print "You already have the broom."
		elif 'toilet' in action:
			print "You don't feel like going."
		else:
			custom_error.errortype(3)
Example #38
0
def enter(the_player):

    splashscreen.outro()

    print "\nAs you set sail you feel a peace, finally."
    print "You observe Welton as it gets further away from"
    print "you. You don't know where you'll end up"
    print "but as long as Wanda\'s with you,"
    print "you feel it's gonna be alright."
    print " \nTHE END"

    custom_error.errortype(4)

    splashscreen.score_board(the_player)

    custom_error.errortype(4)

    exit(1)
Example #39
0
def enter(the_player):

    the_player.location = 'Restroom'
    the_player.directions = ['Maintenance room']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:
        print "At restroom again."

    else:
        the_player.visited.append(the_player.location)

        print "You're in very little room with toilet"
        print "and sink in it. It is pretty crammed in"
        print "here."

    if 'broom' in the_player.inventory.keys():
        print "The door behind you lead back to %s." % the_player.directions[0]

    elif 'broom' not in the_player.inventory.keys():
        print "There's an old broom with steel handle"
        print "leaning on the wall."

    while True:

        action = prompt.standard(the_player)

        if action == "maintenance room" or action == "maintenance" or 'out' in action:
            return 'Maintenance room'
        elif "broom" in action:
            if 'broom' not in the_player.inventory.keys():
                print "You take the broom, it looks like it might"
                print "be useful for something."

                the_player.inventory['broom'] = 1
            else:
                print "You already have the broom."
        elif 'toilet' in action:
            print "You don't feel like going."
        else:
            custom_error.errortype(3)
Example #40
0
def enter(the_player):

	the_player.location = 'Basement'

	the_player.directions = ['Hallway of the house']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:
		if 'flashlight' in the_player.inventory.keys():
			print "Back in the %s." % the_player.location
			print "Heaps of junk everywhere."
		elif 'flashlight' not in the_player.inventory.keys():
			print "You're back at %s but it's still dark here."
			print "You can't see anything."

	else:
		the_player.visited.append(the_player.location)

		if 'flashlight' in the_player.inventory.keys():
			print "Thankfully you have flashlight with you"
			print "so you turn it on."
			print "You're in some kind of a basement that"
			print "has brick walls. It's very humid here."
			print "There's a lot of junk laying around."


		elif 'flashlight' not in the_player.inventory.keys():
			print "You step into the darkness and listen for"
			print "a while. It's silent and very humid in here"
			print "but also no light available."

	while True:
		
		action = prompt. standard(the_player)

		if 'house' in action or 'out' in action or 'hallway' in action:
			return 'House with pirate flag'
		elif 'junk' in action:
			junk(the_player)
		else:
			custom_error.errortype(3)
Example #41
0
def enter(the_player):

    the_player.location = 'Basement'

    the_player.directions = ['Hallway of the house']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:
        if 'flashlight' in the_player.inventory.keys():
            print "Back in the %s." % the_player.location
            print "Heaps of junk everywhere."
        elif 'flashlight' not in the_player.inventory.keys():
            print "You're back at %s but it's still dark here."
            print "You can't see anything."

    else:
        the_player.visited.append(the_player.location)

        if 'flashlight' in the_player.inventory.keys():
            print "Thankfully you have flashlight with you"
            print "so you turn it on."
            print "You're in some kind of a basement that"
            print "has brick walls. It's very humid here."
            print "There's a lot of junk laying around."

        elif 'flashlight' not in the_player.inventory.keys():
            print "You step into the darkness and listen for"
            print "a while. It's silent and very humid in here"
            print "but also no light available."

    while True:

        action = prompt.standard(the_player)

        if 'house' in action or 'out' in action or 'hallway' in action:
            return 'House with pirate flag'
        elif 'junk' in action:
            junk(the_player)
        else:
            custom_error.errortype(3)
def enter(the_player):

    the_player.location = 'Harrington River'
    the_player.directions = ['March Street', 'Marina', 'Bridge']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:
        print "You're back at %s." % the_player.location

    else:
        the_player.visited.append(the_player.location)
        print "The March Street ends abruptly with a large"
        print "parking lot in front of Harrington River."
        print "There is a wooden bridge that overarches the river"
        print "so you can keep going."
        print "A narrow stairwell-like path leads to river's"
        print "edge where small marina is located along"
        print "with couple of boats."

    while True:

        action = prompt.standard(the_player)

        if "bridge" in action:
            print "You step on the bridge and hear loud"
            print "cracking beneath your feet."

            bridge_prompt = raw_input("Continue? Y/N > ").lower()

            if bridge_prompt == "y":
                death.type(11, the_player)
            else:
                pass

        elif 'stairs' in action or 'path' in action or 'marina' in action:
            return 'Marina'
        elif action == "march street":
            return 'March Street'
        else:
            custom_error.errortype(3)
Example #43
0
def get_highest_score(score, previous_hi_score):

	if score > previous_hi_score:
		print chr(27) + "[2J"
		intro()
		print "!!! NEW HIGH SCORE !!!"
		print "!!!%d points!!!" % score
		print "Congratulations."
		custom_error.errortype(4)

	elif score >= previous_hi_score:
		print chr(27) + "[2J"
		print "!!! TIE HIGH SCORE !!!"
		print "You have %d, same as previous winner!" % score
		print "Congrats."
		custom_error.errortype(4)
		
		
	else:
		pass
Example #44
0
def junk(the_player):
	
	dives = 0
	dive_messages = ["You fail to find anything.",
					"Still nothing",
					"You're looking but it's just junk.",
					"Useless junk",
					"Some crap you don't need.",
					"Some dusty thing",
					"Nothing interesting"]

	print "\nYou dive into the junk."

	while dives <= random.randint(8,15):

		chance = random.randint(1,6)
		map_chance = random.randint(1,8)
		dive = raw_input("ENTER to dive, 'S' to stop > ").lower()
		custom_error.errortype(4)

		if dive == "s":
			break
		else:
			dives = dives + 1

			if chance == 4 and 'baseball bat' not in the_player.inventory.keys():
				print '\nYou find a baseball bat!'
				the_player.inventory['baseball bat'] = 10
				score.calculate(the_player, 'baseball bat')
				break
			elif map_chance == 7 and 'map' not in the_player.inventory.keys():
				print "You find a map of the Suburbs!"
				the_player.inventory['map'] = 1
				score.calculate(the_player,'map')
				print "Type 'MAP' to display map."
				break
			else:
				print '\n', random.choice(dive_messages)

	print "\nYou're bored so you need to rest for a while."
def enter(the_player):

	the_player.location = '22nd Street'
	the_player.directions = ['Junction','Suburbs']

	print "\nLocation:", the_player.location
	print "-" * 30

	chance_of_encounter = random.randint(0,1)

	if chance_of_encounter == 1:
		print "You hear growling... Looks like"
		print "an enemy stumbled upon you.\n"
		encounter = fight.Encounter(the_player,'random')
		encounter.start(the_player)
		random.seed(chance_of_encounter)
	else:
		pass

	if the_player.location in the_player.visited:

		print "Your at %s again." % the_player.location

	else:
		the_player.visited.append(the_player.location)
		
		print "You come to %s, it looks empty here." % the_player.location
		print "If you continue going forward, you'll"
		print "reach Suburbs of Welton."


	while True:
		action = prompt.standard(the_player)

		if action == "suburbs":
			return 'Suburbs'
		elif action == "junction":
			return 'Junction'
		else:
			custom_error.errortype(3)
Example #46
0
def enter(the_player):

	the_player.location = 'Marina'
	if 'Wanda' in the_player.visited:
		the_player.directions = ['Harrington River','Wanda\'s boat']
	else:
		the_player.directions = ['Harrington River','Yellow boat']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:
		print "You're back at %s." % the_player.location
		print "You see two smaller boats and %s." % the_player.directions[1]

	else:
		the_player.visited.append(the_player.location)

		print "You come to little Marina and notice two small"
		print "boats with paddle and larger yellow boat."

		if 'Wanda' in the_player.visited:
			print "Wanda: 'That yellow boat is the one!'"
		else:
			pass


	while True:

		action = prompt.standard(the_player)

		if action == "river" or action == "harrington river":
			return 'Harrington River'
		elif 'yellow' in action or 'boat' in action or 'wanda\'s boat' in action:
			return 'Wanda\'s boat'
		elif action == "small boat" or action == "small boats":
			print "One of the small boats is half-sunken and the other"
			print "looks crappy too. There are also no paddles."
		else:
			custom_error.errortype(3)
Example #47
0
def shelf(the_player):


	shelves = [i for i in string.ascii_lowercase]
	shelves_view = ', '.join(shelves).upper()

	while True:
		
		print "\nShelves are labeled as:\n%s." % shelves_view

		try:
			select = str(raw_input("Type letter to inspect shelf, 'exit' to stop > ")).lower()

			if select == "exit":
				return 'Warehouse'
			elif select in shelves:
				single_shelf(select, the_player)
			else:
				custom_error.errortype(3)
				custom_error.errortype(4)
		except ValueError:
			print "Type letters only"
Example #48
0
def enter(the_player):

    the_player.location = 'Marina'
    if 'Wanda' in the_player.visited:
        the_player.directions = ['Harrington River', 'Wanda\'s boat']
    else:
        the_player.directions = ['Harrington River', 'Yellow boat']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:
        print "You're back at %s." % the_player.location
        print "You see two smaller boats and %s." % the_player.directions[1]

    else:
        the_player.visited.append(the_player.location)

        print "You come to little Marina and notice two small"
        print "boats with paddle and larger yellow boat."

        if 'Wanda' in the_player.visited:
            print "Wanda: 'That yellow boat is the one!'"
        else:
            pass

    while True:

        action = prompt.standard(the_player)

        if action == "river" or action == "harrington river":
            return 'Harrington River'
        elif 'yellow' in action or 'boat' in action or 'wanda\'s boat' in action:
            return 'Wanda\'s boat'
        elif action == "small boat" or action == "small boats":
            print "One of the small boats is half-sunken and the other"
            print "looks crappy too. There are also no paddles."
        else:
            custom_error.errortype(3)
def enter(the_player):

    the_player.location = '22nd Street'
    the_player.directions = ['Junction', 'Suburbs']

    print "\nLocation:", the_player.location
    print "-" * 30

    chance_of_encounter = random.randint(0, 1)

    if chance_of_encounter == 1:
        print "You hear growling... Looks like"
        print "an enemy stumbled upon you.\n"
        encounter = fight.Encounter(the_player, 'random')
        encounter.start(the_player)
        random.seed(chance_of_encounter)
    else:
        pass

    if the_player.location in the_player.visited:

        print "Your at %s again." % the_player.location

    else:
        the_player.visited.append(the_player.location)

        print "You come to %s, it looks empty here." % the_player.location
        print "If you continue going forward, you'll"
        print "reach Suburbs of Welton."

    while True:
        action = prompt.standard(the_player)

        if action == "suburbs":
            return 'Suburbs'
        elif action == "junction":
            return 'Junction'
        else:
            custom_error.errortype(3)
Example #50
0
def junk(the_player):

    dives = 0
    dive_messages = [
        "You fail to find anything.", "Still nothing",
        "You're looking but it's just junk.", "Useless junk",
        "Some crap you don't need.", "Some dusty thing", "Nothing interesting"
    ]

    print "\nYou dive into the junk."

    while dives <= random.randint(8, 15):

        chance = random.randint(1, 6)
        map_chance = random.randint(1, 8)
        dive = raw_input("ENTER to dive, 'S' to stop > ").lower()
        custom_error.errortype(4)

        if dive == "s":
            break
        else:
            dives = dives + 1

            if chance == 4 and 'baseball bat' not in the_player.inventory.keys(
            ):
                print '\nYou find a baseball bat!'
                the_player.inventory['baseball bat'] = 10
                score.calculate(the_player, 'baseball bat')
                break
            elif map_chance == 7 and 'map' not in the_player.inventory.keys():
                print "You find a map of the Suburbs!"
                the_player.inventory['map'] = 1
                score.calculate(the_player, 'map')
                print "Type 'MAP' to display map."
                break
            else:
                print '\n', random.choice(dive_messages)

    print "\nYou're bored so you need to rest for a while."
Example #51
0
def enter(the_player):

	the_player.location = 'Suburbs'
	the_player.directions = ['22nd Street','Left','Right']

	print "\nLocation:", the_player.location
	print "-" * 30

	if the_player.location in the_player.visited:

		print "You've reached %s, you're standing in" % the_player.location
		print "one of the front streets."

	else:
		the_player.visited.append(the_player.location)

		print "Few minutes later you arrive to Welton"
		print "suburbs. The street you're on forks"
		print "into two roads (left and right)."
		print "In the distance you see many other roads"
		print "but everything looks so similiar."
		print "All the houses are same size and all"
		print "the lawns are green."
		print "Where do you go?"


	while True:
		action = prompt.standard(the_player)

		if action == "22nd street":
			return '22nd Street'
		elif action == "left":
			return 'Suburb 1'
		elif action == "right":
			return 'Suburb 2'
		else:
			custom_error.errortype(3)
Example #52
0
	def player_attack(self, the_player, the_enemy):

		weapon_stats = {
		'fists': random.randint(1,6),
		'gun': random.randint(30,35),
		'knife': random.randint(10,15),
		'baseball bat': random.randint(8,13) + random.randint(2,6),
		}

		weapons = self.player_weapon(the_player)
		bonus = self.attack_bonus(the_player)

		num_of_weapons = len(weapons)
		w_num = 1

		weapon_table = {}

		print "\nAvailable weapons:"
		while w_num <= num_of_weapons:
	
			for weapon in weapons:
				print str(w_num) + '.' ,weapon
				w_num = w_num + 1
				weapon_table[weapon] = w_num - 1

		selected_weapon = prompt.select_weapon()

		for key, item in weapon_table.items():
			if selected_weapon == item:
				attack_points = weapon_stats.get(key) * bonus
				use_weapon = key
			else:
				pass

		if 'knife' or 'baseball bat' in the_player.inventory.keys():
			for weapon, condition in the_player.inventory.items():

				if condition > 0 and condition <= 5:
					print_condition = "weak"
				elif condition > 5 and condition <= 15:
					print_condition = "OK"
				else:
					print_condition = "fine"
		else:
			pass

		chance_of_missing = random.randint(0,5)	

		if chance_of_missing == 0:
			randomize_attack = 0
		else:
			if use_weapon == 'gun':
				the_player.inventory['gun'] = the_player.inventory['gun'] - 1
				if the_player.inventory['gun'] <= 0:
					attack_points = 0
					print "You don't have enough bullets."
				else:
					pass
			elif use_weapon == 'knife':
				the_player.inventory['knife'] = the_player.inventory['knife'] - 1
				if the_player.inventory['knife'] <= 0:
					attack_points = 0
					print "Your knife is broken." 
			elif use_weapon == 'baseball bat':
				the_player.inventory['baseball bat'] = the_player.inventory['baseball bat'] - 1
				if the_player.inventory['baseball bat'] <= 0:
					attack_points = 0
					print "Your baseball bat is broken."
			else:
				pass

			randomize_attack = attack_points * random.uniform(0.0,1.0)
			the_enemy.enemy_hp = the_enemy.enemy_hp - randomize_attack

		if 'Wanda' in the_player.visited:
			wanda_attack = random.randint(10,12) * random.uniform(0.0,1.0)
			the_enemy.enemy_hp = the_enemy.enemy_hp - wanda_attack
		else:
			pass

		if randomize_attack <= 0:
			print "\nYou miss!"
		else:
			print "\nYou hit %s with %s for %.2f hitpoint damage." % (the_enemy.enemy_name, use_weapon, randomize_attack)
			if use_weapon == 'gun':
				print "%d bullets left.\n" % the_player.inventory['gun']
			elif use_weapon == 'knife' or use_weapon == 'baseball bat':
				print "%s looks %s.\n" % (use_weapon.capitalize(), print_condition)
			else:
				pass

		if 'Wanda' in the_player.visited:

			if wanda_attack <= 0:
				print "\nWanda misses!"
			else:
				print "\nWanda hits %s for %.2f hitpoints." % (the_enemy.enemy_name, wanda_attack)

		
		custom_error.errortype(4)

		if the_enemy.enemy_hp <= 0:
			enemy_alive = False
		else:
			enemy_alive = True

		return enemy_alive
Example #53
0
def enter(the_player):

    the_player.location = 'Old Building'
    the_player.directions = ['March Street', 'Old Building (first floor)']

    print "\nLocation:", the_player.location
    print "-" * 30

    num_of_tries = 4

    if the_player.location in the_player.visited and 'flashlight' in the_player.inventory.keys(
    ):
        print "You turn on the flashlight. Suddenly you can see all"
        print "the dead bodies in the room."

        if 'first time flash light' in the_player.visited:
            print "You see the trunk."

        else:
            the_player.visited.append('first time flash light')
            score.calculate(the_player, 'turn on lights')

            print "Apart from the horrendous scene you notice a large trunk"
            print "in the back of the room."
            print "You come closer to open it but discover that"
            print "it has a mechanical lock on it with three"
            print "cylinders with number on them."
            print "The trunk has letters 'AK' crudely painted on it."

            if 'Wanda' in the_player.visited:
                print "\nWanda: 'That trunk is where our stuff should be.'"

    elif the_player.location in the_player.visited:

        print "You are at the lobby of %s again. It's dark here." % the_player.location

    else:
        the_player.visited.append(the_player.location)

        print "It's very dark inside and the smell is horrible."
        print "You can't see anything but you see a little"
        print "light coming from the other side of the lobby."
        print "You see some stairs leading up to first floor."

        if 'Wanda' in the_player.visited:
            print "\nWanda: 'This is it, this is the building. The stuff"
            print "must be somewhere here.'"

    while True:
        action = prompt.standard(the_player)

        if action == "march street" or 'out' in action:
            return 'March Street'
        elif action == "stairs" or action == "first floor":
            return 'Old Building (first floor)'
        elif action == "trunk" and not 'map' in the_player.inventory.keys():

            if 'Wanda' in the_player.visited:
                print "\n'The code is 498 but be careful"
                print "because you only have few tries."
                print "There's a special poison needle"
                print "to avoid hassling with the lock'"
            else:
                pass

            while True:
                if num_of_tries != 0:
                    try:
                        passcode = int(
                            raw_input(
                                "Enter three digits, '000' to go away > "))
                        num_of_tries = num_of_tries - 1
                    except ValueError:
                        print "Put three numbers only"
                    if passcode == 000:
                        break
                    elif passcode == 498:
                        the_player.inventory['boat key'] = 1
                        score.calculate(the_player, 'key')

                        print "You find some junk inside but most importantly,"
                        print "the key for the boat is there. It is squared-shaped"
                        print "and kind of unique."

                        if 'Wanda' in the_player.visited:
                            print "Wanda: 'We got the key! Let's go.'"
                        else:
                            pass
                        break
                    else:
                        print "It's still locked."
                else:
                    death.type(9, the_player)

        else:
            custom_error.errortype(3)
            pass
def enter(the_player):

    the_player.location = 'Old Building (second floor)'
    the_player.directions = ['Old Building (first floor)']

    print "\nLocation:", the_player.location
    print "-" * 30

    if the_player.location in the_player.visited:

        charlie_greets = [
            'looking good', 'missed you', "haven't seen you for a while",
            'nice ass', 'nice outside?'
        ]

        print "You come back to %s." % the_player.location
        print "'Hey there %s, %s!' Charlie screams." % (
            the_player.name, random.choice(charlie_greets))

        if 'Wanda' in the_player.visited:
            print "Good day to you too, Wanda. Sorry about Dave."

    else:
        the_player.visited.append(the_player.location)

        print "You slowly and carefully climb to second"
        print "floor. You see the source of light now."
        print "It's a small candle under the window."
        print "You see sleeping bag near it and"
        print "empty food cans around."
        print "Someone lives here, evidently."

        custom_error.errortype(4)

        if 'Wanda' in the_player.visited:
            print "Old grey man appears out of nowhere."
            print "'Wanda, wh-wh-what you doin here?' he says."
            print "'I came here to get our stuff' she replies."
            print "\n'Me and Dave were here few days earlier"
            print "and we had a plan to get out of Welton.'"
            print "Old man looks into the ground, his eyes"
            print "fixed on his feet."

            custom_error.errortype(4)

            print "'Listen... sorry if you feel offended, I just"
            print "wanted to keep Dave around, in case something..."
            print "I don't know... changed.'"
            print "\nWanda: 'It's okay Charlie. Don't sweat it..."
            print "We ended it. Just few moments ago. I know"
            print "he wouldn't want a life like that'"
            print "Charlie: 'Oh.. OK. You can stay for today"
            print "if you need the rest':"

            while True:
                rest = str(raw_input("Y/N > ")).lower()
                the_player.visited.append('charlie sleepover')

                if rest == "y":
                    the_player.hitpoints = the_player.max_hitpoints
                    print "You feel good after good rest. You have %.1f hitpoints now." % the_player.hitpoints
                    break
                elif rest == "n":
                    break
                else:
                    custom_error.errortype(5)

            custom_error.errortype(4)
            print "Charlie: 'OK, your stuff is down in the lobby."
            print "I think you're gonna need this.'"
            print "He handles you a flashlight."

            if 'flashlight' in the_player.inventory.keys():
                pass
            else:
                the_player.inventory['flashlight'] = 1

        else:
            charlie_check = random.randint(0, 1)
            if charlie_check == 0:
                print "You feel something hard landing on your head"
                print "and almost lose conscience."
                charlie_hit = random.uniform(0.1, 1.0)
                the_player.hitpoints = the_player.hitpoints - charlie_hit

                if the_player.hitpoints <= 0:
                    death.type(6)
                else:
                    print "You lose %.1f hitpoints." % charlie_hit
                    custom_error.errortype(4)

            elif charlie_check == 1:
                print "You see something approaching fast in"
                print "your peripheral vision."
                print "You manage to roll a feet away and stand"
                print "on your feet."

                score.calculate(the_player, 'charlie hit')

            print "You see old grey man in front of you."
            print "He was definitely hiding in the dark corner"
            print "across the candle."
            print "'Howdy there, I'm awfully sorry for that!"
            print "I thought it was Dave, he snapped that"
            print "rope last week and I had to fight him.'"

            end_conversation = False

            while end_conversation == False:
                print "\n'Heard some noise, is he allright?'\n"
                print "1. Yes"
                print "2. No"

                answer = prompt.conversation()

                if answer == 1:
                    print "'Good, good, he's a good boy."
                    print "He used to work for me in my restaurant."
                    print "I know he's different now...."
                    print "But I keep him around, as a warning"
                    print "and to keep me safe."
                    print "I know it's strange, don't judge me.'"

                    break

                elif answer == 2:

                    while end_conversation == False:

                        print "'No? What did you do to him?!'"
                        print "1. The rope snapped, I just defended myself."
                        print "2. I killed that f****r!"

                        answer2 = prompt.conversation()

                        if answer2 == 1:
                            print "'Oh...' Looks like old man is about to cry."
                            print "I kind of got attached to him, even when"
                            print "he became different, y'know..."
                            print "Nevermind...'"

                            end_conversation = True

                        elif answer2 == 2:
                            print "'What!!! You... I'm gonna f****n ~#^@#$...'"
                            print "Old man pulls a huge shotgun out of his"
                            print "coat."
                            death.type(8, the_player)

                        else:
                            custom_error.errortype(1)

                else:
                    custom_error.errortype(1)

            print "'Hey there, my name's Charlie. What's yours?'"

            custom_error.errortype(4)

            print "'%s' you mumble." % the_player.name
            print "\nYou hear Charlie's story, about his pizza place"
            print "and life he had before."
            print "You talked for a while and he offered you to stay"
            print "for the night: 'I saw a pack of 'em from the window."
            print "Wouldn't be safe for you to wander around at night.'\n"
            print "You agree and wake up late next day."

            custom_error.errortype(4)

            hp_to_heal = the_player.max_hitpoints - the_player.hitpoints
            the_player.hitpoints = the_player.hitpoints + hp_to_heal
            the_player.visited.append('charlie sleepover')

            print "You gain %.1f hitpoints from good night sleep.\n" % hp_to_heal
            print "'Listen, %s, by the way you wouldn't have some candy" % the_player.name
            print "on you or something?'"
            print "I might have a flashlight to trade...'"

    while True:
        action = prompt.standard(the_player)

        if "first floor" in action:
            return 'Old Building (first floor)'
        elif "chocolate" in action and 'Wanda' in the_player.visited:
            print "Charlie: 'No thanks.'"
        elif action == "chocolate" and 'flashlight' in the_player.inventory.keys(
        ) or action == "chocolate bar" and 'flashlight' in the_player.inventory.keys(
        ):
            print "Sorry, I don't have anything else to trade."
        elif action == "chocolate" or action == "chocolate bar" and the_player.inventory[
                'chocolate bar'] >= 1:
            the_player.inventory[
                'chocolate bar'] = the_player.inventory['chocolate bar'] - 1
            the_player.inventory['flashlight'] = 1
            print "Charlie: 'Great! Here you go, you might have a good use for it!'"
            print "He gives you working flashlight"
            score.calculate(the_player, 'flashlight')
        elif action == "chocolate" or action == "chocolate bar" and the_player.inventory[
                'chocolate bar'] == 0:
            print "You don't have any chocolate bar to give to Charlie."
        else:
            custom_error.errortype(3)