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"
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)
97 wr_s16b(autosave_freq);
99 for (int i = 0; option_info[i].o_desc; i++) {
100 int os = option_info[i].o_set;
101 int ob = option_info[i].o_bit;
102 if (!option_info[i].o_var)
105 if (*option_info[i].o_var)
106 option_flag[os] |= (1L << ob);
108 option_flag[os] &= ~(1L << ob);
111 for (int i = 0; i < 8; i++)
112 wr_u32b(option_flag[i]);
114 for (int i = 0; i < 8; i++)
115 wr_u32b(option_mask[i]);
117 for (int i = 0; i < 8; i++)
118 wr_u32b(window_flag[i]);
120 for (int i = 0; i < 8; i++)
121 wr_u32b(window_mask[i]);
125 * @brief ダミー情報スキップを書き込む / Hack -- Write the "ghost" info
130 wr_string(_("不正なゴースト", "Broken Ghost"));
131 for (int i = 0; i < 60; i++)
136 * @brief クイック・スタート情報を書き込む / Save quick start data
139 void save_quick_start(void)
141 wr_byte(previous_char.psex);
142 wr_byte((byte)previous_char.prace);
143 wr_byte((byte)previous_char.pclass);
144 wr_byte((byte)previous_char.pseikaku);
145 wr_byte((byte)previous_char.realm1);
146 wr_byte((byte)previous_char.realm2);
148 wr_s16b(previous_char.age);
149 wr_s16b(previous_char.ht);
150 wr_s16b(previous_char.wt);
151 wr_s16b(previous_char.sc);
152 wr_s32b(previous_char.au);
154 for (int i = 0; i < A_MAX; i++)
155 wr_s16b(previous_char.stat_max[i]);
157 for (int i = 0; i < A_MAX; i++)
158 wr_s16b(previous_char.stat_max_max[i]);
160 for (int i = 0; i < PY_MAX_LEVEL; i++)
161 wr_s16b((s16b)previous_char.player_hp[i]);
163 wr_s16b(previous_char.chaos_patron);
164 for (int i = 0; i < 8; i++)
165 wr_s16b(previous_char.vir_types[i]);
167 for (int i = 0; i < 4; i++)
168 wr_string(previous_char.history[i]);
170 /* UNUSED : Was number of random quests */
172 if (current_world_ptr->noscore)
173 previous_char.quick_ok = FALSE;
175 wr_byte((byte)previous_char.quick_ok);