def _room_main(w, h, wall_material, floor_material): M = room_default(w, h, wall_type=wall_material, floor_type=floor_material) M[1, h - 2].put(T.furniture_closet()) M[w - 2, 1].put(random.choice([T.furniture_chimney(), T.furniture_hearth()])) M[w - 2, 2].put(random.choice([T.food_meat(), T.food_egg()])) for x in (w - 3, w - 4): M[x, 1].put(T.furniture_longtable()) M[w - 5, 1].put(random.choice([T.bucket(), T.bag()])) M[w - 2, h - 2].put(T.furniture_chest_profile()) lantern_w = random.randint(5, w - 4) M[lantern_w, h - 2].put(T.light_lantern()) M[3, h - 1] = C.door_closed() if w >= 11: table_h = 1 if h <= 7 else h // 2 - 1 M[4, table_h].put(T.furniture_table()) M[3, table_h].put(T.furniture_stool()) M[5, table_h].put(T.furniture_stool()) M[4, table_h + 1].put(T.furniture_stool()) if table_h > 1: pantry = _interior_pantry(3, h // 3, wall_material, floor_material) M.meld(pantry, 1, 1) elif w < 11: pantry = _interior_pantry(3, h // 3, wall_material, floor_material) M.meld(pantry, 1, 1) return M
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
def _room_kitchen(w, h, wall_material, floor_material): M = room_default(w, h, wall_type=wall_material, floor_type=floor_material) storage = room_default(6, 6, wall_type=wall_material, floor_type=floor_material) M.meld(storage, 0, 0) M[5, h-3] = C.door_open_empty() M[10, h-1] = C.door_open_empty() M[7, 0] = C.door_closed_window() for x in range(1, 3): for y in range(1, 3): M[x, y] = C.flora_mushroom_button() storage_items = [ T.furniture_barrel(), T.furniture_barrel(), T.furniture_barrel(), T.furniture_barrel(), T.furniture_box_filled(), T.furniture_box_filled(), T.bag(), T.food_leaf() ] storage_w = 6 M.scatter(1, 1, 5, h-1, storage_items, exclude=[ (storage_w-2, h-3), (storage_w-3, h-3), (storage_w-4, h-3), (storage_w-3, h-4), (1, 1), (1, 2), (2, 1), (2, 2) ]) for x in range(8, 11): M[x, 1].put(T.furniture_hearth()) for x in range(8, 11): M[x, 3].put(T.furniture_table()) M[13, 1] = C.stairs_down() M[11, 1].put(T.bucket()) for y in range(1, 3): M[6, y].put(T.food_meat()) M[6, 4].put(T.food_egg()) M[11, 3].put(T.furniture_box_filled()) M.scatter(6, 1, 14, 5, [A.animal_cat()]) if w > 15: num_of_items = (w - 15) * 2 food_items = [ T.furniture_barrel(), T.furniture_barrel(), T.furniture_barrel(), T.furniture_box_filled(), T.furniture_box_filled(), T.bag() ] M.scatter(15, 1, w-1, h-1, random.sample(food_items, min(len(food_items), num_of_items))) return M
def _room_kitchen(w, h, wall_material, floor_material): M = room_default(w, h, wall_type=wall_material, floor_type=floor_material) for x in range(2, w - 1): M[x, h - 4].put(T.furniture_longtable()) for x in range(3, w - 1): M[x, h - 2].put(T.furniture_box_filled()) M[w - 2, h - 3].put(T.furniture_stool()) for y in range(4, h - 5): M[1, y].put(T.furniture_barrel()) M[w - 2, 5].put(T.furniture_hearth()) M[1, h - 2].put(T.bucket()) M[w - 2, 3] = C.stairs_down() M[1, 1].put(T.farm_mangler()) items = [T.food_apple(), T.food_cheese(), T.food_chicken(), T.food_egg()] M.scatter(w - 2, 1, w - 1, h - 6, items, exclude=[(w - 2, 3)]) return M