1 #include "load/world-loader.h"
2 #include "cmd-building/cmd-building.h"
3 #include "dungeon/dungeon.h"
4 #include "floor/wild.h"
5 #include "load/angband-version-comparer.h"
6 #include "load/load-util.h"
7 #include "load/load-zangband.h"
8 #include "market/bounty.h"
9 #include "system/floor-type-definition.h"
10 #include "world/world.h"
12 static void rd_hengband_dungeons(void)
14 byte max = (byte)current_world_ptr->max_d_idx;
17 for (int i = 0; i < max; i++) {
20 if (max_dlv[i] > d_info[i].maxdepth)
21 max_dlv[i] = d_info[i].maxdepth;
25 void rd_dungeons(player_type *creature_ptr)
27 if (z_older_than(10, 3, 8))
28 rd_zangband_dungeon();
30 rd_hengband_dungeons();
32 if (creature_ptr->max_plv < creature_ptr->lev)
33 creature_ptr->max_plv = creature_ptr->lev;
37 * @brief 現実変容処理の有無及びその残りターン数を読み込む
38 * @param creature_ptr プレーヤーへの参照ポインタ
41 void rd_alter_reality(player_type *creature_ptr)
44 if (z_older_than(10, 3, 8))
45 creature_ptr->recall_dungeon = DUNGEON_ANGBAND;
48 creature_ptr->recall_dungeon = (byte)tmp16s;
51 if (h_older_than(1, 5, 0, 0))
52 creature_ptr->alter_reality = 0;
54 rd_s16b(&creature_ptr->alter_reality);
57 void set_gambling_monsters(void)
59 const int max_gambling_monsters = 4;
60 for (int i = 0; i < max_gambling_monsters; i++) {
61 rd_s16b(&battle_mon[i]);
62 if (z_older_than(10, 3, 4))
63 set_zangband_gambling_monsters(i);
65 rd_u32b(&mon_odds[i]);
70 * @details 自動拾い関係はこれしかないのでworldに突っ込むことにする。必要があれば再分割する
72 void rd_autopick(player_type *creature_ptr)
76 creature_ptr->autopick_autoregister = tmp8u != 0;
79 static void set_undead_turn_limit(player_type *creature_ptr)
81 switch (creature_ptr->start_race) {
86 current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
89 current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
94 static void rd_world_info(player_type *creature_ptr)
96 set_undead_turn_limit(creature_ptr);
97 current_world_ptr->dungeon_turn_limit = TURNS_PER_TICK * TOWN_DAWN * (MAX_DAYS - 1) + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
98 rd_s32b(&creature_ptr->current_floor_ptr->generated_turn);
99 if (h_older_than(1, 7, 0, 4))
100 creature_ptr->feeling_turn = creature_ptr->current_floor_ptr->generated_turn;
102 rd_s32b(&creature_ptr->feeling_turn);
104 rd_s32b(¤t_world_ptr->game_turn);
105 if (z_older_than(10, 3, 12))
106 current_world_ptr->dungeon_turn = current_world_ptr->game_turn;
108 rd_s32b(¤t_world_ptr->dungeon_turn);
110 if (z_older_than(11, 0, 13))
111 set_zangband_game_turns(creature_ptr);
113 if (z_older_than(10, 3, 13))
114 current_world_ptr->arena_start_turn = current_world_ptr->game_turn;
116 rd_s32b(¤t_world_ptr->arena_start_turn);
118 if (z_older_than(10, 0, 3))
119 determine_daily_bounty(creature_ptr, TRUE);
122 rd_s16b(&creature_ptr->today_mon);
126 void rd_visited_towns(player_type *creature_ptr)
128 if (z_older_than(10, 3, 9)) {
129 creature_ptr->visit = 1L;
133 if (z_older_than(10, 3, 10)) {
134 set_zangband_visited_towns(creature_ptr);
140 creature_ptr->visit = (BIT_FLAGS)tmp32s;
143 void rd_global_configurations(player_type *creature_ptr)
145 rd_u32b(¤t_world_ptr->seed_flavor);
146 rd_u32b(¤t_world_ptr->seed_town);
148 rd_u16b(&creature_ptr->panic_save);
149 rd_u16b(¤t_world_ptr->total_winner);
150 rd_u16b(¤t_world_ptr->noscore);
154 creature_ptr->is_dead = tmp8u;
156 rd_byte(&creature_ptr->feeling);
157 rd_world_info(creature_ptr);
160 void load_wilderness_info(player_type *creature_ptr)
162 rd_s32b(&creature_ptr->wilderness_x);
163 rd_s32b(&creature_ptr->wilderness_y);
164 if (z_older_than(10, 3, 13)) {
165 creature_ptr->wilderness_x = 5;
166 creature_ptr->wilderness_y = 48;
169 if (z_older_than(10, 3, 7))
170 creature_ptr->wild_mode = FALSE;
172 rd_byte((byte *)&creature_ptr->wild_mode);
174 if (z_older_than(10, 3, 7))
175 creature_ptr->ambush_flag = FALSE;
177 rd_byte((byte *)&creature_ptr->ambush_flag);
180 errr analyze_wilderness(void)
184 rd_s32b(&wild_x_size);
185 rd_s32b(&wild_y_size);
187 if ((wild_x_size > current_world_ptr->max_wild_x) || (wild_y_size > current_world_ptr->max_wild_y)) {
188 load_note(format(_("荒野が大きすぎる(%u/%u)!", "Wilderness is too big (%u/%u)!"), wild_x_size, wild_y_size));
192 for (int i = 0; i < wild_x_size; i++)
193 for (int j = 0; j < wild_y_size; j++)
194 rd_u32b(&wilderness[j][i].seed);