示例#1
0
def do_dig(client, args, msg):
    if len(args) == 1:
        current_room = world.get_room(client.player.room)
        zone = world.get_zone(current_room.zone)
        dir = args[0]
        if current_room.exits.has_exit_by_string(dir):
            client.send("error", db.get_msg('building.error_dig_overlap'))
            return
        for e in EXIT_NAMES.keys():
            if dir == EXIT_NAMES[e].lower():
                md = MAP_DIR[e]
                cl = current_room.get_loc()
                new_room = Room(db.new_room(zone, (cl[0]+md[0], cl[1]+md[1], cl[2]+md[2])))
                out_exit = db.new_exit(dir, new_room.short_name)
                in_exit = db.new_exit(OPPOSITE_EXIT[dir], current_room.short_name)
                current_room.exits.add_exit(out_exit)
                new_room.exits.add_exit(in_exit)
    else:
        client.send("error", 'Usage: dig <dir>')
示例#2
0
    else:
        pygame.draw.line(image, (100,100,100), (x, y+SIZE), (x+SIZE, y+SIZE), 1)

    if room.exits.has_exit_by_string("east"):
        pygame.draw.line(image, (50,50,50), (x+SIZE, y), (x+SIZE, y+SIZE), 1)
    else:
        pygame.draw.line(image, (100,100,100), (x+SIZE, y), (x+SIZE, y+SIZE), 1)

    if room.exits.has_exit_by_string("west"):
        pygame.draw.line(image, (50,50,50), (x, y), (x, y+SIZE), 1)
    else:
        pygame.draw.line(image, (100,100,100), (x, y), (x, y+SIZE), 1)

    

zone = world.get_zone('limbo')
rooms = zone.get_rooms()

print "Generating map for %s\n" % zone.name

minx, maxx = 0, 0
miny, maxy = 0, 0

for r in rooms.values():
    x, y, z = r.get_loc()
    if x < minx: minx = x
    if y < miny: miny = y
    if x > maxx: maxx = x
    if y > maxy: maxy = y

bounds = (abs(minx) + maxx, abs(miny) + maxy)
示例#3
0
def do_zr(client, args, msg):
    room = world.get_room(client.player.room)
    zone = world.get_zone(room.zone)
    zone.reset()