Example #1
0
def enter(name, inventory):
    print("You can make out a large silhouette through the undergrowth.")
    print("Fighting the brambles you reach a revolving door and head inside.")
    print("You take the elevator and find yourself at the top of a large office block.")
    print("There is a desk in the office.")
    print()
    while True:
        action = action_prompt(inventory)

        if action[0] in look_words and 'desk' in action:
            print("There is a folder on the desk labelled Evil Plans.")
        if action[0] in look_words and 'folder' in action:
            if scene_contents['world domination plans']:
                print("There are some papers in the desk.")
            else:
                print("There is nothing on the desk")
        if action[0] in take_words and 'papers' in action:
            take_instruments(inventory)
        if action[0] in use_words and 'paper' in action:
            use_code(inventory)
        if timer == 10:
            print("The guards are here. They don't seem to be interested in a conversation.")
            raise GameLost("The guards were unsympathetic to your claims of being a stooge")
        if timer >= 0:
            print("The footsteps are getting closer.")
            timer += 1
def enter(name, inventory):
    if inventory['§1234']:
        print("Bandits are running away from you with a golden key in their grasp.")
        time.sleep(1)
        print("They drop the key in panic. Lucky huh. It falls into the swamp and starts sinking. Grab it quick!")
        print()

        start = time.time()
        while True:
            action = action_prompt(inventory)
            if action[0] in take_words:
                if time.time() < start +15:
                    inventory['golden key'] +=1
                    print("You have the key! It's dirty... but it's yours!")
                    inventory['§1234'] = 0
                else:
                    print("It's sunk. It's too deep to pull out... maybe you find a stick")
                return wait_for_move(inventory)
            else:
                print("But it's a key. It may be dirty, but still TAKE it! Cmon!")
                print("It's been sinking for", time.time() - start)

    else:
        print("You are in a swamp. You look down and see foot print that mean absolutely nothing to you.")
        print("So you continue walking...")
        return wait_for_move(inventory)
def enter(name, inventory):
    print("You encounter a pond")
    if scene_contents['duck']:
        print("There is a duck in the pond. It looks a bit peaky")
    if scene_contents['stick']:
        print("There is a hefty stick lying on the ground.")
    if scene_contents['entrails']:
        print("The place is covered in duck goo. Don't slip!")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        if (action[0] in take_words) and ('duck' in action):
            take_duck(inventory)
        elif (action[0] in take_words) and ('stick' in action):
            take_stick(inventory)
        elif (action[0] in drop_words) and ('berries' in action):
            drop_berries(inventory)
        elif (action[0] in look_words) and ('goo' in action or 'entrails' in action):
            look_goo(inventory)
        elif (action[0] in take_words) and ('key' in action):
            take_key(inventory)
        else:
            print("Sorry, I don't understand.")
Example #4
0
def enter(name, inventory):
    print("You push through the undergrowth - there's hardly a path here at all.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        else:
            print("Sorry, I don't understand.")
def trap(name, inventory):
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            print("You're trapped! Tough.")
        if (action[0] in take_words) and ('chest' in action) and scene_contents['compass']:
            scene_contents['compass'] = 0
            inventory['compass'] = 1
            print("There is a glowing green compass inside")
            time.sleep(1)
            print("But, behind you are some bandits demanding your keys!!")
            while True:
                action = action_prompt(inventory)
                if action[0] in give_words:
                    inventory['golden key'] -= 1
                    inventory['§1234'] = 1
                    print("Bandits take the key and flee east as the door opens.")
                    return
Example #6
0
def enter(name, inventory):
    print("A path runs through dense jungle. To the north, you can see the "
          "entrance to a cave.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        else:
            print("Sorry, I don't understand.")
Example #7
0
def enter(name, inventory):
    print("A path runs through dense jungle. To the north, you can see the "
          "entrance to a cave.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        else:
            print("Sorry, I don't understand.")
def enter(name, inventory):
    print(
        "You push through the undergrowth - there's hardly a path here at all."
    )
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        else:
            print("Sorry, I don't understand.")
Example #9
0
def enter(name, inventory):
    print("In this room awaits a menacing warrior guarding a golden key. There is a sword on the floor")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        if action[0] in take_words and 'sword' in action:
            inventory["sword"] += 1
        elif action[0] in fight_words and 'warrior' in action:
            fight_warrior(inventory)
        else:
            print("Sorry, I don't understand.")
Example #10
0
def enter(name, inventory):
    print("You are in a boat on the sea YEY sea...")
    print("You can see a dolphins to the west")
    print("You can see a island to the north")
    print("You can see a wreck to the south")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1][0] == 'w':
                print("The dolphins are further to the west")
            else:
                return action[1]
Example #11
0
def enter(name, inventory):
    print("You are in a boat on the sea YEY sea...")
    print("You can see a dolphins to the west")
    print("You can see a island to the north")
    print("You can see a wreck to the south")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1][0] == "w":
                print("The dolphins are further to the west")
            else:
                return action[1]
Example #12
0
def enter(name, inventory):
    print("The trees open out onto a beautiful beach. Small waves lap at the "
          "sand. Ahead of you, the ocean stretches as far as you can see.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1][0] == 'w' and not inventory['boat']:
                print("you've forgotten how to swim")
            else:
                return action[1]
        else:
            print("Sorry, I don't understand.")
Example #13
0
def enter(name, inventory):
    print("The trees open out onto a beautiful beach. Small waves lap at the "
          "sand. Ahead of you, the ocean stretches as far as you can see.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1][0] == 'w' and not inventory['boat']:
                print("you've forgotten how to swim")
            else:
                return action[1]
        else:
            print("Sorry, I don't understand.")
Example #14
0
def deal_with_gold(inventory):
    if not scene_contents[GOLD]:
        print("What are you doing back here?")
        return
        
    print("Wow! It's a pile of gold coins!")
    
    while True:
        action = action_prompt(inventory)
        if (action[0] in take_words) and ('gold' in action):
            take_gold(inventory)
            return
        else:
            print("Sorry, I don't understand.")
def enter(name, inventory):
    print("The path crosses a small stream.")
    if scene_contents['berries']:
        print("There are some berries hanging from a tree. They look edible. "
              "If you're hungry enough, anyway.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        if (action[0] in take_words) and ('berries' in action):
            take_berries(inventory)
        else:
            print("Sorry, I don't understand.")
Example #16
0
def enter(name, inventory):
    print("The path crosses a small stream.")
    if scene_contents['berries']:
        print("There are some berries hanging from a tree. They look edible. "
              "If you're hungry enough, anyway.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        if (action[0] in take_words) and ('berries' in action):
            take_berries(inventory)
        else:
            print("Sorry, I don't understand.")
Example #17
0
def enter(name, inventory):
    print(
        "In this room awaits a menacing warrior guarding a golden key. There is a sword on the floor"
    )
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        if action[0] in take_words and 'sword' in action:
            inventory["sword"] += 1
        elif action[0] in fight_words and 'warrior' in action:
            fight_warrior(inventory)
        else:
            print("Sorry, I don't understand.")
Example #18
0
def enter(name, inventory):
    print("The trees open out onto a beautiful beach. Small waves lap at the "
          "sand. Ahead of you, the ocean stretches as far as you can see.")
    if scene_contents.get('boat'):
        print("There is a small boat high up on the sand")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] in take_words and 'boat' in action:
            pick_up_boat(inventory)
        elif action[0] is move:
            if action[1][0] == 'w' and not inventory['boat']:
                print("you've forgotten how to swim")
            else:
                return action[1]
        else:
            print("Sorry, I don't understand.")
Example #19
0
def enter(name, inventory):
    print("The beach continues. Small waves lap at the "
          "sand. Ahead of you, the ocean stretches as far as you can see.")
    if scene_contents.get('boat'):
        print("There is a small boat high up on the sand")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] in take_words and 'boat' in action:
            pick_up_boat(inventory)
        elif action[0] is move:
            if action[1][0] == 'w' and not inventory['boat']:
                print("you've forgotten how to swim")
            else:
                return action[1]
        else:
            print("Sorry, I don't understand.")
Example #20
0
def enter(name, inventory):
    print("You are in a sizeable clearing in the forest. At your feet, you see "
          "a mysterious trap door, with four golden keyholes. Paths lead off "
          "in four directions, which your unerring sense of direction tells you "
          "correspond to the four compass points.")
    if scene_contents.get('rope'):
        print("A short length of rope is lying on the floor.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        if (action[0] in use) and ('key' in action):
            use_key(inventory)
        elif (action[0] in take_words) and ('rope' in action):
            pick_up_rope(inventory)
        else:
            print("Sorry, I don't understand.")
Example #21
0
def enter(name, inventory):
    print("You cut through the dense forest and find yourself in the House of Commons.")
    print("The great hall is empty except for an eldery man (\033[1;41mjeremy\033[0m) dressed like a geography teacher.")
    print("He is reading through reams of printed emails.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1][0] == 'e':
                print("There are Tories to the East, you don't want to go there.")
            else:
                return action[1]
        if action[0] in fight_words and 'jester' in action:
            print("But Jingle is our friend!")
        if action[0] in fight_words and 'jeremy' in action:
            print("You don't want to hurt jeremy, he says he has thousands of friends... Unfortunately none here in the Commons.")
        if action[0] in talk_words and 'jeremy' in action:
            talk_to_jeremy()
        if action[0] in talk_words and 'kid' in action:
            print("\"Sorry mate, I don't have any golden keys, only pokemon.\"")
            print("\"Try going West!\"")
Example #22
0
def enter(name, inventory):
    stock_scene(inventory)
    print("You come across a cottage with two doors. One door is (b)lue and the other (r)ed.")
    print("You might want to choose a door? Or perhaps both? Do you feel lucky?")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
        if action[0] in ('b', 'blue', 'r', 'red'):
            if action[0] in ('red', 'r'):
                if scene_contents['tiger']:
                    print("Aaarrgh, it's a tiger!")
                    print("Do you want to (r)un from, (f)ight or (b)efriend the tiger?")

                    answer = []
                    while not answer:
                        answer = input('> ').lower().split()
                        if 'r' in answer or 'run' in answer:
                            print("You are running in a random direction")
                            return 'w'
               
                        elif 'f' in answer or 'fight' in answer:
                            print("Ouch! The tiger nearly ate you so you run away screaming!")
                            return 'w'
               
                        elif 'b' in answer or 'befriend' in answer:
                            print("You sing the Tiger Befriending Song you learnt as a child. "
                                  "The tiger is enraptured. It agrees to join you on your quest.")
                            take_tiger(inventory)
                        else:
                            answer = []
                else:
                    print("What are you doing back here?")
               
               
            if action[0] in ('blue', 'b'):
               deal_with_gold(inventory)
        else:
            print("Sorry, I don't understand.")
Example #23
0
def enter(name, inventory):
    print("There is a wreck sticking out of the sea")
    print("There is a barrel floating inside the hull of the ex-boat")
    print("You can see a dolphins to the west")
    print("You can see a island far to the north")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1][0] == 'w':
                print("The dolphins are further to the west")
            else:
                return action[1]
        if action[0] in look_words:
            if action[1] == 'wreck':
                if inventory['rope']:
                    print("You climb down rope and search the barrel")
                    pick_up_key(inventory)
                else:
                    print("You can see a barrel but can't reach it")
        else:
            print("Sorry, I don't understand.")
Example #24
0
def enter(name, inventory):
    global has_castle
    if has_castle:
        print("You are on a wide, sandy beach. You see a formidable sand castle towering above you.\n"
              "The precocious child responsible stands on the battlements brandishing a golden key.")
    else:
        print("You are on a wide, sandy beach. It is so peaceful.")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] in fight_words and 'child' in action and has_castle:
            print("You scramble pathetically at the walls while the child laughs.\n"
                  "Suppose you could wait for the tide to bring the castle down.")
        elif action[0] in wait_words and 'tide' in action and has_castle:
            print("The castle washes away with the tide taking the small child with it.\n"
                  "You see a key on the floor and pick it up.")
            inventory['golden key'] += 1
            has_castle = False
        elif action[0] is move:
            return action[1]
        else:
            print("Sorry, I don't understand.")
Example #25
0
def enter(name, inventory):
    print("There is a wreck sticking out of the sea")
    print("There is a barrel floating inside the hull of the ex-boat")
    print("You can see a dolphins to the west")
    print("You can see a island far to the north")
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1][0] == 'w':
                print("The dolphins are further to the west")
            else:
                return action[1]
        if action[0] in look_words:
            if action[1] == 'wreck':
                if inventory['rope']:
                    print("You climb down rope and search the barrel")
                    pick_up_key(inventory)
                else:
                    print("You can see a barrel but can't reach it")
        else:
            print("Sorry, I don't understand.")
Example #26
0
def enter(name, inventory):
    print("Oh no! You've wandered into a swamp that looks like a wild animal's lair!")
    if 'rhinoceros' in scene_contents:
        print("You spot an angry rhino. It spots you and begins to slosh and roar.")
    if random() > 0.5:
        print('Maybe the rhino is hungry')
    else:
        print('Maybe you can scare the rhino away')
    print()
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            if action[1].upper() == 'S' and 'rhinoceros' in scene_contents:
                print ("There's a rhino in the way! You can't go south")
                continue
            else:
                return action[1]
        if action[0] in give_words and 'berries' in action and ('rhino' in action or 'rhinoceros' in action):
            feed_berries_to_rhino(inventory)
        elif action[0] in fight_words and ('rhino' in action or 'rhinoceros' in action):
            print ("Fight a rhino? Are you insane?")
        else:
            print("Sorry, I don't understand.")
Example #27
0
def wait_for_move(inventory):
    while True:
        action = action_prompt(inventory)
        if action[0] is move:
            return action[1]
Example #28
0
def enter(name, inventory):
    print("You see a castle over the horizon to the North!")
    print()
    return action_prompt(inventory)[1]