1 #include "save/info-writer.h"
2 #include "birth/quick-start.h"
3 #include "game-option/cheat-options.h"
4 #include "game-option/option-flags.h"
5 #include "game-option/option-types-table.h"
6 #include "game-option/special-options.h"
7 #include "save/item-writer.h"
8 #include "save/save-util.h"
9 #include "store/store-util.h"
10 #include "system/angband.h"
11 #include "system/object-type-definition.h"
12 #include "world/world.h"
15 * @brief セーブデータに店舗情報を書き込む / Write a "store" record
16 * @param store_ptr 店舗情報の参照ポインタ
19 void wr_store(store_type *store_ptr)
21 wr_u32b(store_ptr->store_open);
22 wr_s16b(store_ptr->insult_cur);
23 wr_byte(store_ptr->owner);
24 wr_s16b(store_ptr->stock_num);
25 wr_s16b(store_ptr->good_buy);
26 wr_s16b(store_ptr->bad_buy);
27 wr_s32b(store_ptr->last_visit);
28 for (int j = 0; j < store_ptr->stock_num; j++)
29 wr_item(&store_ptr->stock[j]);
33 * @brief セーブデータに乱数情報を書き込む / Write RNG state
37 void wr_randomizer(void)
41 for (int i = 0; i < RAND_DEG; i++)
42 wr_u32b(Rand_state[i]);
46 * @brief ゲームオプション情報を書き込む / Write the "options"
49 void wr_options(save_type type)
51 for (int i = 0; i < 4; i++)
54 wr_byte(delay_factor);
55 wr_byte(hitpoint_warn);
58 /*** Cheating options ***/
60 if (current_world_ptr->wizard)
90 if (cheat_diary_output)
93 if (type == SAVE_TYPE_DEBUG)
100 wr_s16b(autosave_freq);
102 for (int i = 0; option_info[i].o_desc; i++) {
103 int os = option_info[i].o_set;
104 int ob = option_info[i].o_bit;
105 if (!option_info[i].o_var)
108 if (*option_info[i].o_var)
109 option_flag[os] |= (1L << ob);
111 option_flag[os] &= ~(1L << ob);
114 for (int i = 0; i < 8; i++)
115 wr_u32b(option_flag[i]);
117 for (int i = 0; i < 8; i++)
118 wr_u32b(option_mask[i]);
120 for (int i = 0; i < 8; i++)
121 wr_u32b(window_flag[i]);
123 for (int i = 0; i < 8; i++)
124 wr_u32b(window_mask[i]);
128 * @brief ダミー情報スキップを書き込む / Hack -- Write the "ghost" info
133 wr_string(_("不正なゴースト", "Broken Ghost"));
134 for (int i = 0; i < 60; i++)
139 * @brief クイック・スタート情報を書き込む / Save quick start data
142 void save_quick_start(void)
144 wr_byte(previous_char.psex);
145 wr_byte((byte)previous_char.prace);
146 wr_byte((byte)previous_char.pclass);
147 wr_byte((byte)previous_char.pseikaku);
148 wr_byte((byte)previous_char.realm1);
149 wr_byte((byte)previous_char.realm2);
151 wr_s16b(previous_char.age);
152 wr_s16b(previous_char.ht);
153 wr_s16b(previous_char.wt);
154 wr_s16b(previous_char.sc);
155 wr_s32b(previous_char.au);
157 for (int i = 0; i < A_MAX; i++)
158 wr_s16b(previous_char.stat_max[i]);
160 for (int i = 0; i < A_MAX; i++)
161 wr_s16b(previous_char.stat_max_max[i]);
163 for (int i = 0; i < PY_MAX_LEVEL; i++)
164 wr_s16b((s16b)previous_char.player_hp[i]);
166 wr_s16b(previous_char.chaos_patron);
167 for (int i = 0; i < 8; i++)
168 wr_s16b(previous_char.vir_types[i]);
170 for (int i = 0; i < 4; i++)
171 wr_string(previous_char.history[i]);
173 /* UNUSED : Was number of random quests */
175 if (current_world_ptr->noscore)
176 previous_char.quick_ok = FALSE;
178 wr_byte((byte)previous_char.quick_ok);