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 "player-ability/player-ability-types.h"
8 #include "save/item-writer.h"
9 #include "save/save-util.h"
10 #include "store/store-util.h"
11 #include "system/angband.h"
12 #include "system/object-type-definition.h"
13 #include "world/world.h"
16 * @brief セーブデータに店舗情報を書き込む / Write a "store" record
17 * @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
36 void wr_randomizer(void)
40 for (int i = 0; i < RAND_DEG; i++)
41 wr_u32b(Rand_state[i]);
45 * @brief ゲームオプション情報を書き込む / Write the "options"
47 void wr_options(save_type type)
49 for (int i = 0; i < 4; i++)
52 wr_byte(delay_factor);
53 wr_byte(hitpoint_warn);
56 /*** Cheating options ***/
58 if (current_world_ptr->wizard)
88 if (cheat_diary_output)
94 if (type == SAVE_TYPE_DEBUG)
101 wr_s16b(autosave_freq);
103 for (int i = 0; option_info[i].o_desc; i++) {
104 int os = option_info[i].o_set;
105 int ob = option_info[i].o_bit;
106 if (!option_info[i].o_var)
109 if (*option_info[i].o_var)
110 option_flag[os] |= (1UL << ob);
112 option_flag[os] &= ~(1UL << ob);
115 for (int i = 0; i < 8; i++)
116 wr_u32b(option_flag[i]);
118 for (int i = 0; i < 8; i++)
119 wr_u32b(option_mask[i]);
121 for (int i = 0; i < 8; i++)
122 wr_u32b(window_flag[i]);
124 for (int i = 0; i < 8; i++)
125 wr_u32b(window_mask[i]);
129 * @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
141 void save_quick_start(void)
143 wr_byte(previous_char.psex);
144 wr_byte((byte)previous_char.prace);
145 wr_byte((byte)previous_char.pclass);
146 wr_byte((byte)previous_char.pseikaku);
147 wr_byte((byte)previous_char.realm1);
148 wr_byte((byte)previous_char.realm2);
150 wr_s16b(previous_char.age);
151 wr_s16b(previous_char.ht);
152 wr_s16b(previous_char.wt);
153 wr_s16b(previous_char.sc);
154 wr_s32b(previous_char.au);
156 for (int i = 0; i < A_MAX; i++)
157 wr_s16b(previous_char.stat_max[i]);
159 for (int i = 0; i < A_MAX; i++)
160 wr_s16b(previous_char.stat_max_max[i]);
162 for (int i = 0; i < PY_MAX_LEVEL; i++)
163 wr_s16b((s16b)previous_char.player_hp[i]);
165 wr_s16b(previous_char.chaos_patron);
166 for (int i = 0; i < 8; i++)
167 wr_s16b(previous_char.vir_types[i]);
169 for (int i = 0; i < 4; i++)
170 wr_string(previous_char.history[i]);
172 /* UNUSED : Was number of random quests */
174 if (current_world_ptr->noscore)
175 previous_char.quick_ok = false;
177 wr_byte((byte)previous_char.quick_ok);