1 #include "market/building-initializer.h"
2 #include "floor/floor-town.h"
3 #include "object/object-kind.h"
4 #include "object/object-kind-hook.h"
5 #include "player-info/class-types.h"
6 #include "store/articles-on-sale.h"
7 #include "store/store-owners.h"
8 #include "store/store-util.h"
9 #include "store/store.h"
10 #include "system/angband.h"
11 #include "system/building-type-definition.h"
12 #include "system/object-type-definition.h"
16 * @brief 町情報読み込みのメインルーチン /
17 * Initialize town array
21 town_info = std::vector<town_type>(max_towns);
22 for (int i = 1; i < max_towns; i++) {
23 town_info[i].store = std::vector<store_type>(MAX_STORES);
24 for (auto sst : STORE_SALE_TYPE_LIST) {
25 store_type *store_ptr = &town_info[i].store[enum2i(sst)];
26 if ((i > 1) && (sst == StoreSaleType::MUSEUM || sst == StoreSaleType::HOME))
30 * 我が家が 20 ページまで使える隠し機能のための準備。
31 * オプションが有効でもそうでなくても一応スペースを作っておく。
33 store_ptr->stock_size = store_get_stock_max(sst);
35 store_ptr->stock = std::make_unique<object_type[]>(store_ptr->stock_size);
36 if ((sst == StoreSaleType::BLACK) || (sst == StoreSaleType::HOME) || (sst == StoreSaleType::MUSEUM))
39 for (int k = 0; k < STORE_INVEN_MAX; k++) {
40 auto tv = store_regular_table[enum2i(sst)][k].tval;
41 auto sv = store_regular_table[enum2i(sst)][k].sval;
42 if (tv == ItemKindType::NONE)
45 KIND_OBJECT_IDX k_idx = lookup_kind(tv, sv);
50 store_ptr->regular.push_back(k_idx);
53 for (int k = 0; k < STORE_CHOICES; k++) {
54 auto tv = store_table[enum2i(sst)][k].tval;
55 auto sv = store_table[enum2i(sst)][k].sval;
56 if (tv == ItemKindType::NONE)
59 KIND_OBJECT_IDX k_idx = lookup_kind(tv, sv);
64 store_ptr->table.push_back(k_idx);
71 * @brief 店情報初期化のメインルーチン /
72 * Initialize buildings
74 void init_buildings(void)
76 for (int i = 0; i < MAX_BLDG; i++) {
77 building[i].name[0] = '\0';
78 building[i].owner_name[0] = '\0';
79 building[i].owner_race[0] = '\0';
81 for (int j = 0; j < 8; j++) {
82 building[i].act_names[j][0] = '\0';
83 building[i].member_costs[j] = 0;
84 building[i].other_costs[j] = 0;
85 building[i].letters[j] = 0;
86 building[i].actions[j] = 0;
87 building[i].action_restr[j] = 0;
90 building[i].member_class.assign(PLAYER_CLASS_TYPE_MAX, static_cast<short>(PlayerClassType::WARRIOR));
91 building[i].member_race.assign(MAX_RACES, static_cast<short>(PlayerRaceType::HUMAN));
92 building[i].member_realm.assign(MAX_MAGIC + 1, 0);