예제 #1
0
def run_room(player_inventory, player_equipped, combat_off_inventory, combat_spell_inventory, mobs, player_health):
    description = '''
    The room smells vile. A red mist permeates the air, making it difficult to see.The walls are covered in corpses of men 
    and animal and the ground is covered in blood. In the middle of the room lays the Beast. It rears it's hind legs and licks
    the blood off of it's talons. The Beast notices your presence and snarls.
    '''

    print(description)

    next_room = 13

    utils.combat(player_equipped, player_inventory, combat_off_inventory, combat_spell_inventory, mobs, mob,
    player_health, beast_attack)
    if player_health['pl_hp'] <= 0:
        next_room = 15

    if player_health['pl_hp'] <= 0:
        print("A light consumes you...")
    else:
        print('''
            The corpse of the Beast slumps over and begins to shrink, losing it's fur and talons. The old man, once Beast, lays on
            the floor, slowly breathing, grasping his chest. Black blood pools around his as he quivers in agony. He looks up at you,
            standing over him, his eyes still red. He whispers 'Thank you.' and breathes his last breath.
            ''')

        input("\n\tPress ENTER to continue:")

        print('''
            All is quiet until...
            ''')

        input("\n\tPress ENTER to continue:")

        print('''
            The black blood of the man begins to shine a blinding white and light consumes you and knocks you to your knees. An 
            apparition of a young man approaches you through the light. He clasps your forearm and lifts you off the ground.
            He places both hands on your shoulders and the light begins to dissipate.
            ''')

        input("\n\tPress ENTER to continue:")

        print('''
        As you return to the room where the old man lie. An explosion of light blasts the northern wall down and guards flood
        into the dungeon. You collapse to the ground as your fellow prison guards run to aid you. The last thing you see is
        the young man in the light kneeling beside the old man, smiling solemnly.
        ''')
        next_room = 14
    # end of main while loop
    return next_room
예제 #2
0
def run_room(player_inventory, player_equipped, combat_off_inventory, combat_spell_inventory, mobs, player_health):
    description = '''
           A puddle of blood covers the dungeon floor, coming from a body the wolf was feasting on. The body was the commanding
           officer who had given you a walk through the prison. There are passages going north, east, south, and west.
           '''
    next_room = 6
    done_with_room = False

    if room_state['encounter']:
        print("Before you are able to get a good look around, a wolf pounces at you!")
        utils.combat(player_equipped, player_inventory, combat_off_inventory, combat_spell_inventory, mobs, mob,
                     player_health, wolf_attack)
        room_state['encounter'] = False
        if player_health['pl_hp'] <= 0:
            next_room = 15
            done_with_room = True

    print(description)

    # valid commands for this room
    commands = ["go", "take", "drop", "use", "status", "loot", "equip"]
    no_args = ["loot", "equip"]

    # nonsense room number, we need to figure out which room they want in the loop

    while not done_with_room:
        # Examine the response and decide what to do
        response = utils.ask_command("What do you want to do?", commands, no_args)
        the_command = response[0]
        if the_command == 'go':
            direction = response[1]
            if direction == 'north':
                next_room = 11
                done_with_room = True
            elif direction == 'east':
                next_room = 7
                done_with_room = True
            elif direction == 'south':
                next_room = 2
                done_with_room = True
            elif direction == 'west':
                next_room = 5
                done_with_room = True
            else:
                print("\n\tYou may not go in that direction.\n\t")
        elif the_command == 'take':
            take_what = response[1]
            utils.take_item(player_inventory, room6_inventory, take_what)
        elif the_command == 'drop':
            drop_what = response[1]
            utils.drop_item(player_inventory, room6_inventory, drop_what)
        elif the_command == 'status':
            status = response[1]
            if status == 'player':
                utils.player_status(player_inventory, player_equipped, player_health)
            elif status == 'room':
                utils.room_status(room6_inventory, room6_map, room6_loot_sources)
            else:
                print("That is not a valid option.")
        elif the_command == 'equip':
            utils.equip_item(player_equipped, player_inventory)
        elif the_command == 'loot':
            while True:
                print("The available loot sources are:\n")
                for key in room6_loot_sources.keys():
                    print("\t\t", key)
                chosen = input("\nWhich would you like to loot? Type 'Q' if you wish to stop looting.\n\t")
                chosen = chosen.title()
                if chosen == 'Q':
                    break
                elif chosen in room6_loot_sources:
                    utils.loot(chosen, room6_loot_sources, player_inventory)
                    break
                else:
                    print("That is not an available loot source.\n")
        elif the_command == 'use':
            interaction = response[1]
            if interaction == 'heal':
                if room_state['heal']:
                    if utils.has_a(player_inventory, 'Bolster'):
                        utils.heal(player_health, player_inventory, combat_spell_inventory)
                        room_state['heal'] = False
                    elif utils.has_a(player_inventory, 'Heal'):
                        utils.heal(player_health, player_inventory, combat_spell_inventory)
                        room_state['heal'] = False
                    else:
                        print("You do not have the heal spell!")
                else:
                    print("You have already used your heal in this room!\n")
        else:
            print("\n\tThat is not an available command in this room.\n\t")

    if player_health['pl_hp'] <= 0:
        print("A light consumes you...")
    else:
        print("\n\tYou press on the door and it slowly creaks ajar.")
        print("********************************************************\n")
    # end of main while loop
    return next_room
예제 #3
0
def run_room(player_inventory, player_equipped, combat_off_inventory, combat_spell_inventory, mobs, player_health):
    description = '''
    There are skeletons of small animals covering the ground. On the northern wall is gate with a massive bloody paw print
    covering what seems to be a keyhole. There are passages to the north and to the south.
    '''

    next_room = 11
    done_with_room = False

    print(description)

    if room_state['encounter']:
        print("Amongst the bones in the room stands a massive wolf with many scars covering it's face. It's beaming eyes"
              "match the same tint of red as the blood on it's claws. Around it's neck is a rope with a key on it.")
        utils.combat(player_equipped, player_inventory, combat_off_inventory, combat_spell_inventory, mobs, mob,
                     player_health, wolf_attack)
        room_state['encounter'] = False
        if player_health['pl_hp'] <= 0:
            next_room = 15
            done_with_room = True
        else:
            utils.take_item(player_inventory, room11_inventory, 'Key')

    # valid commands for this room
    commands = ["go", "take", "drop", "use", "status", "loot", "equip"]
    no_args = ["loot", "equip"]

    # nonsense room number, we need to figure out which room they want in the loop
    while not done_with_room:
        # Examine the response and decide what to do
        response = utils.ask_command("What do you want to do?", commands, no_args)
        the_command = response[0]
        if the_command == 'go':
            direction = response[1]
            if direction == 'north':
                if room_state['is_locked']:
                    print("The door is locked.")
                else:
                    print("You enter the room.")
                    next_room = 13
                    done_with_room = True
            elif direction == 'south':
                next_room = 6
                done_with_room = True
            else:
                print("\n\tYou may not go in that direction.\n\t")
        elif the_command == 'take':
            take_what = response[1]
            utils.take_item(player_inventory, room11_inventory, take_what)
        elif the_command == 'drop':
            drop_what = response[1]
            utils.drop_item(player_inventory, room11_inventory, drop_what)
        elif the_command == 'status':
            status = response[1]
            if status == 'player':
                utils.player_status(player_inventory, player_equipped, player_health)
            elif status == 'room':
                utils.room_status(room11_inventory, room11_map, room11_loot_sources)
            else:
                print("That is not a valid option.")
        elif the_command == 'equip':
            utils.equip_item(player_equipped, player_inventory)
        elif the_command == 'loot':
            print("There is nothing to loot in this room.")
        elif the_command == 'use':
            interaction = response[1]
            if interaction == 'heal':
                if room_state['heal']:
                    if utils.has_a(player_inventory, 'Bolster'):
                        utils.heal(player_health, player_inventory, combat_spell_inventory)
                        room_state['heal'] = False
                    elif utils.has_a(player_inventory, 'Heal'):
                        utils.heal(player_health, player_inventory, combat_spell_inventory)
                        room_state['heal'] = False
                    else:
                        print("You do not have the heal spell!")
                else:
                    print("You have already used your heal in this room!\n")
            if interaction == 'key':
                if utils.has_a(player_inventory, 'Key'):
                    if room_state['is_locked']:
                        print("You place the key into the keyhole and turn it until it clicks.\n")
                        room_state['is_locked'] = False
                        while True:
                            answer = input("Would you like to enter?")
                            answer = answer.title()
                            if answer == 'Yes':
                                next_room = 13
                                done_with_room = True
                                break
                            elif answer == 'No':
                                print("You back away from the room with the door still unlocked.")
                                break
                            else:
                                print("That is not a valid response.\n")
        else:
            print("\n\tThat is not an available command in this room.\n\t")

    if player_health['pl_hp'] <= 0:
        print("A light consumes you...")
    else:
        print("\n\tYou press on the door and it slowly creaks ajar.")
        print("********************************************************\n")
    # end of main while loop
    return next_room
예제 #4
0
def run_room(player_inventory, player_equipped, combat_off_inventory,
             combat_spell_inventory, mobs, player_health):
    description = (
        "\nThe red light still shines in the dimly light room, exposing the gruesome scene of what used to"
        "\nguards. To the west is a mossy wall stained with blood. To the east is a wall with guard's corpse"
        "\npropped up against it. In the center are the torn shackles and another corpse. There's a passage going"
        "\nnorth.\n")

    print(description)

    # valid commands for this room
    commands = ["go", "take", "drop", "use", "status", "loot", "equip"]
    no_args = ["loot", "equip"]

    # nonsense room number, we need to figure out which room they want in the loop
    next_room = -1

    done_with_room = False
    while not done_with_room:
        # Examine the response and decide what to do
        response = utils.ask_command("What do you want to do?", commands,
                                     no_args)
        response = utils.scrub_response(response)
        the_command = response[0]
        if the_command == 'go':
            direction = response[1]
            # Use your hand drawn map to help you think about what is valid
            if direction == 'north':
                if room_state['encounter']:
                    print(
                        "As you go to enter the next room, a Young Wolf attacks you!"
                    )
                    utils.combat(player_equipped, player_inventory,
                                 combat_off_inventory, combat_spell_inventory,
                                 mobs, mob, player_health, rat_attack)
                    room_state['encounter'] = False
                    if player_health['pl_hp'] <= 0:
                        next_room = 15
                        done_with_room = True
                    else:
                        next_room = 2
                        done_with_room = True
                else:
                    next_room = 2
                    done_with_room = True
            else:
                print("\n\tYou may not go in that direction.\n\t")
        elif the_command == 'take':
            response = utils.scrub_response(response)
            take_what = response[1]
            utils.take_item(player_inventory, room1_inventory, take_what)
        elif the_command == 'drop':
            drop_what = response[1]
            utils.drop_item(player_inventory, room1_inventory, drop_what)
        elif the_command == 'status':
            status = response[1]
            if status == 'player':
                utils.player_status(player_inventory, player_equipped,
                                    player_health)
            elif status == 'room':
                utils.room_status(room1_inventory, room1_map,
                                  room1_loot_sources)
            else:
                print("That is not a valid option.")
        elif the_command == 'equip':
            utils.equip_item(player_equipped, player_inventory)
        elif the_command == 'loot':
            while True:
                print("The available loot sources are:\n")
                for key in room1_loot_sources.keys():
                    print("\t\t", key)
                chosen = input(
                    "\nWhich would you like to loot? Type 'Q' if you wish to stop looting.\n\t"
                )
                chosen = chosen.title()
                if chosen == 'Q':
                    break
                elif chosen in room1_loot_sources:
                    utils.loot(chosen, room1_loot_sources, player_inventory)
                    break
                else:
                    print("That is not an available loot source.\n")
        elif the_command == 'use':
            interaction = response[1]
            if interaction == 'heal':
                if room_state['heal']:
                    if utils.has_a(player_inventory, 'Bolster'):
                        utils.heal(player_health, player_inventory,
                                   combat_spell_inventory)
                        room_state['heal'] = False
                    elif utils.has_a(player_inventory, 'Heal'):
                        utils.heal(player_health, player_inventory,
                                   combat_spell_inventory)
                        room_state['heal'] = False
                    else:
                        print("You do not have the heal spell!")
                else:
                    print("You have already used your heal in this room!\n")
            else:
                print("That is not an option in this room.")
        else:
            print("\n\tThat is not an available command in this room.\n\t")

    if player_health['pl_hp'] <= 0:
        print("A light consumes you...")
    else:
        print("\n\tYou press on the door and it slowly creaks ajar.")
        print("********************************************************")
    # end of while loop
    return next_room
예제 #5
0
def run_room(player_inventory, player_equipped, combat_off_inventory,
             combat_spell_inventory, mobs, player_health):
    description = '''
    On the western wall there is a painting of a man neatly dressed, giving the impression of a baron or a bishop. Upon closer
    inspection you see the man has the paws of a wolf and his eyes are a dark red. On the northern wall is an empty torch
    sconce. There is a passage going west.
    '''

    next_room = 9
    done_with_room = False

    if room_state['encounter']:
        print(
            "You walk into the room and see a grimacing wolf with beaming red eyes staring you down. The wolf has jet black"
            "fur and massive talons.")
        utils.combat(player_equipped, player_inventory, combat_off_inventory,
                     combat_spell_inventory, mobs, mob, player_health,
                     alpha_attack)
        room_state['encounter'] = False
        if player_health['pl_hp'] <= 0:
            next_room = 15
            done_with_room = True
        else:
            print(description)

    else:
        print(description)

    # valid commands for this room
    commands = ["go", "take", "drop", "use", "status", "loot", "equip"]
    no_args = ["loot", "equip"]

    # nonsense room number, we need to figure out which room they want in the loop
    while not done_with_room:
        # Examine the response and decide what to do
        response = utils.ask_command("What do you want to do?", commands,
                                     no_args)
        the_command = response[0]
        if the_command == 'go':
            direction = response[1]
            if direction == 'west':
                next_room = 7
                done_with_room = True
            else:
                print("\n\tYou may not go in that direction.\n\t")
        elif the_command == 'take':
            take_what = response[1]
            utils.take_item(player_inventory, room9_inventory, take_what)
        elif the_command == 'drop':
            drop_what = response[1]
            utils.drop_item(player_inventory, room9_inventory, drop_what)
        elif the_command == 'status':
            status = response[1]
            if status == 'player':
                utils.player_status(player_inventory, player_equipped,
                                    player_health)
            elif status == 'room':
                utils.room_status(room9_inventory, room9_map,
                                  room9_loot_sources)
            else:
                print("That is not a valid option.")
        elif the_command == 'equip':
            utils.equip_item(player_equipped, player_inventory)
        elif the_command == 'loot':
            print("There is nothing to loot in this room.")
        elif the_command == 'use':
            interaction = response[1]
            if interaction == 'heal':
                if room_state['heal']:
                    if utils.has_a(player_inventory, 'Bolster'):
                        utils.heal(player_health, player_inventory,
                                   combat_spell_inventory)
                        room_state['heal'] = False
                    elif utils.has_a(player_inventory, 'Heal'):
                        utils.heal(player_health, player_inventory,
                                   combat_spell_inventory)
                        room_state['heal'] = False
                    else:
                        print("You do not have the heal spell!")
                else:
                    print("You have already used your heal in this room!\n")
            if interaction == 'torch':
                if room_state['is_locked']:
                    if utils.has_a(player_inventory, 'Torch'):
                        print(
                            "You place the torch inside the sconce and the wall behind it shakes. A blinding light consumes you"
                            "and carries you into a new passage.")
                        player_inventory[
                            'Torch'] = player_inventory['Torch'] - 1
                        next_room = 12
                        done_with_room = True
                    else:
                        print("You do not possess a torch!.\n")
                else:
                    print("You are once again consumed by the light.")
        else:
            print("\n\tThat is not an available command in this room.\n\t")

    if player_health['pl_hp'] <= 0:
        print("A light consumes you...")
    else:
        print("\n\tYou press on the door and it slowly creaks ajar.")
        print("********************************************************\n")
    # end of main while loop
    return next_room
예제 #6
0
def run_room(player_inventory, player_equipped, combat_off_inventory,
             combat_spell_inventory, mobs, player_health):
    description = '''
    The ground is damp from the drool of the wolf and the walls contain scratches. The red light still persists throughout the room.
    There are passages going east, south, and west.
    '''
    next_room = 5
    done_with_room = False

    if room_state['encounter']:
        print(
            "In the middle of the stands a snarling wolf with deep red eyes and brown fur. You get a chance to look around the room."
        )
        print(description)
        utils.combat(player_equipped, player_inventory, combat_off_inventory,
                     combat_spell_inventory, mobs, mob, player_health,
                     wolf_attack)
        room_state['encounter'] = False
        if player_health['pl_hp'] <= 0:
            next_room = 15
            done_with_room = True
    else:
        print(description)

    # valid commands for this room
    commands = ["go", "take", "drop", "use", "status", "loot", "equip"]
    no_args = ["loot", "equip"]

    # nonsense room number, we need to figure out which room they want in the loop
    while not done_with_room:
        # Examine the response and decide what to do
        response = utils.ask_command("What do you want to do?", commands,
                                     no_args)
        the_command = response[0]
        if the_command == 'go':
            direction = response[1]
            if direction == 'west':
                next_room = 8
                done_with_room = True
            elif direction == 'east':
                next_room = 6
                done_with_room = True
            elif direction == 'south':
                next_room = 3
                done_with_room = True
            else:
                print("\n\tYou may not go in that direction.\n\t")
        elif the_command == 'take':
            take_what = response[1]
            utils.take_item(player_inventory, room5_inventory, take_what)
        elif the_command == 'drop':
            drop_what = response[1]
            utils.drop_item(player_inventory, room5_inventory, drop_what)
        elif the_command == 'status':
            status = response[1]
            if status == 'player':
                utils.player_status(player_inventory, player_equipped,
                                    player_health)
            elif status == 'room':
                utils.room_status(room5_inventory, room5_map,
                                  room5_loot_sources)
            else:
                print("That is not a valid option.")
        elif the_command == 'equip':
            utils.equip_item(player_equipped, player_inventory)
        elif the_command == 'loot':
            print("There is nothing to loot in this room.")
        elif the_command == 'use':
            interaction = response[1]
            if interaction == 'heal':
                if room_state['heal']:
                    if utils.has_a(player_inventory, 'Bolster'):
                        utils.heal(player_health, player_inventory,
                                   combat_spell_inventory)
                        room_state['heal'] = False
                    elif utils.has_a(player_inventory, 'Heal'):
                        utils.heal(player_health, player_inventory,
                                   combat_spell_inventory)
                        room_state['heal'] = False
                    else:
                        print("You do not have the heal spell!")
                else:
                    print("You have already used your heal in this room!\n")
        else:
            print("\n\tThat is not an available command in this room.\n\t")

    if player_health['pl_hp'] <= 0:
        print("A light consumes you...")
    else:
        print("\n\tYou press on the door and it slowly creaks ajar.")
        print("********************************************************\n")
    # end of main while loop
    return next_room