Example #1
0
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
Example #2
0
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_treasury(w, h, wall_material, floor_material):
    M = room_default(w, h, wall_type=wall_material, floor_type=floor_material)
    items = [
        T.money_pile(),
        T.money_pile(),
        T.necklace(),
        T.mineral_geode(),
        T.mineral_diamond(),
        T.magic_orb(),
        T.scroll_text(),
        T.ring(),
        T.bag(),
    ]
    M.scatter(1, 1, w - 1, h - 1, items, exclude=[(w - 2, h - 3)])

    return M
Example #4
0
def _room_shop(w, h, shop_type, wall_material, floor_material):
    M = room_default(w, h, wall_type=wall_material, floor_type=floor_material)
    M[w // 2, h - 1] = C.door_closed()
    M[1, h - 2].put(T.light_lantern_oil())

    shop_counter_h = h // 2 - 1

    for x in range(w - 3):
        cell_x = 2 + x
        M[cell_x, shop_counter_h].put(T.furniture_longtable_showcase())
    M[w - 2, shop_counter_h - 1].put(T.money_pile())

    type_items = {
        'food': [T.food_meat(), T.food_carrot(),
                 T.food_apple()],
        'jewelry': [T.necklace(), T.necklace_star(),
                    T.ring()],
        'clothe': [T.clothes_coat(),
                   T.clothes_hat(),
                   T.clothes_belt()],
        'weapon':
        [T.weapon_sword_rapier(),
         T.weapon_naginata(),
         T.weapon_crossbow()],
        'armor': [T.helmet(), T.armor_mail(),
                  T.clothes_belt()],
        'potion': [T.potion_health(),
                   T.potion_mana_empty(),
                   T.potion_magic()],
        'tool': [T.tool_tongs(),
                 T.tool_pickaxe(),
                 T.tool_broom()],
        'magic': [T.magic_orb(),
                  T.weapon_stave(),
                  T.potion_stamina()]
    }
    M.scatter(2, 1, w - 2, 2, type_items[shop_type])

    type_items = {
        'food': [
            T.furniture_box_filled(),
            T.furniture_box_filled(),
            T.bag(),
            T.food_milk()
        ],
        'jewelry': [T.mineral_crystal(),
                    T.bag(),
                    T.necklace(),
                    T.ring()],
        'clothe': [
            T.clothes_boots_right(),
            T.clothes_shirt(),
            T.clothes_shirt_inverted(),
            T.clothes_sweater()
        ],
        'weapon': [
            T.weapon_sword(),
            T.weapon_sword_saber(),
            T.weapon_spear(),
            T.weapon_dagger()
        ],
        'armor': [
            T.helmet(),
            T.armor_mail(),
            T.furniture_mannequin(),
            T.shield_buckler()
        ],
        'potion': [
            T.potion_magic_empty(),
            T.potion_stamina(),
            T.dining_bottle(),
            T.potion_health_empty()
        ],
        'tool': [
            T.tool_nails(),
            T.tool_scissors(),
            T.tool_fishingrod(),
            T.tool_pitchfork()
        ],
        'magic': [
            T.weapon_stave(),
            T.book_magic(),
            T.scroll_magic(),
            T.scroll_curled()
        ]
    }
    coord_exclude = [(x, y) for x in range(2, w - 2)
                     for y in range(shop_counter_h + 2, shop_counter_h + 4)]
    coord_exclude.append((w // 2, h - 2))

    M.scatter(2,
              shop_counter_h + 1,
              w - 1,
              h - 1,
              type_items[shop_type],
              exclude=coord_exclude)

    cat_place_x = random.randint(1, 2)
    cat_place_y = random.randint(shop_counter_h + 1, h - 3)
    M[cat_place_x, cat_place_y].put(A.animal_cat())

    return M