Beispiel #1
0
def reflecting_pools():
    """
    Create and return Reflecting Pools.
    """
    room = Room()
    """ Set up the game and initialize the variables. """
    # Sprite lists
    room.wall_list = arcade.SpriteList()

    # -- Set up the walls
    # Create bottom and top row of mirrors
    # This y loops a list of two, the coordinate 0, and just under the top of window
    for y in (0, SCREEN_HEIGHT - WALL_SPRITE_SIZE):
        # Loop for each mirror going across
        for x in range(0, SCREEN_WIDTH, WALL_SPRITE_SIZE):
            wall = arcade.Sprite(
                "images/nature_tileset_without_gaps/_water/water2_transp.png",
                WALL_SPRITE_SCALING)
            wall.left = x
            wall.bottom = y
            wall.tag = "mirror"
            wall.code = dec_to_bin(x)
            room.wall_list.append(wall)

    # Create left and right column of mirrors
    for x in (0, SCREEN_WIDTH - WALL_SPRITE_SIZE):
        # Loop for each mirror going across
        for y in range(WALL_SPRITE_SIZE, SCREEN_HEIGHT - WALL_SPRITE_SIZE,
                       WALL_SPRITE_SIZE):
            # Skip making a block 4 and 5 blocks up
            if (y != WALL_SPRITE_SIZE * 4
                    and y != WALL_SPRITE_SIZE * 5) or x != 0:
                wall = arcade.Sprite(
                    "images/nature_tileset_without_gaps/_water/water1_transp.png",
                    WALL_SPRITE_SCALING)
                wall.left = x
                wall.bottom = y
                wall.tag = "mirror"
                wall.code = bin_to_dec(x)
                room.wall_list.append(wall)

    wall = arcade.Sprite(
        "images/nature_tileset_without_gaps/_water/water_full_1.png",
        WALL_SPRITE_SCALING)
    wall.left = 5 * WALL_SPRITE_SIZE
    wall.bottom = 6 * WALL_SPRITE_SIZE
    room.wall_list.append(wall)
    room.background = arcade.load_texture(
        "images/Glacial-mountains-parallax-background_vnitti.png")

    return room
Beispiel #2
0
def volcano_pit():
    """
    Create and return Volcano Pit.
    """
    room = Room()
    """ Set up the game and initialize the variables. """
    # Sprite lists
    room.wall_list = arcade.SpriteList()

    # -- Set up the walls
    # Create bottom and top row of boxes
    # This y loops a list of two, the coordinate 0, and just under the top of window
    for y in (0, SCREEN_HEIGHT - WALL_SPRITE_SIZE):
        # Loop for each box going across
        for x in range(0, SCREEN_WIDTH, WALL_SPRITE_SIZE):
            wall = arcade.Sprite(
                "images/nature_tileset_without_gaps/_lava/lava1.png",
                WALL_SPRITE_SCALING)
            wall.left = x
            wall.bottom = y
            wall.tag = "firewall"
            room.wall_list.append(wall)

    # Create left and right column of boxes
    for x in (0, SCREEN_WIDTH - WALL_SPRITE_SIZE):
        # Loop for each box going across
        for y in range(WALL_SPRITE_SIZE, SCREEN_HEIGHT - WALL_SPRITE_SIZE,
                       WALL_SPRITE_SIZE):
            # Skip making a block 4 and 5 blocks up
            if (y != WALL_SPRITE_SIZE * 4
                    and y != WALL_SPRITE_SIZE * 5) or x != 0:
                wall = arcade.Sprite(
                    "images/nature_tileset_without_gaps/_lava/lava2.png",
                    WALL_SPRITE_SCALING)
                wall.left = x
                wall.bottom = y
                wall.tag = "firewall"
                room.wall_list.append(wall)

    wall = arcade.Sprite(
        "images/images/nature_tileset_without_gaps/_lava/lava2.png",
        WALL_SPRITE_SCALING)
    wall.left = 5 * WALL_SPRITE_SIZE
    wall.bottom = 6 * WALL_SPRITE_SIZE
    room.wall_list.append(wall)
    room.background = \
        arcade.load_texture("images/bgs/PNG/Full/Miscellaneous/volcanoes.png")

    return room
Beispiel #3
0
def create_rooms():
    """ Creates lists for rooms """

    # create empty list
    chambers = []

    # read csv file with rooms
    with open("../data/zalen.csv", "rt") as csvfile:

        # create csvfile
        rooms = csv.reader(csvfile)

        # iterate over rows
        for row in rooms:

            # extract text out of list
            for text in row:

                # split features
                features = text.split(";")

                # initialize features for class
                name = features[0]
                capacity = features[1]

                # initilaze room using the class
                room = Room(name, capacity)

                # add room to list
                chambers.append(room)

    return chambers
Beispiel #4
0
def generate_rooms(roomList):
    myList = []
    for each in roomList:
        myList.append(Room(each[0],each[1]))
    # for _ in myList:
    #     print(_)
    return myList
Beispiel #5
0
def treasury():
    """
    Create and return Treasury.
    """
    room = Room()
    """ Set up the game and initialize the variables. """
    # Sprite lists
    room.wall_list = arcade.SpriteList()

    # -- Set up the walls
    # Create bottom and top row of mirrors
    # This y loops a list of two, the coordinate 0, and just under the top of window
    for y in (0, SCREEN_HEIGHT - WALL_SPRITE_SIZE):
        # Loop for each mirror going across
        for x in range(0, SCREEN_WIDTH, WALL_SPRITE_SIZE):
            wall = arcade.Sprite("images/16x16/Item__71.png",
                                 WALL_SPRITE_SCALING)
            wall.left = x
            wall.bottom = y
            wall.tag = "trophy"
            wall.code = dec_to_bin(x)
            room.wall_list.append(wall)

    # Create left and right column of mirrors
    for x in (0, SCREEN_WIDTH - WALL_SPRITE_SIZE):
        # Loop for each mirror going across
        for y in range(WALL_SPRITE_SIZE, SCREEN_HEIGHT - WALL_SPRITE_SIZE,
                       WALL_SPRITE_SIZE):
            # Skip making a block 4 and 5 blocks up
            if (y != WALL_SPRITE_SIZE * 4
                    and y != WALL_SPRITE_SIZE * 5) or x != 0:
                wall = arcade.Sprite("images/16x16/Item__71.png",
                                     WALL_SPRITE_SCALING)
                wall.left = x
                wall.bottom = y
                wall.tag = "trophy"
                wall.code = bin_to_dec(x)
                room.wall_list.append(wall)

    wall = arcade.Sprite("images/16x16/Item__71.png", WALL_SPRITE_SCALING)
    wall.left = 9 * WALL_SPRITE_SIZE
    wall.bottom = 3 * WALL_SPRITE_SIZE
    room.wall_list.append(wall)
    room.background = arcade.load_texture(
        "images/bgs/PNG/Full/City/classic_city.png")

    return room
Beispiel #6
0
def cliffs_area():
    """
    Create and return Cliffs Area.
    """
    room = Room()
    """ Set up the game and initialize the variables. """
    # Sprite lists
    room.wall_list = arcade.SpriteList()

    # -- Set up the walls
    # Create bottom and top row of boxes
    # This y loops a list of two, the coordinate 0, and just under the top of window
    for y in (0, SCREEN_HEIGHT - WALL_SPRITE_SIZE):
        # Loop for each box going across
        for x in range(0, SCREEN_WIDTH, WALL_SPRITE_SIZE):
            wall = arcade.Sprite(
                "images/nature_tileset_without_gaps/_lava/lava1.png",
                WALL_SPRITE_SCALING)
            wall.left = x
            wall.bottom = y
            wall.tag = "cliff"
            room.wall_list.append(wall)

    # Create left and right column of boxes
    for x in (0, SCREEN_WIDTH - WALL_SPRITE_SIZE):
        # Loop for each box going across
        for y in range(WALL_SPRITE_SIZE, SCREEN_HEIGHT - WALL_SPRITE_SIZE,
                       WALL_SPRITE_SIZE):
            # Skip making a block 4 and 5 blocks up
            if (y != WALL_SPRITE_SIZE * 4
                    and y != WALL_SPRITE_SIZE * 5) or x != 0:
                wall = arcade.Sprite(
                    "images/nature_tileset_without_gaps/_rocky/rocky4.png",
                    WALL_SPRITE_SCALING)
                wall.left = x
                wall.bottom = y
                wall.tag = "cliff"
                room.wall_list.append(wall)

    room.problem = "Find the will to live!"

    if room.is_answered is True:
        room.key = arcade.Sprite("images/16x16/Item__69.png",
                                 WALL_SPRITE_SCALING)
        room.key.center_x = random.randrange(SCREEN_WIDTH)
        room.key.center_y = random.randrange(SCREEN_HEIGHT)
        room.key.draw()

    wall = arcade.Sprite(
        "images/images/nature_tileset_without_gaps/_lava/lava.png",
        WALL_SPRITE_SCALING)
    wall.left = 5 * WALL_SPRITE_SIZE
    wall.bottom = 2 * WALL_SPRITE_SIZE
    room.wall_list.append(wall)
    room.background = \
        arcade.load_texture("images/bgs/PNG/Full/Miscellaneous/volcanoes.png")

    return room
Beispiel #7
0
def intro():
    """
    Create and return instructions area.
    """
    room = Room()
    room.name = "Intro"
    """ Set up the game and initialize the variables. """

    if room.is_answered is True:
        room.key = arcade.Sprite("images/16x16/Item__69.png",
                                 WALL_SPRITE_SCALING)
        room.key.center_x = random.randrange(SCREEN_WIDTH)
        room.key.center_y = random.randrange(SCREEN_HEIGHT)
        room.key.draw()

    # Load the background image for this level.
    room.background = arcade.load_texture("images/classic1.png")

    room.wall_list = arcade.SpriteList()

    return room
Beispiel #8
0
def battle_room():
    """
    Create and return Battle Room!!!
    """
    room = Room()
    room.name = "Battle"
    """ Set up the game and initialize the variables. """
    # Sprite lists
    room.wall_list = arcade.SpriteList()
    room.enemy_list = arcade.SpriteList()

    # -- Set up the walls
    # Create bottom and top row of boxes
    # This y loops a list of two, the coordinate 0, and just under the top of window
    for y in (0, SCREEN_HEIGHT - SPRITE_SIZE):
        # Loop for each box going across
        for x in range(0, SCREEN_WIDTH, SPRITE_SIZE):
            wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky02.png", SPRITE_SCALING)
            wall.left = x
            wall.bottom = y
            wall.tag = "spike"
            room.wall_list.append(wall)

    # Create left and right column of boxes
    for x in (0, SCREEN_WIDTH - WALL_SPRITE_SIZE):
        # Loop for each box going across
        for y in range(SPRITE_SIZE, SCREEN_HEIGHT - SPRITE_SIZE, SPRITE_SIZE):
            # Skip making a block 3 and 5 blocks up on the right side
            if (y != SPRITE_SIZE * 3 and y != SPRITE_SIZE * 5) or x == 0:
                wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky03.png", SPRITE_SCALING)
                wall.left = y
                wall.bottom = x
                wall.tag = "spike"
                room.wall_list.append(wall)

    wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky03.png", SPRITE_SCALING)
    wall.left = 3 * SPRITE_SIZE
    wall.bottom = 2 * SPRITE_SIZE
    room.wall_list.append(wall)
    wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky03.png", SPRITE_SCALING)
    wall.left = 9 * SPRITE_SIZE
    wall.bottom = 9 * SPRITE_SIZE
    room.wall_list.append(wall)
    wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky03.png", SPRITE_SCALING)
    wall.left = 5 * SPRITE_SIZE
    wall.bottom = 4 * SPRITE_SIZE
    room.wall_list.append(wall)
    wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky03.png", SPRITE_SCALING)
    wall.left = 6 * SPRITE_SIZE
    wall.bottom = 6 * SPRITE_SIZE
    room.wall_list.append(wall)

    room.problem = "Attack with [spacebar]!"

    if room.is_answered is True:
        room.key.draw()

    # Load the background image for this level.
    room.background = arcade.load_texture("images/bgs/PNG/Full/Horror/horror1.png")

    return room
Beispiel #9
0
#
# sectalks 0x03 challenge server
#
# This file defines the  game world: Object and Room instances are created and
# assigned relationships to each other. 
#

import os.path
import socket
import struct

from classes import Room, Object

r = Room(
			"""You are standing in front of a desk in a quiet, windowless office.

			There are posters on the walls. The office door is closed. There is
			a faint smell of tuna.""",
		)

room_start = r


poster = Object(
			"""It seems to be some sort of comic. Two people are talking:
			
			-- Wow - engines can burn vegetable oil!
			-- Well, sure. You can burn almost any organic matter. Corns, leaves, spices...
			-- Spices? Really?
			-- Sure - Mussolini made the trains run on thyme.
			-- ... We are no longer friends
Beispiel #10
0
 def import_rooms_from_json(self) -> typing.Iterable[Room]:
     with open(self.rooms_path, 'r') as rooms_file: 
         for room in json.load(rooms_file):
             yield Room(**room)
Beispiel #11
0
from classes import Room

kanto = {}
kanto['pallet_town'] = Room(
    "Pallet Town", "You just moved here, there is your house, along with other three.\nA route starts from the /north.", 'route1', None, None, None, None, None)
kanto['route1'] = Room("Route 1", "Route from Pallet Town to Viridian City.\nGoing /south you can reach Pallet Town",
                       None, 'pallet_town', None, None, None, None)
Beispiel #12
0
food = Item('Some food',['food', 'foods'])

water = Item('A bottle of water',['water', 'bottle', 'waters'])

boots = Item('Walking boots',['boots', 'walking boots', 'shoes'])

stick = Item('Stick',['stick', 'twig', 'branch'])

#Define some enemies

cow = Enemy('Cow')


#Construct some rooms
startRoom = Room()
startRoom.description = "DofE storage warehouse, everything you need is layed out in front of you"
startRoom.shortDescription = "DofE warehouse"
startRoom.addItem(potatoes)
startRoom.addItem(backpack)
startRoom.addItem(food)
startRoom.addItem(water)
startRoom.addItem(boots)

Footpath1 = Room()
Footpath1.description = 'A footpath'
Footpath1.addItem(stick)
Footpath1.shortDescription = "Footpath with trees"

Road1 = Room()
Road1.description = 'A road'
Beispiel #13
0
def battle_room():
    """
    Create and return Battle Room!!!
    """
    room = Room()
    """ Set up the game and initialize the variables. """
    # Sprite lists
    room.wall_list = arcade.SpriteList()

    # enemy creation
    for i in range(STARTING_IMP_COUNT):
        enemy = arcade.Sprite("images/imp_idle.png")
        room.enemy_list.append(enemy)

    # -- Set up the walls
    # Create bottom and top row of boxes
    # This y loops a list of two, the coordinate 0, and just under the top of window
    for y in (0, SCREEN_HEIGHT - WALL_SPRITE_SIZE):
        # Loop for each box going across
        for x in range(0, SCREEN_WIDTH, WALL_SPRITE_SIZE):
            wall = arcade.Sprite(
                "images/nature_tileset_without_gaps/_rocky/rocky02.png",
                WALL_SPRITE_SCALING)
            wall.left = x
            wall.bottom = y
            wall.tag = "spike"
            room.wall_list.append(wall)

    # Create left and right column of boxes
    for x in (0, SCREEN_WIDTH - WALL_SPRITE_SIZE):
        # Loop for each box going across
        for y in range(WALL_SPRITE_SIZE, SCREEN_HEIGHT - WALL_SPRITE_SIZE,
                       WALL_SPRITE_SIZE):
            # Skip making a block 4 and 5 blocks up on the right side
            if (y != WALL_SPRITE_SIZE * 4
                    and y != WALL_SPRITE_SIZE * 5) or x == 0:
                wall = arcade.Sprite(
                    "images/nature_tileset_without_gaps/_rocky/rocky03.png",
                    WALL_SPRITE_SCALING)
                wall.left = x
                wall.bottom = y
                wall.tag = "spike"
                room.wall_list.append(wall)

    wall = arcade.Sprite(
        "images/nature_tileset_without_gaps/_rocky/rocky03.png",
        WALL_SPRITE_SCALING)
    wall.left = 7 * WALL_SPRITE_SIZE
    wall.bottom = 5 * WALL_SPRITE_SIZE
    room.wall_list.append(wall)

    room.problem = "Find the will to live!"

    if room.is_answered is True:
        room.key.draw()

    # Load the background image for this level.
    room.background = arcade.load_texture(
        "images/bgs/PNG/Full/Horror/horror1.png")

    return room
Beispiel #14
0
items = {
    'knife': Item('knife'),
    'coin': Treasure('coin', 75),
    'shield': Item('shield'),
    'lamp': LightSource('lamp')
}

rooms = {
    'outside':
    Room(
        "Outside Cave Entrance",
        "North of you, the cave mount beckons.",
        True,
        [items['knife'], items['shield'], items['lamp']],
        {
            'n': 'foyer',
            's': None,
            'w': None,
            'e': None
        },
    ),
    'foyer':
    Room(
        "Foyer",
        """Dim light filters in from the south. Dusty passages run north and east.""",
        False,
        [],
        {
            'n': 'overlook',
            's': 'outside',
            'w': None,
Beispiel #15
0
from classes import living_room
from classes.kitchen import Kitchen
from classes import Room, Kitchen, LivingRoom, BathRoom, Studio

room1 = Room(10, 12, 4)
room2 = Room(30, 40, 2)

print(room2.length, room2.width, room2.number_of_windows)

# # Class variables can be accessed by the instance or the class
print(f'Does room 2 have a ceiling {room2.HAS_CEILING}')
print(f'Do rooms have a ceiling? {Room.HAS_CEILING}')

# # Even though it's a "constant" the value can still be changed
# room1.HAS_CEILING = False
# print(room1.HAS_CEILING)

# # Instances can call instance, static, and class methods
room1.turn_on_lights()
room1.static_method('Hannah')
# room1.rip_off_all_ceilings()

# print(f'Does room 2 have a ceiling {room2.HAS_CEILING}')

# # The class can only call static and class methods
Room.rip_off_all_ceilings()
Room.static_method('Hannah')
# # This will error because there isn't a 'self' to be passed to the method
# Room.turn_on_lights()

# # Using a property looks like a variable
Beispiel #16
0
    def make_map(MAP_HEIGHT, MAP_WIDTH, player, objects):
        from classes import Room as Room
        from classes import Object as Object
        import libtcodpy as libtcod
        global game_map

        ROOM_MAX_SIZE = 10
        ROOM_MIN_SIZE = 6
        MAX_ROOMS = 30
        rooms = []
        num_rooms = 0

        #fill map with unblocked tiles
        game_map = [[Tile(True, None) for y in range(MAP_HEIGHT)]
                    for x in range(MAP_WIDTH)]

        for r in range(MAX_ROOMS):
            #random width and height
            w = libtcod.random_get_int(0, ROOM_MIN_SIZE, ROOM_MAX_SIZE)
            h = libtcod.random_get_int(0, ROOM_MIN_SIZE, ROOM_MAX_SIZE)
            #random position without going out of the boundaries of the map
            x = libtcod.random_get_int(0, 0, MAP_WIDTH - w - 1)
            y = libtcod.random_get_int(0, 0, MAP_HEIGHT - h - 1)

            new_room = Room.Room(x, y, w, h)

            if rooms:
                other_room = rooms[num_rooms - 1]
            else:
                other_room = Room.Room(0, 0, 0, 0)

            #run through the other rooms and see if they intersect with this onee
            if not new_room.intersect(other_room):
                #this means there are no intersections, so this room is valid
                #"paint" it to the map's tiles

                Room.Room.create_room(new_room, game_map)
                #center coordinates of new room, will be useful later
                (new_x, new_y) = new_room.center()

                if num_rooms == 0:
                    #this is the first room, where the player starts at
                    player.x = new_x
                    player.y = new_y

                else:
                    #all rooms after the first:
                    #connect it to the previous room with a tunnel

                    #center coordinates of previous room
                    (prev_x, prev_y) = rooms[num_rooms - 1].center()

                    #draw a coin (random number that is either 0 or 1)
                    if libtcod.random_get_int(0, 0, 1) == 1:
                        #first move horizontally, then vertically
                        Room.Room.create_h_tunnel(prev_x, new_x, prev_y,
                                                  game_map)
                        Room.Room.create_v_tunnel(prev_y, new_y, new_x,
                                                  game_map)
                    else:
                        #first move vertically, then horizontally
                        Room.Room.create_v_tunnel(prev_y, new_y, prev_x,
                                                  game_map)
                        Room.Room.create_h_tunnel(prev_x, new_x, new_y,
                                                  game_map)

                Tile.populate_room(new_room, game_map, objects)
                #finally, append the new room to the list
                rooms.append(new_room)
                num_rooms += 1

        return game_map
Beispiel #17
0
 def import_rooms_from_json(self):
     with open(self.rooms_path, 'r') as rooms_file:
         for room in json.load(rooms_file):
             yield Room(**room)
Beispiel #18
0
def cliffs_area():
    """
    Create and return Cliffs Area.
    """
    room = Room()

    """ Set up the game and initialize the variables. """
    # Sprite lists
    room.wall_list = arcade.SpriteList()
    room.item_list = arcade.SpriteList()

    # # collect pies
    # # Set up the items
    # for i in range(10):
    #     # Create the item instance
    #     item = arcade.Sprite("images/16x16/Item__67.png", SPRITE_SCALING * 3)
    #
    #     # Position the item
    #     item.center_x = random.randrange(SCREEN_WIDTH - 150)
    #     item.center_y = random.randrange(SCREEN_HEIGHT - 150)
    #
    #     # Add the item to the lists
    #     room.item_list.append(item)

    # -- Set up the walls
    # Create bottom and top row of boxes
    # This y loops a list of two, the coordinate 0, and just under the top of window
    for y in (0, SCREEN_HEIGHT - SPRITE_SIZE):
        # Loop for each box going across
        for x in range(0, SCREEN_WIDTH, SPRITE_SIZE):
            wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky04.png", SPRITE_SCALING)
            wall.left = x
            wall.bottom = y
            room.wall_list.append(wall)

    # Create left and right column of boxes
    for x in (0, SCREEN_WIDTH - SPRITE_SIZE):
        # Loop for each box going across
        for y in range(SPRITE_SIZE, SCREEN_HEIGHT - SPRITE_SIZE, SPRITE_SIZE):
            # Skip making a block 4 and 5 blocks up on the right side
            if (y != SPRITE_SIZE * 4 and y != SPRITE_SIZE * 5) or x == 0:
                wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky04.png", SPRITE_SCALING)
                wall.left = x
                wall.bottom = y
                wall.tag = "cliff"
                room.wall_list.append(wall)

    wall = arcade.Sprite("images/nature_tileset_without_gaps/_rocky/rocky04.png", SPRITE_SCALING)
    wall.left = 7 * SPRITE_SIZE
    wall.bottom = 5 * SPRITE_SIZE
    room.wall_list.append(wall)

    room.problem = "Find the will to live!"

    if room.is_answered is True:
        room.key = arcade.Sprite("images/16x16/Item__69.png", WALL_SPRITE_SCALING)
        room.key.center_x = random.randrange(SCREEN_WIDTH)
        room.key.center_y = random.randrange(SCREEN_HEIGHT)
        room.key.draw()

    # Load the background image for this level.
    room.background = arcade.load_texture("images/bgs/PNG/Full/Horror/horror2_nomoon.png")

    return room
Beispiel #19
0
from classes import Room

#Create the room (map_uni)
none = Room('', '', '', '')
room_hall = Room('Hall',
                 'You enter a long hall with various portraits on the walls.',
                 {'north': 'Reception'}, ['notebook'])
room_reception = Room(
    'Reception',
    'You enter the main reception of the building. The room is empty.', {
        'south': 'Hall',
        'west': 'Cafe',
        'north': 'Class',
        'east': 'Office'
    }, [])
room_office = Room(
    'Office',
    'You step into a well iluminated office with a paintig of a snowy landscape on the wall.',
    {'west': 'Reception'}, ['notebook'])
room_cafe = Room(
    'Cafe',
    'Before you is a busy cafe. The barista is strugling to keep up with the work load and looks at you desperately as you walk in.',
    {'east': 'Reception'}, ['notebook'])
room_class = Room(
    'Class',
    'You enter an empty class room. On the black board you notice a complicated equation.',
    {'south': 'Reception'}, ['notebook'])

#room dictionary for navigation
map_uni = {
    'Reception': room_reception,
Beispiel #20
0
#
# sectalks 0x03 challenge server
#
# This file defines the  game world: Object and Room instances are created and
# assigned relationships to each other.
#

import os.path
import socket
import struct

from classes import Room, Object

r = Room(
    """You are standing in front of a desk in a quiet, windowless office.

			There are posters on the walls. The office door is closed. There is
			a faint smell of tuna.""", )

room_start = r

poster = Object(
    """It seems to be some sort of comic. Two people are talking:
			
			-- Wow - engines can burn vegetable oil!
			-- Well, sure. You can burn almost any organic matter. Corns, leaves, spices...
			-- Spices? Really?
			-- Sure - Mussolini made the trains run on thyme.
			-- ... We are no longer friends

			You assume this is supposed to be funny. """, )
Beispiel #21
0
        #barehands = randint(4, 7)
        #fistwrappings = randint(5, 8)
        #brassknuckles = rantint(7, 10)

        #health variables
        rags = 15
        parka = 20
        leather = 30

        herodamageintmin = 3
        herodamageintmax = 6
        ''' 
        Room pt 1 Attributes
        '''
        # attic
        attic = Room("attic", False, False, False)
        desc = (
            "- The roof is cracked. To your left you see a circular gable vent tilted open at a precarious angle. "
            "Dense but gentle snowflakes are wafting in through the broken roof. To your right is a gray, weathered door. "
            "It doesn't look like there is any loot for you here. You feel safe but terribly alone."
        )
        attic.set_description(desc)
        attic.lootable = False

        # hallway
        hallway = Room("hallway", "", False, False)
        hallway.name = "hallway"
        hallway.set_description(
            "- It doesn't look like there's any loot in the hallway, "
            "but there are three doors along its length which might contain something."
            " You're certain there's something or someone at the end of the hallway."
Beispiel #22
0
    creatures = []
    i = random.randint(0,3)
    if i == 2:
        creatures.append(mutant)
    elif i == 3:
        creatures.append(drone)
    return creatures
    




#------------REGION 1: THE JUNGLE------------
warehouse = Room("Warehouse", [0,0,0], [], """You are in what appears to be a large abandoned amazon fulfilment centre. 
                Rows of shelves stretch along the warehouse. The floor is littered with long-dead package retrieval robots.
                There is no sound, and almost no light, save for a faint glow from a large green message scrawled
                on the north wall. The message reads: if you seek answers, journey north and find headquarters. 
                Under the text, you can see a door, slightly ajar. There do not appear to be any other exits""", [shelves, boxes, torch], True, [])
                
jungle_SW = Room("Southwest Jungle",[0,1,0],"",[machete], [], False, [])
#machete is needed to cut through from jungle into forest

jungle_SE = Room("Southeast Jungle",[1,1,0],"",[tree, rope], [], False, [])
#tree can be used as a vantage point to see the next area

jungle_NE = Room("Northeast Jungle",[1,2,0],"",[pistol], generate_creatures(), False, [])
#pistol is a weapon

jungle_NW = Room("Northwest Jungle",[0,2,0],"",[body, coat, medicine], generate_creatures(), False, [])
#coat is needed to survive in the northern half of the forest
Beispiel #23
0
from classes import Room, Person, Item, GameState

rooms = [Room() for i in range(5)]

rooms[0].description = "The centre of the maze"
rooms[0].addExit('NW', rooms[1])
rooms[0].addExit('NE', rooms[2])
rooms[0].addExit('SW', rooms[3])
rooms[0].addExit('SE', rooms[4])
rooms[0].addItem(Item("Chekhov's Gun", ['gun']))

rooms[1].description = "The first room"
rooms[1].addExit('E', rooms[2])
rooms[1].addExit('S', rooms[3])
rooms[1].addItem(Item("Yakimov's Knife", ['knife']))

rooms[1].addExit('SE', rooms[0])

rooms[2].description = "The second room"

rooms[2].addExit('W', rooms[1])
rooms[2].addExit('S', rooms[4])
rooms[2].addExit('SW', rooms[0])

rooms[3].description = "The third room"
rooms[3].addExit('N', rooms[1])
rooms[3].addExit('E', rooms[4])
rooms[3].addExit('NE', rooms[0])
rooms[3].addItem(Item("Rudnikov's Spatula", ['spatula']))

rooms[4].description = "The fourth room"