Пример #1
0
def _room_cattle_pens(w, h, wall_material, floor_material):
    M = room_default(w, h, wall_type=C.wall_fence, floor_type=floor_material)
    M[w - 7, 0] = C.door_close_fence()
    for i in range(w * h // 3):
        grass_x = random.randint(1, w - 2)
        grass_y = random.randint(1, h - 2)
        M[grass_x, grass_y] = random.choice(
            [C.flora_grass, C.flora_cane, C.floor_grass])()
    num_cattles = h // 4 + 1
    cowshed = Map(4, 3, fill_cell=floor_material)
    for y in (1, 2):
        cowshed[0, y] = C.wall_fence()
    for y in range(0, 3):
        cowshed[3, y].put(T.water_trough())
    for x in (1, 2):
        cowshed[x, 2] = wall_material()
    cowshed[1, 1].put(T.bucket())
    cowshed_y = 1
    for x in range(num_cattles):
        copied_cowshed = deepcopy(cowshed)
        M.meld(copied_cowshed, w - 5, cowshed_y)
        cowshed_y += 3
    cows = [A.animal_cow() for _ in range(num_cattles)]
    M.scatter(1, 1, w - 5, h - 1, cows)

    return M
Пример #2
0
def _room_outdoor(w, h):
    M = Map(w, h, fill_cell=C.floor_rocks)
    for i in range(w * h // 3):
        grass_x = random.randint(1, w - 1)
        grass_y = random.randint(0, h - 2)
        M[grass_x, grass_y] = random.choice(
            [C.flora_grass, C.flora_tree, C.floor_grass])()
    M[w - 1, 0].put(T.washtub())
    for x in range(w):
        M[x, h - 1] = C.wall_fence_thin()
    for y in range(h - 1):
        M[0, y] = C.wall_fence_thin()
    for y in range(h - 1):
        M[3, y] = C.floor_rocks()
    M[3, h - 1] = C.door_close_fence()

    return M
Пример #3
0
def _room_outdoor(w, h):
    M = Map(w, h, fill_cell=C.floor_rocks)
    for i in range(w*h//3):
        grass_x = random.randint(0, w-1)
        grass_y = random.randint(0, h-1)
        M[grass_x, grass_y] = random.choice([C.flora_grass, C.flora_tree, C.floor_grass])()
    for x in (1, 8):
        M[x, 0].put(T.furniture_table())
    for x in (0, 2, 7, 9):
        M[x, 0].put(T.furniture_stool())
    if w > 13:
        M[11, 0].put(T.furniture_table())
        M[10, 0].put(T.furniture_stool())
        M[12, 0].put(T.furniture_stool())
    for y in range(0, h):
        M[4, y] = C.floor_cobblestone()

    num_stables = (h - 5) // 2
    stables = Map(3, 2, fill_cell=C.void)
    for x in range(3):
        stables[x, 0] = C.wall_fence_thin()
    stables[2, 1] = C.wall_fence_thin()
    stables[0, 1] = C.door_close_fence()
    stables[1, 1].put(A.animal_horse())
    last_stable_y = h - 1
    for i in range(num_stables):
        stable_x = w - 3
        stable_y = 4 + (i * 2)
        M.meld(stables, stable_x, stable_y)
        last_stable_y = stable_y
    for x in range(w-3, w):
        M[x, last_stable_y + 2] = C.wall_fence_thin()
    M[2, h-1].put(T.sign_pointer())
    M[3, 0].put(T.light_torch())
    for y in (h//2-1, h//2):
        M[0, y].put(T.washtub())
    if w > 9:
        M[0, h//2+1].put(T.washtub())
    M[5, 0] = C.flora_flower()

    return M