Exemplo n.º 1
0
from base.Room import Room

# Second intersection, comes after the first one
name = "Intersection"
description = """You arrive at an intersection. From here, with the path to the place you started behind you, the tunnel splits off to the\nleft and to the right."""

intersection2 = Room(name, description)


@intersection2.action('go', "left")
def go_left(g):

    print("You continue left down the tunnel")

    g.set_room("large_intersection")


@intersection2.action('go', "right")
def go_right(g):

    print("You decide to go down the tunnel to your right.")

    g.set_room("bottomless_pit")


@intersection2.action('go', 'back')
def go_back(g):

    g.set_room("intersection1")
Exemplo n.º 2
0
from base.Room import Room

# Large intersection that leads to the puzzle and the final room.
name = "Large Intersection"
description = """This intersection does not appear to be like the others. It is a large square room, with stone tiles as the flooring. In\nthe tiles, there are some tiles that were cut differently, creating the number III in the middle of the floor. From the\nentrance from the previous intersection, the room has three doorways on each side of the room. One on your left, your\nright, and straight ahead."""

large_intersection = Room(name, description)


@large_intersection.action('go', "left")
def go_left(g):

    print("You continue into the room on your left")

    g.set_room("storage")


@large_intersection.action('go', "right")
def go_right(g):

    print("You decide to into the room to your right.")

    g.set_room("final_entrance")


@large_intersection.action('go', "straight")
def go_straight(g):

    print("You decide to go into the room in front of you.")

    g.set_room("puzzle_room")
Exemplo n.º 3
0
from base.Room import Room
from base.Item import Item

# Storage room, attached to the large intersection

name = "Storage Room"
description = """The room appears to be some kind of storage. Entering, a few mice scurry away. Looking around reveals a few new-looking\nswords, and nothing much else except for a large amount of barrels."""

storage = Room(name, description)

sword = Item(
    "Sword",
    "A shiny, sharp sword. It looks as though it has never been used.")


@storage.action('take', "sword")
def pickup_sword(g):

    if sword not in g.player.inventory:

        g.player.pickupItem(sword)
        storage.del_action(("take", ))

        print(
            "You pickup a sword form among the boxes, and hold it in your hand. The torchlight glints off of it as you turn it, admiring\nit. You place it away on your back."
        )

    else:

        print("You already have a sword, strapped to you back.")
Exemplo n.º 4
0
from base.Room import Room

# A puzzle. Attached to large intersection

name = "Weird Puzzle"
description = """The first thing you notice about the room is a large grid on the floor. There are nine squares, each with one number\nbetween 1 and 9 on it in Roman numerals. It seems to be some form of large keypad, the code hidden somewhere across the\ntunnels. On the back wall, three large diamond shaped gemstones sit, possibly to represent the numbers entered. """

puzzle_room = Room(name,description)

@puzzle_room.action('press','*')
def enter_number(g,noun):

    # Checks if puzzle has already been solved
    if g.puzzle_data["puzzle_complete"]:
        print("You have already completed the puzzle.")
        return

    try:

        # Checks if the number is an actual number and if it is negative at the same time
        if int(noun) < 0:
            print(f"The number {noun} does not exist on the keypad")
            return

        # Checks to make sure the number is within size contraints
        if len(noun) > 3:
            print(f"You enter the number {noun}, but all three gemstones light up, then turn off. Seeing the number of gemstones, the number\nshould be only 3 digits.")
        elif len(noun) < 1:
            print("You must enter a number.")
        else:
Exemplo n.º 5
0
from base.Room import Room

# The first room of the game

name = "Final Room Entrance"
description = ""

finalEntrance = Room(name, description)


@finalEntrance.on_enter()
def on_enter(g):

    if g.puzzle_data["puzzle_complete"]:

        finalEntrance.description = "The room contains a rather large door. It is lit on all sides with torches, unlike the other rooms and tunnels. Stones\nand dust rest on the ground around it, with a massive door, standing open on the end of the room, almost begging you to\nenter it."

        if "enter" not in finalEntrance.actions:

            @finalEntrance.action('enter', "doorway")
            def enter_final_room(g):

                g.set_room("final_room")

    else:

        finalEntrance.description = "The room contains a rather large door. It is lit on all sides with torches, unlike the other rooms and tunnels. You seem\nto have come in through the only entrance, but upon close observation you notice what looks to be a large stone door at the\nend of the room. The door is massive, with many differnent symbols carved into it. There has got to be some way to open it."


@finalEntrance.action('go', "back")
def go_back(g):
Exemplo n.º 6
0
from base.Room import Room
from base.Item import Item

# It's bottomless.

name = "Bottomless Pit"
description = """You enter the room, and a wave of anxiety rushes over you as you stare into a large pit before you. It descends deep\ninto the darkness, the bottom not even touched by the torchlight. Perhaps you could drop a rock to see how deep it is?"""

bottomless_pit = Room(name,description)

health_potion = Item("Health Potion","Will heal you back 50 health")
@bottomless_pit.action('go',"back")
def go_back(g):

    print("You decide to turn back, and return down the tunnel.")

    g.set_room("intersection2")

@bottomless_pit.action('drop',"rock")
def drop_rock(g):

    print("You pick up a sizeable rock next to you, and toss it down the hole. The rock falls, and you hear nothing for a few seconds.\nYou hear the rock hit, but a few seconds later it hits again, hitting the walls. The rock hits the wall a total of SIX\ntimes before the sound disappears.")

    if health_potion not in g.player.inventory:

        print("However, next to the spot on the ground where the rock that you just dropped was beforehand, you notice a small glass vile.")

        @bottomless_pit.action('take','vile')
        def take_potion(g):

            g.player.pickupItem(health_potion)
Exemplo n.º 7
0
from base.Room import Room
from rooms.finalRoom import key
# A large door, which is also the exit to the game

name = "Large Door"
description = """The room at the end of the tunnel is relativly shallow, maybe two meters in depth from the end of the tunnel. As you wave\nthe torch around, you realize that the room contains a large, wood and iron door. In the middle of the door near\nthe ground, there is a small keyhole, which is ever so ironic considering the size of the door. On the floor of the room\nis a large V."""

large_door = Room(name,description)

@large_door.action('go',"back")
def go_back(g):

    print("There is nothing much else to see in the room, so you decide to return through the tunnel you came.")

    g.set_room("intersection1")

@large_door.action('unlock',"door")
def unlock_door(g):
    
    if key in g.player.inventory:

        print("You take the key you found, and place it into the hole in the door. You turn the key, with little effort, and the door\nbegins to make a large clanking noise.")
        print("After a few seconds, the noise stops. The door is unlocked")
        g.player.door_unlocked = True

        large_door.del_action(("unlock",))

        @large_door.action('open',"door")
        def open_door(g):
            
            if g.player.door_unlocked:
Exemplo n.º 8
0
from base.Room import Room
from base.Item import Item

# The first room of the game

name = "Field of Green"
description = """The field only goes about 20 feet, then is stopped by a wall of rock. Sunlight rains down above you, from a large hole in\nthe ceiling. The only difference in the walls in the room is a tunnel that would appear to lead further into the cave,\nwith a single torch at the entrance."""

torch = Item("Torch", "A samll torch, which emits a warm light.")

startRoom = Room(name, description)


@startRoom.on_enter()
def on_enter(g):
    print(
        "You wake up with a bright light shining down on your face. You try to think back to how you got here, but you cannot\nremember. You get up and look around.\n"
    )


@startRoom.action('enter', 'tunnel')
def enter_tunnel(g):

    if torch in g.player.inventory:
        print(
            """Now, with the warm light of the torch, you begin your trek down the tunnel."""
        )
        g.set_room('intersection1')
    else:
        print(
            """You begin to go down the tunnel, to find that it is lit by a single torch at the entrance. The rest of the tunnel is too\ndark to continue"""
Exemplo n.º 9
0
from base.Room import Room
from base.Boss import Boss
from base.Item import Item
from rooms.storage import sword
from rooms.bottomlessPit import health_potion
import random
import time

# The first room of the game

name = "Final Room"
description = ""

finalRoom = Room(name,description)

# The final boss
bird_boss = Boss("Bird","A bird that found its home in the final chamber of this underground structure. You appear to have angered it.",100,20,)

# Key to the exit
key = Item("Key","A small, golden looking key. There is really only one door this could go to.")

# On enter event
@finalRoom.on_enter()
def on_enter(g):

    print("Entering the room, it appears the same as any other room.")
    print("A large room, with torches lining the edges.")
    print("But, at the end of the room opposite of the door, there is a pedastal, with a small key atop it.")

@finalRoom.action('go',"back")
def go_back(g):