変愚蛮怒のメインリポジトリです
修訂 | f3edabeafea9ccd198f21e7301b54e91006fe782 (tree) |
---|---|
時間 | 2020-03-14 03:50:36 |
作者 | deskull <deskull@user...> |
Commiter | deskull |
Merge remote-tracking branch 'remotes/origin/For2.2.2-Fix-Hourier' into For2.2.2-Refactoring
@@ -175,6 +175,10 @@ | ||
175 | 175 | <ClCompile Include="..\..\src\cmd\cmd-usestaff.c" /> |
176 | 176 | <ClCompile Include="..\..\src\cmd\cmd-zaprod.c" /> |
177 | 177 | <ClCompile Include="..\..\src\cmd\cmd-zapwand.c" /> |
178 | + <ClCompile Include="..\..\src\cmd\diary-subtitle-table.c" /> | |
179 | + <ClCompile Include="..\..\src\cmd\feeling-table.c" /> | |
180 | + <ClCompile Include="..\..\src\cmd\monster-group-table.c" /> | |
181 | + <ClCompile Include="..\..\src\cmd\object-group-table.c" /> | |
178 | 182 | <ClCompile Include="..\..\src\combat\melee1.c" /> |
179 | 183 | <ClCompile Include="..\..\src\combat\shoot.c" /> |
180 | 184 | <ClCompile Include="..\..\src\core.c" /> |
@@ -199,6 +203,7 @@ | ||
199 | 203 | <ClCompile Include="..\..\src\io\read-pref-file.c" /> |
200 | 204 | <ClCompile Include="..\..\src\io\special-class-dump.c" /> |
201 | 205 | <ClCompile Include="..\..\src\io\tokenizer.c" /> |
206 | + <ClCompile Include="..\..\src\io\write-diary.c" /> | |
202 | 207 | <ClCompile Include="..\..\src\monster-dist-offsets.c" /> |
203 | 208 | <ClCompile Include="..\..\src\monster-process.c" /> |
204 | 209 | <ClCompile Include="..\..\src\monster-status.c" /> |
@@ -348,6 +353,10 @@ | ||
348 | 353 | <ClInclude Include="..\..\src\cmd\cmd-usestaff.h" /> |
349 | 354 | <ClInclude Include="..\..\src\cmd\cmd-zaprod.h" /> |
350 | 355 | <ClInclude Include="..\..\src\cmd\cmd-zapwand.h" /> |
356 | + <ClInclude Include="..\..\src\cmd\diary-subtitle-table.h" /> | |
357 | + <ClInclude Include="..\..\src\cmd\feeling-table.h" /> | |
358 | + <ClInclude Include="..\..\src\cmd\monster-group-table.h" /> | |
359 | + <ClInclude Include="..\..\src\cmd\object-group-table.h" /> | |
351 | 360 | <ClInclude Include="..\..\src\combat\melee.h" /> |
352 | 361 | <ClInclude Include="..\..\src\combat\shoot.h" /> |
353 | 362 | <ClInclude Include="..\..\src\core\show-file.h" /> |
@@ -359,6 +368,7 @@ | ||
359 | 368 | <ClInclude Include="..\..\src\io\read-pref-file.h" /> |
360 | 369 | <ClInclude Include="..\..\src\io\special-class-dump.h" /> |
361 | 370 | <ClInclude Include="..\..\src\io\tokenizer.h" /> |
371 | + <ClInclude Include="..\..\src\io\write-diary.h" /> | |
362 | 372 | <ClInclude Include="..\..\src\monster-dist-offsets.h" /> |
363 | 373 | <ClInclude Include="..\..\src\monster\monster-attack.h" /> |
364 | 374 | <ClInclude Include="..\..\src\monster\monster-direction.h" /> |
@@ -508,6 +508,21 @@ | ||
508 | 508 | <ClCompile Include="..\..\src\monster\monster-sweep-grid.c"> |
509 | 509 | <Filter>monster</Filter> |
510 | 510 | </ClCompile> |
511 | + <ClCompile Include="..\..\src\io\write-diary.c"> | |
512 | + <Filter>io</Filter> | |
513 | + </ClCompile> | |
514 | + <ClCompile Include="..\..\src\cmd\feeling-table.c"> | |
515 | + <Filter>cmd</Filter> | |
516 | + </ClCompile> | |
517 | + <ClCompile Include="..\..\src\cmd\monster-group-table.c"> | |
518 | + <Filter>cmd</Filter> | |
519 | + </ClCompile> | |
520 | + <ClCompile Include="..\..\src\cmd\diary-subtitle-table.c"> | |
521 | + <Filter>cmd</Filter> | |
522 | + </ClCompile> | |
523 | + <ClCompile Include="..\..\src\cmd\object-group-table.c"> | |
524 | + <Filter>cmd</Filter> | |
525 | + </ClCompile> | |
511 | 526 | </ItemGroup> |
512 | 527 | <ItemGroup> |
513 | 528 | <ClInclude Include="..\..\src\gamevalue.h" /> |
@@ -998,6 +1013,21 @@ | ||
998 | 1013 | <ClInclude Include="..\..\src\monster\monster-sweep-grid.h"> |
999 | 1014 | <Filter>monster</Filter> |
1000 | 1015 | </ClInclude> |
1016 | + <ClInclude Include="..\..\src\io\write-diary.h"> | |
1017 | + <Filter>io</Filter> | |
1018 | + </ClInclude> | |
1019 | + <ClInclude Include="..\..\src\cmd\feeling-table.h"> | |
1020 | + <Filter>cmd</Filter> | |
1021 | + </ClInclude> | |
1022 | + <ClInclude Include="..\..\src\cmd\monster-group-table.h"> | |
1023 | + <Filter>cmd</Filter> | |
1024 | + </ClInclude> | |
1025 | + <ClInclude Include="..\..\src\cmd\diary-subtitle-table.h"> | |
1026 | + <Filter>cmd</Filter> | |
1027 | + </ClInclude> | |
1028 | + <ClInclude Include="..\..\src\cmd\object-group-table.h"> | |
1029 | + <Filter>cmd</Filter> | |
1030 | + </ClInclude> | |
1001 | 1031 | </ItemGroup> |
1002 | 1032 | <ItemGroup> |
1003 | 1033 | <None Include="..\..\src\wall.bmp" /> |
@@ -131,6 +131,10 @@ hengband_SOURCES = \ | ||
131 | 131 | z-form.c z-form.h z-rand.c z-rand.h z-term.c z-term.h z-util.c z-util.h \ |
132 | 132 | z-virt.c z-virt.h \ |
133 | 133 | \ |
134 | + cmd/feeling-table.c cmd/feeling-table.h \ | |
135 | + cmd/monster-group-table.c cmd/monster-group-table.h \ | |
136 | + cmd/diary-subtitle-table.c cmd/diary-subtitle-table.h \ | |
137 | + cmd/object-group-table.c cmd/object-group-table.h \ | |
134 | 138 | cmd/cmd-activate.c cmd/cmd-activate.h cmd/cmd-basic.c cmd/cmd-basic.h \ |
135 | 139 | cmd/cmd-dump.c cmd/cmd-dump.h cmd/cmd-eat.c cmd/cmd-eat.h \ |
136 | 140 | cmd/cmd-gameoption.c cmd/cmd-gameoption.h cmd/cmd-help.c cmd/cmd-help.h \ |
@@ -22,7 +22,8 @@ | ||
22 | 22 | #include "object-ego.h" |
23 | 23 | #include "artifact.h" |
24 | 24 | #include "avatar.h" |
25 | -#include "cmd-dump.h" | |
25 | +#include "io/write-diary.h" | |
26 | +#include "cmd/cmd-dump.h" | |
26 | 27 | #include "dungeon.h" |
27 | 28 | #include "history.h" |
28 | 29 | #include "monster.h" |
@@ -18,8 +18,9 @@ | ||
18 | 18 | |
19 | 19 | #include "core.h" |
20 | 20 | #include "core/show-file.h" |
21 | -#include "cmd-dump.h" | |
22 | -#include "cmd-magiceat.h" | |
21 | +#include "io/write-diary.h" | |
22 | +#include "cmd/cmd-dump.h" | |
23 | +#include "cmd/cmd-magiceat.h" | |
23 | 24 | #include "floor.h" |
24 | 25 | #include "floor-events.h" |
25 | 26 | #include "floor-save.h" |
@@ -14,6 +14,7 @@ | ||
14 | 14 | #include "core.h" |
15 | 15 | #include "term.h" |
16 | 16 | |
17 | +#include "io/write-diary.h" | |
17 | 18 | #include "cmd/cmd-dump.h" |
18 | 19 | #include "cmd/cmd-save.h" |
19 | 20 | #include "chest.h" |
@@ -45,6 +45,7 @@ | ||
45 | 45 | #include "core.h" |
46 | 46 | #include "core/show-file.h" |
47 | 47 | #include "io/read-pref-file.h" |
48 | +#include "io/write-diary.h" | |
48 | 49 | #include "chuukei.h" |
49 | 50 | |
50 | 51 | #include "autopick.h" |
@@ -76,11 +77,15 @@ | ||
76 | 77 | #include "spells.h" |
77 | 78 | #include "objectkind.h" |
78 | 79 | #include "floor-town.h" |
80 | +#include "cmd/feeling-table.h" | |
81 | +#include "cmd/monster-group-table.h" | |
82 | +#include "cmd/diary-subtitle-table.h" | |
83 | +#include "cmd/object-group-table.h" | |
79 | 84 | #include "view-mainwindow.h" // 暫定。後で消す |
80 | 85 | |
81 | 86 | #include "english.h" |
82 | 87 | |
83 | - // Mark strings for auto dump | |
88 | +// Mark strings for auto dump | |
84 | 89 | static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv"; |
85 | 90 | static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^"; |
86 | 91 |
@@ -97,16 +102,12 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
97 | 102 | static TERM_COLOR attr_idx = 0; |
98 | 103 | static SYMBOL_CODE char_idx = 0; |
99 | 104 | |
100 | -/* Hack -- for feature lighting */ | |
101 | 105 | static TERM_COLOR attr_idx_feat[F_LIT_MAX]; |
102 | 106 | static SYMBOL_CODE char_idx_feat[F_LIT_MAX]; |
103 | 107 | |
104 | 108 | // Encode the screen colors |
105 | 109 | static char hack[17] = "dwsorgbuDWvyRGBU"; |
106 | 110 | |
107 | -// todo *抹殺* したい… | |
108 | -bool write_level; | |
109 | - | |
110 | 111 | /*! |
111 | 112 | * @brief prf出力内容を消去する / |
112 | 113 | * Remove old lines automatically generated before. |
@@ -115,7 +116,6 @@ bool write_level; | ||
115 | 116 | static void remove_auto_dump(concptr orig_file) |
116 | 117 | { |
117 | 118 | FILE *tmp_fff, *orig_fff; |
118 | - | |
119 | 119 | char tmp_file[1024]; |
120 | 120 | char buf[1024]; |
121 | 121 | bool between_mark = FALSE; |
@@ -124,23 +124,14 @@ static void remove_auto_dump(concptr orig_file) | ||
124 | 124 | long header_location = 0; |
125 | 125 | char header_mark_str[80]; |
126 | 126 | char footer_mark_str[80]; |
127 | - size_t mark_len; | |
128 | 127 | |
129 | - /* Prepare a header/footer mark string */ | |
130 | 128 | sprintf(header_mark_str, auto_dump_header, auto_dump_mark); |
131 | 129 | sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark); |
132 | - | |
133 | - mark_len = strlen(footer_mark_str); | |
134 | - | |
135 | - /* Open an old dump file in read-only mode */ | |
130 | + size_t mark_len = strlen(footer_mark_str); | |
136 | 131 | orig_fff = my_fopen(orig_file, "r"); |
137 | - | |
138 | - /* If original file does not exist, nothing to do */ | |
139 | 132 | if (!orig_fff) return; |
140 | 133 | |
141 | - /* Open a new (temporary) file */ | |
142 | 134 | tmp_fff = my_fopen_temp(tmp_file, 1024); |
143 | - | |
144 | 135 | if (!tmp_fff) |
145 | 136 | { |
146 | 137 | msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), tmp_file); |
@@ -148,110 +139,62 @@ static void remove_auto_dump(concptr orig_file) | ||
148 | 139 | return; |
149 | 140 | } |
150 | 141 | |
151 | - /* Loop for every line */ | |
152 | 142 | while (TRUE) |
153 | 143 | { |
154 | - /* Read a line */ | |
155 | 144 | if (my_fgets(orig_fff, buf, sizeof(buf))) |
156 | 145 | { |
157 | - /* Read error: Assume End of File */ | |
158 | - | |
159 | - /* | |
160 | - * Was looking for the footer, but not found. | |
161 | - * | |
162 | - * Since automatic dump might be edited by hand, | |
163 | - * it's dangerous to kill these lines. | |
164 | - * Seek back to the next line of the (pseudo) header, | |
165 | - * and read again. | |
166 | - */ | |
167 | 146 | if (between_mark) |
168 | 147 | { |
169 | 148 | fseek(orig_fff, header_location, SEEK_SET); |
170 | 149 | between_mark = FALSE; |
171 | 150 | continue; |
172 | 151 | } |
173 | - | |
174 | - /* Success -- End the loop */ | |
175 | 152 | else |
176 | 153 | { |
177 | 154 | break; |
178 | 155 | } |
179 | 156 | } |
180 | 157 | |
181 | - /* We are looking for the header mark of automatic dump */ | |
182 | 158 | if (!between_mark) |
183 | 159 | { |
184 | - /* Is this line a header? */ | |
185 | 160 | if (!strcmp(buf, header_mark_str)) |
186 | 161 | { |
187 | - /* Memorise seek point of this line */ | |
188 | 162 | header_location = ftell(orig_fff); |
189 | - | |
190 | - /* Initialize counter for number of lines */ | |
191 | 163 | line_num = 0; |
192 | - | |
193 | - /* Look for the footer from now */ | |
194 | 164 | between_mark = TRUE; |
195 | - | |
196 | - /* There are some changes */ | |
197 | 165 | changed = TRUE; |
198 | 166 | } |
199 | - | |
200 | - /* Not a header */ | |
201 | 167 | else |
202 | 168 | { |
203 | - /* Copy orginally lines */ | |
204 | 169 | fprintf(tmp_fff, "%s\n", buf); |
205 | 170 | } |
206 | 171 | |
207 | 172 | continue; |
208 | 173 | } |
209 | 174 | |
210 | - /* todo 処理よりもコメントが邪魔でif文を反転できない*/ | |
211 | - /* We are looking for the footer mark of automatic dump */ | |
212 | - /* Is this line a footer? */ | |
213 | 175 | if (!strncmp(buf, footer_mark_str, mark_len)) |
214 | 176 | { |
215 | 177 | int tmp; |
216 | - | |
217 | - /* | |
218 | - * Compare the number of lines | |
219 | - * | |
220 | - * If there is an inconsistency between | |
221 | - * actual number of lines and the | |
222 | - * number here, the automatic dump | |
223 | - * might be edited by hand. So it's | |
224 | - * dangerous to kill these lines. | |
225 | - * Seek back to the next line of the | |
226 | - * (pseudo) header, and read again. | |
227 | - */ | |
228 | 178 | if (!sscanf(buf + mark_len, " (%d)", &tmp) |
229 | 179 | || tmp != line_num) |
230 | 180 | { |
231 | 181 | fseek(orig_fff, header_location, SEEK_SET); |
232 | 182 | } |
233 | 183 | |
234 | - /* Look for another header */ | |
235 | 184 | between_mark = FALSE; |
236 | 185 | continue; |
237 | 186 | } |
238 | 187 | |
239 | - /* Not a footer */ | |
240 | - /* Ignore old line, and count number of lines */ | |
241 | 188 | line_num++; |
242 | 189 | } |
243 | 190 | |
244 | - /* Close files */ | |
245 | 191 | my_fclose(orig_fff); |
246 | 192 | my_fclose(tmp_fff); |
247 | 193 | |
248 | - /* If there are some changes, overwrite the original file with new one */ | |
249 | 194 | if (changed) |
250 | 195 | { |
251 | - /* Copy contents of temporary file */ | |
252 | 196 | tmp_fff = my_fopen(tmp_file, "r"); |
253 | 197 | orig_fff = my_fopen(orig_file, "w"); |
254 | - | |
255 | 198 | while (!my_fgets(tmp_fff, buf, sizeof(buf))) |
256 | 199 | fprintf(orig_fff, "%s\n", buf); |
257 | 200 |
@@ -270,27 +213,16 @@ static void remove_auto_dump(concptr orig_file) | ||
270 | 213 | */ |
271 | 214 | static void auto_dump_printf(concptr fmt, ...) |
272 | 215 | { |
273 | - concptr p; | |
274 | 216 | va_list vp; |
275 | - | |
276 | 217 | char buf[1024]; |
277 | - | |
278 | - /* Begin the Varargs Stuff */ | |
279 | 218 | va_start(vp, fmt); |
280 | - | |
281 | - /* Format the args, save the length */ | |
282 | 219 | (void)vstrnfmt(buf, sizeof(buf), fmt, vp); |
283 | - | |
284 | - /* End the Varargs Stuff */ | |
285 | 220 | va_end(vp); |
286 | - | |
287 | - /* Count number of lines */ | |
288 | - for (p = buf; *p; p++) | |
221 | + for (concptr p = buf; *p; p++) | |
289 | 222 | { |
290 | 223 | if (*p == '\n') auto_dump_line_num++; |
291 | 224 | } |
292 | 225 | |
293 | - /* Dump it */ | |
294 | 226 | fprintf(auto_dump_stream, "%s", buf); |
295 | 227 | } |
296 | 228 |
@@ -305,35 +237,19 @@ static void auto_dump_printf(concptr fmt, ...) | ||
305 | 237 | static bool open_auto_dump(concptr buf, concptr mark) |
306 | 238 | { |
307 | 239 | char header_mark_str[80]; |
308 | - | |
309 | - /* Save the mark string */ | |
310 | 240 | auto_dump_mark = mark; |
311 | - | |
312 | - /* Prepare a header mark string */ | |
313 | 241 | sprintf(header_mark_str, auto_dump_header, auto_dump_mark); |
314 | - | |
315 | - /* Remove old macro dumps */ | |
316 | 242 | remove_auto_dump(buf); |
317 | - | |
318 | - /* Append to the file */ | |
319 | 243 | auto_dump_stream = my_fopen(buf, "a"); |
320 | - | |
321 | - /* Failure */ | |
322 | 244 | if (!auto_dump_stream) |
323 | 245 | { |
324 | 246 | msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf); |
325 | 247 | msg_print(NULL); |
326 | - | |
327 | - /* Failed */ | |
328 | 248 | return FALSE; |
329 | 249 | } |
330 | 250 | |
331 | - /* Start dumping */ | |
332 | 251 | fprintf(auto_dump_stream, "%s\n", header_mark_str); |
333 | - | |
334 | - /* Initialize counter */ | |
335 | 252 | auto_dump_line_num = 0; |
336 | - | |
337 | 253 | auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n", |
338 | 254 | "# *Warning!* The lines below are an automatic dump.\n")); |
339 | 255 | auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n", |
@@ -349,17 +265,12 @@ static bool open_auto_dump(concptr buf, concptr mark) | ||
349 | 265 | static void close_auto_dump(void) |
350 | 266 | { |
351 | 267 | char footer_mark_str[80]; |
352 | - | |
353 | - /* Prepare a footer mark string */ | |
354 | 268 | sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark); |
355 | - | |
356 | 269 | auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n", |
357 | 270 | "# *Warning!* The lines below are an automatic dump.\n")); |
358 | 271 | auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n", |
359 | 272 | "# Don't edit them; changes will be deleted and replaced automatically.\n")); |
360 | - /* End of dump */ | |
361 | 273 | fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num); |
362 | - | |
363 | 274 | my_fclose(auto_dump_stream); |
364 | 275 | } |
365 | 276 |
@@ -390,367 +301,9 @@ concptr get_ordinal_number_suffix(int num) | ||
390 | 301 | |
391 | 302 | |
392 | 303 | /*! |
393 | - * @brief 日記にメッセージを追加する / | |
394 | - * Take note to the diary. | |
395 | - * @param type 日記内容のID | |
396 | - * @param num 日記内容のIDに応じた数値 | |
397 | - * @param note 日記内容のIDに応じた文字列参照ポインタ | |
398 | - * @return エラーID | |
399 | - */ | |
400 | -errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note) | |
401 | -{ | |
402 | - int day, hour, min; | |
403 | - FILE *fff = NULL; | |
404 | - GAME_TEXT file_name[MAX_NLEN]; | |
405 | - char buf[1024]; | |
406 | - concptr note_level = ""; | |
407 | - bool do_level = TRUE; | |
408 | - char note_level_buf[40]; | |
409 | - QUEST_IDX q_idx; | |
410 | - | |
411 | - static bool disable_diary = FALSE; | |
412 | - | |
413 | - extract_day_hour_min(creature_ptr, &day, &hour, &min); | |
414 | - | |
415 | - if (disable_diary) return(-1); | |
416 | - | |
417 | - if (type == DIARY_FIX_QUEST_C || | |
418 | - type == DIARY_FIX_QUEST_F || | |
419 | - type == DIARY_RAND_QUEST_C || | |
420 | - type == DIARY_RAND_QUEST_F || | |
421 | - type == DIARY_TO_QUEST) | |
422 | - { | |
423 | - QUEST_IDX old_quest; | |
424 | - | |
425 | - old_quest = creature_ptr->current_floor_ptr->inside_quest; | |
426 | - creature_ptr->current_floor_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num; | |
427 | - | |
428 | - /* Get the quest text */ | |
429 | - init_flags = INIT_NAME_ONLY; | |
430 | - | |
431 | - process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0); | |
432 | - | |
433 | - /* Reset the old quest number */ | |
434 | - creature_ptr->current_floor_ptr->inside_quest = old_quest; | |
435 | - } | |
436 | - | |
437 | - /* different filne name to avoid mixing */ | |
438 | - sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base); | |
439 | - path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name); | |
440 | - | |
441 | - /* File type is "TEXT" */ | |
442 | - FILE_TYPE(FILE_TYPE_TEXT); | |
443 | - | |
444 | - fff = my_fopen(buf, "a"); | |
445 | - | |
446 | - /* Failure */ | |
447 | - if (!fff) | |
448 | - { | |
449 | - msg_format(_("%s を開くことができませんでした。プレイ記録を一時停止します。", "Failed to open %s. Play-Record is disabled temporarily."), buf); | |
450 | - msg_format(NULL); | |
451 | - disable_diary = TRUE; | |
452 | - return -1; | |
453 | - } | |
454 | - | |
455 | - q_idx = quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level); | |
456 | - | |
457 | - if (write_level) | |
458 | - { | |
459 | - if (creature_ptr->current_floor_ptr->inside_arena) | |
460 | - note_level = _("アリーナ:", "Arane:"); | |
461 | - else if (!creature_ptr->current_floor_ptr->dun_level) | |
462 | - note_level = _("地上:", "Surface:"); | |
463 | - else if (q_idx && (is_fixed_quest_idx(q_idx) | |
464 | - && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT)))) | |
465 | - note_level = _("クエスト:", "Quest:"); | |
466 | - else | |
467 | - { | |
468 | -#ifdef JP | |
469 | - sprintf(note_level_buf, "%d階(%s):", (int)creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name); | |
470 | -#else | |
471 | - sprintf(note_level_buf, "%s L%d:", d_name + d_info[creature_ptr->dungeon_idx].name, (int)creature_ptr->current_floor_ptr->dun_level); | |
472 | -#endif | |
473 | - note_level = note_level_buf; | |
474 | - } | |
475 | - } | |
476 | - | |
477 | - switch (type) | |
478 | - { | |
479 | - case DIARY_DIALY: | |
480 | - { | |
481 | - if (day < MAX_DAYS) fprintf(fff, _("%d日目\n", "Day %d\n"), day); | |
482 | - else fputs(_("*****日目\n", "Day *****\n"), fff); | |
483 | - do_level = FALSE; | |
484 | - break; | |
485 | - } | |
486 | - case DIARY_DESCRIPTION: | |
487 | - { | |
488 | - if (num) | |
489 | - { | |
490 | - fprintf(fff, "%s\n", note); | |
491 | - do_level = FALSE; | |
492 | - } | |
493 | - else | |
494 | - fprintf(fff, " %2d:%02d %20s %s\n", hour, min, note_level, note); | |
495 | - break; | |
496 | - } | |
497 | - case DIARY_ART: | |
498 | - { | |
499 | - fprintf(fff, _(" %2d:%02d %20s %sを発見した。\n", " %2d:%02d %20s discovered %s.\n"), hour, min, note_level, note); | |
500 | - break; | |
501 | - } | |
502 | - case DIARY_ART_SCROLL: | |
503 | - { | |
504 | - fprintf(fff, _(" %2d:%02d %20s 巻物によって%sを生成した。\n", " %2d:%02d %20s created %s by scroll.\n"), hour, min, note_level, note); | |
505 | - break; | |
506 | - } | |
507 | - case DIARY_UNIQUE: | |
508 | - { | |
509 | - fprintf(fff, _(" %2d:%02d %20s %sを倒した。\n", " %2d:%02d %20s defeated %s.\n"), hour, min, note_level, note); | |
510 | - break; | |
511 | - } | |
512 | - case DIARY_FIX_QUEST_C: | |
513 | - { | |
514 | - if (quest[num].flags & QUEST_FLAG_SILENT) break; | |
515 | - fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n", | |
516 | - " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest[num].name); | |
517 | - break; | |
518 | - } | |
519 | - case DIARY_FIX_QUEST_F: | |
520 | - { | |
521 | - if (quest[num].flags & QUEST_FLAG_SILENT) break; | |
522 | - fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n", | |
523 | - " %2d:%02d %20s run away from quest '%s'.\n"), hour, min, note_level, quest[num].name); | |
524 | - break; | |
525 | - } | |
526 | - case DIARY_RAND_QUEST_C: | |
527 | - { | |
528 | - GAME_TEXT name[MAX_NLEN]; | |
529 | - strcpy(name, r_name + r_info[quest[num].r_idx].name); | |
530 | - fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)を達成した。\n", | |
531 | - " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name); | |
532 | - break; | |
533 | - } | |
534 | - case DIARY_RAND_QUEST_F: | |
535 | - { | |
536 | - GAME_TEXT name[MAX_NLEN]; | |
537 | - strcpy(name, r_name + r_info[quest[num].r_idx].name); | |
538 | - fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)から逃げ出した。\n", | |
539 | - " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name); | |
540 | - break; | |
541 | - } | |
542 | - case DIARY_MAXDEAPTH: | |
543 | - { | |
544 | - fprintf(fff, _(" %2d:%02d %20s %sの最深階%d階に到達した。\n", | |
545 | - " %2d:%02d %20s reached level %d of %s for the first time.\n"), hour, min, note_level, | |
546 | - _(d_name + d_info[creature_ptr->dungeon_idx].name, num), | |
547 | - _(num, d_name + d_info[creature_ptr->dungeon_idx].name)); | |
548 | - break; | |
549 | - } | |
550 | - case DIARY_TRUMP: | |
551 | - { | |
552 | - fprintf(fff, _(" %2d:%02d %20s %s%sの最深階を%d階にセットした。\n", | |
553 | - " %2d:%02d %20s reset recall level of %s to %d %s.\n"), hour, min, note_level, note, | |
554 | - _(d_name + d_info[num].name, (int)max_dlv[num]), | |
555 | - _((int)max_dlv[num], d_name + d_info[num].name)); | |
556 | - break; | |
557 | - } | |
558 | - case DIARY_STAIR: | |
559 | - { | |
560 | - concptr to; | |
561 | - if (q_idx && (is_fixed_quest_idx(q_idx) | |
562 | - && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT)))) | |
563 | - { | |
564 | - to = _("地上", "the surface"); | |
565 | - } | |
566 | - else | |
567 | - { | |
568 | - if (!(creature_ptr->current_floor_ptr->dun_level + num)) to = _("地上", "the surface"); | |
569 | - else to = format(_("%d階", "level %d"), creature_ptr->current_floor_ptr->dun_level + num); | |
570 | - } | |
571 | - fprintf(fff, _(" %2d:%02d %20s %sへ%s。\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to)); | |
572 | - break; | |
573 | - } | |
574 | - case DIARY_RECALL: | |
575 | - { | |
576 | - if (!num) | |
577 | - fprintf(fff, _(" %2d:%02d %20s 帰還を使って%sの%d階へ下りた。\n", " %2d:%02d %20s recalled to dungeon level %d of %s.\n"), | |
578 | - hour, min, note_level, _(d_name + d_info[creature_ptr->dungeon_idx].name, (int)max_dlv[creature_ptr->dungeon_idx]), | |
579 | - _((int)max_dlv[creature_ptr->dungeon_idx], d_name + d_info[creature_ptr->dungeon_idx].name)); | |
580 | - else | |
581 | - fprintf(fff, _(" %2d:%02d %20s 帰還を使って地上へと戻った。\n", " %2d:%02d %20s recalled from dungeon to surface.\n"), hour, min, note_level); | |
582 | - break; | |
583 | - } | |
584 | - case DIARY_TO_QUEST: | |
585 | - { | |
586 | - if (quest[num].flags & QUEST_FLAG_SILENT) break; | |
587 | - fprintf(fff, _(" %2d:%02d %20s クエスト「%s」へと突入した。\n", " %2d:%02d %20s entered the quest '%s'.\n"), | |
588 | - hour, min, note_level, quest[num].name); | |
589 | - break; | |
590 | - } | |
591 | - case DIARY_TELEPORT_LEVEL: | |
592 | - { | |
593 | - fprintf(fff, _(" %2d:%02d %20s レベル・テレポートで脱出した。\n", " %2d:%02d %20s Got out using teleport level.\n"), | |
594 | - hour, min, note_level); | |
595 | - break; | |
596 | - } | |
597 | - case DIARY_BUY: | |
598 | - { | |
599 | - fprintf(fff, _(" %2d:%02d %20s %sを購入した。\n", " %2d:%02d %20s bought %s.\n"), hour, min, note_level, note); | |
600 | - break; | |
601 | - } | |
602 | - case DIARY_SELL: | |
603 | - { | |
604 | - fprintf(fff, _(" %2d:%02d %20s %sを売却した。\n", " %2d:%02d %20s sold %s.\n"), hour, min, note_level, note); | |
605 | - break; | |
606 | - } | |
607 | - case DIARY_ARENA: | |
608 | - { | |
609 | - if (num < 0) | |
610 | - { | |
611 | - int n = -num; | |
612 | - fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦で、%sの前に敗れ去った。\n", " %2d:%02d %20s beaten by %s in the %d%s fight.\n"), | |
613 | - hour, min, note_level, _(n, note), _("", n), _(note, get_ordinal_number_suffix(n))); | |
614 | - break; | |
615 | - } | |
616 | - fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦(%s)に勝利した。\n", " %2d:%02d %20s won the %d%s fight (%s).\n"), | |
617 | - hour, min, note_level, num, _("", get_ordinal_number_suffix(num)), note); | |
618 | - | |
619 | - if (num == MAX_ARENA_MONS) | |
620 | - { | |
621 | - fprintf(fff, _(" 闘技場のすべての敵に勝利し、チャンピオンとなった。\n", | |
622 | - " won all fights to become a Champion.\n")); | |
623 | - do_level = FALSE; | |
624 | - } | |
625 | - break; | |
626 | - } | |
627 | - case DIARY_FOUND: | |
628 | - { | |
629 | - fprintf(fff, _(" %2d:%02d %20s %sを識別した。\n", " %2d:%02d %20s identified %s.\n"), hour, min, note_level, note); | |
630 | - break; | |
631 | - } | |
632 | - case DIARY_WIZ_TELE: | |
633 | - { | |
634 | - concptr to; | |
635 | - if (!creature_ptr->current_floor_ptr->dun_level) | |
636 | - to = _("地上", "the surface"); | |
637 | - else | |
638 | - to = format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name); | |
639 | - | |
640 | - fprintf(fff, _(" %2d:%02d %20s %sへとウィザード・テレポートで移動した。\n", | |
641 | - " %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to); | |
642 | - break; | |
643 | - } | |
644 | - case DIARY_PAT_TELE: | |
645 | - { | |
646 | - concptr to; | |
647 | - if (!creature_ptr->current_floor_ptr->dun_level) | |
648 | - to = _("地上", "the surface"); | |
649 | - else | |
650 | - to = format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name); | |
651 | - | |
652 | - fprintf(fff, _(" %2d:%02d %20s %sへとパターンの力で移動した。\n", | |
653 | - " %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to); | |
654 | - break; | |
655 | - } | |
656 | - case DIARY_LEVELUP: | |
657 | - { | |
658 | - fprintf(fff, _(" %2d:%02d %20s レベルが%dに上がった。\n", " %2d:%02d %20s reached player level %d.\n"), hour, min, note_level, num); | |
659 | - break; | |
660 | - } | |
661 | - case DIARY_GAMESTART: | |
662 | - { | |
663 | - time_t ct = time((time_t*)0); | |
664 | - do_level = FALSE; | |
665 | - if (num) | |
666 | - { | |
667 | - fprintf(fff, "%s %s", note, ctime(&ct)); | |
668 | - } | |
669 | - else | |
670 | - fprintf(fff, " %2d:%02d %20s %s %s", hour, min, note_level, note, ctime(&ct)); | |
671 | - break; | |
672 | - } | |
673 | - case DIARY_NAMED_PET: | |
674 | - { | |
675 | - fprintf(fff, " %2d:%02d %20s ", hour, min, note_level); | |
676 | - switch (num) | |
677 | - { | |
678 | - case RECORD_NAMED_PET_NAME: | |
679 | - fprintf(fff, _("%sを旅の友にすることに決めた。\n", "decided to travel together with %s.\n"), note); | |
680 | - break; | |
681 | - case RECORD_NAMED_PET_UNNAME: | |
682 | - fprintf(fff, _("%sの名前を消した。\n", "unnamed %s.\n"), note); | |
683 | - break; | |
684 | - case RECORD_NAMED_PET_DISMISS: | |
685 | - fprintf(fff, _("%sを解放した。\n", "dismissed %s.\n"), note); | |
686 | - break; | |
687 | - case RECORD_NAMED_PET_DEATH: | |
688 | - fprintf(fff, _("%sが死んでしまった。\n", "%s died.\n"), note); | |
689 | - break; | |
690 | - case RECORD_NAMED_PET_MOVED: | |
691 | - fprintf(fff, _("%sをおいて別のマップへ移動した。\n", "moved to another map leaving %s behind.\n"), note); | |
692 | - break; | |
693 | - case RECORD_NAMED_PET_LOST_SIGHT: | |
694 | - fprintf(fff, _("%sとはぐれてしまった。\n", "lost sight of %s.\n"), note); | |
695 | - break; | |
696 | - case RECORD_NAMED_PET_DESTROY: | |
697 | - fprintf(fff, _("%sが*破壊*によって消え去った。\n", "%s was killed by *destruction*.\n"), note); | |
698 | - break; | |
699 | - case RECORD_NAMED_PET_EARTHQUAKE: | |
700 | - fprintf(fff, _("%sが岩石に押し潰された。\n", "%s was crushed by falling rocks.\n"), note); | |
701 | - break; | |
702 | - case RECORD_NAMED_PET_GENOCIDE: | |
703 | - fprintf(fff, _("%sが抹殺によって消え去った。\n", "%s was a victim of genocide.\n"), note); | |
704 | - break; | |
705 | - case RECORD_NAMED_PET_WIZ_ZAP: | |
706 | - fprintf(fff, _("%sがデバッグコマンドによって消え去った。\n", "%s was removed by debug command.\n"), note); | |
707 | - break; | |
708 | - case RECORD_NAMED_PET_TELE_LEVEL: | |
709 | - fprintf(fff, _("%sがテレポート・レベルによって消え去った。\n", "%s was lost after teleporting a level.\n"), note); | |
710 | - break; | |
711 | - case RECORD_NAMED_PET_BLAST: | |
712 | - fprintf(fff, _("%sを爆破した。\n", "blasted %s.\n"), note); | |
713 | - break; | |
714 | - case RECORD_NAMED_PET_HEAL_LEPER: | |
715 | - fprintf(fff, _("%sの病気が治り旅から外れた。\n", "%s was healed and left.\n"), note); | |
716 | - break; | |
717 | - case RECORD_NAMED_PET_COMPACT: | |
718 | - fprintf(fff, _("%sがモンスター情報圧縮によって消え去った。\n", "%s was lost when the monster list was pruned.\n"), note); | |
719 | - break; | |
720 | - case RECORD_NAMED_PET_LOSE_PARENT: | |
721 | - fprintf(fff, _("%sの召喚者が既にいないため消え去った。\n", "%s disappeared because its summoner left.\n"), note); | |
722 | - break; | |
723 | - | |
724 | - default: | |
725 | - fprintf(fff, "\n"); | |
726 | - break; | |
727 | - } | |
728 | - break; | |
729 | - } | |
730 | - | |
731 | - case DIARY_WIZARD_LOG: | |
732 | - fprintf(fff, "%s\n", note); | |
733 | - break; | |
734 | - | |
735 | - default: | |
736 | - break; | |
737 | - } | |
738 | - | |
739 | - my_fclose(fff); | |
740 | - | |
741 | - if (do_level) write_level = FALSE; | |
742 | - | |
743 | - return 0; | |
744 | -} | |
745 | - | |
746 | - | |
747 | -#define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0])) | |
748 | - | |
749 | -/*! | |
750 | - * @brief 日記のタイトル表記と内容出力 / | |
304 | + * @brief 日記のタイトル表記と内容出力 | |
305 | + * @param creature_ptr プレーヤーへの参照ポインタ | |
751 | 306 | * @return なし |
752 | - * @details | |
753 | - * 日記のタイトルは本関数の subtitle ローカル変数で定義されている。 | |
754 | 307 | */ |
755 | 308 | static void display_diary(player_type *creature_ptr) |
756 | 309 | { |
@@ -758,76 +311,6 @@ static void display_diary(player_type *creature_ptr) | ||
758 | 311 | GAME_TEXT file_name[MAX_NLEN]; |
759 | 312 | char buf[1024]; |
760 | 313 | char tmp[80]; |
761 | -#ifdef JP | |
762 | - static const char subtitle[][30] = { | |
763 | - "最強の肉体を求めて", | |
764 | - "人生それははかない", | |
765 | - "明日に向かって", | |
766 | - "棚からぼたもち", | |
767 | - "あとの祭り", | |
768 | - "それはいい考えだ", | |
769 | - "何とでも言え", | |
770 | - "兎にも角にも", | |
771 | - "ウソだけど", | |
772 | - "もはやこれまで", | |
773 | - "なんでこうなるの", | |
774 | - "それは無理だ", | |
775 | - "倒すべき敵はゲ○ツ", | |
776 | - "ん~?聞こえんなぁ", | |
777 | - "オレの名を言ってみろ", | |
778 | - "頭が変になっちゃった", | |
779 | - "互換しません", | |
780 | - "せっかくだから", | |
781 | - "まだまだ甘いね", | |
782 | - "むごいむごすぎる", | |
783 | - "こんなもんじゃない", | |
784 | - "だめだこりゃ", | |
785 | - "次いってみよう", | |
786 | - "ちょっとだけよ", | |
787 | - "哀しき冒険者", | |
788 | - "野望の果て", | |
789 | - "無限地獄", | |
790 | - "神に喧嘩を売る者", | |
791 | - "未知の世界へ", | |
792 | - "最高の頭脳を求めて" | |
793 | - }; | |
794 | -#else | |
795 | - static const char subtitle[][51] = { | |
796 | - "Quest of The World's Toughest Body", | |
797 | - "Attack is the best form of defence.", | |
798 | - "Might is right.", | |
799 | - "An unexpected windfall", | |
800 | - "A drowning man will catch at a straw", | |
801 | - "Don't count your chickens before they are hatched.", | |
802 | - "It is no use crying over spilt milk.", | |
803 | - "Seeing is believing.", | |
804 | - "Strike the iron while it is hot.", | |
805 | - "I don't care what follows.", | |
806 | - "To dig a well to put out a house on fire.", | |
807 | - "Tomorrow is another day.", | |
808 | - "Easy come, easy go.", | |
809 | - "The more haste, the less speed.", | |
810 | - "Where there is life, there is hope.", | |
811 | - "There is no royal road to *WINNER*.", | |
812 | - "Danger past, God forgotten.", | |
813 | - "The best thing to do now is to run away.", | |
814 | - "Life is but an empty dream.", | |
815 | - "Dead men tell no tales.", | |
816 | - "A book that remains shut is but a block.", | |
817 | - "Misfortunes never come singly.", | |
818 | - "A little knowledge is a dangerous thing.", | |
819 | - "History repeats itself.", | |
820 | - "*WINNER* was not built in a day.", | |
821 | - "Ignorance is bliss.", | |
822 | - "To lose is to win?", | |
823 | - "No medicine can cure folly.", | |
824 | - "All good things come to an end.", | |
825 | - "M$ Empire strikes back.", | |
826 | - "To see is to believe", | |
827 | - "Time is money.", | |
828 | - "Quest of The World's Greatest Brain" | |
829 | - }; | |
830 | -#endif | |
831 | 314 | sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base); |
832 | 315 | path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name); |
833 | 316 |
@@ -843,7 +326,6 @@ static void display_diary(player_type *creature_ptr) | ||
843 | 326 | sprintf(diary_title, "Legend of %s %s '%s'", ap_ptr->title, creature_ptr->name, tmp); |
844 | 327 | #endif |
845 | 328 | |
846 | - /* Display the file contents */ | |
847 | 329 | (void)show_file(creature_ptr, FALSE, buf, diary_title, -1, 0); |
848 | 330 | } |
849 | 331 |
@@ -856,7 +338,6 @@ static void add_diary_note(player_type *creature_ptr) | ||
856 | 338 | { |
857 | 339 | char tmp[80] = "\0"; |
858 | 340 | char bunshou[80] = "\0"; |
859 | - | |
860 | 341 | if (get_string(_("内容: ", "diary note: "), tmp, 79)) |
861 | 342 | { |
862 | 343 | strcpy(bunshou, tmp); |
@@ -921,33 +402,20 @@ static void do_cmd_erase_diary(void) | ||
921 | 402 | */ |
922 | 403 | void do_cmd_diary(player_type *creature_ptr) |
923 | 404 | { |
924 | - /* File type is "TEXT" */ | |
925 | 405 | FILE_TYPE(FILE_TYPE_TEXT); |
926 | 406 | screen_save(); |
927 | - | |
928 | - /* Interact until done */ | |
929 | 407 | int i; |
930 | 408 | while (TRUE) |
931 | 409 | { |
932 | 410 | Term_clear(); |
933 | - | |
934 | - /* Ask for a choice */ | |
935 | 411 | prt(_("[ 記録の設定 ]", "[ Play Record ]"), 2, 0); |
936 | - | |
937 | - /* Give some choices */ | |
938 | 412 | prt(_("(1) 記録を見る", "(1) Display your record"), 4, 5); |
939 | 413 | prt(_("(2) 文章を記録する", "(2) Add record"), 5, 5); |
940 | 414 | prt(_("(3) 直前に入手又は鑑定したものを記録する", "(3) Record the last item you got or identified"), 6, 5); |
941 | 415 | prt(_("(4) 記録を消去する", "(4) Delete your record"), 7, 5); |
942 | - | |
943 | 416 | prt(_("(R) プレイ動画を記録する/中止する", "(R) Record playing movie / or stop it"), 9, 5); |
944 | - | |
945 | - /* Prompt */ | |
946 | 417 | prt(_("コマンド:", "Command: "), 18, 0); |
947 | - | |
948 | - /* Prompt */ | |
949 | 418 | i = inkey(); |
950 | - | |
951 | 419 | if (i == ESCAPE) break; |
952 | 420 | |
953 | 421 | switch (i) |
@@ -968,7 +436,7 @@ void do_cmd_diary(player_type *creature_ptr) | ||
968 | 436 | screen_load(); |
969 | 437 | prepare_movie_hooks(); |
970 | 438 | return; |
971 | - default: /* Unknown option */ | |
439 | + default: | |
972 | 440 | bell(); |
973 | 441 | } |
974 | 442 |
@@ -999,7 +467,6 @@ void do_cmd_redraw(player_type *creature_ptr) | ||
999 | 467 | { |
1000 | 468 | Term_xtra(TERM_XTRA_REACT, 0); |
1001 | 469 | |
1002 | - /* Combine and Reorder the pack (later) */ | |
1003 | 470 | creature_ptr->update |= (PU_COMBINE | PU_REORDER); |
1004 | 471 | creature_ptr->update |= (PU_TORCH); |
1005 | 472 | creature_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); |
@@ -1014,17 +481,13 @@ void do_cmd_redraw(player_type *creature_ptr) | ||
1014 | 481 | |
1015 | 482 | update_playtime(); |
1016 | 483 | handle_stuff(creature_ptr); |
1017 | - | |
1018 | 484 | if (creature_ptr->prace == RACE_ANDROID) calc_android_exp(creature_ptr); |
1019 | 485 | |
1020 | - /* Redraw every window */ | |
1021 | 486 | term *old = Term; |
1022 | 487 | for (int j = 0; j < 8; j++) |
1023 | 488 | { |
1024 | - /* Dead window */ | |
1025 | 489 | if (!angband_term[j]) continue; |
1026 | 490 | |
1027 | - /* Activate */ | |
1028 | 491 | Term_activate(angband_term[j]); |
1029 | 492 | Term_redraw(); |
1030 | 493 | Term_fresh(); |
@@ -1039,12 +502,9 @@ void do_cmd_redraw(player_type *creature_ptr) | ||
1039 | 502 | */ |
1040 | 503 | void do_cmd_player_status(player_type *creature_ptr) |
1041 | 504 | { |
1042 | - char c; | |
1043 | 505 | int mode = 0; |
1044 | 506 | char tmp[160]; |
1045 | 507 | screen_save(); |
1046 | - | |
1047 | - /* Forever */ | |
1048 | 508 | while (TRUE) |
1049 | 509 | { |
1050 | 510 | update_playtime(); |
@@ -1056,24 +516,16 @@ void do_cmd_player_status(player_type *creature_ptr) | ||
1056 | 516 | display_player(creature_ptr, mode, map_name); |
1057 | 517 | } |
1058 | 518 | |
1059 | - /* Prompt */ | |
1060 | 519 | Term_putstr(2, 23, -1, TERM_WHITE, |
1061 | 520 | _("['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]", "['c' to change name, 'f' to file, 'h' to change mode, or ESC]")); |
1062 | - | |
1063 | - /* Query */ | |
1064 | - c = inkey(); | |
521 | + char c = inkey(); | |
1065 | 522 | if (c == ESCAPE) break; |
1066 | 523 | |
1067 | - /* Change name */ | |
1068 | 524 | if (c == 'c') |
1069 | 525 | { |
1070 | 526 | get_name(creature_ptr); |
1071 | - | |
1072 | - /* Process the player name */ | |
1073 | 527 | process_player_name(creature_ptr, FALSE); |
1074 | 528 | } |
1075 | - | |
1076 | - /* File dump */ | |
1077 | 529 | else if (c == 'f') |
1078 | 530 | { |
1079 | 531 | sprintf(tmp, "%s.txt", creature_ptr->base_name); |
@@ -1085,7 +537,6 @@ void do_cmd_player_status(player_type *creature_ptr) | ||
1085 | 537 | } |
1086 | 538 | } |
1087 | 539 | } |
1088 | - | |
1089 | 540 | else if (c == 'h') |
1090 | 541 | { |
1091 | 542 | mode++; |
@@ -1100,7 +551,6 @@ void do_cmd_player_status(player_type *creature_ptr) | ||
1100 | 551 | |
1101 | 552 | screen_load(); |
1102 | 553 | creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY); |
1103 | - | |
1104 | 554 | handle_stuff(creature_ptr); |
1105 | 555 | } |
1106 | 556 |
@@ -1112,7 +562,6 @@ void do_cmd_player_status(player_type *creature_ptr) | ||
1112 | 562 | */ |
1113 | 563 | void do_cmd_message_one(void) |
1114 | 564 | { |
1115 | - /* Recall one message */ | |
1116 | 565 | prt(format("> %s", message_str(0)), 0, 0); |
1117 | 566 | } |
1118 | 567 |
@@ -1145,107 +594,59 @@ void do_cmd_messages(int num_now) | ||
1145 | 594 | char back_str[81]; |
1146 | 595 | concptr shower = NULL; |
1147 | 596 | int wid, hgt; |
1148 | - int num_lines; | |
1149 | - | |
1150 | 597 | Term_get_size(&wid, &hgt); |
1151 | - | |
1152 | - /* Number of message lines in a screen */ | |
1153 | - num_lines = hgt - 4; | |
1154 | - | |
1155 | - /* Wipe finder */ | |
598 | + int num_lines = hgt - 4; | |
1156 | 599 | strcpy(finder_str, ""); |
1157 | - | |
1158 | - /* Wipe shower */ | |
1159 | 600 | strcpy(shower_str, ""); |
1160 | - | |
1161 | - /* Total messages */ | |
1162 | 601 | int n = message_num(); |
1163 | - | |
1164 | - /* Start on first message */ | |
1165 | 602 | int i = 0; |
1166 | 603 | screen_save(); |
1167 | 604 | Term_clear(); |
1168 | - | |
1169 | - /* Process requests until done */ | |
1170 | 605 | while (TRUE) |
1171 | 606 | { |
1172 | 607 | int j; |
1173 | 608 | int skey; |
1174 | - | |
1175 | - /* Dump up to 20 lines of messages */ | |
1176 | 609 | for (j = 0; (j < num_lines) && (i + j < n); j++) |
1177 | 610 | { |
1178 | 611 | concptr msg = message_str(i + j); |
1179 | - | |
1180 | - /* Dump the messages, bottom to top */ | |
1181 | 612 | c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0); |
1182 | - | |
1183 | 613 | if (!shower || !shower[0]) continue; |
1184 | 614 | |
1185 | - /* Hilite "shower" */ | |
1186 | 615 | concptr str = msg; |
1187 | - | |
1188 | - /* Display matches */ | |
1189 | 616 | while ((str = my_strstr(str, shower)) != NULL) |
1190 | 617 | { |
1191 | 618 | int len = strlen(shower); |
1192 | - | |
1193 | - /* Display the match */ | |
1194 | 619 | Term_putstr(str - msg, num_lines + 1 - j, len, TERM_YELLOW, shower); |
1195 | - | |
1196 | - /* Advance */ | |
1197 | 620 | str += len; |
1198 | 621 | } |
1199 | 622 | } |
1200 | 623 | |
1201 | - /* Erase remaining lines */ | |
1202 | - for (; j < num_lines; j++) Term_erase(0, num_lines + 1 - j, 255); | |
624 | + for (; j < num_lines; j++) | |
625 | + Term_erase(0, num_lines + 1 - j, 255); | |
1203 | 626 | |
1204 | - /* Display header */ | |
1205 | - /* translation */ | |
1206 | 627 | prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"), |
1207 | 628 | i, i + j - 1, n), 0, 0); |
1208 | - | |
1209 | - /* Display prompt (not very informative) */ | |
1210 | 629 | prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]", |
1211 | 630 | "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0); |
1212 | - | |
1213 | 631 | skey = inkey_special(TRUE); |
1214 | - | |
1215 | - /* Exit on Escape */ | |
1216 | 632 | if (skey == ESCAPE) break; |
1217 | 633 | |
1218 | - /* Hack -- Save the old index */ | |
1219 | 634 | j = i; |
1220 | - | |
1221 | 635 | switch (skey) |
1222 | 636 | { |
1223 | - /* Hack -- handle show */ | |
1224 | 637 | case '=': |
1225 | - /* Prompt */ | |
1226 | 638 | prt(_("強調: ", "Show: "), hgt - 1, 0); |
1227 | - | |
1228 | - /* Get a "shower" string, or continue */ | |
1229 | 639 | strcpy(back_str, shower_str); |
1230 | 640 | if (askfor(shower_str, 80)) |
1231 | - { | |
1232 | - /* Show it */ | |
1233 | 641 | shower = shower_str[0] ? shower_str : NULL; |
1234 | - } | |
1235 | - else strcpy(shower_str, back_str); | |
642 | + else | |
643 | + strcpy(shower_str, back_str); | |
1236 | 644 | |
1237 | 645 | continue; |
1238 | - | |
1239 | - /* Hack -- handle find */ | |
1240 | 646 | case '/': |
1241 | 647 | case KTRL('s'): |
1242 | 648 | { |
1243 | - int z; | |
1244 | - | |
1245 | - /* Prompt */ | |
1246 | 649 | prt(_("検索: ", "Find: "), hgt - 1, 0); |
1247 | - | |
1248 | - /* Get a "finder" string, or continue */ | |
1249 | 650 | strcpy(back_str, finder_str); |
1250 | 651 | if (!askfor(finder_str, 80)) |
1251 | 652 | { |
@@ -1254,89 +655,59 @@ void do_cmd_messages(int num_now) | ||
1254 | 655 | } |
1255 | 656 | else if (!finder_str[0]) |
1256 | 657 | { |
1257 | - shower = NULL; /* Stop showing */ | |
658 | + shower = NULL; | |
1258 | 659 | continue; |
1259 | 660 | } |
1260 | 661 | |
1261 | - /* Show it */ | |
1262 | 662 | shower = finder_str; |
1263 | - | |
1264 | - /* Scan messages */ | |
1265 | - for (z = i + 1; z < n; z++) | |
663 | + for (int z = i + 1; z < n; z++) | |
1266 | 664 | { |
1267 | 665 | concptr msg = message_str(z); |
1268 | - | |
1269 | - /* Search for it */ | |
1270 | 666 | if (my_strstr(msg, finder_str)) |
1271 | 667 | { |
1272 | - /* New location */ | |
1273 | 668 | i = z; |
1274 | - | |
1275 | 669 | break; |
1276 | 670 | } |
1277 | 671 | } |
1278 | 672 | } |
673 | + | |
1279 | 674 | break; |
1280 | 675 | |
1281 | - /* Recall 1 older message */ | |
1282 | 676 | case SKEY_TOP: |
1283 | - /* Go to the oldest line */ | |
1284 | 677 | i = n - num_lines; |
1285 | 678 | break; |
1286 | - | |
1287 | - /* Recall 1 newer message */ | |
1288 | 679 | case SKEY_BOTTOM: |
1289 | - /* Go to the newest line */ | |
1290 | 680 | i = 0; |
1291 | 681 | break; |
1292 | - | |
1293 | - /* Recall 1 older message */ | |
1294 | 682 | case '8': |
1295 | 683 | case SKEY_UP: |
1296 | 684 | case '\n': |
1297 | 685 | case '\r': |
1298 | - /* Go older if legal */ | |
1299 | 686 | i = MIN(i + 1, n - num_lines); |
1300 | 687 | break; |
1301 | - | |
1302 | - /* Recall 10 older messages */ | |
1303 | 688 | case '+': |
1304 | - /* Go older if legal */ | |
1305 | 689 | i = MIN(i + 10, n - num_lines); |
1306 | 690 | break; |
1307 | - | |
1308 | - /* Recall 20 older messages */ | |
1309 | 691 | case 'p': |
1310 | 692 | case KTRL('P'): |
1311 | 693 | case ' ': |
1312 | 694 | case SKEY_PGUP: |
1313 | - /* Go older if legal */ | |
1314 | 695 | i = MIN(i + num_lines, n - num_lines); |
1315 | 696 | break; |
1316 | - | |
1317 | - /* Recall 20 newer messages */ | |
1318 | 697 | case 'n': |
1319 | 698 | case KTRL('N'): |
1320 | 699 | case SKEY_PGDOWN: |
1321 | - /* Go newer (if able) */ | |
1322 | 700 | i = MAX(0, i - num_lines); |
1323 | 701 | break; |
1324 | - | |
1325 | - /* Recall 10 newer messages */ | |
1326 | 702 | case '-': |
1327 | - /* Go newer (if able) */ | |
1328 | 703 | i = MAX(0, i - 10); |
1329 | 704 | break; |
1330 | - | |
1331 | - /* Recall 1 newer messages */ | |
1332 | 705 | case '2': |
1333 | 706 | case SKEY_DOWN: |
1334 | - /* Go newer (if able) */ | |
1335 | 707 | i = MAX(0, i - 1); |
1336 | 708 | break; |
1337 | 709 | } |
1338 | 710 | |
1339 | - /* Hack -- Error of some kind */ | |
1340 | 711 | if (i == j) bell(); |
1341 | 712 | } |
1342 | 713 |
@@ -1356,11 +727,8 @@ void do_cmd_pref(player_type *creature_ptr) | ||
1356 | 727 | { |
1357 | 728 | char buf[80]; |
1358 | 729 | strcpy(buf, ""); |
1359 | - | |
1360 | - /* Ask for a "user pref command" */ | |
1361 | 730 | if (!get_string(_("設定変更コマンド: ", "Pref: "), buf, 80)) return; |
1362 | 731 | |
1363 | - /* Process that pref command */ | |
1364 | 732 | (void)interpret_pref_file(creature_ptr, buf); |
1365 | 733 | } |
1366 | 734 |
@@ -1372,8 +740,9 @@ void do_cmd_pref(player_type *creature_ptr) | ||
1372 | 740 | */ |
1373 | 741 | void do_cmd_reload_autopick(player_type *creature_ptr) |
1374 | 742 | { |
1375 | - if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? "))) return; | |
1376 | - /* Load the file with messages */ | |
743 | + if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? "))) | |
744 | + return; | |
745 | + | |
1377 | 746 | autopick_load_pref(creature_ptr, TRUE); |
1378 | 747 | } |
1379 | 748 |
@@ -1388,32 +757,16 @@ static errr macro_dump(concptr fname) | ||
1388 | 757 | static concptr mark = "Macro Dump"; |
1389 | 758 | char buf[1024]; |
1390 | 759 | path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname); |
1391 | - | |
1392 | - /* File type is "TEXT" */ | |
1393 | 760 | FILE_TYPE(FILE_TYPE_TEXT); |
1394 | - | |
1395 | - /* Append to the file */ | |
1396 | 761 | if (!open_auto_dump(buf, mark)) return -1; |
1397 | 762 | |
1398 | - /* Start dumping */ | |
1399 | 763 | auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n")); |
1400 | - | |
1401 | - /* Dump them */ | |
1402 | 764 | for (int i = 0; i < macro__num; i++) |
1403 | 765 | { |
1404 | - /* Extract the action */ | |
1405 | 766 | ascii_to_text(buf, macro__act[i]); |
1406 | - | |
1407 | - /* Dump the macro */ | |
1408 | 767 | auto_dump_printf("A:%s\n", buf); |
1409 | - | |
1410 | - /* Extract the action */ | |
1411 | 768 | ascii_to_text(buf, macro__pat[i]); |
1412 | - | |
1413 | - /* Dump normal macros */ | |
1414 | 769 | auto_dump_printf("P:%s\n", buf); |
1415 | - | |
1416 | - /* End the macro */ | |
1417 | 770 | auto_dump_printf("\n"); |
1418 | 771 | } |
1419 | 772 |
@@ -1437,40 +790,21 @@ static errr macro_dump(concptr fname) | ||
1437 | 790 | static void do_cmd_macro_aux(char *buf) |
1438 | 791 | { |
1439 | 792 | flush(); |
1440 | - | |
1441 | - /* Do not process macros */ | |
1442 | 793 | inkey_base = TRUE; |
1443 | - | |
1444 | - /* First key */ | |
1445 | 794 | char i = inkey(); |
1446 | - | |
1447 | - /* Read the pattern */ | |
1448 | 795 | int n = 0; |
1449 | 796 | while (i) |
1450 | 797 | { |
1451 | - /* Save the key */ | |
1452 | 798 | buf[n++] = i; |
1453 | - | |
1454 | - /* Do not process macros */ | |
1455 | 799 | inkey_base = TRUE; |
1456 | - | |
1457 | - /* Do not wait for keys */ | |
1458 | 800 | inkey_scan = TRUE; |
1459 | - | |
1460 | - /* Attempt to read a key */ | |
1461 | 801 | i = inkey(); |
1462 | 802 | } |
1463 | 803 | |
1464 | - /* Terminate */ | |
1465 | 804 | buf[n] = '\0'; |
1466 | - | |
1467 | 805 | flush(); |
1468 | - | |
1469 | - /* Convert the trigger */ | |
1470 | 806 | char tmp[1024]; |
1471 | 807 | ascii_to_text(tmp, buf); |
1472 | - | |
1473 | - /* Hack -- display the trigger */ | |
1474 | 808 | Term_addstr(-1, TERM_WHITE, tmp); |
1475 | 809 | } |
1476 | 810 |
@@ -1489,19 +823,11 @@ static void do_cmd_macro_aux(char *buf) | ||
1489 | 823 | static void do_cmd_macro_aux_keymap(char *buf) |
1490 | 824 | { |
1491 | 825 | char tmp[1024]; |
1492 | - | |
1493 | 826 | flush(); |
1494 | - | |
1495 | - /* Get a key */ | |
1496 | 827 | buf[0] = inkey(); |
1497 | 828 | buf[1] = '\0'; |
1498 | - | |
1499 | - /* Convert to ascii */ | |
1500 | 829 | ascii_to_text(tmp, buf); |
1501 | - | |
1502 | - /* Hack -- display the trigger */ | |
1503 | 830 | Term_addstr(-1, TERM_WHITE, tmp); |
1504 | - | |
1505 | 831 | flush(); |
1506 | 832 | } |
1507 | 833 |
@@ -1518,52 +844,31 @@ static errr keymap_dump(concptr fname) | ||
1518 | 844 | static concptr mark = "Keymap Dump"; |
1519 | 845 | char key[1024]; |
1520 | 846 | char buf[1024]; |
1521 | - | |
1522 | 847 | BIT_FLAGS mode; |
1523 | - | |
1524 | - /* Roguelike */ | |
1525 | 848 | if (rogue_like_commands) |
1526 | 849 | { |
1527 | 850 | mode = KEYMAP_MODE_ROGUE; |
1528 | 851 | } |
1529 | - | |
1530 | - /* Original */ | |
1531 | 852 | else |
1532 | 853 | { |
1533 | 854 | mode = KEYMAP_MODE_ORIG; |
1534 | 855 | } |
1535 | 856 | |
1536 | 857 | path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname); |
1537 | - | |
1538 | - /* File type is "TEXT" */ | |
1539 | 858 | FILE_TYPE(FILE_TYPE_TEXT); |
1540 | - | |
1541 | - /* Append to the file */ | |
1542 | 859 | if (!open_auto_dump(buf, mark)) return -1; |
1543 | 860 | |
1544 | - /* Start dumping */ | |
1545 | 861 | auto_dump_printf(_("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n")); |
1546 | - | |
1547 | - /* Dump them */ | |
1548 | 862 | for (int i = 0; i < 256; i++) |
1549 | 863 | { |
1550 | 864 | concptr act; |
1551 | - | |
1552 | - /* Loop up the keymap */ | |
1553 | 865 | act = keymap_act[mode][i]; |
1554 | - | |
1555 | - /* Skip empty keymaps */ | |
1556 | 866 | if (!act) continue; |
1557 | 867 | |
1558 | - /* Encode the key */ | |
1559 | 868 | buf[0] = (char)i; |
1560 | 869 | buf[1] = '\0'; |
1561 | 870 | ascii_to_text(key, buf); |
1562 | - | |
1563 | - /* Encode the action */ | |
1564 | 871 | ascii_to_text(buf, act); |
1565 | - | |
1566 | - /* Dump the macro */ | |
1567 | 872 | auto_dump_printf("A:%s\n", buf); |
1568 | 873 | auto_dump_printf("C:%d:%s\n", mode, key); |
1569 | 874 | } |
@@ -1586,45 +891,28 @@ static errr keymap_dump(concptr fname) | ||
1586 | 891 | */ |
1587 | 892 | void do_cmd_macros(player_type *creature_ptr) |
1588 | 893 | { |
1589 | - int i; | |
1590 | 894 | char tmp[1024]; |
1591 | 895 | char buf[1024]; |
1592 | 896 | BIT_FLAGS mode; |
1593 | - | |
1594 | - /* Roguelike */ | |
1595 | 897 | if (rogue_like_commands) |
1596 | 898 | { |
1597 | 899 | mode = KEYMAP_MODE_ROGUE; |
1598 | 900 | } |
1599 | - | |
1600 | - /* Original */ | |
1601 | 901 | else |
1602 | 902 | { |
1603 | 903 | mode = KEYMAP_MODE_ORIG; |
1604 | 904 | } |
1605 | 905 | |
1606 | - /* File type is "TEXT" */ | |
1607 | 906 | FILE_TYPE(FILE_TYPE_TEXT); |
1608 | - | |
1609 | 907 | screen_save(); |
1610 | - | |
1611 | - /* Process requests until done */ | |
1612 | 908 | while (TRUE) |
1613 | 909 | { |
1614 | 910 | Term_clear(); |
1615 | 911 | prt(_("[ マクロの設定 ]", "Interact with Macros"), 2, 0); |
1616 | - | |
1617 | - /* Describe that action */ | |
1618 | 912 | prt(_("マクロ行動が(もしあれば)下に表示されます:", "Current action (if any) shown below:"), 20, 0); |
1619 | - | |
1620 | - /* Analyze the current action */ | |
1621 | 913 | ascii_to_text(buf, macro__buf); |
1622 | - | |
1623 | - /* Display the current action */ | |
1624 | 914 | prt(buf, 22, 0); |
1625 | 915 | |
1626 | - | |
1627 | - /* Selections */ | |
1628 | 916 | prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5); |
1629 | 917 | prt(_("(2) ファイルにマクロを追加", "(2) Append macros to a file"), 5, 5); |
1630 | 918 | prt(_("(3) マクロの確認", "(3) Query a macro"), 6, 5); |
@@ -1636,317 +924,145 @@ void do_cmd_macros(player_type *creature_ptr) | ||
1636 | 924 | prt(_("(9) キー配置の削除", "(9) Remove a keymap"), 12, 5); |
1637 | 925 | prt(_("(0) マクロ行動の入力", "(0) Enter a new action"), 13, 5); |
1638 | 926 | |
1639 | - /* Prompt */ | |
1640 | 927 | prt(_("コマンド: ", "Command: "), 16, 0); |
1641 | - | |
1642 | - i = inkey(); | |
1643 | - | |
1644 | - /* Leave */ | |
928 | + int i = inkey(); | |
1645 | 929 | if (i == ESCAPE) break; |
1646 | 930 | |
1647 | - /* Load a 'macro' file */ | |
1648 | 931 | else if (i == '1') |
1649 | 932 | { |
1650 | - errr err; | |
1651 | - | |
1652 | - /* Prompt */ | |
1653 | 933 | prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 16, 0); |
1654 | - | |
1655 | - /* Prompt */ | |
1656 | 934 | prt(_("ファイル: ", "File: "), 18, 0); |
1657 | - | |
1658 | - /* Default filename */ | |
1659 | 935 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
1660 | - | |
1661 | - /* Ask for a file */ | |
1662 | 936 | if (!askfor(tmp, 80)) continue; |
1663 | 937 | |
1664 | - /* Process the given filename */ | |
1665 | - err = process_pref_file(creature_ptr, tmp); | |
938 | + errr err = process_pref_file(creature_ptr, tmp); | |
1666 | 939 | if (-2 == err) |
1667 | - { | |
1668 | 940 | msg_format(_("標準の設定ファイル'%s'を読み込みました。", "Loaded default '%s'."), tmp); |
1669 | - } | |
1670 | 941 | else if (err) |
1671 | - { | |
1672 | - /* Prompt */ | |
1673 | 942 | msg_format(_("'%s'の読み込みに失敗しました!", "Failed to load '%s'!"), tmp); |
1674 | - } | |
1675 | 943 | else |
1676 | - { | |
1677 | 944 | msg_format(_("'%s'を読み込みました。", "Loaded '%s'."), tmp); |
1678 | - } | |
1679 | 945 | } |
1680 | - | |
1681 | - /* Save macros */ | |
1682 | 946 | else if (i == '2') |
1683 | 947 | { |
1684 | - /* Prompt */ | |
1685 | 948 | prt(_("コマンド: マクロをファイルに追加する", "Command: Append macros to a file"), 16, 0); |
1686 | - | |
1687 | - /* Prompt */ | |
1688 | 949 | prt(_("ファイル: ", "File: "), 18, 0); |
1689 | - | |
1690 | - /* Default filename */ | |
1691 | 950 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
1692 | - | |
1693 | - /* Ask for a file */ | |
1694 | 951 | if (!askfor(tmp, 80)) continue; |
1695 | 952 | |
1696 | - /* Dump the macros */ | |
1697 | 953 | (void)macro_dump(tmp); |
1698 | - | |
1699 | - /* Prompt */ | |
1700 | 954 | msg_print(_("マクロを追加しました。", "Appended macros.")); |
1701 | 955 | } |
1702 | - | |
1703 | - /* Query a macro */ | |
1704 | 956 | else if (i == '3') |
1705 | 957 | { |
1706 | - int k; | |
1707 | - | |
1708 | - /* Prompt */ | |
1709 | 958 | prt(_("コマンド: マクロの確認", "Command: Query a macro"), 16, 0); |
1710 | - | |
1711 | - | |
1712 | - /* Prompt */ | |
1713 | 959 | prt(_("トリガーキー: ", "Trigger: "), 18, 0); |
1714 | - | |
1715 | - /* Get a macro trigger */ | |
1716 | 960 | do_cmd_macro_aux(buf); |
1717 | - | |
1718 | - /* Acquire action */ | |
1719 | - k = macro_find_exact(buf); | |
1720 | - | |
1721 | - /* Nothing found */ | |
961 | + int k = macro_find_exact(buf); | |
1722 | 962 | if (k < 0) |
1723 | 963 | { |
1724 | - /* Prompt */ | |
1725 | 964 | msg_print(_("そのキーにはマクロは定義されていません。", "Found no macro.")); |
1726 | 965 | } |
1727 | - | |
1728 | - /* Found one */ | |
1729 | 966 | else |
1730 | 967 | { |
1731 | - /* Obtain the action */ | |
1732 | 968 | strcpy(macro__buf, macro__act[k]); |
1733 | - | |
1734 | - /* Analyze the current action */ | |
1735 | 969 | ascii_to_text(buf, macro__buf); |
1736 | - | |
1737 | - /* Display the current action */ | |
1738 | 970 | prt(buf, 22, 0); |
1739 | - | |
1740 | - /* Prompt */ | |
1741 | 971 | msg_print(_("マクロを確認しました。", "Found a macro.")); |
1742 | 972 | } |
1743 | 973 | } |
1744 | - | |
1745 | - /* Create a macro */ | |
1746 | 974 | else if (i == '4') |
1747 | 975 | { |
1748 | - /* Prompt */ | |
1749 | 976 | prt(_("コマンド: マクロの作成", "Command: Create a macro"), 16, 0); |
1750 | - | |
1751 | - /* Prompt */ | |
1752 | 977 | prt(_("トリガーキー: ", "Trigger: "), 18, 0); |
1753 | - | |
1754 | - /* Get a macro trigger */ | |
1755 | 978 | do_cmd_macro_aux(buf); |
1756 | 979 | clear_from(20); |
1757 | - | |
1758 | - /* Help message */ | |
1759 | 980 | c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。", |
1760 | 981 | "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); |
1761 | - | |
1762 | - /* Prompt */ | |
1763 | 982 | prt(_("マクロ行動: ", "Action: "), 20, 0); |
1764 | - | |
1765 | - /* Convert to text */ | |
1766 | 983 | ascii_to_text(tmp, macro__buf); |
1767 | - | |
1768 | - /* Get an encoded action */ | |
1769 | 984 | if (askfor(tmp, 80)) |
1770 | 985 | { |
1771 | - /* Convert to ascii */ | |
1772 | 986 | text_to_ascii(macro__buf, tmp); |
1773 | - | |
1774 | - /* Link the macro */ | |
1775 | 987 | macro_add(buf, macro__buf); |
1776 | - | |
1777 | - /* Prompt */ | |
1778 | 988 | msg_print(_("マクロを追加しました。", "Added a macro.")); |
1779 | 989 | } |
1780 | 990 | } |
1781 | - | |
1782 | - /* Remove a macro */ | |
1783 | 991 | else if (i == '5') |
1784 | 992 | { |
1785 | - /* Prompt */ | |
1786 | 993 | prt(_("コマンド: マクロの削除", "Command: Remove a macro"), 16, 0); |
1787 | - | |
1788 | - /* Prompt */ | |
1789 | 994 | prt(_("トリガーキー: ", "Trigger: "), 18, 0); |
1790 | - | |
1791 | - /* Get a macro trigger */ | |
1792 | 995 | do_cmd_macro_aux(buf); |
1793 | - | |
1794 | - /* Link the macro */ | |
1795 | 996 | macro_add(buf, buf); |
1796 | - | |
1797 | - /* Prompt */ | |
1798 | 997 | msg_print(_("マクロを削除しました。", "Removed a macro.")); |
1799 | 998 | } |
1800 | - | |
1801 | - /* Save keymaps */ | |
1802 | 999 | else if (i == '6') |
1803 | 1000 | { |
1804 | - /* Prompt */ | |
1805 | 1001 | prt(_("コマンド: キー配置をファイルに追加する", "Command: Append keymaps to a file"), 16, 0); |
1806 | - | |
1807 | - /* Prompt */ | |
1808 | 1002 | prt(_("ファイル: ", "File: "), 18, 0); |
1809 | - | |
1810 | - /* Default filename */ | |
1811 | 1003 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
1812 | - | |
1813 | - /* Ask for a file */ | |
1814 | 1004 | if (!askfor(tmp, 80)) continue; |
1815 | 1005 | |
1816 | - /* Dump the macros */ | |
1817 | 1006 | (void)keymap_dump(tmp); |
1818 | - | |
1819 | - /* Prompt */ | |
1820 | 1007 | msg_print(_("キー配置を追加しました。", "Appended keymaps.")); |
1821 | 1008 | } |
1822 | - | |
1823 | - /* Query a keymap */ | |
1824 | 1009 | else if (i == '7') |
1825 | 1010 | { |
1826 | - concptr act; | |
1827 | - | |
1828 | - /* Prompt */ | |
1829 | 1011 | prt(_("コマンド: キー配置の確認", "Command: Query a keymap"), 16, 0); |
1830 | - | |
1831 | - /* Prompt */ | |
1832 | 1012 | prt(_("押すキー: ", "Keypress: "), 18, 0); |
1833 | - | |
1834 | - /* Get a keymap trigger */ | |
1835 | 1013 | do_cmd_macro_aux_keymap(buf); |
1836 | - | |
1837 | - /* Look up the keymap */ | |
1838 | - act = keymap_act[mode][(byte)(buf[0])]; | |
1839 | - | |
1840 | - /* Nothing found */ | |
1014 | + concptr act = keymap_act[mode][(byte)(buf[0])]; | |
1841 | 1015 | if (!act) |
1842 | 1016 | { |
1843 | - /* Prompt */ | |
1844 | 1017 | msg_print(_("キー配置は定義されていません。", "Found no keymap.")); |
1845 | 1018 | } |
1846 | - | |
1847 | - /* Found one */ | |
1848 | 1019 | else |
1849 | 1020 | { |
1850 | - /* Obtain the action */ | |
1851 | 1021 | strcpy(macro__buf, act); |
1852 | - | |
1853 | - /* Analyze the current action */ | |
1854 | 1022 | ascii_to_text(buf, macro__buf); |
1855 | - | |
1856 | - /* Display the current action */ | |
1857 | 1023 | prt(buf, 22, 0); |
1858 | - | |
1859 | - /* Prompt */ | |
1860 | 1024 | msg_print(_("キー配置を確認しました。", "Found a keymap.")); |
1861 | 1025 | } |
1862 | 1026 | } |
1863 | - | |
1864 | - /* Create a keymap */ | |
1865 | 1027 | else if (i == '8') |
1866 | 1028 | { |
1867 | - /* Prompt */ | |
1868 | 1029 | prt(_("コマンド: キー配置の作成", "Command: Create a keymap"), 16, 0); |
1869 | - | |
1870 | - /* Prompt */ | |
1871 | 1030 | prt(_("押すキー: ", "Keypress: "), 18, 0); |
1872 | - | |
1873 | - /* Get a keymap trigger */ | |
1874 | 1031 | do_cmd_macro_aux_keymap(buf); |
1875 | 1032 | clear_from(20); |
1876 | - | |
1877 | - /* Help message */ | |
1878 | 1033 | c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。", |
1879 | 1034 | "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); |
1880 | - | |
1881 | - /* Prompt */ | |
1882 | 1035 | prt(_("行動: ", "Action: "), 20, 0); |
1883 | - | |
1884 | - /* Convert to text */ | |
1885 | 1036 | ascii_to_text(tmp, macro__buf); |
1886 | - | |
1887 | - /* Get an encoded action */ | |
1888 | 1037 | if (askfor(tmp, 80)) |
1889 | 1038 | { |
1890 | - /* Convert to ascii */ | |
1891 | 1039 | text_to_ascii(macro__buf, tmp); |
1892 | - | |
1893 | - /* Free old keymap */ | |
1894 | 1040 | string_free(keymap_act[mode][(byte)(buf[0])]); |
1895 | - | |
1896 | - /* Make new keymap */ | |
1897 | 1041 | keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf); |
1898 | - | |
1899 | - /* Prompt */ | |
1900 | 1042 | msg_print(_("キー配置を追加しました。", "Added a keymap.")); |
1901 | 1043 | } |
1902 | 1044 | } |
1903 | - | |
1904 | - /* Remove a keymap */ | |
1905 | 1045 | else if (i == '9') |
1906 | 1046 | { |
1907 | - /* Prompt */ | |
1908 | 1047 | prt(_("コマンド: キー配置の削除", "Command: Remove a keymap"), 16, 0); |
1909 | - | |
1910 | - /* Prompt */ | |
1911 | 1048 | prt(_("押すキー: ", "Keypress: "), 18, 0); |
1912 | - | |
1913 | - /* Get a keymap trigger */ | |
1914 | 1049 | do_cmd_macro_aux_keymap(buf); |
1915 | - | |
1916 | - /* Free old keymap */ | |
1917 | 1050 | string_free(keymap_act[mode][(byte)(buf[0])]); |
1918 | - | |
1919 | - /* Make new keymap */ | |
1920 | 1051 | keymap_act[mode][(byte)(buf[0])] = NULL; |
1921 | - | |
1922 | - /* Prompt */ | |
1923 | 1052 | msg_print(_("キー配置を削除しました。", "Removed a keymap.")); |
1924 | 1053 | } |
1925 | - | |
1926 | - /* Enter a new action */ | |
1927 | 1054 | else if (i == '0') |
1928 | 1055 | { |
1929 | - /* Prompt */ | |
1930 | 1056 | prt(_("コマンド: マクロ行動の入力", "Command: Enter a new action"), 16, 0); |
1931 | 1057 | clear_from(20); |
1932 | - | |
1933 | - /* Help message */ | |
1934 | 1058 | c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。", |
1935 | 1059 | "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); |
1936 | - | |
1937 | - /* Prompt */ | |
1938 | 1060 | prt(_("マクロ行動: ", "Action: "), 20, 0); |
1939 | - | |
1940 | - /* Hack -- limit the value */ | |
1941 | 1061 | tmp[80] = '\0'; |
1942 | - | |
1943 | - /* Get an encoded action */ | |
1944 | 1062 | if (!askfor(buf, 80)) continue; |
1945 | 1063 | |
1946 | - /* Extract an action */ | |
1947 | 1064 | text_to_ascii(macro__buf, buf); |
1948 | 1065 | } |
1949 | - | |
1950 | 1066 | else |
1951 | 1067 | { |
1952 | 1068 | bell(); |
@@ -1964,15 +1080,9 @@ void do_cmd_macros(player_type *creature_ptr) | ||
1964 | 1080 | */ |
1965 | 1081 | static concptr lighting_level_str[F_LIT_MAX] = |
1966 | 1082 | { |
1967 | -#ifdef JP | |
1968 | - "標準色", | |
1969 | - "明色", | |
1970 | - "暗色", | |
1971 | -#else | |
1972 | - "standard", | |
1973 | - "brightly lit", | |
1974 | - "darkened", | |
1975 | -#endif | |
1083 | + _("標準色", "standard"), | |
1084 | + _("明色", "brightly lit"), | |
1085 | + _("暗色", "darkened"), | |
1976 | 1086 | }; |
1977 | 1087 | |
1978 | 1088 |
@@ -1988,14 +1098,11 @@ static bool cmd_visuals_aux(int i, IDX *num, IDX max) | ||
1988 | 1098 | if (iscntrl(i)) |
1989 | 1099 | { |
1990 | 1100 | char str[10] = ""; |
1991 | - IDX tmp; | |
1992 | - | |
1993 | 1101 | sprintf(str, "%d", *num); |
1994 | - | |
1995 | 1102 | if (!get_string(format("Input new number(0-%d): ", max - 1), str, 4)) |
1996 | 1103 | return FALSE; |
1997 | 1104 | |
1998 | - tmp = (IDX)strtol(str, NULL, 0); | |
1105 | + IDX tmp = (IDX)strtol(str, NULL, 0); | |
1999 | 1106 | if (tmp >= 0 && tmp < max) |
2000 | 1107 | *num = tmp; |
2001 | 1108 | } |
@@ -2015,8 +1122,6 @@ static bool cmd_visuals_aux(int i, IDX *num, IDX max) | ||
2015 | 1122 | static void print_visuals_menu(concptr choice_msg) |
2016 | 1123 | { |
2017 | 1124 | prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0); |
2018 | - | |
2019 | - /* Give some choices */ | |
2020 | 1125 | prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5); |
2021 | 1126 | prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5); |
2022 | 1127 | prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5); |
@@ -2028,8 +1133,6 @@ static void print_visuals_menu(concptr choice_msg) | ||
2028 | 1133 | prt(_("(8) アイテムの 色/文字 を変更する (シンボルエディタ)", "(8) Change object attr/chars (visual mode)"), 11, 5); |
2029 | 1134 | prt(_("(9) 地形の 色/文字 を変更する (シンボルエディタ)", "(9) Change feature attr/chars (visual mode)"), 12, 5); |
2030 | 1135 | prt(_("(R) 画面表示方法の初期化", "(R) Reset visuals"), 13, 5); |
2031 | - | |
2032 | - /* Prompt */ | |
2033 | 1136 | prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0); |
2034 | 1137 | } |
2035 | 1138 |
@@ -2039,229 +1142,132 @@ static void print_visuals_menu(concptr choice_msg) | ||
2039 | 1142 | */ |
2040 | 1143 | void do_cmd_visuals(player_type *creature_ptr) |
2041 | 1144 | { |
2042 | - int i; | |
2043 | 1145 | char tmp[160]; |
2044 | 1146 | char buf[1024]; |
2045 | 1147 | bool need_redraw = FALSE; |
2046 | 1148 | concptr empty_symbol = "<< ? >>"; |
2047 | - | |
2048 | 1149 | if (use_bigtile) empty_symbol = "<< ?? >>"; |
2049 | 1150 | |
2050 | - /* File type is "TEXT" */ | |
2051 | 1151 | FILE_TYPE(FILE_TYPE_TEXT); |
2052 | 1152 | screen_save(); |
2053 | - | |
2054 | - /* Interact until done */ | |
2055 | 1153 | while (TRUE) |
2056 | 1154 | { |
2057 | 1155 | Term_clear(); |
2058 | - | |
2059 | - /* Ask for a choice */ | |
2060 | 1156 | print_visuals_menu(NULL); |
2061 | - | |
2062 | - /* Prompt */ | |
2063 | - i = inkey(); | |
2064 | - | |
1157 | + int i = inkey(); | |
2065 | 1158 | if (i == ESCAPE) break; |
2066 | 1159 | |
2067 | 1160 | switch (i) |
2068 | 1161 | { |
2069 | - /* Load a 'pref' file */ | |
2070 | 1162 | case '0': |
2071 | - /* Prompt */ | |
1163 | + { | |
2072 | 1164 | prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0); |
2073 | - | |
2074 | - /* Prompt */ | |
2075 | 1165 | prt(_("ファイル: ", "File: "), 17, 0); |
2076 | - | |
2077 | - /* Default filename */ | |
2078 | 1166 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
2079 | - | |
2080 | - /* Query */ | |
2081 | 1167 | if (!askfor(tmp, 70)) continue; |
2082 | 1168 | |
2083 | - /* Process the given filename */ | |
2084 | 1169 | (void)process_pref_file(creature_ptr, tmp); |
2085 | - | |
2086 | 1170 | need_redraw = TRUE; |
2087 | 1171 | break; |
2088 | - | |
2089 | - /* Dump monster attr/chars */ | |
1172 | + } | |
2090 | 1173 | case '1': |
2091 | 1174 | { |
2092 | 1175 | static concptr mark = "Monster attr/chars"; |
2093 | - | |
2094 | - /* Prompt */ | |
2095 | 1176 | prt(_("コマンド: モンスターの[色/文字]をファイルに書き出します", "Command: Dump monster attr/chars"), 15, 0); |
2096 | - | |
2097 | - /* Prompt */ | |
2098 | 1177 | prt(_("ファイル: ", "File: "), 17, 0); |
2099 | - | |
2100 | - /* Default filename */ | |
2101 | 1178 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
2102 | - | |
2103 | - /* Get a filename */ | |
2104 | 1179 | if (!askfor(tmp, 70)) continue; |
2105 | - path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2106 | 1180 | |
2107 | - /* Append to the file */ | |
1181 | + path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2108 | 1182 | if (!open_auto_dump(buf, mark)) continue; |
2109 | 1183 | |
2110 | - /* Start dumping */ | |
2111 | 1184 | auto_dump_printf(_("\n# モンスターの[色/文字]の設定\n\n", "\n# Monster attr/char definitions\n\n")); |
2112 | - | |
2113 | - /* Dump monsters */ | |
2114 | 1185 | for (i = 0; i < max_r_idx; i++) |
2115 | 1186 | { |
2116 | 1187 | monster_race *r_ptr = &r_info[i]; |
2117 | - | |
2118 | - /* Skip non-entries */ | |
2119 | 1188 | if (!r_ptr->name) continue; |
2120 | 1189 | |
2121 | - /* Dump a comment */ | |
2122 | 1190 | auto_dump_printf("# %s\n", (r_name + r_ptr->name)); |
2123 | - | |
2124 | - /* Dump the monster attr/char info */ | |
2125 | 1191 | auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i, |
2126 | 1192 | (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char)); |
2127 | 1193 | } |
2128 | 1194 | |
2129 | - /* Close */ | |
2130 | 1195 | close_auto_dump(); |
2131 | - | |
2132 | 1196 | msg_print(_("モンスターの[色/文字]をファイルに書き出しました。", "Dumped monster attr/chars.")); |
2133 | - | |
2134 | 1197 | break; |
2135 | 1198 | } |
2136 | - | |
2137 | - /* Dump object attr/chars */ | |
2138 | 1199 | case '2': |
2139 | 1200 | { |
2140 | 1201 | static concptr mark = "Object attr/chars"; |
2141 | - KIND_OBJECT_IDX k_idx; | |
2142 | - | |
2143 | - /* Prompt */ | |
2144 | 1202 | prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0); |
2145 | - | |
2146 | - /* Prompt */ | |
2147 | 1203 | prt(_("ファイル: ", "File: "), 17, 0); |
2148 | - | |
2149 | - /* Default filename */ | |
2150 | 1204 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
2151 | - | |
2152 | - /* Get a filename */ | |
2153 | 1205 | if (!askfor(tmp, 70)) continue; |
2154 | - path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2155 | 1206 | |
2156 | - /* Append to the file */ | |
1207 | + path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2157 | 1208 | if (!open_auto_dump(buf, mark)) continue; |
2158 | 1209 | |
2159 | - /* Start dumping */ | |
2160 | 1210 | auto_dump_printf(_("\n# アイテムの[色/文字]の設定\n\n", "\n# Object attr/char definitions\n\n")); |
2161 | - | |
2162 | - /* Dump objects */ | |
2163 | - for (k_idx = 0; k_idx < max_k_idx; k_idx++) | |
1211 | + for (KIND_OBJECT_IDX k_idx = 0; k_idx < max_k_idx; k_idx++) | |
2164 | 1212 | { |
2165 | 1213 | GAME_TEXT o_name[MAX_NLEN]; |
2166 | 1214 | object_kind *k_ptr = &k_info[k_idx]; |
2167 | - | |
2168 | - /* Skip non-entries */ | |
2169 | 1215 | if (!k_ptr->name) continue; |
2170 | 1216 | |
2171 | 1217 | if (!k_ptr->flavor) |
2172 | 1218 | { |
2173 | - /* Tidy name */ | |
2174 | 1219 | strip_name(o_name, k_idx); |
2175 | 1220 | } |
2176 | 1221 | else |
2177 | 1222 | { |
2178 | 1223 | object_type forge; |
2179 | - | |
2180 | - /* Prepare dummy object */ | |
2181 | 1224 | object_prep(&forge, k_idx); |
2182 | - | |
2183 | - /* Get un-shuffled flavor name */ | |
2184 | 1225 | object_desc(creature_ptr, o_name, &forge, OD_FORCE_FLAVOR); |
2185 | 1226 | } |
2186 | 1227 | |
2187 | - /* Dump a comment */ | |
2188 | 1228 | auto_dump_printf("# %s\n", o_name); |
2189 | - | |
2190 | - /* Dump the object attr/char info */ | |
2191 | 1229 | auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", (int)k_idx, |
2192 | 1230 | (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char)); |
2193 | 1231 | } |
2194 | 1232 | |
2195 | - /* Close */ | |
2196 | 1233 | close_auto_dump(); |
2197 | - | |
2198 | 1234 | msg_print(_("アイテムの[色/文字]をファイルに書き出しました。", "Dumped object attr/chars.")); |
2199 | - | |
2200 | 1235 | break; |
2201 | 1236 | } |
2202 | - | |
2203 | - /* Dump feature attr/chars */ | |
2204 | 1237 | case '3': |
2205 | 1238 | { |
2206 | 1239 | static concptr mark = "Feature attr/chars"; |
2207 | - | |
2208 | - /* Prompt */ | |
2209 | 1240 | prt(_("コマンド: 地形の[色/文字]をファイルに書き出します", "Command: Dump feature attr/chars"), 15, 0); |
2210 | - | |
2211 | - /* Prompt */ | |
2212 | 1241 | prt(_("ファイル: ", "File: "), 17, 0); |
2213 | - | |
2214 | - /* Default filename */ | |
2215 | 1242 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
2216 | - | |
2217 | - /* Get a filename */ | |
2218 | 1243 | if (!askfor(tmp, 70)) continue; |
2219 | - path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2220 | 1244 | |
2221 | - /* Append to the file */ | |
1245 | + path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2222 | 1246 | if (!open_auto_dump(buf, mark)) continue; |
2223 | 1247 | |
2224 | - /* Start dumping */ | |
2225 | 1248 | auto_dump_printf(_("\n# 地形の[色/文字]の設定\n\n", "\n# Feature attr/char definitions\n\n")); |
2226 | - | |
2227 | - /* Dump features */ | |
2228 | 1249 | for (i = 0; i < max_f_idx; i++) |
2229 | 1250 | { |
2230 | 1251 | feature_type *f_ptr = &f_info[i]; |
2231 | - | |
2232 | - /* Skip non-entries */ | |
2233 | 1252 | if (!f_ptr->name) continue; |
2234 | - | |
2235 | - /* Skip mimiccing features */ | |
2236 | 1253 | if (f_ptr->mimic != i) continue; |
2237 | 1254 | |
2238 | - /* Dump a comment */ | |
2239 | 1255 | auto_dump_printf("# %s\n", (f_name + f_ptr->name)); |
2240 | - | |
2241 | - /* Dump the feature attr/char info */ | |
2242 | 1256 | auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i, |
2243 | 1257 | (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]), |
2244 | 1258 | (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]), |
2245 | 1259 | (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK])); |
2246 | 1260 | } |
2247 | 1261 | |
2248 | - /* Close */ | |
2249 | 1262 | close_auto_dump(); |
2250 | - | |
2251 | 1263 | msg_print(_("地形の[色/文字]をファイルに書き出しました。", "Dumped feature attr/chars.")); |
2252 | - | |
2253 | 1264 | break; |
2254 | 1265 | } |
2255 | - | |
2256 | - /* Modify monster attr/chars (numeric operation) */ | |
2257 | 1266 | case '4': |
2258 | 1267 | { |
2259 | 1268 | static concptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars"); |
2260 | 1269 | static MONRACE_IDX r = 0; |
2261 | - | |
2262 | 1270 | prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0); |
2263 | - | |
2264 | - /* Hack -- query until done */ | |
2265 | 1271 | while (TRUE) |
2266 | 1272 | { |
2267 | 1273 | monster_race *r_ptr = &r_info[r]; |
@@ -2273,31 +1279,19 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2273 | 1279 | TERM_COLOR ca = r_ptr->x_attr; |
2274 | 1280 | byte cc = r_ptr->x_char; |
2275 | 1281 | |
2276 | - /* Label the object */ | |
2277 | 1282 | Term_putstr(5, 17, -1, TERM_WHITE, |
2278 | 1283 | format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name))); |
2279 | - | |
2280 | - /* Label the Default values */ | |
2281 | 1284 | Term_putstr(10, 19, -1, TERM_WHITE, |
2282 | 1285 | format(_("初期値 色 / 文字 = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc)); |
2283 | - | |
2284 | 1286 | Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); |
2285 | 1287 | Term_queue_bigchar(43, 19, da, dc, 0, 0); |
2286 | - | |
2287 | - /* Label the Current values */ | |
2288 | 1288 | Term_putstr(10, 20, -1, TERM_WHITE, |
2289 | 1289 | format(_("現在値 色 / 文字 = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc)); |
2290 | - | |
2291 | 1290 | Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); |
2292 | 1291 | Term_queue_bigchar(43, 20, ca, cc, 0, 0); |
2293 | - | |
2294 | - /* Prompt */ | |
2295 | 1292 | Term_putstr(0, 22, -1, TERM_WHITE, |
2296 | 1293 | _("コマンド (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ")); |
2297 | - | |
2298 | 1294 | i = inkey(); |
2299 | - | |
2300 | - /* All done */ | |
2301 | 1295 | if (i == ESCAPE) break; |
2302 | 1296 | |
2303 | 1297 | if (iscntrl(i)) c = 'a' + i - KTRL('A'); |
@@ -2318,6 +1312,7 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2318 | 1312 | } |
2319 | 1313 | } while (!r_info[r].name); |
2320 | 1314 | } |
1315 | + | |
2321 | 1316 | break; |
2322 | 1317 | case 'a': |
2323 | 1318 | t = (int)r_ptr->x_attr; |
@@ -2341,15 +1336,11 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2341 | 1336 | |
2342 | 1337 | break; |
2343 | 1338 | } |
2344 | - | |
2345 | - /* Modify object attr/chars (numeric operation) */ | |
2346 | 1339 | case '5': |
2347 | 1340 | { |
2348 | 1341 | static concptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars"); |
2349 | 1342 | static IDX k = 0; |
2350 | 1343 | prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0); |
2351 | - | |
2352 | - /* Hack -- query until done */ | |
2353 | 1344 | while (TRUE) |
2354 | 1345 | { |
2355 | 1346 | object_kind *k_ptr = &k_info[k]; |
@@ -2361,32 +1352,21 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2361 | 1352 | TERM_COLOR ca = k_ptr->x_attr; |
2362 | 1353 | SYMBOL_CODE cc = k_ptr->x_char; |
2363 | 1354 | |
2364 | - /* Label the object */ | |
2365 | 1355 | Term_putstr(5, 17, -1, TERM_WHITE, |
2366 | 1356 | format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"), |
2367 | 1357 | k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name))); |
2368 | - | |
2369 | - /* Label the Default values */ | |
2370 | 1358 | Term_putstr(10, 19, -1, TERM_WHITE, |
2371 | 1359 | format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc)); |
2372 | - | |
2373 | 1360 | Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); |
2374 | 1361 | Term_queue_bigchar(43, 19, da, dc, 0, 0); |
2375 | - | |
2376 | - /* Label the Current values */ | |
2377 | 1362 | Term_putstr(10, 20, -1, TERM_WHITE, |
2378 | 1363 | format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc)); |
2379 | - | |
2380 | 1364 | Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); |
2381 | 1365 | Term_queue_bigchar(43, 20, ca, cc, 0, 0); |
2382 | - | |
2383 | - /* Prompt */ | |
2384 | 1366 | Term_putstr(0, 22, -1, TERM_WHITE, |
2385 | 1367 | _("コマンド (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ")); |
2386 | 1368 | |
2387 | 1369 | i = inkey(); |
2388 | - | |
2389 | - /* All done */ | |
2390 | 1370 | if (i == ESCAPE) break; |
2391 | 1371 | |
2392 | 1372 | if (iscntrl(i)) c = 'a' + i - KTRL('A'); |
@@ -2407,6 +1387,7 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2407 | 1387 | } |
2408 | 1388 | } while (!k_info[k].name); |
2409 | 1389 | } |
1390 | + | |
2410 | 1391 | break; |
2411 | 1392 | case 'a': |
2412 | 1393 | t = (int)k_ptr->x_attr; |
@@ -2430,16 +1411,12 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2430 | 1411 | |
2431 | 1412 | break; |
2432 | 1413 | } |
2433 | - | |
2434 | - /* Modify feature attr/chars (numeric operation) */ | |
2435 | 1414 | case '6': |
2436 | 1415 | { |
2437 | 1416 | static concptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars"); |
2438 | 1417 | static IDX f = 0; |
2439 | 1418 | static IDX lighting_level = F_LIT_STANDARD; |
2440 | 1419 | prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0); |
2441 | - | |
2442 | - /* Hack -- query until done */ | |
2443 | 1420 | while (TRUE) |
2444 | 1421 | { |
2445 | 1422 | feature_type *f_ptr = &f_info[f]; |
@@ -2451,43 +1428,22 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2451 | 1428 | TERM_COLOR ca = f_ptr->x_attr[lighting_level]; |
2452 | 1429 | byte cc = f_ptr->x_char[lighting_level]; |
2453 | 1430 | |
2454 | - /* Label the object */ | |
2455 | 1431 | prt("", 17, 5); |
2456 | 1432 | Term_putstr(5, 17, -1, TERM_WHITE, |
2457 | 1433 | format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"), |
2458 | 1434 | f, (f_name + f_ptr->name), lighting_level_str[lighting_level])); |
2459 | - | |
2460 | - /* Label the Default values */ | |
2461 | 1435 | Term_putstr(10, 19, -1, TERM_WHITE, |
2462 | 1436 | format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc)); |
2463 | - | |
2464 | 1437 | Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); |
2465 | 1438 | Term_queue_bigchar(43, 19, da, dc, 0, 0); |
2466 | - | |
2467 | - /* Label the Current values */ | |
2468 | -#ifdef JP | |
2469 | - Term_putstr(10, 20, -1, TERM_WHITE, | |
2470 | - format("現在値 色 / 文字 = %3d / %3d", ca, cc)); | |
2471 | -#else | |
2472 | 1439 | Term_putstr(10, 20, -1, TERM_WHITE, |
2473 | - format("Current attr/char = %3d / %3d", ca, cc)); | |
2474 | -#endif | |
2475 | - | |
1440 | + format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc)); | |
2476 | 1441 | Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); |
2477 | 1442 | Term_queue_bigchar(43, 20, ca, cc, 0, 0); |
2478 | - | |
2479 | - /* Prompt */ | |
2480 | -#ifdef JP | |
2481 | - Term_putstr(0, 22, -1, TERM_WHITE, | |
2482 | - "コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): "); | |
2483 | -#else | |
2484 | 1443 | Term_putstr(0, 22, -1, TERM_WHITE, |
2485 | - "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): "); | |
2486 | -#endif | |
1444 | + _("コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ")); | |
2487 | 1445 | |
2488 | 1446 | i = inkey(); |
2489 | - | |
2490 | - /* All done */ | |
2491 | 1447 | if (i == ESCAPE) break; |
2492 | 1448 | |
2493 | 1449 | if (iscntrl(i)) c = 'a' + i - KTRL('A'); |
@@ -2508,6 +1464,7 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2508 | 1464 | } |
2509 | 1465 | } while (!f_info[f].name || (f_info[f].mimic != f)); |
2510 | 1466 | } |
1467 | + | |
2511 | 1468 | break; |
2512 | 1469 | case 'a': |
2513 | 1470 | t = (int)f_ptr->x_attr[lighting_level]; |
@@ -2538,36 +1495,24 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2538 | 1495 | |
2539 | 1496 | break; |
2540 | 1497 | } |
2541 | - | |
2542 | - /* Modify monster attr/chars (visual mode) */ | |
2543 | 1498 | case '7': |
2544 | 1499 | do_cmd_knowledge_monsters(creature_ptr, &need_redraw, TRUE, -1); |
2545 | 1500 | break; |
2546 | - | |
2547 | - /* Modify object attr/chars (visual mode) */ | |
2548 | 1501 | case '8': |
2549 | 1502 | do_cmd_knowledge_objects(creature_ptr, &need_redraw, TRUE, -1); |
2550 | 1503 | break; |
2551 | - | |
2552 | - /* Modify feature attr/chars (visual mode) */ | |
2553 | 1504 | case '9': |
2554 | 1505 | { |
2555 | 1506 | IDX lighting_level = F_LIT_STANDARD; |
2556 | 1507 | do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level); |
2557 | 1508 | break; |
2558 | 1509 | } |
2559 | - | |
2560 | - /* Reset visuals */ | |
2561 | 1510 | case 'R': |
2562 | 1511 | case 'r': |
2563 | - /* Reset */ | |
2564 | 1512 | reset_visuals(creature_ptr); |
2565 | - | |
2566 | 1513 | msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset.")); |
2567 | 1514 | need_redraw = TRUE; |
2568 | 1515 | break; |
2569 | - | |
2570 | - /* Unknown option */ | |
2571 | 1516 | default: |
2572 | 1517 | bell(); |
2573 | 1518 | break; |
@@ -2577,7 +1522,6 @@ void do_cmd_visuals(player_type *creature_ptr) | ||
2577 | 1522 | } |
2578 | 1523 | |
2579 | 1524 | screen_load(); |
2580 | - | |
2581 | 1525 | if (need_redraw) do_cmd_redraw(creature_ptr); |
2582 | 1526 | } |
2583 | 1527 |
@@ -2590,82 +1534,42 @@ void do_cmd_colors(player_type *creature_ptr) | ||
2590 | 1534 | int i; |
2591 | 1535 | char tmp[160]; |
2592 | 1536 | char buf[1024]; |
2593 | - | |
2594 | - /* File type is "TEXT" */ | |
2595 | 1537 | FILE_TYPE(FILE_TYPE_TEXT); |
2596 | - | |
2597 | 1538 | screen_save(); |
2598 | - | |
2599 | - /* Interact until done */ | |
2600 | 1539 | while (TRUE) |
2601 | 1540 | { |
2602 | 1541 | Term_clear(); |
2603 | - | |
2604 | - /* Ask for a choice */ | |
2605 | 1542 | prt(_("[ カラーの設定 ]", "Interact with Colors"), 2, 0); |
2606 | - | |
2607 | - /* Give some choices */ | |
2608 | 1543 | prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5); |
2609 | 1544 | prt(_("(2) カラーの設定をファイルに書き出す", "(2) Dump colors"), 5, 5); |
2610 | 1545 | prt(_("(3) カラーの設定を変更する", "(3) Modify colors"), 6, 5); |
2611 | - | |
2612 | - /* Prompt */ | |
2613 | 1546 | prt(_("コマンド: ", "Command: "), 8, 0); |
2614 | - /* Prompt */ | |
2615 | 1547 | i = inkey(); |
2616 | - | |
2617 | 1548 | if (i == ESCAPE) break; |
2618 | 1549 | |
2619 | - /* Load a 'pref' file */ | |
2620 | 1550 | if (i == '1') |
2621 | 1551 | { |
2622 | - /* Prompt */ | |
2623 | 1552 | prt(_("コマンド: ユーザー設定ファイルをロードします", "Command: Load a user pref file"), 8, 0); |
2624 | - | |
2625 | - /* Prompt */ | |
2626 | 1553 | prt(_("ファイル: ", "File: "), 10, 0); |
2627 | - | |
2628 | - /* Default file */ | |
2629 | 1554 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
2630 | - | |
2631 | - /* Query */ | |
2632 | 1555 | if (!askfor(tmp, 70)) continue; |
2633 | 1556 | |
2634 | - /* Process the given filename */ | |
2635 | 1557 | (void)process_pref_file(creature_ptr, tmp); |
2636 | - | |
2637 | - /* Mega-Hack -- react to changes */ | |
2638 | 1558 | Term_xtra(TERM_XTRA_REACT, 0); |
2639 | - | |
2640 | - /* Mega-Hack -- redraw */ | |
2641 | 1559 | Term_redraw(); |
2642 | 1560 | } |
2643 | - | |
2644 | - /* Dump colors */ | |
2645 | 1561 | else if (i == '2') |
2646 | 1562 | { |
2647 | 1563 | static concptr mark = "Colors"; |
2648 | - | |
2649 | - /* Prompt */ | |
2650 | 1564 | prt(_("コマンド: カラーの設定をファイルに書き出します", "Command: Dump colors"), 8, 0); |
2651 | - | |
2652 | - /* Prompt */ | |
2653 | 1565 | prt(_("ファイル: ", "File: "), 10, 0); |
2654 | - | |
2655 | - /* Default filename */ | |
2656 | 1566 | sprintf(tmp, "%s.prf", creature_ptr->base_name); |
2657 | - | |
2658 | - /* Get a filename */ | |
2659 | 1567 | if (!askfor(tmp, 70)) continue; |
2660 | - path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2661 | 1568 | |
2662 | - /* Append to the file */ | |
1569 | + path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); | |
2663 | 1570 | if (!open_auto_dump(buf, mark)) continue; |
2664 | 1571 | |
2665 | - /* Start dumping */ | |
2666 | 1572 | auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n")); |
2667 | - | |
2668 | - /* Dump colors */ | |
2669 | 1573 | for (i = 0; i < 256; i++) |
2670 | 1574 | { |
2671 | 1575 | int kv = angband_color_table[i][0]; |
@@ -2674,77 +1578,46 @@ void do_cmd_colors(player_type *creature_ptr) | ||
2674 | 1578 | int bv = angband_color_table[i][3]; |
2675 | 1579 | |
2676 | 1580 | concptr name = _("未知", "unknown"); |
2677 | - | |
2678 | - /* Skip non-entries */ | |
2679 | 1581 | if (!kv && !rv && !gv && !bv) continue; |
2680 | 1582 | |
2681 | - /* Extract the color name */ | |
2682 | 1583 | if (i < 16) name = color_names[i]; |
2683 | 1584 | |
2684 | - /* Dump a comment */ | |
2685 | 1585 | auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name); |
2686 | - | |
2687 | - /* Dump the monster attr/char info */ | |
2688 | 1586 | auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n", |
2689 | 1587 | i, kv, rv, gv, bv); |
2690 | 1588 | } |
2691 | 1589 | |
2692 | - /* Close */ | |
2693 | 1590 | close_auto_dump(); |
2694 | - | |
2695 | 1591 | msg_print(_("カラーの設定をファイルに書き出しました。", "Dumped color redefinitions.")); |
2696 | 1592 | } |
2697 | - | |
2698 | - /* Edit colors */ | |
2699 | 1593 | else if (i == '3') |
2700 | 1594 | { |
2701 | 1595 | static byte a = 0; |
2702 | - | |
2703 | - /* Prompt */ | |
2704 | 1596 | prt(_("コマンド: カラーの設定を変更します", "Command: Modify colors"), 8, 0); |
2705 | - | |
2706 | - /* Hack -- query until done */ | |
2707 | 1597 | while (TRUE) |
2708 | 1598 | { |
2709 | 1599 | concptr name; |
2710 | - byte j; | |
2711 | 1600 | clear_from(10); |
2712 | - | |
2713 | - /* Exhibit the normal colors */ | |
2714 | - for (j = 0; j < 16; j++) | |
1601 | + for (byte j = 0; j < 16; j++) | |
2715 | 1602 | { |
2716 | - /* Exhibit this color */ | |
2717 | 1603 | Term_putstr(j * 4, 20, -1, a, "###"); |
2718 | - | |
2719 | - /* Exhibit all colors */ | |
2720 | 1604 | Term_putstr(j * 4, 22, -1, j, format("%3d", j)); |
2721 | 1605 | } |
2722 | 1606 | |
2723 | - /* Describe the color */ | |
2724 | 1607 | name = ((a < 16) ? color_names[a] : _("未定義", "undefined")); |
2725 | - | |
2726 | - /* Describe the color */ | |
2727 | 1608 | Term_putstr(5, 10, -1, TERM_WHITE, |
2728 | 1609 | format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name)); |
2729 | - | |
2730 | - /* Label the Current values */ | |
2731 | 1610 | Term_putstr(5, 12, -1, TERM_WHITE, |
2732 | 1611 | format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x", |
2733 | 1612 | angband_color_table[a][0], |
2734 | 1613 | angband_color_table[a][1], |
2735 | 1614 | angband_color_table[a][2], |
2736 | 1615 | angband_color_table[a][3])); |
2737 | - | |
2738 | - /* Prompt */ | |
2739 | 1616 | Term_putstr(0, 14, -1, TERM_WHITE, |
2740 | 1617 | _("コマンド (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): ")); |
2741 | - | |
2742 | 1618 | i = inkey(); |
2743 | - | |
2744 | - /* All done */ | |
2745 | 1619 | if (i == ESCAPE) break; |
2746 | 1620 | |
2747 | - /* Analyze */ | |
2748 | 1621 | if (i == 'n') a = (byte)(a + 1); |
2749 | 1622 | if (i == 'N') a = (byte)(a - 1); |
2750 | 1623 | if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1); |
@@ -2756,15 +1629,10 @@ void do_cmd_colors(player_type *creature_ptr) | ||
2756 | 1629 | if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1); |
2757 | 1630 | if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1); |
2758 | 1631 | |
2759 | - /* Hack -- react to changes */ | |
2760 | 1632 | Term_xtra(TERM_XTRA_REACT, 0); |
2761 | - | |
2762 | - /* Hack -- redraw */ | |
2763 | 1633 | Term_redraw(); |
2764 | 1634 | } |
2765 | 1635 | } |
2766 | - | |
2767 | - /* Unknown option */ | |
2768 | 1636 | else |
2769 | 1637 | { |
2770 | 1638 | bell(); |
@@ -2783,17 +1651,10 @@ void do_cmd_colors(player_type *creature_ptr) | ||
2783 | 1651 | void do_cmd_note(void) |
2784 | 1652 | { |
2785 | 1653 | char buf[80]; |
2786 | - | |
2787 | - /* Default */ | |
2788 | 1654 | strcpy(buf, ""); |
2789 | - | |
2790 | - /* Input */ | |
2791 | 1655 | if (!get_string(_("メモ: ", "Note: "), buf, 60)) return; |
2792 | - | |
2793 | - /* Ignore empty notes */ | |
2794 | 1656 | if (!buf[0] || (buf[0] == ' ')) return; |
2795 | 1657 | |
2796 | - /* Add the note to the message recall */ | |
2797 | 1658 | msg_format(_("メモ: %s", "Note: %s"), buf); |
2798 | 1659 | } |
2799 | 1660 |
@@ -2814,55 +1675,6 @@ void do_cmd_version(void) | ||
2814 | 1675 | |
2815 | 1676 | |
2816 | 1677 | /* |
2817 | - * Array of feeling strings | |
2818 | - */ | |
2819 | -static concptr do_cmd_feeling_text[11] = | |
2820 | -{ | |
2821 | - _("この階の雰囲気を感じとれなかった...", "Looks like any other level."), | |
2822 | - _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."), | |
2823 | - _("恐ろしい死の幻が目に浮かび、気絶しそうになった!", "You nearly faint as horrible visions of death fill your mind!"), | |
2824 | - _("この階はとても危険なようだ。", "This level looks very dangerous."), | |
2825 | - _("とても悪い予感がする...", "You have a very bad feeling..."), | |
2826 | - _("悪い予感がする...", "You have a bad feeling..."), | |
2827 | - _("何か緊張する。", "You feel nervous."), | |
2828 | - _("少し不運な気がする...", "You feel your luck is turning..."), | |
2829 | - _("この場所は好きになれない。", "You don't like the look of this place."), | |
2830 | - _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."), | |
2831 | - _("なんて退屈なところだ...", "What a boring place...") | |
2832 | -}; | |
2833 | - | |
2834 | -static concptr do_cmd_feeling_text_combat[11] = | |
2835 | -{ | |
2836 | - _("この階の雰囲気を感じとれなかった...", "Looks like any other level."), | |
2837 | - _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."), | |
2838 | - _("今夜もまた、誰かが命を落とす...", "You nearly faint as horrible visions of death fill your mind!"), | |
2839 | - _("この階はとても危険なようだ。", "This level looks very dangerous."), | |
2840 | - _("とても悪い予感がする...", "You have a very bad feeling..."), | |
2841 | - _("悪い予感がする...", "You have a bad feeling..."), | |
2842 | - _("何か緊張する。", "You feel nervous."), | |
2843 | - _("少し不運な気がする...", "You feel your luck is turning..."), | |
2844 | - _("この場所は好きになれない。", "You don't like the look of this place."), | |
2845 | - _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."), | |
2846 | - _("なんて退屈なところだ...", "What a boring place...") | |
2847 | -}; | |
2848 | - | |
2849 | -static concptr do_cmd_feeling_text_lucky[11] = | |
2850 | -{ | |
2851 | - _("この階の雰囲気を感じとれなかった...", "Looks like any other level."), | |
2852 | - _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."), | |
2853 | - _("この階はこの上なく素晴らしい感じがする。", "You have a superb feeling about this level."), | |
2854 | - _("素晴らしい感じがする...", "You have an excellent feeling..."), | |
2855 | - _("とても良い感じがする...", "You have a very good feeling..."), | |
2856 | - _("良い感じがする...", "You have a good feeling..."), | |
2857 | - _("ちょっと幸運な感じがする...", "You feel strangely lucky..."), | |
2858 | - _("多少は運が向いてきたか...", "You feel your luck is turning..."), | |
2859 | - _("見た感じ悪くはない...", "You like the look of this place..."), | |
2860 | - _("全然駄目ということはないが...", "This level can't be all bad..."), | |
2861 | - _("なんて退屈なところだ...", "What a boring place...") | |
2862 | -}; | |
2863 | - | |
2864 | - | |
2865 | -/* | |
2866 | 1678 | * Note that "feeling" is set to zero unless some time has passed. |
2867 | 1679 | * Note that this is done when the level is GENERATED, not entered. |
2868 | 1680 | */ |
@@ -2870,14 +1682,12 @@ void do_cmd_feeling(player_type *creature_ptr) | ||
2870 | 1682 | { |
2871 | 1683 | if (creature_ptr->wild_mode) return; |
2872 | 1684 | |
2873 | - /* No useful feeling in quests */ | |
2874 | 1685 | if (creature_ptr->current_floor_ptr->inside_quest && !random_quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level)) |
2875 | 1686 | { |
2876 | 1687 | msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level.")); |
2877 | 1688 | return; |
2878 | 1689 | } |
2879 | 1690 | |
2880 | - /* No useful feeling in town */ | |
2881 | 1691 | if (creature_ptr->town_num && !creature_ptr->current_floor_ptr->dun_level) |
2882 | 1692 | { |
2883 | 1693 | if (!strcmp(town_info[creature_ptr->town_num].name, _("荒野", "wilderness"))) |
@@ -2890,14 +1700,12 @@ void do_cmd_feeling(player_type *creature_ptr) | ||
2890 | 1700 | return; |
2891 | 1701 | } |
2892 | 1702 | |
2893 | - /* No useful feeling in the wilderness */ | |
2894 | 1703 | if (!creature_ptr->current_floor_ptr->dun_level) |
2895 | 1704 | { |
2896 | 1705 | msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness.")); |
2897 | 1706 | return; |
2898 | 1707 | } |
2899 | 1708 | |
2900 | - /* Display the feeling */ | |
2901 | 1709 | if (creature_ptr->muta3 & MUT3_GOOD_LUCK) |
2902 | 1710 | msg_print(do_cmd_feeling_text_lucky[creature_ptr->feeling]); |
2903 | 1711 | else if (IS_ECHIZEN(creature_ptr)) |
@@ -2908,208 +1716,6 @@ void do_cmd_feeling(player_type *creature_ptr) | ||
2908 | 1716 | |
2909 | 1717 | |
2910 | 1718 | /* |
2911 | - * Description of each monster group. | |
2912 | - */ | |
2913 | -static concptr monster_group_text[] = | |
2914 | -{ | |
2915 | -#ifdef JP | |
2916 | - "ユニーク", /* "Uniques" */ | |
2917 | - "乗馬可能なモンスター", /* "Riding" */ | |
2918 | - "賞金首", /* "Wanted */ | |
2919 | - "アンバーの王族", /* "Amberite" */ | |
2920 | - "アリ", | |
2921 | - "コウモリ", | |
2922 | - "ムカデ", | |
2923 | - "ドラゴン", | |
2924 | - "目玉", | |
2925 | - "ネコ", | |
2926 | - "ゴーレム", | |
2927 | - "標準人間型生物", | |
2928 | - "ベトベト", | |
2929 | - "ゼリー", | |
2930 | - "コボルド", | |
2931 | - "水棲生物", | |
2932 | - "モルド", | |
2933 | - "ナーガ", | |
2934 | - "オーク", | |
2935 | - "人間", | |
2936 | - "四足獣", | |
2937 | - "ネズミ", | |
2938 | - "スケルトン", | |
2939 | - "デーモン", | |
2940 | - "ボルテックス", | |
2941 | - "イモムシ/大群", | |
2942 | - /* "unused", */ | |
2943 | - "イーク", | |
2944 | - "ゾンビ/ミイラ", | |
2945 | - "天使", | |
2946 | - "鳥", | |
2947 | - "犬", | |
2948 | - /* "古代ドラゴン/ワイアーム", */ | |
2949 | - "エレメンタル", | |
2950 | - "トンボ", | |
2951 | - "ゴースト", | |
2952 | - "雑種", | |
2953 | - "昆虫", | |
2954 | - "ヘビ", | |
2955 | - "キラー・ビートル", | |
2956 | - "リッチ", | |
2957 | - "多首の爬虫類", | |
2958 | - "謎の生物", | |
2959 | - "オーガ", | |
2960 | - "巨大人間型生物", | |
2961 | - "クイルスルグ", | |
2962 | - "爬虫類/両生類", | |
2963 | - "蜘蛛/サソリ/ダニ", | |
2964 | - "トロル", | |
2965 | - /* "上級デーモン", */ | |
2966 | - "バンパイア", | |
2967 | - "ワイト/レイス/等", | |
2968 | - "ゾーン/ザレン/等", | |
2969 | - "イエティ", | |
2970 | - "ハウンド", | |
2971 | - "ミミック", | |
2972 | - "壁/植物/気体", | |
2973 | - "おばけキノコ", | |
2974 | - "球体", | |
2975 | - "プレイヤー", | |
2976 | -#else | |
2977 | - "Uniques", | |
2978 | - "Ridable monsters", | |
2979 | - "Wanted monsters", | |
2980 | - "Amberite", | |
2981 | - "Ant", | |
2982 | - "Bat", | |
2983 | - "Centipede", | |
2984 | - "Dragon", | |
2985 | - "Floating Eye", | |
2986 | - "Feline", | |
2987 | - "Golem", | |
2988 | - "Hobbit/Elf/Dwarf", | |
2989 | - "Icky Thing", | |
2990 | - "Jelly", | |
2991 | - "Kobold", | |
2992 | - "Aquatic monster", | |
2993 | - "Mold", | |
2994 | - "Naga", | |
2995 | - "Orc", | |
2996 | - "Person/Human", | |
2997 | - "Quadruped", | |
2998 | - "Rodent", | |
2999 | - "Skeleton", | |
3000 | - "Demon", | |
3001 | - "Vortex", | |
3002 | - "Worm/Worm-Mass", | |
3003 | - /* "unused", */ | |
3004 | - "Yeek", | |
3005 | - "Zombie/Mummy", | |
3006 | - "Angel", | |
3007 | - "Bird", | |
3008 | - "Canine", | |
3009 | - /* "Ancient Dragon/Wyrm", */ | |
3010 | - "Elemental", | |
3011 | - "Dragon Fly", | |
3012 | - "Ghost", | |
3013 | - "Hybrid", | |
3014 | - "Insect", | |
3015 | - "Snake", | |
3016 | - "Killer Beetle", | |
3017 | - "Lich", | |
3018 | - "Multi-Headed Reptile", | |
3019 | - "Mystery Living", | |
3020 | - "Ogre", | |
3021 | - "Giant Humanoid", | |
3022 | - "Quylthulg", | |
3023 | - "Reptile/Amphibian", | |
3024 | - "Spider/Scorpion/Tick", | |
3025 | - "Troll", | |
3026 | - /* "Major Demon", */ | |
3027 | - "Vampire", | |
3028 | - "Wight/Wraith/etc", | |
3029 | - "Xorn/Xaren/etc", | |
3030 | - "Yeti", | |
3031 | - "Zephyr Hound", | |
3032 | - "Mimic", | |
3033 | - "Wall/Plant/Gas", | |
3034 | - "Mushroom patch", | |
3035 | - "Ball", | |
3036 | - "Player", | |
3037 | -#endif | |
3038 | - NULL | |
3039 | -}; | |
3040 | - | |
3041 | - | |
3042 | -/* | |
3043 | - * Symbols of monsters in each group. Note the "Uniques" group | |
3044 | - * is handled differently. | |
3045 | - */ | |
3046 | -static concptr monster_group_char[] = | |
3047 | -{ | |
3048 | - (char *)-1L, | |
3049 | - (char *)-2L, | |
3050 | - (char *)-3L, | |
3051 | - (char *)-4L, | |
3052 | - "a", | |
3053 | - "b", | |
3054 | - "c", | |
3055 | - "dD", | |
3056 | - "e", | |
3057 | - "f", | |
3058 | - "g", | |
3059 | - "h", | |
3060 | - "i", | |
3061 | - "j", | |
3062 | - "k", | |
3063 | - "l", | |
3064 | - "m", | |
3065 | - "n", | |
3066 | - "o", | |
3067 | - "pt", | |
3068 | - "q", | |
3069 | - "r", | |
3070 | - "s", | |
3071 | - "uU", | |
3072 | - "v", | |
3073 | - "w", | |
3074 | - /* "x", */ | |
3075 | - "y", | |
3076 | - "z", | |
3077 | - "A", | |
3078 | - "B", | |
3079 | - "C", | |
3080 | - /* "D", */ | |
3081 | - "E", | |
3082 | - "F", | |
3083 | - "G", | |
3084 | - "H", | |
3085 | - "I", | |
3086 | - "J", | |
3087 | - "K", | |
3088 | - "L", | |
3089 | - "M", | |
3090 | - "N", | |
3091 | - "O", | |
3092 | - "P", | |
3093 | - "Q", | |
3094 | - "R", | |
3095 | - "S", | |
3096 | - "T", | |
3097 | - /* "U", */ | |
3098 | - "V", | |
3099 | - "W", | |
3100 | - "X", | |
3101 | - "Y", | |
3102 | - "Z", | |
3103 | - "!$&()+./=>?[\\]`{|~", | |
3104 | - "#%", | |
3105 | - ",", | |
3106 | - "*", | |
3107 | - "@", | |
3108 | - NULL | |
3109 | -}; | |
3110 | - | |
3111 | - | |
3112 | -/* | |
3113 | 1719 | * todo 引数と戻り値について追記求む |
3114 | 1720 | * Build a list of monster indexes in the given group. |
3115 | 1721 | * |
@@ -3124,42 +1730,31 @@ static concptr monster_group_char[] = | ||
3124 | 1730 | */ |
3125 | 1731 | static IDX collect_monsters(player_type *creature_ptr, IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode) |
3126 | 1732 | { |
3127 | - /* Get a list of x_char in this group */ | |
3128 | 1733 | concptr group_char = monster_group_char[grp_cur]; |
3129 | - | |
3130 | 1734 | bool grp_unique = (monster_group_char[grp_cur] == (char *)-1L); |
3131 | 1735 | bool grp_riding = (monster_group_char[grp_cur] == (char *)-2L); |
3132 | 1736 | bool grp_wanted = (monster_group_char[grp_cur] == (char *)-3L); |
3133 | 1737 | bool grp_amberite = (monster_group_char[grp_cur] == (char *)-4L); |
3134 | 1738 | |
3135 | - /* Check every race */ | |
3136 | 1739 | IDX mon_cnt = 0; |
3137 | 1740 | for (IDX i = 0; i < max_r_idx; i++) |
3138 | 1741 | { |
3139 | - /* Access the race */ | |
3140 | 1742 | monster_race *r_ptr = &r_info[i]; |
3141 | - | |
3142 | - /* Skip empty race */ | |
3143 | 1743 | if (!r_ptr->name) continue; |
3144 | - | |
3145 | - /* Require known monsters */ | |
3146 | 1744 | if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue; |
3147 | 1745 | |
3148 | 1746 | if (grp_unique) |
3149 | 1747 | { |
3150 | 1748 | if (!(r_ptr->flags1 & RF1_UNIQUE)) continue; |
3151 | 1749 | } |
3152 | - | |
3153 | 1750 | else if (grp_riding) |
3154 | 1751 | { |
3155 | 1752 | if (!(r_ptr->flags7 & RF7_RIDING)) continue; |
3156 | 1753 | } |
3157 | - | |
3158 | 1754 | else if (grp_wanted) |
3159 | 1755 | { |
3160 | 1756 | bool wanted = FALSE; |
3161 | - int j; | |
3162 | - for (j = 0; j < MAX_BOUNTY; j++) | |
1757 | + for (int j = 0; j < MAX_BOUNTY; j++) | |
3163 | 1758 | { |
3164 | 1759 | if (current_world_ptr->bounty_r_idx[j] == i || current_world_ptr->bounty_r_idx[j] - 10000 == i || |
3165 | 1760 | (creature_ptr->today_mon && creature_ptr->today_mon == i)) |
@@ -3168,186 +1763,30 @@ static IDX collect_monsters(player_type *creature_ptr, IDX grp_cur, IDX mon_idx[ | ||
3168 | 1763 | break; |
3169 | 1764 | } |
3170 | 1765 | } |
1766 | + | |
3171 | 1767 | if (!wanted) continue; |
3172 | 1768 | } |
3173 | - | |
3174 | 1769 | else if (grp_amberite) |
3175 | 1770 | { |
3176 | 1771 | if (!(r_ptr->flags3 & RF3_AMBERITE)) continue; |
3177 | 1772 | } |
3178 | - | |
3179 | 1773 | else |
3180 | 1774 | { |
3181 | - /* Check for race in the group */ | |
3182 | 1775 | if (!my_strchr(group_char, r_ptr->d_char)) continue; |
3183 | 1776 | } |
3184 | 1777 | |
3185 | - /* Add the race */ | |
3186 | 1778 | mon_idx[mon_cnt++] = i; |
3187 | - | |
3188 | - /* XXX Hack -- Just checking for non-empty group */ | |
3189 | 1779 | if (mode & 0x01) break; |
3190 | 1780 | } |
3191 | 1781 | |
3192 | - /* Terminate the list */ | |
3193 | 1782 | mon_idx[mon_cnt] = -1; |
3194 | - | |
3195 | 1783 | int dummy_why; |
3196 | 1784 | ang_sort(mon_idx, &dummy_why, mon_cnt, ang_sort_comp_monster_level, ang_sort_swap_hook); |
3197 | - | |
3198 | - /* Return the number of races */ | |
3199 | 1785 | return mon_cnt; |
3200 | 1786 | } |
3201 | 1787 | |
3202 | 1788 | |
3203 | 1789 | /* |
3204 | - * Description of each monster group. | |
3205 | - */ | |
3206 | -static concptr object_group_text[] = | |
3207 | -{ | |
3208 | -#ifdef JP | |
3209 | - "キノコ", /* "Mushrooms" */ | |
3210 | - "薬", /* "Potions" */ | |
3211 | - "油つぼ", /* "Flasks" */ | |
3212 | - "巻物", /* "Scrolls" */ | |
3213 | - "指輪", /* "Rings" */ | |
3214 | - "アミュレット", /* "Amulets" */ | |
3215 | - "笛", /* "Whistle" */ | |
3216 | - "光源", /* "Lanterns" */ | |
3217 | - "魔法棒", /* "Wands" */ | |
3218 | - "杖", /* "Staffs" */ | |
3219 | - "ロッド", /* "Rods" */ | |
3220 | - "カード", /* "Cards" */ | |
3221 | - "キャプチャー・ボール", | |
3222 | - "羊皮紙", | |
3223 | - "くさび", | |
3224 | - "箱", | |
3225 | - "人形", | |
3226 | - "像", | |
3227 | - "ゴミ", | |
3228 | - "空のビン", | |
3229 | - "骨", | |
3230 | - "死体", | |
3231 | - "刀剣類", /* "Swords" */ | |
3232 | - "鈍器", /* "Blunt Weapons" */ | |
3233 | - "長柄武器", /* "Polearms" */ | |
3234 | - "採掘道具", /* "Diggers" */ | |
3235 | - "飛び道具", /* "Bows" */ | |
3236 | - "弾", | |
3237 | - "矢", | |
3238 | - "ボルト", | |
3239 | - "軽装鎧", /* "Soft Armor" */ | |
3240 | - "重装鎧", /* "Hard Armor" */ | |
3241 | - "ドラゴン鎧", /* "Dragon Armor" */ | |
3242 | - "盾", /* "Shields" */ | |
3243 | - "クローク", /* "Cloaks" */ | |
3244 | - "籠手", /* "Gloves" */ | |
3245 | - "ヘルメット", /* "Helms" */ | |
3246 | - "冠", /* "Crowns" */ | |
3247 | - "ブーツ", /* "Boots" */ | |
3248 | - "魔法書", | |
3249 | - "財宝", | |
3250 | - "何か", | |
3251 | -#else | |
3252 | - "Mushrooms", | |
3253 | - "Potions", | |
3254 | - "Flasks", | |
3255 | - "Scrolls", | |
3256 | - "Rings", | |
3257 | - "Amulets", | |
3258 | - "Whistle", | |
3259 | - "Lanterns", | |
3260 | - "Wands", | |
3261 | - "Staffs", | |
3262 | - "Rods", | |
3263 | - "Cards", | |
3264 | - "Capture Balls", | |
3265 | - "Parchments", | |
3266 | - "Spikes", | |
3267 | - "Boxs", | |
3268 | - "Figurines", | |
3269 | - "Statues", | |
3270 | - "Junks", | |
3271 | - "Bottles", | |
3272 | - "Skeletons", | |
3273 | - "Corpses", | |
3274 | - "Swords", | |
3275 | - "Blunt Weapons", | |
3276 | - "Polearms", | |
3277 | - "Diggers", | |
3278 | - "Bows", | |
3279 | - "Shots", | |
3280 | - "Arrows", | |
3281 | - "Bolts", | |
3282 | - "Soft Armor", | |
3283 | - "Hard Armor", | |
3284 | - "Dragon Armor", | |
3285 | - "Shields", | |
3286 | - "Cloaks", | |
3287 | - "Gloves", | |
3288 | - "Helms", | |
3289 | - "Crowns", | |
3290 | - "Boots", | |
3291 | - "Spellbooks", | |
3292 | - "Treasure", | |
3293 | - "Something", | |
3294 | -#endif | |
3295 | - NULL | |
3296 | -}; | |
3297 | - | |
3298 | - | |
3299 | -/* | |
3300 | - * TVALs of items in each group | |
3301 | - */ | |
3302 | -static byte object_group_tval[] = | |
3303 | -{ | |
3304 | - TV_FOOD, | |
3305 | - TV_POTION, | |
3306 | - TV_FLASK, | |
3307 | - TV_SCROLL, | |
3308 | - TV_RING, | |
3309 | - TV_AMULET, | |
3310 | - TV_WHISTLE, | |
3311 | - TV_LITE, | |
3312 | - TV_WAND, | |
3313 | - TV_STAFF, | |
3314 | - TV_ROD, | |
3315 | - TV_CARD, | |
3316 | - TV_CAPTURE, | |
3317 | - TV_PARCHMENT, | |
3318 | - TV_SPIKE, | |
3319 | - TV_CHEST, | |
3320 | - TV_FIGURINE, | |
3321 | - TV_STATUE, | |
3322 | - TV_JUNK, | |
3323 | - TV_BOTTLE, | |
3324 | - TV_SKELETON, | |
3325 | - TV_CORPSE, | |
3326 | - TV_SWORD, | |
3327 | - TV_HAFTED, | |
3328 | - TV_POLEARM, | |
3329 | - TV_DIGGING, | |
3330 | - TV_BOW, | |
3331 | - TV_SHOT, | |
3332 | - TV_ARROW, | |
3333 | - TV_BOLT, | |
3334 | - TV_SOFT_ARMOR, | |
3335 | - TV_HARD_ARMOR, | |
3336 | - TV_DRAG_ARMOR, | |
3337 | - TV_SHIELD, | |
3338 | - TV_CLOAK, | |
3339 | - TV_GLOVES, | |
3340 | - TV_HELM, | |
3341 | - TV_CROWN, | |
3342 | - TV_BOOTS, | |
3343 | - TV_LIFE_BOOK, /* Hack -- all spellbooks */ | |
3344 | - TV_GOLD, | |
3345 | - 0, | |
3346 | - 0, | |
3347 | -}; | |
3348 | - | |
3349 | - | |
3350 | -/* | |
3351 | 1790 | * Build a list of object indexes in the given group. Return the number |
3352 | 1791 | * of objects in the group. |
3353 | 1792 | * |
@@ -3356,63 +1795,47 @@ static byte object_group_tval[] = | ||
3356 | 1795 | */ |
3357 | 1796 | static KIND_OBJECT_IDX collect_objects(int grp_cur, KIND_OBJECT_IDX object_idx[], BIT_FLAGS8 mode) |
3358 | 1797 | { |
3359 | - KIND_OBJECT_IDX i, object_cnt = 0; | |
3360 | - int j, k; | |
3361 | - | |
3362 | - /* Get a list of x_char in this group */ | |
1798 | + KIND_OBJECT_IDX object_cnt = 0; | |
3363 | 1799 | byte group_tval = object_group_tval[grp_cur]; |
3364 | - | |
3365 | - /* Check every object */ | |
3366 | - for (i = 0; i < max_k_idx; i++) | |
1800 | + for (KIND_OBJECT_IDX i = 0; i < max_k_idx; i++) | |
3367 | 1801 | { |
3368 | - /* Access the object */ | |
3369 | 1802 | object_kind *k_ptr = &k_info[i]; |
3370 | - | |
3371 | - /* Skip empty objects */ | |
3372 | 1803 | if (!k_ptr->name) continue; |
3373 | 1804 | |
3374 | 1805 | if (!(mode & 0x02)) |
3375 | 1806 | { |
3376 | 1807 | if (!current_world_ptr->wizard) |
3377 | 1808 | { |
3378 | - /* Skip non-flavoured objects */ | |
3379 | 1809 | if (!k_ptr->flavor) continue; |
3380 | - | |
3381 | - /* Require objects ever seen */ | |
3382 | 1810 | if (!k_ptr->aware) continue; |
3383 | 1811 | } |
3384 | 1812 | |
3385 | - /* Skip items with no distribution (special artifacts) */ | |
3386 | - for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j]; | |
1813 | + int k = 0; | |
1814 | + for (int j = 0; j < 4; j++) | |
1815 | + k += k_ptr->chance[j]; | |
3387 | 1816 | if (!k) continue; |
3388 | 1817 | } |
3389 | 1818 | |
3390 | - /* Check for objects in the group */ | |
3391 | 1819 | if (TV_LIFE_BOOK == group_tval) |
3392 | 1820 | { |
3393 | - /* Hack -- All spell books */ | |
3394 | 1821 | if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK) |
3395 | 1822 | { |
3396 | - /* Add the object */ | |
3397 | 1823 | object_idx[object_cnt++] = i; |
3398 | 1824 | } |
3399 | - else continue; | |
1825 | + else | |
1826 | + continue; | |
3400 | 1827 | } |
3401 | 1828 | else if (k_ptr->tval == group_tval) |
3402 | 1829 | { |
3403 | - /* Add the object */ | |
3404 | 1830 | object_idx[object_cnt++] = i; |
3405 | 1831 | } |
3406 | - else continue; | |
1832 | + else | |
1833 | + continue; | |
3407 | 1834 | |
3408 | - /* XXX Hack -- Just checking for non-empty group */ | |
3409 | 1835 | if (mode & 0x01) break; |
3410 | 1836 | } |
3411 | 1837 | |
3412 | - /* Terminate the list */ | |
3413 | 1838 | object_idx[object_cnt] = -1; |
3414 | - | |
3415 | - /* Return the number of objects */ | |
3416 | 1839 | return object_cnt; |
3417 | 1840 | } |
3418 | 1841 |
@@ -3435,29 +1858,18 @@ static concptr feature_group_text[] = | ||
3435 | 1858 | */ |
3436 | 1859 | static FEAT_IDX collect_features(FEAT_IDX *feat_idx, BIT_FLAGS8 mode) |
3437 | 1860 | { |
3438 | - /* Check every feature */ | |
3439 | 1861 | FEAT_IDX feat_cnt = 0; |
3440 | 1862 | for (FEAT_IDX i = 0; i < max_f_idx; i++) |
3441 | 1863 | { |
3442 | 1864 | feature_type *f_ptr = &f_info[i]; |
3443 | - | |
3444 | - /* Skip empty index */ | |
3445 | 1865 | if (!f_ptr->name) continue; |
3446 | - | |
3447 | - /* Skip mimiccing features */ | |
3448 | 1866 | if (f_ptr->mimic != i) continue; |
3449 | 1867 | |
3450 | - /* Add the index */ | |
3451 | 1868 | feat_idx[feat_cnt++] = i; |
3452 | - | |
3453 | - /* XXX Hack -- Just checking for non-empty group */ | |
3454 | 1869 | if (mode & 0x01) break; |
3455 | 1870 | } |
3456 | 1871 | |
3457 | - /* Terminate the list */ | |
3458 | 1872 | feat_idx[feat_cnt] = -1; |
3459 | - | |
3460 | - /* Return the number of races */ | |
3461 | 1873 | return feat_cnt; |
3462 | 1874 | } |
3463 | 1875 |
@@ -3467,20 +1879,15 @@ static FEAT_IDX collect_features(FEAT_IDX *feat_idx, BIT_FLAGS8 mode) | ||
3467 | 1879 | */ |
3468 | 1880 | void do_cmd_load_screen(void) |
3469 | 1881 | { |
3470 | - TERM_LEN y, x; | |
3471 | 1882 | TERM_COLOR a = 0; |
3472 | 1883 | SYMBOL_CODE c = ' '; |
3473 | 1884 | bool okay = TRUE; |
3474 | 1885 | FILE *fff; |
3475 | 1886 | char buf[1024]; |
3476 | 1887 | TERM_LEN wid, hgt; |
3477 | - | |
3478 | 1888 | Term_get_size(&wid, &hgt); |
3479 | 1889 | path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt"); |
3480 | - | |
3481 | - /* Append to the file */ | |
3482 | 1890 | fff = my_fopen(buf, "r"); |
3483 | - | |
3484 | 1891 | if (!fff) |
3485 | 1892 | { |
3486 | 1893 | msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf); |
@@ -3490,70 +1897,46 @@ void do_cmd_load_screen(void) | ||
3490 | 1897 | |
3491 | 1898 | screen_save(); |
3492 | 1899 | Term_clear(); |
3493 | - | |
3494 | - /* Load the screen */ | |
3495 | - for (y = 0; okay; y++) | |
1900 | + for (TERM_LEN y = 0; okay; y++) | |
3496 | 1901 | { |
3497 | - /* Get a line of data including control code */ | |
3498 | 1902 | if (!fgets(buf, 1024, fff)) okay = FALSE; |
3499 | 1903 | |
3500 | - /* Get the blank line */ | |
3501 | 1904 | if (buf[0] == '\n' || buf[0] == '\0') break; |
3502 | - | |
3503 | - /* Ignore too large screen image */ | |
3504 | 1905 | if (y >= hgt) continue; |
3505 | 1906 | |
3506 | - /* Show each row */ | |
3507 | - for (x = 0; x < wid - 1; x++) | |
1907 | + for (TERM_LEN x = 0; x < wid - 1; x++) | |
3508 | 1908 | { |
3509 | - /* End of line */ | |
3510 | 1909 | if (buf[x] == '\n' || buf[x] == '\0') break; |
3511 | 1910 | |
3512 | - /* Put the attr/char */ | |
3513 | 1911 | Term_draw(x, y, TERM_WHITE, buf[x]); |
3514 | 1912 | } |
3515 | 1913 | } |
3516 | 1914 | |
3517 | - /* Dump the screen */ | |
3518 | - for (y = 0; okay; y++) | |
1915 | + for (TERM_LEN y = 0; okay; y++) | |
3519 | 1916 | { |
3520 | - /* Get a line of data including control code */ | |
3521 | 1917 | if (!fgets(buf, 1024, fff)) okay = FALSE; |
3522 | 1918 | |
3523 | - /* Get the blank line */ | |
3524 | 1919 | if (buf[0] == '\n' || buf[0] == '\0') break; |
3525 | - | |
3526 | - /* Ignore too large screen image */ | |
3527 | 1920 | if (y >= hgt) continue; |
3528 | 1921 | |
3529 | - /* Dump each row */ | |
3530 | - for (x = 0; x < wid - 1; x++) | |
1922 | + for (TERM_LEN x = 0; x < wid - 1; x++) | |
3531 | 1923 | { |
3532 | - /* End of line */ | |
3533 | 1924 | if (buf[x] == '\n' || buf[x] == '\0') break; |
3534 | 1925 | |
3535 | - /* Get the attr/char */ | |
3536 | 1926 | (void)(Term_what(x, y, &a, &c)); |
3537 | - | |
3538 | - /* Look up the attr */ | |
3539 | 1927 | for (int i = 0; i < 16; i++) |
3540 | 1928 | { |
3541 | - /* Use attr matches */ | |
3542 | 1929 | if (hack[i] == buf[x]) a = (byte)i; |
3543 | 1930 | } |
3544 | 1931 | |
3545 | - /* Put the attr/char */ | |
3546 | 1932 | Term_draw(x, y, a, c); |
3547 | 1933 | } |
3548 | 1934 | } |
3549 | 1935 | |
3550 | 1936 | my_fclose(fff); |
3551 | - | |
3552 | 1937 | prt(_("ファイルに書き出された画面(記念撮影)をロードしました。", "Screen dump loaded."), 0, 0); |
3553 | - | |
3554 | 1938 | flush(); |
3555 | 1939 | inkey(); |
3556 | - | |
3557 | 1940 | screen_load(); |
3558 | 1941 | } |
3559 | 1942 |
@@ -3577,22 +1960,14 @@ concptr inven_res_label = _(" 酸電火冷毒光 | ||
3577 | 1960 | } |
3578 | 1961 | |
3579 | 1962 | |
3580 | -/* XTRA HACK RESLIST */ | |
3581 | 1963 | static void do_cmd_knowledge_inven_aux(player_type *creature_ptr, FILE *fff, object_type *o_ptr, int *j, OBJECT_TYPE_VALUE tval, char *where) |
3582 | 1964 | { |
3583 | 1965 | GAME_TEXT o_name[MAX_NLEN]; |
3584 | 1966 | BIT_FLAGS flgs[TR_FLAG_SIZE]; |
3585 | - | |
3586 | 1967 | if (!o_ptr->k_idx) return; |
3587 | 1968 | if (o_ptr->tval != tval) return; |
3588 | - | |
3589 | - /* Identified items only */ | |
3590 | 1969 | if (!object_is_known(o_ptr)) return; |
3591 | 1970 | |
3592 | - /* | |
3593 | - * HACK:Ring of Lordly protection and Dragon equipment | |
3594 | - * have random resistances. | |
3595 | - */ | |
3596 | 1971 | bool is_special_item_type = (object_is_wearable(o_ptr) && object_is_ego(o_ptr)) |
3597 | 1972 | || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE)) |
3598 | 1973 | || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY)) |
@@ -3608,7 +1983,6 @@ static void do_cmd_knowledge_inven_aux(player_type *creature_ptr, FILE *fff, obj | ||
3608 | 1983 | |
3609 | 1984 | int i = 0; |
3610 | 1985 | object_desc(creature_ptr, o_name, o_ptr, OD_NAME_ONLY); |
3611 | - | |
3612 | 1986 | while (o_name[i] && (i < 26)) |
3613 | 1987 | { |
3614 | 1988 | #ifdef JP |
@@ -3685,12 +2059,9 @@ static void do_cmd_knowledge_inven(player_type *creature_ptr) | ||
3685 | 2059 | GAME_TEXT file_name[1024]; |
3686 | 2060 | store_type *st_ptr; |
3687 | 2061 | OBJECT_TYPE_VALUE tval; |
3688 | - int i = 0; | |
3689 | 2062 | int j = 0; |
3690 | 2063 | |
3691 | 2064 | char where[32]; |
3692 | - | |
3693 | - /* Open a new file */ | |
3694 | 2065 | fff = my_fopen_temp(file_name, 1024); |
3695 | 2066 | if (!fff) |
3696 | 2067 | { |
@@ -3700,7 +2071,6 @@ static void do_cmd_knowledge_inven(player_type *creature_ptr) | ||
3700 | 2071 | } |
3701 | 2072 | |
3702 | 2073 | fprintf(fff, "%s\n", inven_res_label); |
3703 | - | |
3704 | 2074 | for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++) |
3705 | 2075 | { |
3706 | 2076 | if (j != 0) |
@@ -3711,28 +2081,26 @@ static void do_cmd_knowledge_inven(player_type *creature_ptr) | ||
3711 | 2081 | } |
3712 | 2082 | |
3713 | 2083 | strcpy(where, _("装", "E ")); |
3714 | - for (i = INVEN_RARM; i < INVEN_TOTAL; i++) | |
2084 | + for (int i = INVEN_RARM; i < INVEN_TOTAL; i++) | |
3715 | 2085 | { |
3716 | 2086 | do_cmd_knowledge_inven_aux(creature_ptr, fff, &creature_ptr->inventory_list[i], &j, tval, where); |
3717 | 2087 | } |
3718 | 2088 | |
3719 | 2089 | strcpy(where, _("持", "I ")); |
3720 | - for (i = 0; i < INVEN_PACK; i++) | |
2090 | + for (int i = 0; i < INVEN_PACK; i++) | |
3721 | 2091 | { |
3722 | 2092 | do_cmd_knowledge_inven_aux(creature_ptr, fff, &creature_ptr->inventory_list[i], &j, tval, where); |
3723 | 2093 | } |
3724 | 2094 | |
3725 | 2095 | st_ptr = &town_info[1].store[STORE_HOME]; |
3726 | 2096 | strcpy(where, _("家", "H ")); |
3727 | - for (i = 0; i < st_ptr->stock_num; i++) | |
2097 | + for (int i = 0; i < st_ptr->stock_num; i++) | |
3728 | 2098 | { |
3729 | 2099 | do_cmd_knowledge_inven_aux(creature_ptr, fff, &st_ptr->stock[i], &j, tval, where); |
3730 | 2100 | } |
3731 | 2101 | } |
3732 | 2102 | |
3733 | 2103 | my_fclose(fff); |
3734 | - | |
3735 | - /* Display the file contents */ | |
3736 | 2104 | (void)show_file(creature_ptr, TRUE, file_name, _("*鑑定*済み武器/防具の耐性リスト", "Resistances of *identified* equipment"), 0, 0); |
3737 | 2105 | fd_kill(file_name); |
3738 | 2106 | } |
@@ -3759,14 +2127,9 @@ void do_cmd_save_screen_html_aux(char *filename, int message) | ||
3759 | 2127 | |
3760 | 2128 | TERM_LEN wid, hgt; |
3761 | 2129 | Term_get_size(&wid, &hgt); |
3762 | - | |
3763 | - /* File type is "TEXT" */ | |
3764 | 2130 | FILE_TYPE(FILE_TYPE_TEXT); |
3765 | - | |
3766 | - /* Append to the file */ | |
3767 | 2131 | FILE *fff; |
3768 | 2132 | fff = my_fopen(filename, "w"); |
3769 | - | |
3770 | 2133 | if (!fff) |
3771 | 2134 | { |
3772 | 2135 | if (message) |
@@ -3779,6 +2142,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message) | ||
3779 | 2142 | } |
3780 | 2143 | |
3781 | 2144 | if (message) screen_save(); |
2145 | + | |
3782 | 2146 | char buf[2048]; |
3783 | 2147 | path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf"); |
3784 | 2148 | FILE *tmpfff; |
@@ -3807,21 +2171,16 @@ void do_cmd_save_screen_html_aux(char *filename, int message) | ||
3807 | 2171 | } |
3808 | 2172 | } |
3809 | 2173 | |
3810 | - /* Dump the screen */ | |
3811 | 2174 | for (TERM_LEN y = 0; y < hgt; y++) |
3812 | 2175 | { |
3813 | - /* Start the row */ | |
3814 | 2176 | if (y != 0) fprintf(fff, "\n"); |
3815 | 2177 | |
3816 | - /* Dump each row */ | |
3817 | 2178 | TERM_COLOR a = 0, old_a = 0; |
3818 | 2179 | char c = ' '; |
3819 | 2180 | for (TERM_LEN x = 0; x < wid - 1; x++) |
3820 | 2181 | { |
3821 | 2182 | concptr cc = NULL; |
3822 | - /* Get the attr/char */ | |
3823 | 2183 | (void)(Term_what(x, y, &a, &c)); |
3824 | - | |
3825 | 2184 | switch (c) |
3826 | 2185 | { |
3827 | 2186 | case '&': cc = "&"; break; |
@@ -3852,7 +2211,6 @@ void do_cmd_save_screen_html_aux(char *filename, int message) | ||
3852 | 2211 | } |
3853 | 2212 | |
3854 | 2213 | fprintf(fff, "</font>"); |
3855 | - | |
3856 | 2214 | if (!tmpfff) |
3857 | 2215 | { |
3858 | 2216 | for (int i = 0; html_foot[i]; i++) |
@@ -3880,10 +2238,8 @@ void do_cmd_save_screen_html_aux(char *filename, int message) | ||
3880 | 2238 | my_fclose(tmpfff); |
3881 | 2239 | } |
3882 | 2240 | |
3883 | - /* Skip a line */ | |
3884 | 2241 | fprintf(fff, "\n"); |
3885 | 2242 | my_fclose(fff); |
3886 | - | |
3887 | 2243 | if (message) |
3888 | 2244 | { |
3889 | 2245 | msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved.")); |
@@ -3894,6 +2250,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message) | ||
3894 | 2250 | screen_load(); |
3895 | 2251 | } |
3896 | 2252 | |
2253 | + | |
3897 | 2254 | /* |
3898 | 2255 | * Hack -- save a screen dump to a file |
3899 | 2256 | */ |
@@ -3960,14 +2317,11 @@ void do_cmd_save_screen(player_type *creature_ptr) | ||
3960 | 2317 | do_cmd_save_screen_html(); |
3961 | 2318 | do_cmd_redraw(creature_ptr); |
3962 | 2319 | } |
3963 | - | |
3964 | - /* Do we use a special screendump function ? */ | |
3965 | 2320 | else if (screendump_aux) |
3966 | 2321 | { |
3967 | - /* Dump the screen to a graphics file */ | |
3968 | 2322 | (*screendump_aux)(); |
3969 | 2323 | } |
3970 | - else /* Dump the screen as text */ | |
2324 | + else | |
3971 | 2325 | { |
3972 | 2326 | TERM_LEN y, x; |
3973 | 2327 | TERM_COLOR a = 0; |
@@ -3975,13 +2329,8 @@ void do_cmd_save_screen(player_type *creature_ptr) | ||
3975 | 2329 | FILE *fff; |
3976 | 2330 | char buf[1024]; |
3977 | 2331 | path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt"); |
3978 | - | |
3979 | - /* File type is "TEXT" */ | |
3980 | 2332 | FILE_TYPE(FILE_TYPE_TEXT); |
3981 | - | |
3982 | - /* Append to the file */ | |
3983 | 2333 | fff = my_fopen(buf, "w"); |
3984 | - | |
3985 | 2334 | if (!fff) |
3986 | 2335 | { |
3987 | 2336 | msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf); |
@@ -3990,55 +2339,33 @@ void do_cmd_save_screen(player_type *creature_ptr) | ||
3990 | 2339 | } |
3991 | 2340 | |
3992 | 2341 | screen_save(); |
3993 | - | |
3994 | - /* Dump the screen */ | |
3995 | 2342 | for (y = 0; y < hgt; y++) |
3996 | 2343 | { |
3997 | - /* Dump each row */ | |
3998 | 2344 | for (x = 0; x < wid - 1; x++) |
3999 | 2345 | { |
4000 | - /* Get the attr/char */ | |
4001 | 2346 | (void)(Term_what(x, y, &a, &c)); |
4002 | - | |
4003 | - /* Dump it */ | |
4004 | 2347 | buf[x] = c; |
4005 | 2348 | } |
4006 | 2349 | |
4007 | - /* Terminate */ | |
4008 | 2350 | buf[x] = '\0'; |
4009 | - | |
4010 | - /* End the row */ | |
4011 | 2351 | fprintf(fff, "%s\n", buf); |
4012 | 2352 | } |
4013 | 2353 | |
4014 | - /* Skip a line */ | |
4015 | 2354 | fprintf(fff, "\n"); |
4016 | - | |
4017 | - | |
4018 | - /* Dump the screen */ | |
4019 | 2355 | for (y = 0; y < hgt; y++) |
4020 | 2356 | { |
4021 | - /* Dump each row */ | |
4022 | 2357 | for (x = 0; x < wid - 1; x++) |
4023 | 2358 | { |
4024 | - /* Get the attr/char */ | |
4025 | 2359 | (void)(Term_what(x, y, &a, &c)); |
4026 | - | |
4027 | - /* Dump it */ | |
4028 | 2360 | buf[x] = hack[a & 0x0F]; |
4029 | 2361 | } |
4030 | 2362 | |
4031 | - /* Terminate */ | |
4032 | 2363 | buf[x] = '\0'; |
4033 | - | |
4034 | - /* End the row */ | |
4035 | 2364 | fprintf(fff, "%s\n", buf); |
4036 | 2365 | } |
4037 | 2366 | |
4038 | - /* Skip a line */ | |
4039 | 2367 | fprintf(fff, "\n"); |
4040 | 2368 | my_fclose(fff); |
4041 | - | |
4042 | 2369 | msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved.")); |
4043 | 2370 | msg_print(NULL); |
4044 | 2371 | screen_load(); |
@@ -4062,7 +2389,6 @@ void do_cmd_save_screen(player_type *creature_ptr) | ||
4062 | 2389 | */ |
4063 | 2390 | static void do_cmd_knowledge_artifacts(player_type *player_ptr) |
4064 | 2391 | { |
4065 | - /* Open a new file */ | |
4066 | 2392 | FILE *fff; |
4067 | 2393 | GAME_TEXT file_name[1024]; |
4068 | 2394 | fff = my_fopen_temp(file_name, 1024); |
@@ -4073,75 +2399,47 @@ static void do_cmd_knowledge_artifacts(player_type *player_ptr) | ||
4073 | 2399 | return; |
4074 | 2400 | } |
4075 | 2401 | |
4076 | - /* Allocate the "who" array */ | |
4077 | 2402 | ARTIFACT_IDX *who; |
4078 | 2403 | C_MAKE(who, max_a_idx, ARTIFACT_IDX); |
4079 | - | |
4080 | - /* Allocate the "okay" array */ | |
4081 | 2404 | bool *okay; |
4082 | 2405 | C_MAKE(okay, max_a_idx, bool); |
4083 | 2406 | |
4084 | - /* Scan the artifacts */ | |
4085 | 2407 | for (ARTIFACT_IDX k = 0; k < max_a_idx; k++) |
4086 | 2408 | { |
4087 | 2409 | artifact_type *a_ptr = &a_info[k]; |
4088 | - | |
4089 | - /* Default */ | |
4090 | 2410 | okay[k] = FALSE; |
4091 | - | |
4092 | - /* Skip "empty" artifacts */ | |
4093 | 2411 | if (!a_ptr->name) continue; |
4094 | - | |
4095 | - /* Skip "uncreated" artifacts */ | |
4096 | 2412 | if (!a_ptr->cur_num) continue; |
4097 | 2413 | |
4098 | - /* Assume okay */ | |
4099 | 2414 | okay[k] = TRUE; |
4100 | 2415 | } |
4101 | 2416 | |
4102 | - /* Check the dungeon */ | |
4103 | 2417 | for (POSITION y = 0; y < player_ptr->current_floor_ptr->height; y++) |
4104 | 2418 | { |
4105 | 2419 | for (POSITION x = 0; x < player_ptr->current_floor_ptr->width; x++) |
4106 | 2420 | { |
4107 | 2421 | grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x]; |
4108 | - | |
4109 | 2422 | OBJECT_IDX this_o_idx, next_o_idx = 0; |
4110 | - | |
4111 | - /* Scan all objects in the grid */ | |
4112 | 2423 | for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx) |
4113 | 2424 | { |
4114 | 2425 | object_type *o_ptr; |
4115 | 2426 | o_ptr = &player_ptr->current_floor_ptr->o_list[this_o_idx]; |
4116 | 2427 | next_o_idx = o_ptr->next_o_idx; |
4117 | - | |
4118 | - /* Ignore non-artifacts */ | |
4119 | 2428 | if (!object_is_fixed_artifact(o_ptr)) continue; |
4120 | - | |
4121 | - /* Ignore known items */ | |
4122 | 2429 | if (object_is_known(o_ptr)) continue; |
4123 | 2430 | |
4124 | - /* Note the artifact */ | |
4125 | 2431 | okay[o_ptr->name1] = FALSE; |
4126 | 2432 | } |
4127 | 2433 | } |
4128 | 2434 | } |
4129 | 2435 | |
4130 | - /* Check the player_ptr->inventory_list and equipment */ | |
4131 | 2436 | for (ARTIFACT_IDX i = 0; i < INVEN_TOTAL; i++) |
4132 | 2437 | { |
4133 | 2438 | object_type *o_ptr = &player_ptr->inventory_list[i]; |
4134 | - | |
4135 | - /* Ignore non-objects */ | |
4136 | 2439 | if (!o_ptr->k_idx) continue; |
4137 | - | |
4138 | - /* Ignore non-artifacts */ | |
4139 | 2440 | if (!object_is_fixed_artifact(o_ptr)) continue; |
4140 | - | |
4141 | - /* Ignore known items */ | |
4142 | 2441 | if (object_is_known(o_ptr)) continue; |
4143 | 2442 | |
4144 | - /* Note the artifact */ | |
4145 | 2443 | okay[o_ptr->name1] = FALSE; |
4146 | 2444 | } |
4147 | 2445 |
@@ -4153,49 +2451,29 @@ static void do_cmd_knowledge_artifacts(player_type *player_ptr) | ||
4153 | 2451 | |
4154 | 2452 | u16b why = 3; |
4155 | 2453 | ang_sort(who, &why, n, ang_sort_art_comp, ang_sort_art_swap); |
4156 | - | |
4157 | - /* Scan the artifacts */ | |
4158 | 2454 | for (ARTIFACT_IDX k = 0; k < n; k++) |
4159 | 2455 | { |
4160 | 2456 | artifact_type *a_ptr = &a_info[who[k]]; |
4161 | 2457 | GAME_TEXT base_name[MAX_NLEN]; |
4162 | 2458 | strcpy(base_name, _("未知の伝説のアイテム", "Unknown Artifact")); |
4163 | - | |
4164 | - /* Obtain the base object type */ | |
4165 | 2459 | ARTIFACT_IDX z = lookup_kind(a_ptr->tval, a_ptr->sval); |
4166 | - | |
4167 | - /* Real object */ | |
4168 | 2460 | if (z) |
4169 | 2461 | { |
4170 | 2462 | object_type forge; |
4171 | 2463 | object_type *q_ptr; |
4172 | 2464 | q_ptr = &forge; |
4173 | - | |
4174 | - /* Create fake object */ | |
4175 | 2465 | object_prep(q_ptr, z); |
4176 | - | |
4177 | - /* Make it an artifact */ | |
4178 | 2466 | q_ptr->name1 = (byte)who[k]; |
4179 | - | |
4180 | - /* Display as if known */ | |
4181 | 2467 | q_ptr->ident |= IDENT_STORE; |
4182 | - | |
4183 | - /* Describe the artifact */ | |
4184 | 2468 | object_desc(player_ptr, base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); |
4185 | 2469 | } |
4186 | 2470 | |
4187 | - /* Hack -- Build the artifact name */ | |
4188 | 2471 | fprintf(fff, _(" %s\n", " The %s\n"), base_name); |
4189 | 2472 | } |
4190 | 2473 | |
4191 | - /* Free the "who" array */ | |
4192 | 2474 | C_KILL(who, max_a_idx, ARTIFACT_IDX); |
4193 | - | |
4194 | - /* Free the "okay" array */ | |
4195 | 2475 | C_KILL(okay, max_a_idx, bool); |
4196 | 2476 | my_fclose(fff); |
4197 | - | |
4198 | - /* Display the file contents */ | |
4199 | 2477 | (void)show_file(player_ptr, TRUE, file_name, _("既知の伝説のアイテム", "Artifacts Seen"), 0, 0); |
4200 | 2478 | fd_kill(file_name); |
4201 | 2479 | } |
@@ -4209,22 +2487,17 @@ static void do_cmd_knowledge_uniques(player_type *creature_ptr) | ||
4209 | 2487 | { |
4210 | 2488 | u16b why = 2; |
4211 | 2489 | IDX *who; |
4212 | - | |
4213 | - FILE *fff; | |
4214 | - | |
4215 | 2490 | GAME_TEXT file_name[1024]; |
4216 | - | |
4217 | 2491 | int n_alive[10]; |
4218 | 2492 | int n_alive_surface = 0; |
4219 | 2493 | int n_alive_over100 = 0; |
4220 | 2494 | int n_alive_total = 0; |
4221 | 2495 | int max_lev = -1; |
2496 | + for (IDX i = 0; i < 10; i++) | |
2497 | + n_alive[i] = 0; | |
4222 | 2498 | |
4223 | - for (IDX i = 0; i < 10; i++) n_alive[i] = 0; | |
4224 | - | |
4225 | - /* Open a new file */ | |
2499 | + FILE *fff; | |
4226 | 2500 | fff = my_fopen_temp(file_name, 1024); |
4227 | - | |
4228 | 2501 | if (!fff) |
4229 | 2502 | { |
4230 | 2503 | msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name); |
@@ -4232,49 +2505,35 @@ static void do_cmd_knowledge_uniques(player_type *creature_ptr) | ||
4232 | 2505 | return; |
4233 | 2506 | } |
4234 | 2507 | |
4235 | - /* Allocate the "who" array */ | |
4236 | 2508 | C_MAKE(who, max_r_idx, MONRACE_IDX); |
4237 | - | |
4238 | - /* Scan the monsters */ | |
4239 | 2509 | int n = 0; |
4240 | 2510 | for (IDX i = 1; i < max_r_idx; i++) |
4241 | 2511 | { |
4242 | 2512 | monster_race *r_ptr = &r_info[i]; |
4243 | - int lev; | |
4244 | - | |
4245 | 2513 | if (!r_ptr->name) continue; |
4246 | - | |
4247 | - /* Require unique monsters */ | |
4248 | 2514 | if (!(r_ptr->flags1 & RF1_UNIQUE)) continue; |
4249 | - | |
4250 | - /* Only display "known" uniques */ | |
4251 | 2515 | if (!cheat_know && !r_ptr->r_sights) continue; |
4252 | - | |
4253 | - /* Only print rarity <= 100 uniques */ | |
4254 | 2516 | if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue; |
4255 | - | |
4256 | - /* Only "alive" uniques */ | |
4257 | 2517 | if (r_ptr->max_num == 0) continue; |
4258 | 2518 | |
4259 | 2519 | if (r_ptr->level) |
4260 | 2520 | { |
4261 | - lev = (r_ptr->level - 1) / 10; | |
2521 | + int lev = (r_ptr->level - 1) / 10; | |
4262 | 2522 | if (lev < 10) |
4263 | 2523 | { |
4264 | 2524 | n_alive[lev]++; |
4265 | 2525 | if (max_lev < lev) max_lev = lev; |
4266 | 2526 | } |
4267 | - else n_alive_over100++; | |
2527 | + else | |
2528 | + n_alive_over100++; | |
4268 | 2529 | } |
4269 | - else n_alive_surface++; | |
2530 | + else | |
2531 | + n_alive_surface++; | |
4270 | 2532 | |
4271 | - /* Collect "appropriate" monsters */ | |
4272 | 2533 | who[n++] = i; |
4273 | 2534 | } |
4274 | 2535 | |
4275 | - /* Sort the array by dungeon depth of monsters */ | |
4276 | 2536 | ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook); |
4277 | - | |
4278 | 2537 | if (n_alive_surface) |
4279 | 2538 | { |
4280 | 2539 | fprintf(fff, _(" 地上 生存: %3d体\n", " Surface alive: %3d\n"), n_alive_surface); |
@@ -4303,18 +2562,14 @@ static void do_cmd_knowledge_uniques(player_type *creature_ptr) | ||
4303 | 2562 | fputs(_("現在は既知の生存ユニークはいません。\n", "No known uniques alive.\n"), fff); |
4304 | 2563 | } |
4305 | 2564 | |
4306 | - /* Scan the monster races */ | |
4307 | 2565 | for (int k = 0; k < n; k++) |
4308 | 2566 | { |
4309 | 2567 | monster_race *r_ptr = &r_info[who[k]]; |
4310 | 2568 | fprintf(fff, _(" %s (レベル%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, (int)r_ptr->level); |
4311 | 2569 | } |
4312 | 2570 | |
4313 | - /* Free the "who" array */ | |
4314 | 2571 | C_KILL(who, max_r_idx, s16b); |
4315 | 2572 | my_fclose(fff); |
4316 | - | |
4317 | - /* Display the file contents */ | |
4318 | 2573 | (void)show_file(creature_ptr, TRUE, file_name, _("まだ生きているユニーク・モンスター", "Alive Uniques"), 0, 0); |
4319 | 2574 | fd_kill(file_name); |
4320 | 2575 | } |
@@ -4325,7 +2580,6 @@ static void do_cmd_knowledge_uniques(player_type *creature_ptr) | ||
4325 | 2580 | */ |
4326 | 2581 | static void do_cmd_knowledge_weapon_exp(player_type *creature_ptr) |
4327 | 2582 | { |
4328 | - /* Open a new file */ | |
4329 | 2583 | FILE *fff; |
4330 | 2584 | GAME_TEXT file_name[1024]; |
4331 | 2585 | fff = my_fopen_temp(file_name, 1024); |
@@ -4363,8 +2617,6 @@ static void do_cmd_knowledge_weapon_exp(player_type *creature_ptr) | ||
4363 | 2617 | } |
4364 | 2618 | |
4365 | 2619 | my_fclose(fff); |
4366 | - | |
4367 | - /* Display the file contents */ | |
4368 | 2620 | (void)show_file(creature_ptr, TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0); |
4369 | 2621 | fd_kill(file_name); |
4370 | 2622 | } |
@@ -4377,7 +2629,6 @@ static void do_cmd_knowledge_weapon_exp(player_type *creature_ptr) | ||
4377 | 2629 | */ |
4378 | 2630 | static void do_cmd_knowledge_spell_exp(player_type *creature_ptr) |
4379 | 2631 | { |
4380 | - /* Open a new file */ | |
4381 | 2632 | FILE *fff; |
4382 | 2633 | GAME_TEXT file_name[1024]; |
4383 | 2634 | fff = my_fopen_temp(file_name, 1024); |
@@ -4450,8 +2701,6 @@ static void do_cmd_knowledge_spell_exp(player_type *creature_ptr) | ||
4450 | 2701 | } |
4451 | 2702 | |
4452 | 2703 | my_fclose(fff); |
4453 | - | |
4454 | - /* Display the file contents */ | |
4455 | 2704 | (void)show_file(creature_ptr, TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0); |
4456 | 2705 | fd_kill(file_name); |
4457 | 2706 | } |
@@ -4472,7 +2721,6 @@ static void do_cmd_knowledge_skill_exp(player_type *creature_ptr) | ||
4472 | 2721 | _("盾 ", "Shield ") |
4473 | 2722 | }; |
4474 | 2723 | |
4475 | - /* Open a new file */ | |
4476 | 2724 | FILE *fff; |
4477 | 2725 | char file_name[1024]; |
4478 | 2726 | fff = my_fopen_temp(file_name, 1024); |
@@ -4495,8 +2743,6 @@ static void do_cmd_knowledge_skill_exp(player_type *creature_ptr) | ||
4495 | 2743 | } |
4496 | 2744 | |
4497 | 2745 | my_fclose(fff); |
4498 | - | |
4499 | - /* Display the file contents */ | |
4500 | 2746 | (void)show_file(creature_ptr, TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0); |
4501 | 2747 | fd_kill(file_name); |
4502 | 2748 | } |
@@ -4510,7 +2756,6 @@ static void do_cmd_knowledge_skill_exp(player_type *creature_ptr) | ||
4510 | 2756 | */ |
4511 | 2757 | static void do_cmd_knowledge_pets(player_type *creature_ptr) |
4512 | 2758 | { |
4513 | - /* Open a new file */ | |
4514 | 2759 | GAME_TEXT file_name[1024]; |
4515 | 2760 | FILE *fff; |
4516 | 2761 | fff = my_fopen_temp(file_name, 1024); |
@@ -4521,18 +2766,13 @@ static void do_cmd_knowledge_pets(player_type *creature_ptr) | ||
4521 | 2766 | return; |
4522 | 2767 | } |
4523 | 2768 | |
4524 | - /* Process the monsters (backwards) */ | |
4525 | 2769 | monster_type *m_ptr; |
4526 | 2770 | GAME_TEXT pet_name[MAX_NLEN]; |
4527 | 2771 | int t_friends = 0; |
4528 | 2772 | for (int i = creature_ptr->current_floor_ptr->m_max - 1; i >= 1; i--) |
4529 | 2773 | { |
4530 | 2774 | m_ptr = &creature_ptr->current_floor_ptr->m_list[i]; |
4531 | - | |
4532 | - /* Ignore "dead" monsters */ | |
4533 | 2775 | if (!monster_is_valid(m_ptr)) continue; |
4534 | - | |
4535 | - /* Calculate "upkeep" for pets */ | |
4536 | 2776 | if (!is_pet(m_ptr)) continue; |
4537 | 2777 | |
4538 | 2778 | t_friends++; |
@@ -4551,8 +2791,6 @@ static void do_cmd_knowledge_pets(player_type *creature_ptr) | ||
4551 | 2791 | fprintf(fff, _(" 維持コスト: %d%% MP\n", " Upkeep: %d%% mana.\n"), show_upkeep); |
4552 | 2792 | |
4553 | 2793 | my_fclose(fff); |
4554 | - | |
4555 | - /* Display the file contents */ | |
4556 | 2794 | (void)show_file(creature_ptr, TRUE, file_name, _("現在のペット", "Current Pets"), 0, 0); |
4557 | 2795 | fd_kill(file_name); |
4558 | 2796 | } |
@@ -4567,7 +2805,6 @@ static void do_cmd_knowledge_pets(player_type *creature_ptr) | ||
4567 | 2805 | */ |
4568 | 2806 | static void do_cmd_knowledge_kill_count(player_type *creature_ptr) |
4569 | 2807 | { |
4570 | - /* Open a new file */ | |
4571 | 2808 | FILE *fff; |
4572 | 2809 | GAME_TEXT file_name[1024]; |
4573 | 2810 | fff = my_fopen_temp(file_name, 1024); |
@@ -4578,72 +2815,58 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr) | ||
4578 | 2815 | return; |
4579 | 2816 | } |
4580 | 2817 | |
4581 | - /* Allocate the "who" array */ | |
4582 | 2818 | MONRACE_IDX *who; |
4583 | 2819 | C_MAKE(who, max_r_idx, MONRACE_IDX); |
4584 | - | |
4585 | 2820 | s32b total = 0; |
2821 | + for (int kk = 1; kk < max_r_idx; kk++) | |
4586 | 2822 | { |
4587 | - /* Monsters slain */ | |
4588 | - for (int kk = 1; kk < max_r_idx; kk++) | |
2823 | + monster_race *r_ptr = &r_info[kk]; | |
2824 | + | |
2825 | + if (r_ptr->flags1 & (RF1_UNIQUE)) | |
4589 | 2826 | { |
4590 | - monster_race *r_ptr = &r_info[kk]; | |
2827 | + bool dead = (r_ptr->max_num == 0); | |
4591 | 2828 | |
4592 | - if (r_ptr->flags1 & (RF1_UNIQUE)) | |
2829 | + if (dead) | |
4593 | 2830 | { |
4594 | - bool dead = (r_ptr->max_num == 0); | |
4595 | - | |
4596 | - if (dead) | |
4597 | - { | |
4598 | - total++; | |
4599 | - } | |
2831 | + total++; | |
4600 | 2832 | } |
4601 | - else | |
4602 | - { | |
4603 | - MONSTER_NUMBER this_monster = r_ptr->r_pkills; | |
2833 | + } | |
2834 | + else | |
2835 | + { | |
2836 | + MONSTER_NUMBER this_monster = r_ptr->r_pkills; | |
4604 | 2837 | |
4605 | - if (this_monster > 0) | |
4606 | - { | |
4607 | - total += this_monster; | |
4608 | - } | |
2838 | + if (this_monster > 0) | |
2839 | + { | |
2840 | + total += this_monster; | |
4609 | 2841 | } |
4610 | 2842 | } |
2843 | + } | |
4611 | 2844 | |
4612 | - if (total < 1) | |
4613 | - fprintf(fff, _("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n")); | |
4614 | - else | |
2845 | + if (total < 1) | |
2846 | + fprintf(fff, _("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n")); | |
2847 | + else | |
4615 | 2848 | #ifdef JP |
4616 | - fprintf(fff, "あなたは%ld体の敵を倒している。\n\n", (long int)total); | |
2849 | + fprintf(fff, "あなたは%ld体の敵を倒している。\n\n", (long int)total); | |
4617 | 2850 | #else |
4618 | - fprintf(fff, "You have defeated %ld %s.\n\n", (long int)total, (total == 1) ? "enemy" : "enemies"); | |
2851 | + fprintf(fff, "You have defeated %ld %s.\n\n", (long int)total, (total == 1) ? "enemy" : "enemies"); | |
4619 | 2852 | #endif |
4620 | - } | |
4621 | 2853 | |
4622 | 2854 | total = 0; |
4623 | - | |
4624 | - /* Scan the monsters */ | |
4625 | 2855 | int n = 0; |
4626 | 2856 | for (MONRACE_IDX i = 1; i < max_r_idx; i++) |
4627 | 2857 | { |
4628 | 2858 | monster_race *r_ptr = &r_info[i]; |
4629 | - | |
4630 | - /* Use that monster */ | |
4631 | 2859 | if (r_ptr->name) who[n++] = i; |
4632 | 2860 | } |
4633 | 2861 | |
4634 | - /* Sort the array by dungeon depth of monsters */ | |
4635 | 2862 | u16b why = 2; |
4636 | 2863 | ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook); |
4637 | - | |
4638 | - /* Scan the monster races */ | |
4639 | 2864 | for (int k = 0; k < n; k++) |
4640 | 2865 | { |
4641 | 2866 | monster_race *r_ptr = &r_info[who[k]]; |
4642 | - | |
4643 | 2867 | if (r_ptr->flags1 & (RF1_UNIQUE)) |
4644 | 2868 | { |
4645 | 2869 | bool dead = (r_ptr->max_num == 0); |
4646 | - | |
4647 | 2870 | if (dead) |
4648 | 2871 | { |
4649 | 2872 | fprintf(fff, " %s\n", (r_name + r_ptr->name)); |
@@ -4654,11 +2877,9 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr) | ||
4654 | 2877 | } |
4655 | 2878 | |
4656 | 2879 | MONSTER_NUMBER this_monster = r_ptr->r_pkills; |
4657 | - | |
4658 | 2880 | if (this_monster <= 0) continue; |
4659 | 2881 | |
4660 | 2882 | #ifdef JP |
4661 | - /* p,tは人と数える by ita */ | |
4662 | 2883 | if (my_strchr("pt", r_ptr->d_char)) |
4663 | 2884 | fprintf(fff, " %3d 人の %s\n", (int)this_monster, r_name + r_ptr->name); |
4664 | 2885 | else |
@@ -4693,11 +2914,8 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr) | ||
4693 | 2914 | fprintf(fff, " Total: %lu creature%s killed.\n", (unsigned long int)total, (total == 1 ? "" : "s")); |
4694 | 2915 | #endif |
4695 | 2916 | |
4696 | - /* Free the "who" array */ | |
4697 | 2917 | C_KILL(who, max_r_idx, s16b); |
4698 | 2918 | my_fclose(fff); |
4699 | - | |
4700 | - /* Display the file contents */ | |
4701 | 2919 | (void)show_file(creature_ptr, TRUE, file_name, _("倒した敵の数", "Kill Count"), 0, 0); |
4702 | 2920 | fd_kill(file_name); |
4703 | 2921 | } |
@@ -4718,19 +2936,11 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr) | ||
4718 | 2936 | */ |
4719 | 2937 | static void display_group_list(int col, int row, int wid, int per_page, IDX grp_idx[], concptr group_text[], int grp_cur, int grp_top) |
4720 | 2938 | { |
4721 | - /* Display lines until done */ | |
4722 | 2939 | for (int i = 0; i < per_page && (grp_idx[i] >= 0); i++) |
4723 | 2940 | { |
4724 | - /* Get the group index */ | |
4725 | 2941 | int grp = grp_idx[grp_top + i]; |
4726 | - | |
4727 | - /* Choose a color */ | |
4728 | 2942 | TERM_COLOR attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE; |
4729 | - | |
4730 | - /* Erase the entire line */ | |
4731 | 2943 | Term_erase(col, row + i, wid); |
4732 | - | |
4733 | - /* Display the group label */ | |
4734 | 2944 | c_put_str(attr, group_text[grp], row + i, col); |
4735 | 2945 | } |
4736 | 2946 | } |
@@ -4739,70 +2949,44 @@ static void display_group_list(int col, int row, int wid, int per_page, IDX grp_ | ||
4739 | 2949 | /* |
4740 | 2950 | * Move the cursor in a browser window |
4741 | 2951 | */ |
4742 | -static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt, | |
4743 | - IDX *list_cur, int list_cnt) | |
2952 | +static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt, IDX *list_cur, int list_cnt) | |
4744 | 2953 | { |
4745 | 2954 | int d; |
4746 | 2955 | int col = *column; |
4747 | 2956 | IDX grp = *grp_cur; |
4748 | 2957 | IDX list = *list_cur; |
4749 | - | |
4750 | - /* Extract direction */ | |
4751 | 2958 | if (ch == ' ') |
4752 | - { | |
4753 | - /* Hack -- scroll up full screen */ | |
4754 | 2959 | d = 3; |
4755 | - } | |
4756 | 2960 | else if (ch == '-') |
4757 | - { | |
4758 | - /* Hack -- scroll down full screen */ | |
4759 | 2961 | d = 9; |
4760 | - } | |
4761 | 2962 | else |
4762 | - { | |
4763 | 2963 | d = get_keymap_dir(ch); |
4764 | - } | |
4765 | 2964 | |
4766 | 2965 | if (!d) return; |
4767 | 2966 | |
4768 | - /* Diagonals - hack */ | |
4769 | 2967 | if ((ddx[d] > 0) && ddy[d]) |
4770 | 2968 | { |
4771 | 2969 | int browser_rows; |
4772 | 2970 | int wid, hgt; |
4773 | - | |
4774 | 2971 | Term_get_size(&wid, &hgt); |
4775 | - | |
4776 | 2972 | browser_rows = hgt - 8; |
4777 | - | |
4778 | - /* Browse group list */ | |
4779 | 2973 | if (!col) |
4780 | 2974 | { |
4781 | 2975 | int old_grp = grp; |
4782 | - | |
4783 | - /* Move up or down */ | |
4784 | 2976 | grp += ddy[d] * (browser_rows - 1); |
4785 | - | |
4786 | - /* Verify */ | |
4787 | 2977 | if (grp >= grp_cnt) grp = grp_cnt - 1; |
4788 | 2978 | if (grp < 0) grp = 0; |
4789 | 2979 | if (grp != old_grp) list = 0; |
4790 | 2980 | } |
4791 | - | |
4792 | - /* Browse sub-list list */ | |
4793 | 2981 | else |
4794 | 2982 | { |
4795 | - /* Move up or down */ | |
4796 | 2983 | list += ddy[d] * browser_rows; |
4797 | - | |
4798 | - /* Verify */ | |
4799 | 2984 | if (list >= list_cnt) list = list_cnt - 1; |
4800 | 2985 | if (list < 0) list = 0; |
4801 | 2986 | } |
4802 | 2987 | |
4803 | 2988 | (*grp_cur) = grp; |
4804 | 2989 | (*list_cur) = list; |
4805 | - | |
4806 | 2990 | return; |
4807 | 2991 | } |
4808 | 2992 |
@@ -4813,31 +2997,20 @@ static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt, | ||
4813 | 2997 | if (col > 1) col = 1; |
4814 | 2998 | |
4815 | 2999 | (*column) = col; |
4816 | - | |
4817 | 3000 | return; |
4818 | 3001 | } |
4819 | 3002 | |
4820 | - /* Browse group list */ | |
4821 | 3003 | if (!col) |
4822 | 3004 | { |
4823 | 3005 | int old_grp = grp; |
4824 | - | |
4825 | - /* Move up or down */ | |
4826 | 3006 | grp += (IDX)ddy[d]; |
4827 | - | |
4828 | - /* Verify */ | |
4829 | 3007 | if (grp >= grp_cnt) grp = grp_cnt - 1; |
4830 | 3008 | if (grp < 0) grp = 0; |
4831 | 3009 | if (grp != old_grp) list = 0; |
4832 | 3010 | } |
4833 | - | |
4834 | - /* Browse sub-list list */ | |
4835 | 3011 | else |
4836 | 3012 | { |
4837 | - /* Move up or down */ | |
4838 | 3013 | list += (IDX)ddy[d]; |
4839 | - | |
4840 | - /* Verify */ | |
4841 | 3014 | if (list >= list_cnt) list = list_cnt - 1; |
4842 | 3015 | if (list < 0) list = 0; |
4843 | 3016 | } |
@@ -4852,42 +3025,31 @@ static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt, | ||
4852 | 3025 | */ |
4853 | 3026 | static void display_visual_list(int col, int row, int height, int width, TERM_COLOR attr_top, byte char_left) |
4854 | 3027 | { |
4855 | - /* Clear the display lines */ | |
4856 | 3028 | for (int i = 0; i < height; i++) |
4857 | 3029 | { |
4858 | 3030 | Term_erase(col, row + i, width); |
4859 | 3031 | } |
4860 | 3032 | |
4861 | - /* Bigtile mode uses double width */ | |
4862 | 3033 | if (use_bigtile) width /= 2; |
4863 | 3034 | |
4864 | - /* Display lines until done */ | |
4865 | 3035 | for (int i = 0; i < height; i++) |
4866 | 3036 | { |
4867 | - /* Display columns until done */ | |
4868 | 3037 | for (int j = 0; j < width; j++) |
4869 | 3038 | { |
4870 | 3039 | TERM_LEN x = col + j; |
4871 | 3040 | TERM_LEN y = row + i; |
4872 | - | |
4873 | - /* Bigtile mode uses double width */ | |
4874 | 3041 | if (use_bigtile) x += j; |
4875 | 3042 | |
4876 | 3043 | TERM_COLOR ia = attr_top + i; |
4877 | 3044 | SYMBOL_CODE ic = char_left + j; |
4878 | - | |
4879 | - /* Ignore illegal characters */ | |
4880 | 3045 | if (ia > 0x7f || ic > 0xff || ic < ' ' || |
4881 | 3046 | (!use_graphics && ic > 0x7f)) |
4882 | 3047 | continue; |
4883 | 3048 | |
4884 | 3049 | TERM_COLOR a = ia; |
4885 | 3050 | SYMBOL_CODE c = ic; |
4886 | - | |
4887 | - /* Force correct code for both ASCII character and tile */ | |
4888 | 3051 | if (c & 0x80) a |= 0x80; |
4889 | 3052 | |
4890 | - /* Display symbol */ | |
4891 | 3053 | Term_queue_bigchar(x, y, a, c, 0, 0); |
4892 | 3054 | } |
4893 | 3055 | } |
@@ -4904,11 +3066,8 @@ static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, b | ||
4904 | 3066 | |
4905 | 3067 | TERM_LEN x = col + j; |
4906 | 3068 | TERM_LEN y = row + i; |
4907 | - | |
4908 | - /* Bigtile mode uses double width */ | |
4909 | 3069 | if (use_bigtile) x += j; |
4910 | 3070 | |
4911 | - /* Place the cursor */ | |
4912 | 3071 | Term_gotoxy(x, y); |
4913 | 3072 | } |
4914 | 3073 |
@@ -4929,25 +3088,25 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, | ||
4929 | 3088 | case ESCAPE: |
4930 | 3089 | if (*visual_list_ptr) |
4931 | 3090 | { |
4932 | - /* Cancel change */ | |
4933 | 3091 | *cur_attr_ptr = attr_old; |
4934 | 3092 | *cur_char_ptr = char_old; |
4935 | 3093 | *visual_list_ptr = FALSE; |
4936 | 3094 | |
4937 | 3095 | return TRUE; |
4938 | 3096 | } |
3097 | + | |
4939 | 3098 | break; |
4940 | 3099 | |
4941 | 3100 | case '\n': |
4942 | 3101 | case '\r': |
4943 | 3102 | if (*visual_list_ptr) |
4944 | 3103 | { |
4945 | - /* Accept change */ | |
4946 | 3104 | *visual_list_ptr = FALSE; |
4947 | 3105 | *need_redraw = TRUE; |
4948 | 3106 | |
4949 | 3107 | return TRUE; |
4950 | 3108 | } |
3109 | + | |
4951 | 3110 | break; |
4952 | 3111 | |
4953 | 3112 | case 'V': |
@@ -4964,31 +3123,27 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, | ||
4964 | 3123 | |
4965 | 3124 | return TRUE; |
4966 | 3125 | } |
3126 | + | |
4967 | 3127 | break; |
4968 | 3128 | |
4969 | 3129 | case 'C': |
4970 | 3130 | case 'c': |
4971 | 3131 | { |
4972 | - int i; | |
4973 | - | |
4974 | - /* Set the visual */ | |
4975 | 3132 | attr_idx = *cur_attr_ptr; |
4976 | 3133 | char_idx = *cur_char_ptr; |
4977 | - | |
4978 | - /* Hack -- for feature lighting */ | |
4979 | - for (i = 0; i < F_LIT_MAX; i++) | |
3134 | + for (int i = 0; i < F_LIT_MAX; i++) | |
4980 | 3135 | { |
4981 | 3136 | attr_idx_feat[i] = 0; |
4982 | 3137 | char_idx_feat[i] = 0; |
4983 | 3138 | } |
4984 | 3139 | } |
3140 | + | |
4985 | 3141 | return TRUE; |
4986 | 3142 | |
4987 | 3143 | case 'P': |
4988 | 3144 | case 'p': |
4989 | - if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */ | |
3145 | + if (attr_idx || (!(char_idx & 0x80) && char_idx)) | |
4990 | 3146 | { |
4991 | - /* Set the char */ | |
4992 | 3147 | *cur_attr_ptr = attr_idx; |
4993 | 3148 | *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5); |
4994 | 3149 | if (!*visual_list_ptr) *need_redraw = TRUE; |
@@ -5015,7 +3170,6 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, | ||
5015 | 3170 | if (use_bigtile) eff_width = width / 2; |
5016 | 3171 | else eff_width = width; |
5017 | 3172 | |
5018 | - /* Restrict direction */ | |
5019 | 3173 | if ((a == 0) && (ddy[d] < 0)) d = 0; |
5020 | 3174 | if ((c == 0) && (ddx[d] < 0)) d = 0; |
5021 | 3175 | if ((a == 0x7f) && (ddy[d] > 0)) d = 0; |
@@ -5023,26 +3177,20 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, | ||
5023 | 3177 | |
5024 | 3178 | a += (TERM_COLOR)ddy[d]; |
5025 | 3179 | c += (SYMBOL_CODE)ddx[d]; |
5026 | - | |
5027 | - /* Force correct code for both ASCII character and tile */ | |
5028 | 3180 | if (c & 0x80) a |= 0x80; |
5029 | 3181 | |
5030 | - /* Set the visual */ | |
5031 | 3182 | *cur_attr_ptr = a; |
5032 | 3183 | *cur_char_ptr = c; |
5033 | - | |
5034 | - | |
5035 | - /* Move the frame */ | |
5036 | 3184 | if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--; |
5037 | 3185 | if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++; |
5038 | 3186 | if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--; |
5039 | 3187 | if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++; |
5040 | 3188 | return TRUE; |
5041 | 3189 | } |
3190 | + | |
5042 | 3191 | break; |
5043 | 3192 | } |
5044 | 3193 | |
5045 | - /* Visual mode command is not used */ | |
5046 | 3194 | return FALSE; |
5047 | 3195 | } |
5048 | 3196 |
@@ -5050,28 +3198,16 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, | ||
5050 | 3198 | /* |
5051 | 3199 | * Display the monsters in a group. |
5052 | 3200 | */ |
5053 | -static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], | |
5054 | - int mon_cur, int mon_top, bool visual_only) | |
3201 | +static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], int mon_cur, int mon_top, bool visual_only) | |
5055 | 3202 | { |
5056 | - /* Display lines until done */ | |
5057 | 3203 | int i; |
5058 | 3204 | for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++) |
5059 | 3205 | { |
5060 | 3206 | TERM_COLOR attr; |
5061 | - | |
5062 | - /* Get the race index */ | |
5063 | 3207 | MONRACE_IDX r_idx = mon_idx[mon_top + i]; |
5064 | - | |
5065 | - /* Access the race */ | |
5066 | 3208 | monster_race *r_ptr = &r_info[r_idx]; |
5067 | - | |
5068 | - /* Choose a color */ | |
5069 | 3209 | attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE); |
5070 | - | |
5071 | - /* Display the name */ | |
5072 | 3210 | c_prt(attr, (r_name + r_ptr->name), row + i, col); |
5073 | - | |
5074 | - /* Hack -- visual_list mode */ | |
5075 | 3211 | if (per_page == 1) |
5076 | 3212 | { |
5077 | 3213 | c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (current_world_ptr->wizard || visual_only) ? 56 : 61); |
@@ -5082,15 +3218,10 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], | ||
5082 | 3218 | c_prt(attr, format("%d", r_idx), row + i, 62); |
5083 | 3219 | } |
5084 | 3220 | |
5085 | - /* Erase chars before overwritten by the race letter */ | |
5086 | 3221 | Term_erase(69, row + i, 255); |
5087 | - | |
5088 | - /* Display symbol */ | |
5089 | 3222 | Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0); |
5090 | - | |
5091 | 3223 | if (!visual_only) |
5092 | 3224 | { |
5093 | - /* Display kills */ | |
5094 | 3225 | if (!(r_ptr->flags1 & RF1_UNIQUE)) |
5095 | 3226 | put_str(format("%5d", r_ptr->r_pkills), row + i, 73); |
5096 | 3227 | else |
@@ -5099,7 +3230,6 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], | ||
5099 | 3230 | } |
5100 | 3231 | } |
5101 | 3232 | |
5102 | - /* Clear remaining lines */ | |
5103 | 3233 | for (; i < per_page; i++) |
5104 | 3234 | { |
5105 | 3235 | Term_erase(col, row + i, 255); |
@@ -5120,8 +3250,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5120 | 3250 | { |
5121 | 3251 | TERM_LEN wid, hgt; |
5122 | 3252 | Term_get_size(&wid, &hgt); |
5123 | - | |
5124 | - /* Allocate the "mon_idx" array */ | |
5125 | 3253 | IDX *mon_idx; |
5126 | 3254 | C_MAKE(mon_idx, max_r_idx, MONRACE_IDX); |
5127 | 3255 |
@@ -5137,21 +3265,14 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5137 | 3265 | if (direct_r_idx < 0) |
5138 | 3266 | { |
5139 | 3267 | mode = visual_only ? 0x03 : 0x01; |
5140 | - | |
5141 | - /* Check every group */ | |
5142 | 3268 | int len; |
5143 | 3269 | for (IDX i = 0; monster_group_text[i] != NULL; i++) |
5144 | 3270 | { |
5145 | - /* Measure the label */ | |
5146 | 3271 | len = strlen(monster_group_text[i]); |
5147 | - | |
5148 | - /* Save the maximum length */ | |
5149 | 3272 | if (len > max) max = len; |
5150 | 3273 | |
5151 | - /* See if any monsters are known */ | |
5152 | 3274 | if ((monster_group_char[i] == ((char *)-1L)) || collect_monsters(creature_ptr, i, mon_idx, mode)) |
5153 | 3275 | { |
5154 | - /* Build a list of groups with known monsters */ | |
5155 | 3276 | grp_idx[grp_cnt++] = i; |
5156 | 3277 | } |
5157 | 3278 | } |
@@ -5162,17 +3283,13 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5162 | 3283 | { |
5163 | 3284 | mon_idx[0] = direct_r_idx; |
5164 | 3285 | mon_cnt = 1; |
5165 | - | |
5166 | - /* Terminate the list */ | |
5167 | 3286 | mon_idx[1] = -1; |
5168 | 3287 | |
5169 | 3288 | (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3), |
5170 | 3289 | &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw); |
5171 | 3290 | } |
5172 | 3291 | |
5173 | - /* Terminate the list */ | |
5174 | 3292 | grp_idx[grp_cnt] = -1; |
5175 | - | |
5176 | 3293 | mode = visual_only ? 0x02 : 0x00; |
5177 | 3294 | IDX old_grp_cur = -1; |
5178 | 3295 | IDX grp_cur = 0; |
@@ -5212,22 +3329,16 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5212 | 3329 | |
5213 | 3330 | if (direct_r_idx < 0) |
5214 | 3331 | { |
5215 | - /* Scroll group list */ | |
5216 | 3332 | if (grp_cur < grp_top) grp_top = grp_cur; |
5217 | 3333 | if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1; |
5218 | 3334 | |
5219 | - /* Display a list of monster groups */ | |
5220 | 3335 | display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top); |
5221 | - | |
5222 | 3336 | if (old_grp_cur != grp_cur) |
5223 | 3337 | { |
5224 | 3338 | old_grp_cur = grp_cur; |
5225 | - | |
5226 | - /* Get a list of monsters in the current group */ | |
5227 | 3339 | mon_cnt = collect_monsters(creature_ptr, grp_idx[grp_cur], mon_idx, mode); |
5228 | 3340 | } |
5229 | 3341 | |
5230 | - /* Scroll monster list */ | |
5231 | 3342 | while (mon_cur < mon_top) |
5232 | 3343 | mon_top = MAX(0, mon_top - browser_rows / 2); |
5233 | 3344 | while (mon_cur >= mon_top + browser_rows) |
@@ -5236,34 +3347,26 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5236 | 3347 | |
5237 | 3348 | if (!visual_list) |
5238 | 3349 | { |
5239 | - /* Display a list of monsters in the current group */ | |
5240 | 3350 | display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only); |
5241 | 3351 | } |
5242 | 3352 | else |
5243 | 3353 | { |
5244 | 3354 | mon_top = mon_cur; |
5245 | - | |
5246 | - /* Display a monster name */ | |
5247 | 3355 | display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only); |
5248 | - | |
5249 | - /* Display visual list below first monster */ | |
5250 | 3356 | display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left); |
5251 | 3357 | } |
5252 | 3358 | |
5253 | - /* Prompt */ | |
5254 | 3359 | prt(format(_("<方向>%s%s%s, ESC", "<dir>%s%s%s, ESC"), |
5255 | 3360 | (!visual_list && !visual_only) ? _(", 'r'で思い出を見る", ", 'r' to recall") : "", |
5256 | 3361 | visual_list ? _(", ENTERで決定", ", ENTER to accept") : _(", 'v'でシンボル変更", ", 'v' for visuals"), |
5257 | 3362 | (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")), |
5258 | 3363 | hgt - 1, 0); |
5259 | 3364 | |
5260 | - /* Get the current monster */ | |
5261 | 3365 | monster_race *r_ptr; |
5262 | 3366 | r_ptr = &r_info[mon_idx[mon_cur]]; |
5263 | 3367 | |
5264 | 3368 | if (!visual_only) |
5265 | 3369 | { |
5266 | - /* Mega Hack -- track this monster race */ | |
5267 | 3370 | if (mon_cnt) monster_race_track(creature_ptr, mon_idx[mon_cur]); |
5268 | 3371 | handle_stuff(creature_ptr); |
5269 | 3372 | } |
@@ -5282,8 +3385,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5282 | 3385 | } |
5283 | 3386 | |
5284 | 3387 | char ch = inkey(); |
5285 | - | |
5286 | - /* Do visual mode command if needed */ | |
5287 | 3388 | if (visual_mode_command(ch, &visual_list, browser_rows - 1, wid - (max + 3), &attr_top, &char_left, &r_ptr->x_attr, &r_ptr->x_char, need_redraw)) |
5288 | 3389 | { |
5289 | 3390 | if (direct_r_idx >= 0) |
@@ -5312,7 +3413,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5312 | 3413 | case 'R': |
5313 | 3414 | case 'r': |
5314 | 3415 | { |
5315 | - /* Recall on screen */ | |
5316 | 3416 | if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0)) |
5317 | 3417 | { |
5318 | 3418 | screen_roff(creature_ptr, mon_idx[mon_cur], 0); |
@@ -5327,7 +3427,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5327 | 3427 | |
5328 | 3428 | default: |
5329 | 3429 | { |
5330 | - /* Move the cursor */ | |
5331 | 3430 | browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt); |
5332 | 3431 | |
5333 | 3432 | break; |
@@ -5335,7 +3434,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5335 | 3434 | } |
5336 | 3435 | } |
5337 | 3436 | |
5338 | - /* Free the "mon_idx" array */ | |
5339 | 3437 | C_KILL(mon_idx, max_r_idx, MONRACE_IDX); |
5340 | 3438 | } |
5341 | 3439 |
@@ -5346,7 +3444,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr | ||
5346 | 3444 | static void display_object_list(int col, int row, int per_page, IDX object_idx[], |
5347 | 3445 | int object_cur, int object_top, bool visual_only) |
5348 | 3446 | { |
5349 | - /* Display lines until done */ | |
5350 | 3447 | int i; |
5351 | 3448 | for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++) |
5352 | 3449 | { |
@@ -5354,45 +3451,30 @@ static void display_object_list(int col, int row, int per_page, IDX object_idx[] | ||
5354 | 3451 | TERM_COLOR a; |
5355 | 3452 | SYMBOL_CODE c; |
5356 | 3453 | object_kind *flavor_k_ptr; |
5357 | - | |
5358 | - /* Get the object index */ | |
5359 | 3454 | KIND_OBJECT_IDX k_idx = object_idx[object_top + i]; |
5360 | - | |
5361 | - /* Access the object */ | |
5362 | 3455 | object_kind *k_ptr = &k_info[k_idx]; |
5363 | - | |
5364 | - /* Choose a color */ | |
5365 | 3456 | TERM_COLOR attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE); |
5366 | 3457 | byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE); |
5367 | - | |
5368 | 3458 | if (!visual_only && k_ptr->flavor) |
5369 | 3459 | { |
5370 | - /* Appearance of this object is shuffled */ | |
5371 | 3460 | flavor_k_ptr = &k_info[k_ptr->flavor]; |
5372 | 3461 | } |
5373 | 3462 | else |
5374 | 3463 | { |
5375 | - /* Appearance of this object is very normal */ | |
5376 | 3464 | flavor_k_ptr = k_ptr; |
5377 | 3465 | } |
5378 | 3466 | |
5379 | 3467 | attr = ((i + object_top == object_cur) ? cursor : attr); |
5380 | - | |
5381 | 3468 | if (!k_ptr->flavor || (!visual_only && k_ptr->aware)) |
5382 | 3469 | { |
5383 | - /* Tidy name */ | |
5384 | 3470 | strip_name(o_name, k_idx); |
5385 | 3471 | } |
5386 | 3472 | else |
5387 | 3473 | { |
5388 | - /* Flavor name */ | |
5389 | 3474 | strcpy(o_name, k_name + flavor_k_ptr->flavor_name); |
5390 | 3475 | } |
5391 | 3476 | |
5392 | - /* Display the name */ | |
5393 | 3477 | c_prt(attr, o_name, row + i, col); |
5394 | - | |
5395 | - /* Hack -- visual_list mode */ | |
5396 | 3478 | if (per_page == 1) |
5397 | 3479 | { |
5398 | 3480 | c_prt(attr, format("%02x/%02x", flavor_k_ptr->x_attr, flavor_k_ptr->x_char), row + i, (current_world_ptr->wizard || visual_only) ? 64 : 68); |
@@ -5406,11 +3488,9 @@ static void display_object_list(int col, int row, int per_page, IDX object_idx[] | ||
5406 | 3488 | a = flavor_k_ptr->x_attr; |
5407 | 3489 | c = flavor_k_ptr->x_char; |
5408 | 3490 | |
5409 | - /* Display symbol */ | |
5410 | 3491 | Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0); |
5411 | 3492 | } |
5412 | 3493 | |
5413 | - /* Clear remaining lines */ | |
5414 | 3494 | for (; i < per_page; i++) |
5415 | 3495 | { |
5416 | 3496 | Term_erase(col, row + i, 255); |
@@ -5429,7 +3509,6 @@ static void desc_obj_fake(player_type *creature_ptr, KIND_OBJECT_IDX k_idx) | ||
5429 | 3509 | object_wipe(o_ptr); |
5430 | 3510 | object_prep(o_ptr, k_idx); |
5431 | 3511 | |
5432 | - /* It's fully know */ | |
5433 | 3512 | o_ptr->ident |= IDENT_KNOWN; |
5434 | 3513 | handle_stuff(creature_ptr); |
5435 | 3514 |
@@ -5459,8 +3538,6 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5459 | 3538 | Term_get_size(&wid, &hgt); |
5460 | 3539 | |
5461 | 3540 | int browser_rows = hgt - 8; |
5462 | - | |
5463 | - /* Allocate the "object_idx" array */ | |
5464 | 3541 | C_MAKE(object_idx, max_k_idx, KIND_OBJECT_IDX); |
5465 | 3542 | |
5466 | 3543 | int len; |
@@ -5469,20 +3546,13 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5469 | 3546 | if (direct_k_idx < 0) |
5470 | 3547 | { |
5471 | 3548 | mode = visual_only ? 0x03 : 0x01; |
5472 | - | |
5473 | - /* Check every group */ | |
5474 | 3549 | for (IDX i = 0; object_group_text[i] != NULL; i++) |
5475 | 3550 | { |
5476 | - /* Measure the label */ | |
5477 | 3551 | len = strlen(object_group_text[i]); |
5478 | - | |
5479 | - /* Save the maximum length */ | |
5480 | 3552 | if (len > max) max = len; |
5481 | 3553 | |
5482 | - /* See if any monsters are known */ | |
5483 | 3554 | if (collect_objects(i, object_idx, mode)) |
5484 | 3555 | { |
5485 | - /* Build a list of groups with known monsters */ | |
5486 | 3556 | grp_idx[grp_cnt++] = i; |
5487 | 3557 | } |
5488 | 3558 | } |
@@ -5497,29 +3567,22 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5497 | 3567 | |
5498 | 3568 | if (!visual_only && k_ptr->flavor) |
5499 | 3569 | { |
5500 | - /* Appearance of this object is shuffled */ | |
5501 | 3570 | flavor_k_ptr = &k_info[k_ptr->flavor]; |
5502 | 3571 | } |
5503 | 3572 | else |
5504 | 3573 | { |
5505 | - /* Appearance of this object is very normal */ | |
5506 | 3574 | flavor_k_ptr = k_ptr; |
5507 | 3575 | } |
5508 | 3576 | |
5509 | 3577 | object_idx[0] = direct_k_idx; |
5510 | 3578 | object_old = direct_k_idx; |
5511 | 3579 | object_cnt = 1; |
5512 | - | |
5513 | - /* Terminate the list */ | |
5514 | 3580 | object_idx[1] = -1; |
5515 | - | |
5516 | 3581 | (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3), |
5517 | 3582 | &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw); |
5518 | 3583 | } |
5519 | 3584 | |
5520 | - /* Terminate the list */ | |
5521 | 3585 | grp_idx[grp_cnt] = -1; |
5522 | - | |
5523 | 3586 | mode = visual_only ? 0x02 : 0x00; |
5524 | 3587 | IDX old_grp_cur = -1; |
5525 | 3588 | IDX grp_cur = 0; |
@@ -5568,22 +3631,16 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5568 | 3631 | |
5569 | 3632 | if (direct_k_idx < 0) |
5570 | 3633 | { |
5571 | - /* Scroll group list */ | |
5572 | 3634 | if (grp_cur < grp_top) grp_top = grp_cur; |
5573 | 3635 | if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1; |
5574 | 3636 | |
5575 | - /* Display a list of object groups */ | |
5576 | 3637 | display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top); |
5577 | - | |
5578 | 3638 | if (old_grp_cur != grp_cur) |
5579 | 3639 | { |
5580 | 3640 | old_grp_cur = grp_cur; |
5581 | - | |
5582 | - /* Get a list of objects in the current group */ | |
5583 | 3641 | object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode); |
5584 | 3642 | } |
5585 | 3643 | |
5586 | - /* Scroll object list */ | |
5587 | 3644 | while (object_cur < object_top) |
5588 | 3645 | object_top = MAX(0, object_top - browser_rows / 2); |
5589 | 3646 | while (object_cur >= object_top + browser_rows) |
@@ -5592,35 +3649,26 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5592 | 3649 | |
5593 | 3650 | if (!visual_list) |
5594 | 3651 | { |
5595 | - /* Display a list of objects in the current group */ | |
5596 | 3652 | display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only); |
5597 | 3653 | } |
5598 | 3654 | else |
5599 | 3655 | { |
5600 | 3656 | object_top = object_cur; |
5601 | - | |
5602 | - /* Display a list of objects in the current group */ | |
5603 | 3657 | display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only); |
5604 | - | |
5605 | - /* Display visual list below first object */ | |
5606 | 3658 | display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left); |
5607 | 3659 | } |
5608 | 3660 | |
5609 | - /* Get the current object */ | |
5610 | 3661 | k_ptr = &k_info[object_idx[object_cur]]; |
5611 | 3662 | |
5612 | 3663 | if (!visual_only && k_ptr->flavor) |
5613 | 3664 | { |
5614 | - /* Appearance of this object is shuffled */ | |
5615 | 3665 | flavor_k_ptr = &k_info[k_ptr->flavor]; |
5616 | 3666 | } |
5617 | 3667 | else |
5618 | 3668 | { |
5619 | - /* Appearance of this object is very normal */ | |
5620 | 3669 | flavor_k_ptr = k_ptr; |
5621 | 3670 | } |
5622 | 3671 | |
5623 | - /* Prompt */ | |
5624 | 3672 | #ifdef JP |
5625 | 3673 | prt(format("<方向>%s%s%s, ESC", |
5626 | 3674 | (!visual_list && !visual_only) ? ", 'r'で詳細を見る" : "", |
@@ -5637,15 +3685,11 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5637 | 3685 | |
5638 | 3686 | if (!visual_only) |
5639 | 3687 | { |
5640 | - /* Mega Hack -- track this object */ | |
5641 | 3688 | if (object_cnt) object_kind_track(creature_ptr, object_idx[object_cur]); |
5642 | 3689 | |
5643 | - /* The "current" object changed */ | |
5644 | 3690 | if (object_old != object_idx[object_cur]) |
5645 | 3691 | { |
5646 | 3692 | handle_stuff(creature_ptr); |
5647 | - | |
5648 | - /* Remember the "current" object */ | |
5649 | 3693 | object_old = object_idx[object_cur]; |
5650 | 3694 | } |
5651 | 3695 | } |
@@ -5664,8 +3708,6 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5664 | 3708 | } |
5665 | 3709 | |
5666 | 3710 | char ch = inkey(); |
5667 | - | |
5668 | - /* Do visual mode command if needed */ | |
5669 | 3711 | if (visual_mode_command(ch, &visual_list, browser_rows - 1, wid - (max + 3), &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw)) |
5670 | 3712 | { |
5671 | 3713 | if (direct_k_idx >= 0) |
@@ -5693,25 +3735,23 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra | ||
5693 | 3735 | case 'R': |
5694 | 3736 | case 'r': |
5695 | 3737 | { |
5696 | - /* Recall on screen */ | |
5697 | 3738 | if (!visual_list && !visual_only && (grp_cnt > 0)) |
5698 | 3739 | { |
5699 | 3740 | desc_obj_fake(creature_ptr, object_idx[object_cur]); |
5700 | 3741 | redraw = TRUE; |
5701 | 3742 | } |
3743 | + | |
5702 | 3744 | break; |
5703 | 3745 | } |
5704 | 3746 | |
5705 | 3747 | default: |
5706 | 3748 | { |
5707 | - /* Move the cursor */ | |
5708 | 3749 | browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt); |
5709 | 3750 | break; |
5710 | 3751 | } |
5711 | 3752 | } |
5712 | 3753 | } |
5713 | 3754 | |
5714 | - /* Free the "object_idx" array */ | |
5715 | 3755 | C_KILL(object_idx, max_k_idx, KIND_OBJECT_IDX); |
5716 | 3756 | } |
5717 | 3757 |
@@ -5725,31 +3765,21 @@ static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_ | ||
5725 | 3765 | int lit_col[F_LIT_MAX], i; |
5726 | 3766 | int f_idx_col = use_bigtile ? 62 : 64; |
5727 | 3767 | |
5728 | - /* Correct columns 1 and 4 */ | |
5729 | 3768 | lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71; |
5730 | 3769 | for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++) |
5731 | 3770 | lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0); |
5732 | 3771 | |
5733 | - /* Display lines until done */ | |
5734 | 3772 | for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++) |
5735 | 3773 | { |
5736 | 3774 | TERM_COLOR attr; |
5737 | 3775 | FEAT_IDX f_idx = feat_idx[feat_top + i]; |
5738 | 3776 | feature_type *f_ptr = &f_info[f_idx]; |
5739 | 3777 | int row_i = row + i; |
5740 | - | |
5741 | - /* Choose a color */ | |
5742 | 3778 | attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE); |
5743 | - | |
5744 | - /* Display the name */ | |
5745 | 3779 | c_prt(attr, f_name + f_ptr->name, row_i, col); |
5746 | - | |
5747 | - /* Hack -- visual_list mode */ | |
5748 | 3780 | if (per_page == 1) |
5749 | 3781 | { |
5750 | - /* Display lighting level */ | |
5751 | 3782 | c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name)); |
5752 | - | |
5753 | 3783 | c_prt(attr, format("%02x/%02x", f_ptr->x_attr[lighting_level], f_ptr->x_char[lighting_level]), row_i, f_idx_col - ((current_world_ptr->wizard || visual_only) ? 6 : 2)); |
5754 | 3784 | } |
5755 | 3785 | if (current_world_ptr->wizard || visual_only) |
@@ -5757,24 +3787,20 @@ static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_ | ||
5757 | 3787 | c_prt(attr, format("%d", f_idx), row_i, f_idx_col); |
5758 | 3788 | } |
5759 | 3789 | |
5760 | - /* Display symbol */ | |
5761 | 3790 | Term_queue_bigchar(lit_col[F_LIT_STANDARD], row_i, f_ptr->x_attr[F_LIT_STANDARD], f_ptr->x_char[F_LIT_STANDARD], 0, 0); |
5762 | - | |
5763 | 3791 | Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '('); |
5764 | 3792 | for (int j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++) |
5765 | 3793 | { |
5766 | 3794 | Term_putch(lit_col[j], row_i, TERM_SLATE, '/'); |
5767 | 3795 | } |
5768 | - Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')'); | |
5769 | 3796 | |
5770 | - /* Mega-hack -- Use non-standard colour */ | |
3797 | + Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')'); | |
5771 | 3798 | for (int j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++) |
5772 | 3799 | { |
5773 | 3800 | Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0); |
5774 | 3801 | } |
5775 | 3802 | } |
5776 | 3803 | |
5777 | - /* Clear remaining lines */ | |
5778 | 3804 | for (; i < per_page; i++) |
5779 | 3805 | { |
5780 | 3806 | Term_erase(col, row + i, 255); |
@@ -5795,7 +3821,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5795 | 3821 | TERM_LEN wid, hgt; |
5796 | 3822 | Term_get_size(&wid, &hgt); |
5797 | 3823 | |
5798 | - /* Allocate the "feat_idx" array */ | |
5799 | 3824 | FEAT_IDX *feat_idx; |
5800 | 3825 | C_MAKE(feat_idx, max_f_idx, FEAT_IDX); |
5801 | 3826 |
@@ -5810,19 +3835,13 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5810 | 3835 | TERM_LEN browser_rows = hgt - 8; |
5811 | 3836 | if (direct_f_idx < 0) |
5812 | 3837 | { |
5813 | - /* Check every group */ | |
5814 | 3838 | for (FEAT_IDX i = 0; feature_group_text[i] != NULL; i++) |
5815 | 3839 | { |
5816 | - /* Measure the label */ | |
5817 | 3840 | len = strlen(feature_group_text[i]); |
5818 | - | |
5819 | - /* Save the maximum length */ | |
5820 | 3841 | if (len > max) max = len; |
5821 | 3842 | |
5822 | - /* See if any features are known */ | |
5823 | 3843 | if (collect_features(feat_idx, 0x01)) |
5824 | 3844 | { |
5825 | - /* Build a list of groups with known features */ | |
5826 | 3845 | grp_idx[grp_cnt++] = i; |
5827 | 3846 | } |
5828 | 3847 | } |
@@ -5835,8 +3854,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5835 | 3854 | |
5836 | 3855 | feat_idx[0] = direct_f_idx; |
5837 | 3856 | feat_cnt = 1; |
5838 | - | |
5839 | - /* Terminate the list */ | |
5840 | 3857 | feat_idx[1] = -1; |
5841 | 3858 | |
5842 | 3859 | (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3), |
@@ -5849,7 +3866,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5849 | 3866 | } |
5850 | 3867 | } |
5851 | 3868 | |
5852 | - /* Terminate the list */ | |
5853 | 3869 | grp_idx[grp_cnt] = -1; |
5854 | 3870 | |
5855 | 3871 | FEAT_IDX old_grp_cur = -1; |
@@ -5903,22 +3919,16 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5903 | 3919 | |
5904 | 3920 | if (direct_f_idx < 0) |
5905 | 3921 | { |
5906 | - /* Scroll group list */ | |
5907 | 3922 | if (grp_cur < grp_top) grp_top = grp_cur; |
5908 | 3923 | if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1; |
5909 | 3924 | |
5910 | - /* Display a list of feature groups */ | |
5911 | 3925 | display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top); |
5912 | - | |
5913 | 3926 | if (old_grp_cur != grp_cur) |
5914 | 3927 | { |
5915 | 3928 | old_grp_cur = grp_cur; |
5916 | - | |
5917 | - /* Get a list of features in the current group */ | |
5918 | 3929 | feat_cnt = collect_features(feat_idx, 0x00); |
5919 | 3930 | } |
5920 | 3931 | |
5921 | - /* Scroll feature list */ | |
5922 | 3932 | while (feat_cur < feat_top) |
5923 | 3933 | feat_top = MAX(0, feat_top - browser_rows / 2); |
5924 | 3934 | while (feat_cur >= feat_top + browser_rows) |
@@ -5927,27 +3937,20 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5927 | 3937 | |
5928 | 3938 | if (!visual_list) |
5929 | 3939 | { |
5930 | - /* Display a list of features in the current group */ | |
5931 | 3940 | display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD); |
5932 | 3941 | } |
5933 | 3942 | else |
5934 | 3943 | { |
5935 | 3944 | feat_top = feat_cur; |
5936 | - | |
5937 | - /* Display a list of features in the current group */ | |
5938 | 3945 | display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level); |
5939 | - | |
5940 | - /* Display visual list below first object */ | |
5941 | 3946 | display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left); |
5942 | 3947 | } |
5943 | 3948 | |
5944 | - /* Prompt */ | |
5945 | 3949 | prt(format(_("<方向>%s, 'd'で標準光源効果%s, ESC", "<dir>%s, 'd' for default lighting%s, ESC"), |
5946 | 3950 | visual_list ? _(", ENTERで決定, 'a'で対象明度変更", ", ENTER to accept, 'a' for lighting level") : _(", 'v'でシンボル変更", ", 'v' for visuals"), |
5947 | 3951 | (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")), |
5948 | 3952 | hgt - 1, 0); |
5949 | 3953 | |
5950 | - /* Get the current feature */ | |
5951 | 3954 | f_ptr = &f_info[feat_idx[feat_cur]]; |
5952 | 3955 | cur_attr_ptr = &f_ptr->x_attr[*lighting_level]; |
5953 | 3956 | cur_char_ptr = &f_ptr->x_char[*lighting_level]; |
@@ -5966,7 +3969,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5966 | 3969 | } |
5967 | 3970 | |
5968 | 3971 | ch = inkey(); |
5969 | - | |
5970 | 3972 | if (visual_list && ((ch == 'A') || (ch == 'a'))) |
5971 | 3973 | { |
5972 | 3974 | int prev_lighting_level = *lighting_level; |
@@ -5990,7 +3992,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
5990 | 3992 | |
5991 | 3993 | continue; |
5992 | 3994 | } |
5993 | - | |
5994 | 3995 | else if ((ch == 'D') || (ch == 'd')) |
5995 | 3996 | { |
5996 | 3997 | TERM_COLOR prev_x_attr = f_ptr->x_attr[*lighting_level]; |
@@ -6010,13 +4011,10 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
6010 | 4011 | |
6011 | 4012 | continue; |
6012 | 4013 | } |
6013 | - | |
6014 | - /* Do visual mode command if needed */ | |
6015 | 4014 | else if (visual_mode_command(ch, &visual_list, browser_rows - 1, wid - (max + 3), &attr_top, &char_left, cur_attr_ptr, cur_char_ptr, need_redraw)) |
6016 | 4015 | { |
6017 | 4016 | switch (ch) |
6018 | 4017 | { |
6019 | - /* Restore previous visual settings */ | |
6020 | 4018 | case ESCAPE: |
6021 | 4019 | for (FEAT_IDX i = 0; i < F_LIT_MAX; i++) |
6022 | 4020 | { |
@@ -6025,14 +4023,11 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
6025 | 4023 | } |
6026 | 4024 | |
6027 | 4025 | /* Fall through */ |
6028 | - | |
6029 | 4026 | case '\n': |
6030 | 4027 | case '\r': |
6031 | 4028 | if (direct_f_idx >= 0) flag = TRUE; |
6032 | 4029 | else *lighting_level = F_LIT_STANDARD; |
6033 | 4030 | break; |
6034 | - | |
6035 | - /* Preserve current visual settings */ | |
6036 | 4031 | case 'V': |
6037 | 4032 | case 'v': |
6038 | 4033 | for (FEAT_IDX i = 0; i < F_LIT_MAX; i++) |
@@ -6059,7 +4054,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
6059 | 4054 | case 'p': |
6060 | 4055 | if (!visual_list) |
6061 | 4056 | { |
6062 | - /* Allow TERM_DARK text */ | |
6063 | 4057 | for (FEAT_IDX i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++) |
6064 | 4058 | { |
6065 | 4059 | if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i]; |
@@ -6081,14 +4075,12 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
6081 | 4075 | |
6082 | 4076 | default: |
6083 | 4077 | { |
6084 | - /* Move the cursor */ | |
6085 | 4078 | browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt); |
6086 | 4079 | break; |
6087 | 4080 | } |
6088 | 4081 | } |
6089 | 4082 | } |
6090 | 4083 | |
6091 | - /* Free the "feat_idx" array */ | |
6092 | 4084 | C_KILL(feat_idx, max_f_idx, FEAT_IDX); |
6093 | 4085 | } |
6094 | 4086 |
@@ -6100,7 +4092,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d | ||
6100 | 4092 | */ |
6101 | 4093 | static void do_cmd_knowledge_bounty(player_type *creature_ptr) |
6102 | 4094 | { |
6103 | - /* Open a new file */ | |
6104 | 4095 | FILE *fff; |
6105 | 4096 | GAME_TEXT file_name[1024]; |
6106 | 4097 | fff = my_fopen_temp(file_name, 1024); |
@@ -6133,8 +4124,6 @@ static void do_cmd_knowledge_bounty(player_type *creature_ptr) | ||
6133 | 4124 | } |
6134 | 4125 | |
6135 | 4126 | my_fclose(fff); |
6136 | - | |
6137 | - /* Display the file contents */ | |
6138 | 4127 | (void)show_file(creature_ptr, TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0); |
6139 | 4128 | fd_kill(file_name); |
6140 | 4129 | } |
@@ -6144,7 +4133,6 @@ static void do_cmd_knowledge_bounty(player_type *creature_ptr) | ||
6144 | 4133 | */ |
6145 | 4134 | static void do_cmd_knowledge_virtues(player_type *creature_ptr) |
6146 | 4135 | { |
6147 | - /* Open a new file */ | |
6148 | 4136 | FILE *fff; |
6149 | 4137 | GAME_TEXT file_name[1024]; |
6150 | 4138 | fff = my_fopen_temp(file_name, 1024); |
@@ -6158,8 +4146,6 @@ static void do_cmd_knowledge_virtues(player_type *creature_ptr) | ||
6158 | 4146 | fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), your_alignment(creature_ptr)); |
6159 | 4147 | dump_virtues(creature_ptr, fff); |
6160 | 4148 | my_fclose(fff); |
6161 | - | |
6162 | - /* Display the file contents */ | |
6163 | 4149 | (void)show_file(creature_ptr, TRUE, file_name, _("八つの徳", "Virtues"), 0, 0); |
6164 | 4150 | fd_kill(file_name); |
6165 | 4151 | } |
@@ -6169,7 +4155,6 @@ static void do_cmd_knowledge_virtues(player_type *creature_ptr) | ||
6169 | 4155 | */ |
6170 | 4156 | static void do_cmd_knowledge_dungeon(player_type *creature_ptr) |
6171 | 4157 | { |
6172 | - /* Open a new file */ | |
6173 | 4158 | FILE *fff; |
6174 | 4159 | GAME_TEXT file_name[1024]; |
6175 | 4160 | fff = my_fopen_temp(file_name, 1024); |
@@ -6196,8 +4181,6 @@ static void do_cmd_knowledge_dungeon(player_type *creature_ptr) | ||
6196 | 4181 | } |
6197 | 4182 | |
6198 | 4183 | my_fclose(fff); |
6199 | - | |
6200 | - /* Display the file contents */ | |
6201 | 4184 | (void)show_file(creature_ptr, TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0); |
6202 | 4185 | fd_kill(file_name); |
6203 | 4186 | } |
@@ -6209,7 +4192,6 @@ static void do_cmd_knowledge_dungeon(player_type *creature_ptr) | ||
6209 | 4192 | */ |
6210 | 4193 | static void do_cmd_knowledge_stat(player_type *creature_ptr) |
6211 | 4194 | { |
6212 | - /* Open a new file */ | |
6213 | 4195 | FILE *fff; |
6214 | 4196 | GAME_TEXT file_name[1024]; |
6215 | 4197 | fff = my_fopen_temp(file_name, 1024); |
@@ -6237,8 +4219,6 @@ static void do_cmd_knowledge_stat(player_type *creature_ptr) | ||
6237 | 4219 | |
6238 | 4220 | dump_yourself(creature_ptr, fff); |
6239 | 4221 | my_fclose(fff); |
6240 | - | |
6241 | - /* Display the file contents */ | |
6242 | 4222 | (void)show_file(creature_ptr, TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0); |
6243 | 4223 | fd_kill(file_name); |
6244 | 4224 | } |
@@ -6269,28 +4249,18 @@ static void do_cmd_knowledge_quests_current(player_type *creature_ptr, FILE *fff | ||
6269 | 4249 | if (!is_print) |
6270 | 4250 | continue; |
6271 | 4251 | |
6272 | - /* Set the quest number temporary */ | |
6273 | 4252 | QUEST_IDX old_quest = creature_ptr->current_floor_ptr->inside_quest; |
4253 | + for (int j = 0; j < 10; j++) | |
4254 | + quest_text[j][0] = '\0'; | |
6274 | 4255 | |
6275 | - /* Clear the text */ | |
6276 | - for (int j = 0; j < 10; j++) quest_text[j][0] = '\0'; | |
6277 | 4256 | quest_text_line = 0; |
6278 | - | |
6279 | 4257 | creature_ptr->current_floor_ptr->inside_quest = i; |
6280 | - | |
6281 | - /* Get the quest text */ | |
6282 | 4258 | init_flags = INIT_SHOW_TEXT; |
6283 | - | |
6284 | 4259 | process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0); |
6285 | - | |
6286 | - /* Reset the old quest number */ | |
6287 | 4260 | creature_ptr->current_floor_ptr->inside_quest = old_quest; |
6288 | - | |
6289 | - /* No info from "silent" quests */ | |
6290 | 4261 | if (quest[i].flags & QUEST_FLAG_SILENT) continue; |
6291 | 4262 | |
6292 | 4263 | total++; |
6293 | - | |
6294 | 4264 | if (quest[i].type != QUEST_TYPE_RANDOM) |
6295 | 4265 | { |
6296 | 4266 | char note[80] = "\0"; |
@@ -6353,12 +4323,9 @@ static void do_cmd_knowledge_quests_current(player_type *creature_ptr, FILE *fff | ||
6353 | 4323 | } |
6354 | 4324 | } |
6355 | 4325 | |
6356 | - /* Print the quest info */ | |
6357 | 4326 | sprintf(tmp_str, _(" %s (危険度:%d階相当)%s\n", " %s (Danger level: %d)%s\n"), |
6358 | 4327 | quest[i].name, (int)quest[i].level, note); |
6359 | - | |
6360 | 4328 | fputs(tmp_str, fff); |
6361 | - | |
6362 | 4329 | if (quest[i].status == QUEST_STATUS_COMPLETED) |
6363 | 4330 | { |
6364 | 4331 | sprintf(tmp_str, _(" クエスト達成 - まだ報酬を受けとってない。\n", " Quest Completed - Unrewarded\n")); |
@@ -6376,19 +4343,14 @@ static void do_cmd_knowledge_quests_current(player_type *creature_ptr, FILE *fff | ||
6376 | 4343 | continue; |
6377 | 4344 | } |
6378 | 4345 | |
6379 | - /* QUEST_TYPE_RANDOM */ | |
6380 | 4346 | if (quest[i].level >= rand_level) |
6381 | 4347 | continue; |
6382 | 4348 | |
6383 | - /* New random */ | |
6384 | 4349 | rand_level = quest[i].level; |
6385 | - | |
6386 | 4350 | if (max_dlv[DUNGEON_ANGBAND] < rand_level) continue; |
6387 | 4351 | |
6388 | - /* Print the quest info */ | |
6389 | 4352 | r_ptr = &r_info[quest[i].r_idx]; |
6390 | 4353 | strcpy(name, r_name + r_ptr->name); |
6391 | - | |
6392 | 4354 | if (quest[i].max_num <= 1) |
6393 | 4355 | { |
6394 | 4356 | sprintf(rand_tmp_str, _(" %s (%d 階) - %sを倒す。\n", " %s (Dungeon level: %d)\n Kill %s.\n"), |
@@ -6409,7 +4371,6 @@ static void do_cmd_knowledge_quests_current(player_type *creature_ptr, FILE *fff | ||
6409 | 4371 | #endif |
6410 | 4372 | } |
6411 | 4373 | |
6412 | - /* Print the current random quest */ | |
6413 | 4374 | if (rand_tmp_str[0]) fputs(rand_tmp_str, fff); |
6414 | 4375 | |
6415 | 4376 | if (!total) fprintf(fff, _(" なし\n", " Nothing.\n")); |
@@ -6425,20 +4386,11 @@ static bool do_cmd_knowledge_quests_aux(player_type *player_ptr, FILE *fff, IDX | ||
6425 | 4386 | floor_type *floor_ptr = player_ptr->current_floor_ptr; |
6426 | 4387 | if (is_fixed_quest_idx(q_idx)) |
6427 | 4388 | { |
6428 | - /* Set the quest number temporary */ | |
6429 | 4389 | IDX old_quest = floor_ptr->inside_quest; |
6430 | - | |
6431 | 4390 | floor_ptr->inside_quest = q_idx; |
6432 | - | |
6433 | - /* Get the quest */ | |
6434 | 4391 | init_flags = INIT_NAME_ONLY; |
6435 | - | |
6436 | 4392 | process_dungeon_file(player_ptr, "q_info.txt", 0, 0, 0, 0); |
6437 | - | |
6438 | - /* Reset the old quest number */ | |
6439 | 4393 | floor_ptr->inside_quest = old_quest; |
6440 | - | |
6441 | - /* No info from "silent" quests */ | |
6442 | 4394 | if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE; |
6443 | 4395 | } |
6444 | 4396 |
@@ -6447,7 +4399,6 @@ static bool do_cmd_knowledge_quests_aux(player_type *player_ptr, FILE *fff, IDX | ||
6447 | 4399 | |
6448 | 4400 | if (is_fixed_quest_idx(q_idx) || (q_ptr->r_idx == 0)) |
6449 | 4401 | { |
6450 | - /* Print the quest info */ | |
6451 | 4402 | sprintf(tmp_str, |
6452 | 4403 | _(" %-35s (危険度:%3d階相当) - レベル%2d - %s\n", |
6453 | 4404 | " %-35s (Danger level: %3d) - level %2d - %s\n"), |
@@ -6456,7 +4407,6 @@ static bool do_cmd_knowledge_quests_aux(player_type *player_ptr, FILE *fff, IDX | ||
6456 | 4407 | return TRUE; |
6457 | 4408 | } |
6458 | 4409 | |
6459 | - /* Print the quest info */ | |
6460 | 4410 | if (q_ptr->complev == 0) |
6461 | 4411 | { |
6462 | 4412 | sprintf(tmp_str, |
@@ -6543,14 +4493,11 @@ static void do_cmd_knowledge_quests_wiz_random(FILE *fff) | ||
6543 | 4493 | QUEST_IDX total = 0; |
6544 | 4494 | for (QUEST_IDX i = 1; i < max_q_idx; i++) |
6545 | 4495 | { |
6546 | - /* No info from "silent" quests */ | |
6547 | 4496 | if (quest[i].flags & QUEST_FLAG_SILENT) continue; |
6548 | 4497 | |
6549 | 4498 | if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN)) |
6550 | 4499 | { |
6551 | 4500 | total++; |
6552 | - | |
6553 | - /* Print the quest info */ | |
6554 | 4501 | sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"), |
6555 | 4502 | quest[i].name, (int)quest[i].level, r_name + r_info[quest[i].r_idx].name); |
6556 | 4503 | fputs(tmp_str, fff); |
@@ -6567,7 +4514,6 @@ static void do_cmd_knowledge_quests_wiz_random(FILE *fff) | ||
6567 | 4514 | */ |
6568 | 4515 | static void do_cmd_knowledge_quests(player_type *creature_ptr) |
6569 | 4516 | { |
6570 | - /* Open a new file */ | |
6571 | 4517 | FILE *fff; |
6572 | 4518 | GAME_TEXT file_name[1024]; |
6573 | 4519 | fff = my_fopen_temp(file_name, 1024); |
@@ -6578,16 +4524,15 @@ static void do_cmd_knowledge_quests(player_type *creature_ptr) | ||
6578 | 4524 | return; |
6579 | 4525 | } |
6580 | 4526 | |
6581 | - /* Allocate Memory */ | |
6582 | 4527 | IDX *quest_num; |
6583 | 4528 | C_MAKE(quest_num, max_q_idx, QUEST_IDX); |
6584 | 4529 | |
6585 | - /* Sort by compete level */ | |
6586 | - for (IDX i = 1; i < max_q_idx; i++) quest_num[i] = i; | |
4530 | + for (IDX i = 1; i < max_q_idx; i++) | |
4531 | + quest_num[i] = i; | |
4532 | + | |
6587 | 4533 | int dummy; |
6588 | 4534 | ang_sort(quest_num, &dummy, max_q_idx, ang_sort_comp_quest_num, ang_sort_swap_quest_num); |
6589 | 4535 | |
6590 | - /* Dump Quest Information */ | |
6591 | 4536 | do_cmd_knowledge_quests_current(creature_ptr, fff); |
6592 | 4537 | fputc('\n', fff); |
6593 | 4538 | do_cmd_knowledge_quests_completed(creature_ptr, fff, quest_num); |
@@ -6600,12 +4545,8 @@ static void do_cmd_knowledge_quests(player_type *creature_ptr) | ||
6600 | 4545 | } |
6601 | 4546 | |
6602 | 4547 | my_fclose(fff); |
6603 | - | |
6604 | - /* Display the file contents */ | |
6605 | 4548 | (void)show_file(creature_ptr, TRUE, file_name, _("クエスト達成状況", "Quest status"), 0, 0); |
6606 | 4549 | fd_kill(file_name); |
6607 | - | |
6608 | - /* Free Memory */ | |
6609 | 4550 | C_KILL(quest_num, max_q_idx, QUEST_IDX); |
6610 | 4551 | } |
6611 | 4552 |
@@ -6630,20 +4571,15 @@ static void do_cmd_knowledge_home(player_type *player_ptr) | ||
6630 | 4571 | return; |
6631 | 4572 | } |
6632 | 4573 | |
6633 | - /* Print all homes in the different towns */ | |
6634 | 4574 | store_type *st_ptr; |
6635 | 4575 | st_ptr = &town_info[1].store[STORE_HOME]; |
6636 | 4576 | |
6637 | - /* Home -- if anything there */ | |
6638 | 4577 | if (st_ptr->stock_num) |
6639 | 4578 | { |
6640 | 4579 | #ifdef JP |
6641 | 4580 | TERM_LEN x = 1; |
6642 | 4581 | #endif |
6643 | - /* Header with name of the town */ | |
6644 | 4582 | fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n")); |
6645 | - | |
6646 | - /* Dump all available items */ | |
6647 | 4583 | concptr paren = ")"; |
6648 | 4584 | GAME_TEXT o_name[MAX_NLEN]; |
6649 | 4585 | for (int i = 0; i < st_ptr->stock_num; i++) |
@@ -6672,13 +4608,10 @@ static void do_cmd_knowledge_home(player_type *player_ptr) | ||
6672 | 4608 | #endif |
6673 | 4609 | } |
6674 | 4610 | |
6675 | - /* Add an empty line */ | |
6676 | 4611 | fprintf(fff, "\n\n"); |
6677 | 4612 | } |
6678 | 4613 | |
6679 | 4614 | my_fclose(fff); |
6680 | - | |
6681 | - /* Display the file contents */ | |
6682 | 4615 | (void)show_file(player_ptr, TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0); |
6683 | 4616 | fd_kill(file_name); |
6684 | 4617 | } |
@@ -6744,7 +4677,6 @@ static void do_cmd_knowledge_autopick(player_type *creature_ptr) | ||
6744 | 4677 | |
6745 | 4678 | my_fclose(fff); |
6746 | 4679 | |
6747 | - /* Display the file contents */ | |
6748 | 4680 | (void)show_file(creature_ptr, TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0); |
6749 | 4681 | fd_kill(file_name); |
6750 | 4682 | } |
@@ -6757,21 +4689,14 @@ void do_cmd_knowledge(player_type *creature_ptr) | ||
6757 | 4689 | { |
6758 | 4690 | int i, p = 0; |
6759 | 4691 | bool need_redraw = FALSE; |
6760 | - | |
6761 | - /* File type is "TEXT" */ | |
6762 | 4692 | FILE_TYPE(FILE_TYPE_TEXT); |
6763 | 4693 | screen_save(); |
6764 | - | |
6765 | - /* Interact until done */ | |
6766 | 4694 | while (TRUE) |
6767 | 4695 | { |
6768 | 4696 | Term_clear(); |
6769 | - | |
6770 | - /* Ask for a choice */ | |
6771 | 4697 | prt(format(_("%d/2 ページ", "page %d/2"), (p + 1)), 2, 65); |
6772 | 4698 | prt(_("現在の知識を確認する", "Display current knowledge"), 3, 0); |
6773 | 4699 | |
6774 | - /* Give some choices */ | |
6775 | 4700 | #ifdef JP |
6776 | 4701 | if (p == 0) |
6777 | 4702 | { |
@@ -6825,11 +4750,9 @@ void do_cmd_knowledge(player_type *creature_ptr) | ||
6825 | 4750 | prt("(i) Display auto pick/destroy", 14, 5); |
6826 | 4751 | } |
6827 | 4752 | #endif |
6828 | - /* Prompt */ | |
6829 | 4753 | prt(_("-続く-", "-more-"), 17, 8); |
6830 | 4754 | prt(_("ESC) 抜ける", "ESC) Exit menu"), 21, 1); |
6831 | 4755 | prt(_("SPACE) 次ページ", "SPACE) Next page"), 21, 30); |
6832 | - /*prt("-) 前ページ", 21, 60);*/ | |
6833 | 4756 | prt(_("コマンド:", "Command: "), 20, 0); |
6834 | 4757 | i = inkey(); |
6835 | 4758 |
@@ -6920,11 +4843,8 @@ void do_cmd_knowledge(player_type *creature_ptr) | ||
6920 | 4843 | */ |
6921 | 4844 | void do_cmd_checkquest(player_type *creature_ptr) |
6922 | 4845 | { |
6923 | - /* File type is "TEXT" */ | |
6924 | 4846 | FILE_TYPE(FILE_TYPE_TEXT); |
6925 | 4847 | screen_save(); |
6926 | - | |
6927 | - /* Quest info */ | |
6928 | 4848 | do_cmd_knowledge_quests(creature_ptr); |
6929 | 4849 | screen_load(); |
6930 | 4850 | } |
@@ -6950,7 +4870,6 @@ void do_cmd_time(player_type *creature_ptr) | ||
6950 | 4870 | msg_format(_("%s日目, 時刻は%d:%02d %sです。", "This is day %s. The time is %d:%02d %s."), |
6951 | 4871 | day_buf, (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM"); |
6952 | 4872 | |
6953 | - /* Find the path */ | |
6954 | 4873 | char buf[1024]; |
6955 | 4874 | if (!randint0(10) || creature_ptr->image) |
6956 | 4875 | { |
@@ -6961,54 +4880,40 @@ void do_cmd_time(player_type *creature_ptr) | ||
6961 | 4880 | path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt")); |
6962 | 4881 | } |
6963 | 4882 | |
6964 | - /* Open this file */ | |
6965 | 4883 | FILE *fff; |
6966 | 4884 | fff = my_fopen(buf, "rt"); |
6967 | 4885 | |
6968 | 4886 | if (!fff) return; |
6969 | 4887 | |
6970 | - /* Find this time */ | |
6971 | 4888 | int full = hour * 100 + min; |
6972 | 4889 | int start = 9999; |
6973 | 4890 | int end = -9999; |
6974 | 4891 | int num = 0; |
6975 | 4892 | while (!my_fgets(fff, buf, sizeof(buf))) |
6976 | 4893 | { |
6977 | - /* Ignore comments */ | |
6978 | 4894 | if (!buf[0] || (buf[0] == '#')) continue; |
6979 | - | |
6980 | - /* Ignore invalid lines */ | |
6981 | 4895 | if (buf[1] != ':') continue; |
6982 | 4896 | |
6983 | - /* Process 'Start' */ | |
6984 | 4897 | if (buf[0] == 'S') |
6985 | 4898 | { |
6986 | - /* Extract the starting time */ | |
6987 | 4899 | start = atoi(buf + 2); |
6988 | - | |
6989 | - /* Assume valid for an hour */ | |
6990 | 4900 | end = start + 59; |
6991 | 4901 | continue; |
6992 | 4902 | } |
6993 | 4903 | |
6994 | - /* Process 'End' */ | |
6995 | 4904 | if (buf[0] == 'E') |
6996 | 4905 | { |
6997 | - /* Extract the ending time */ | |
6998 | 4906 | end = atoi(buf + 2); |
6999 | 4907 | continue; |
7000 | 4908 | } |
7001 | 4909 | |
7002 | - /* Ignore incorrect range */ | |
7003 | 4910 | if ((start > full) || (full > end)) continue; |
7004 | 4911 | |
7005 | - /* Process 'Description' */ | |
7006 | 4912 | if (buf[0] == 'D') |
7007 | 4913 | { |
7008 | 4914 | num++; |
7009 | - | |
7010 | - /* Apply the randomizer */ | |
7011 | 4915 | if (!randint0(num)) strcpy(desc, buf + 2); |
4916 | + | |
7012 | 4917 | continue; |
7013 | 4918 | } |
7014 | 4919 | } |
@@ -1,54 +1,9 @@ | ||
1 | 1 | #pragma once |
2 | 2 | |
3 | -#define DIARY_DIALY 0 | |
4 | -#define DIARY_DESCRIPTION 1 | |
5 | -#define DIARY_ART 2 | |
6 | -#define DIARY_UNIQUE 3 | |
7 | -#define DIARY_FIX_QUEST_C 4 | |
8 | -#define DIARY_FIX_QUEST_F 5 | |
9 | -#define DIARY_RAND_QUEST_C 6 | |
10 | -#define DIARY_RAND_QUEST_F 7 | |
11 | -#define DIARY_MAXDEAPTH 8 | |
12 | -#define DIARY_TRUMP 9 | |
13 | -#define DIARY_STAIR 10 | |
14 | -#define DIARY_RECALL 11 | |
15 | -#define DIARY_TO_QUEST 12 | |
16 | -#define DIARY_TELEPORT_LEVEL 13 | |
17 | -#define DIARY_BUY 14 | |
18 | -#define DIARY_SELL 15 | |
19 | -#define DIARY_ARENA 16 | |
20 | -#define DIARY_FOUND 17 | |
21 | -#define DIARY_LEVELUP 18 | |
22 | -#define DIARY_GAMESTART 19 | |
23 | -#define DIARY_WIZ_TELE 20 | |
24 | -#define DIARY_NAMED_PET 21 | |
25 | -#define DIARY_PAT_TELE 22 | |
26 | -#define DIARY_ART_SCROLL 23 | |
27 | -#define DIARY_WIZARD_LOG 24 | |
28 | - | |
29 | -#define RECORD_NAMED_PET_NAME 0 | |
30 | -#define RECORD_NAMED_PET_UNNAME 1 | |
31 | -#define RECORD_NAMED_PET_DISMISS 2 | |
32 | -#define RECORD_NAMED_PET_DEATH 3 | |
33 | -#define RECORD_NAMED_PET_MOVED 4 | |
34 | -#define RECORD_NAMED_PET_LOST_SIGHT 5 | |
35 | -#define RECORD_NAMED_PET_DESTROY 6 | |
36 | -#define RECORD_NAMED_PET_EARTHQUAKE 7 | |
37 | -#define RECORD_NAMED_PET_GENOCIDE 8 | |
38 | -#define RECORD_NAMED_PET_WIZ_ZAP 9 | |
39 | -#define RECORD_NAMED_PET_TELE_LEVEL 10 | |
40 | -#define RECORD_NAMED_PET_BLAST 11 | |
41 | -#define RECORD_NAMED_PET_HEAL_LEPER 12 | |
42 | -#define RECORD_NAMED_PET_COMPACT 13 | |
43 | -#define RECORD_NAMED_PET_LOSE_PARENT 14 | |
44 | - | |
45 | - | |
46 | -/* cmd4.c */ | |
47 | 3 | #ifdef JP |
48 | 4 | #else |
49 | 5 | extern concptr get_ordinal_number_suffix(int num); |
50 | 6 | #endif |
51 | -extern errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note); | |
52 | 7 | extern void do_cmd_diary(player_type *creature_ptr); |
53 | 8 | extern void do_cmd_redraw(player_type *creature_ptr); |
54 | 9 | extern void do_cmd_player_status(player_type *creature_ptr); |
@@ -78,5 +33,3 @@ extern void do_cmd_spoilers(player_type *creature_ptr); | ||
78 | 33 | |
79 | 34 | /* wizard1.c */ |
80 | 35 | extern void spoil_random_artifact(player_type *creature_ptr, concptr fname); |
81 | - | |
82 | -extern bool write_level; |
@@ -1,7 +1,8 @@ | ||
1 | 1 | #include "angband.h" |
2 | 2 | |
3 | 3 | #include "autopick.h" |
4 | -#include "cmd-gameoption.h" | |
4 | +#include "io/write-diary.h" | |
5 | +#include "cmd/cmd-gameoption.h" | |
5 | 6 | #include "term.h" |
6 | 7 | #include "view-mainwindow.h" |
7 | 8 | #include "cmd/cmd-dump.h" |
@@ -2,7 +2,8 @@ | ||
2 | 2 | #include "core.h" |
3 | 3 | #include "util.h" |
4 | 4 | |
5 | -#include "cmd-dump.h" | |
5 | +#include "io/write-diary.h" | |
6 | +#include "cmd/cmd-dump.h" | |
6 | 7 | #include "floor.h" |
7 | 8 | #include "grid.h" |
8 | 9 | #include "melee.h" |
@@ -1,4 +1,5 @@ | ||
1 | 1 | #include "signal-handlers.h" |
2 | +#include "io/write-diary.h" | |
2 | 3 | #include "cmd/cmd-save.h" |
3 | 4 | #include "cmd/cmd-dump.h" |
4 | 5 | #include "player-move.h" |
@@ -9,9 +9,10 @@ | ||
9 | 9 | #include "angband.h" |
10 | 10 | #include "core.h" |
11 | 11 | #include "util.h" |
12 | -#include "cmd-spell.h" | |
12 | +#include "cmd/cmd-spell.h" | |
13 | 13 | |
14 | -#include "cmd-dump.h" | |
14 | +#include "io/write-diary.h" | |
15 | +#include "cmd/cmd-dump.h" | |
15 | 16 | #include "selfinfo.h" |
16 | 17 | #include "spells.h" |
17 | 18 | #include "spells-summon.h" |
@@ -0,0 +1,77 @@ | ||
1 | +/* | |
2 | + * @brief 日記のサブタイトルを表すテキストの配列群 | |
3 | + * @date 2020/03/08 | |
4 | + * @author Hourier | |
5 | + */ | |
6 | + | |
7 | +#include "angband.h" | |
8 | +#include "diary-subtitle-table.h" | |
9 | + | |
10 | +concptr subtitle[MAX_SUBTITLE] = { | |
11 | +#ifdef JP | |
12 | + "最強の肉体を求めて", | |
13 | + "人生それははかない", | |
14 | + "明日に向かって", | |
15 | + "棚からぼたもち", | |
16 | + "あとの祭り", | |
17 | + "それはいい考えだ", | |
18 | + "何とでも言え", | |
19 | + "兎にも角にも", | |
20 | + "ウソだけど", | |
21 | + "もはやこれまで", | |
22 | + "なんでこうなるの", | |
23 | + "それは無理だ", | |
24 | + "倒すべき敵はゲ○ツ", | |
25 | + "ん~?聞こえんなぁ", | |
26 | + "オレの名を言ってみろ", | |
27 | + "頭が変になっちゃった", | |
28 | + "互換しません", | |
29 | + "せっかくだから", | |
30 | + "まだまだ甘いね", | |
31 | + "むごいむごすぎる", | |
32 | + "こんなもんじゃない", | |
33 | + "だめだこりゃ", | |
34 | + "次いってみよう", | |
35 | + "ちょっとだけよ", | |
36 | + "哀しき冒険者", | |
37 | + "野望の果て", | |
38 | + "無限地獄", | |
39 | + "神に喧嘩を売る者", | |
40 | + "未知の世界へ", | |
41 | + "最高の頭脳を求めて" | |
42 | +#else | |
43 | + "Quest of The World's Toughest Body", | |
44 | + "Attack is the best form of defence.", | |
45 | + "Might is right.", | |
46 | + "An unexpected windfall", | |
47 | + "A drowning man will catch at a straw", | |
48 | + "Don't count your chickens before they are hatched.", | |
49 | + "It is no use crying over spilt milk.", | |
50 | + "Seeing is believing.", | |
51 | + "Strike the iron while it is hot.", | |
52 | + "I don't care what follows.", | |
53 | + "To dig a well to put out a house on fire.", | |
54 | + "Tomorrow is another day.", | |
55 | + "Easy come, easy go.", | |
56 | + "The more haste, the less speed.", | |
57 | + "Where there is life, there is hope.", | |
58 | + "There is no royal road to *WINNER*.", | |
59 | + "Danger past, God forgotten.", | |
60 | + "The best thing to do now is to run away.", | |
61 | + "Life is but an empty dream.", | |
62 | + "Dead men tell no tales.", | |
63 | + "A book that remains shut is but a block.", | |
64 | + "Misfortunes never come singly.", | |
65 | + "A little knowledge is a dangerous thing.", | |
66 | + "History repeats itself.", | |
67 | + "*WINNER* was not built in a day.", | |
68 | + "Ignorance is bliss.", | |
69 | + "To lose is to win?", | |
70 | + "No medicine can cure folly.", | |
71 | + "All good things come to an end.", | |
72 | + "M$ Empire strikes back.", | |
73 | + "To see is to believe", | |
74 | + "Time is money.", | |
75 | + "Quest of The World's Greatest Brain" | |
76 | +#endif | |
77 | +}; |
@@ -0,0 +1,5 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#define MAX_SUBTITLE 30 | |
4 | + | |
5 | +extern concptr subtitle[MAX_SUBTITLE]; |
@@ -0,0 +1,53 @@ | ||
1 | +/* | |
2 | + * @brief 雰囲気を表すテキストの配列群 | |
3 | + * @date 2020/03/08 | |
4 | + * @author Hourier | |
5 | + */ | |
6 | + | |
7 | +#include "angband.h" | |
8 | +#include "feeling-table.h" | |
9 | + | |
10 | +concptr do_cmd_feeling_text[MAX_FEELING_TEXT] = | |
11 | +{ | |
12 | + _("この階の雰囲気を感じとれなかった...", "Looks like any other level."), | |
13 | + _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."), | |
14 | + _("恐ろしい死の幻が目に浮かび、気絶しそうになった!", "You nearly faint as horrible visions of death fill your mind!"), | |
15 | + _("この階はとても危険なようだ。", "This level looks very dangerous."), | |
16 | + _("とても悪い予感がする...", "You have a very bad feeling..."), | |
17 | + _("悪い予感がする...", "You have a bad feeling..."), | |
18 | + _("何か緊張する。", "You feel nervous."), | |
19 | + _("少し不運な気がする...", "You feel your luck is turning..."), | |
20 | + _("この場所は好きになれない。", "You don't like the look of this place."), | |
21 | + _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."), | |
22 | + _("なんて退屈なところだ...", "What a boring place...") | |
23 | +}; | |
24 | + | |
25 | +concptr do_cmd_feeling_text_combat[MAX_FEELING_TEXT] = | |
26 | +{ | |
27 | + _("この階の雰囲気を感じとれなかった...", "Looks like any other level."), | |
28 | + _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."), | |
29 | + _("今夜もまた、誰かが命を落とす...", "You nearly faint as horrible visions of death fill your mind!"), | |
30 | + _("この階はとても危険なようだ。", "This level looks very dangerous."), | |
31 | + _("とても悪い予感がする...", "You have a very bad feeling..."), | |
32 | + _("悪い予感がする...", "You have a bad feeling..."), | |
33 | + _("何か緊張する。", "You feel nervous."), | |
34 | + _("少し不運な気がする...", "You feel your luck is turning..."), | |
35 | + _("この場所は好きになれない。", "You don't like the look of this place."), | |
36 | + _("この階はそれなりに安全なようだ。", "This level looks reasonably safe."), | |
37 | + _("なんて退屈なところだ...", "What a boring place...") | |
38 | +}; | |
39 | + | |
40 | +concptr do_cmd_feeling_text_lucky[MAX_FEELING_TEXT] = | |
41 | +{ | |
42 | + _("この階の雰囲気を感じとれなかった...", "Looks like any other level."), | |
43 | + _("この階には何か特別なものがあるような気がする。", "You feel there is something special about this level."), | |
44 | + _("この階はこの上なく素晴らしい感じがする。", "You have a superb feeling about this level."), | |
45 | + _("素晴らしい感じがする...", "You have an excellent feeling..."), | |
46 | + _("とても良い感じがする...", "You have a very good feeling..."), | |
47 | + _("良い感じがする...", "You have a good feeling..."), | |
48 | + _("ちょっと幸運な感じがする...", "You feel strangely lucky..."), | |
49 | + _("多少は運が向いてきたか...", "You feel your luck is turning..."), | |
50 | + _("見た感じ悪くはない...", "You like the look of this place..."), | |
51 | + _("全然駄目ということはないが...", "This level can't be all bad..."), | |
52 | + _("なんて退屈なところだ...", "What a boring place...") | |
53 | +}; |
@@ -0,0 +1,7 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#define MAX_FEELING_TEXT 11 | |
4 | + | |
5 | +extern concptr do_cmd_feeling_text[MAX_FEELING_TEXT]; | |
6 | +extern concptr do_cmd_feeling_text_combat[MAX_FEELING_TEXT]; | |
7 | +extern concptr do_cmd_feeling_text_lucky[MAX_FEELING_TEXT]; |
@@ -0,0 +1,201 @@ | ||
1 | +/* | |
2 | + * @brief シンボルテキストの配列群 | |
3 | + * @date 2020/03/08 | |
4 | + * @author Hourier | |
5 | + */ | |
6 | + | |
7 | +#include "angband.h" | |
8 | +#include "cmd/monster-group-table.h" | |
9 | + | |
10 | +/* | |
11 | + * todo 元々t (町人)がいなかったが、問題ないのか? | |
12 | + * Description of each monster group. | |
13 | + */ | |
14 | +concptr monster_group_text[] = | |
15 | +{ | |
16 | +#ifdef JP | |
17 | + "ユニーク", | |
18 | + "乗馬可能なモンスター", | |
19 | + "賞金首", | |
20 | + "アンバーの王族", | |
21 | + "アリ", | |
22 | + "コウモリ", | |
23 | + "ムカデ", | |
24 | + "ドラゴン", | |
25 | + "目玉", | |
26 | + "ネコ", | |
27 | + "ゴーレム", | |
28 | + "標準人間型生物", | |
29 | + "ベトベト", | |
30 | + "ゼリー", | |
31 | + "コボルド", | |
32 | + "水棲生物", | |
33 | + "モルド", | |
34 | + "ナーガ", | |
35 | + "オーク", | |
36 | + "人間", | |
37 | + "四足獣", | |
38 | + "ネズミ", | |
39 | + "スケルトン", | |
40 | + "デーモン", | |
41 | + "ボルテックス", | |
42 | + "イモムシ/大群", | |
43 | + "イーク", | |
44 | + "ゾンビ/ミイラ", | |
45 | + "天使", | |
46 | + "鳥", | |
47 | + "犬", | |
48 | + "エレメンタル", | |
49 | + "トンボ", | |
50 | + "ゴースト", | |
51 | + "雑種", | |
52 | + "昆虫", | |
53 | + "ヘビ", | |
54 | + "キラー・ビートル", | |
55 | + "リッチ", | |
56 | + "多首の爬虫類", | |
57 | + "謎の生物", | |
58 | + "オーガ", | |
59 | + "巨大人間型生物", | |
60 | + "クイルスルグ", | |
61 | + "爬虫類/両生類", | |
62 | + "蜘蛛/サソリ/ダニ", | |
63 | + "トロル", | |
64 | + "バンパイア", | |
65 | + "ワイト/レイス/等", | |
66 | + "ゾーン/ザレン/等", | |
67 | + "イエティ", | |
68 | + "ハウンド", | |
69 | + "ミミック", | |
70 | + "壁/植物/気体", | |
71 | + "おばけキノコ", | |
72 | + "球体", | |
73 | + "プレイヤー", | |
74 | +#else | |
75 | + "Uniques", | |
76 | + "Ridable monsters", | |
77 | + "Wanted monsters", | |
78 | + "Amberite", | |
79 | + "Ant", | |
80 | + "Bat", | |
81 | + "Centipede", | |
82 | + "Dragon", | |
83 | + "Floating Eye", | |
84 | + "Feline", | |
85 | + "Golem", | |
86 | + "Hobbit/Elf/Dwarf", | |
87 | + "Icky Thing", | |
88 | + "Jelly", | |
89 | + "Kobold", | |
90 | + "Aquatic monster", | |
91 | + "Mold", | |
92 | + "Naga", | |
93 | + "Orc", | |
94 | + "Person/Human", | |
95 | + "Quadruped", | |
96 | + "Rodent", | |
97 | + "Skeleton", | |
98 | + "Demon", | |
99 | + "Vortex", | |
100 | + "Worm/Worm-Mass", | |
101 | + "Yeek", | |
102 | + "Zombie/Mummy", | |
103 | + "Angel", | |
104 | + "Bird", | |
105 | + "Canine", | |
106 | + "Elemental", | |
107 | + "Dragon Fly", | |
108 | + "Ghost", | |
109 | + "Hybrid", | |
110 | + "Insect", | |
111 | + "Snake", | |
112 | + "Killer Beetle", | |
113 | + "Lich", | |
114 | + "Multi-Headed Reptile", | |
115 | + "Mystery Living", | |
116 | + "Ogre", | |
117 | + "Giant Humanoid", | |
118 | + "Quylthulg", | |
119 | + "Reptile/Amphibian", | |
120 | + "Spider/Scorpion/Tick", | |
121 | + "Troll", | |
122 | + "Vampire", | |
123 | + "Wight/Wraith/etc", | |
124 | + "Xorn/Xaren/etc", | |
125 | + "Yeti", | |
126 | + "Zephyr Hound", | |
127 | + "Mimic", | |
128 | + "Wall/Plant/Gas", | |
129 | + "Mushroom patch", | |
130 | + "Ball", | |
131 | + "Player", | |
132 | +#endif | |
133 | + NULL | |
134 | +}; | |
135 | + | |
136 | + | |
137 | +/* | |
138 | + * Symbols of monsters in each group. Note the "Uniques" group | |
139 | + * is handled differently. | |
140 | + */ | |
141 | +concptr monster_group_char[] = | |
142 | +{ | |
143 | + (char *)-1L, | |
144 | + (char *)-2L, | |
145 | + (char *)-3L, | |
146 | + (char *)-4L, | |
147 | + "a", | |
148 | + "b", | |
149 | + "c", | |
150 | + "dD", | |
151 | + "e", | |
152 | + "f", | |
153 | + "g", | |
154 | + "h", | |
155 | + "i", | |
156 | + "j", | |
157 | + "k", | |
158 | + "l", | |
159 | + "m", | |
160 | + "n", | |
161 | + "o", | |
162 | + "pt", | |
163 | + "q", | |
164 | + "r", | |
165 | + "s", | |
166 | + "uU", | |
167 | + "v", | |
168 | + "w", | |
169 | + "y", | |
170 | + "z", | |
171 | + "A", | |
172 | + "B", | |
173 | + "C", | |
174 | + "E", | |
175 | + "F", | |
176 | + "G", | |
177 | + "H", | |
178 | + "I", | |
179 | + "J", | |
180 | + "K", | |
181 | + "L", | |
182 | + "M", | |
183 | + "N", | |
184 | + "O", | |
185 | + "P", | |
186 | + "Q", | |
187 | + "R", | |
188 | + "S", | |
189 | + "T", | |
190 | + "V", | |
191 | + "W", | |
192 | + "X", | |
193 | + "Y", | |
194 | + "Z", | |
195 | + "!$&()+./=>?[\\]`{|~", | |
196 | + "#%", | |
197 | + ",", | |
198 | + "*", | |
199 | + "@", | |
200 | + NULL | |
201 | +}; |
@@ -0,0 +1,4 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +extern concptr monster_group_text[]; | |
4 | +extern concptr monster_group_char[]; |
@@ -0,0 +1,156 @@ | ||
1 | +/* | |
2 | + * @brief オブジェクト種別を表すテキストの配列群 | |
3 | + * @date 2020/03/08 | |
4 | + * @author Hourier | |
5 | + */ | |
6 | + | |
7 | +#include "angband.h" | |
8 | +#include "object-group-table.h" | |
9 | +#include "object.h" | |
10 | + | |
11 | +/* | |
12 | + * todo キャプチャー・ボールではなくモンスター・ボールでは? | |
13 | + * Description of each monster group. | |
14 | + */ | |
15 | +concptr object_group_text[MAX_OBJECT_GROUP_TEXT] = | |
16 | +{ | |
17 | +#ifdef JP | |
18 | + "キノコ", | |
19 | + "薬", | |
20 | + "油つぼ", | |
21 | + "巻物", | |
22 | + "指輪", | |
23 | + "アミュレット", | |
24 | + "笛", | |
25 | + "光源", | |
26 | + "魔法棒", | |
27 | + "杖", | |
28 | + "ロッド", | |
29 | + "カード", | |
30 | + "キャプチャー・ボール", | |
31 | + "羊皮紙", | |
32 | + "くさび", | |
33 | + "箱", | |
34 | + "人形", | |
35 | + "像", | |
36 | + "ゴミ", | |
37 | + "空のビン", | |
38 | + "骨", | |
39 | + "死体", | |
40 | + "刀剣類", | |
41 | + "鈍器", | |
42 | + "長柄武器", | |
43 | + "採掘道具", | |
44 | + "飛び道具", | |
45 | + "弾", | |
46 | + "矢", | |
47 | + "ボルト", | |
48 | + "軽装鎧", | |
49 | + "重装鎧", | |
50 | + "ドラゴン鎧", | |
51 | + "盾", | |
52 | + "クローク", | |
53 | + "籠手", | |
54 | + "ヘルメット", | |
55 | + "冠", | |
56 | + "ブーツ", | |
57 | + "魔法書", | |
58 | + "財宝", | |
59 | + "何か", | |
60 | +#else | |
61 | + "Mushrooms", | |
62 | + "Potions", | |
63 | + "Flasks", | |
64 | + "Scrolls", | |
65 | + "Rings", | |
66 | + "Amulets", | |
67 | + "Whistle", | |
68 | + "Lanterns", | |
69 | + "Wands", | |
70 | + "Staffs", | |
71 | + "Rods", | |
72 | + "Cards", | |
73 | + "Capture Balls", | |
74 | + "Parchments", | |
75 | + "Spikes", | |
76 | + "Boxs", | |
77 | + "Figurines", | |
78 | + "Statues", | |
79 | + "Junks", | |
80 | + "Bottles", | |
81 | + "Skeletons", | |
82 | + "Corpses", | |
83 | + "Swords", | |
84 | + "Blunt Weapons", | |
85 | + "Polearms", | |
86 | + "Diggers", | |
87 | + "Bows", | |
88 | + "Shots", | |
89 | + "Arrows", | |
90 | + "Bolts", | |
91 | + "Soft Armor", | |
92 | + "Hard Armor", | |
93 | + "Dragon Armor", | |
94 | + "Shields", | |
95 | + "Cloaks", | |
96 | + "Gloves", | |
97 | + "Helms", | |
98 | + "Crowns", | |
99 | + "Boots", | |
100 | + "Spellbooks", | |
101 | + "Treasure", | |
102 | + "Something", | |
103 | +#endif | |
104 | + NULL | |
105 | +}; | |
106 | + | |
107 | + | |
108 | +/* | |
109 | + * TVALs of items in each group | |
110 | + */ | |
111 | +byte object_group_tval[MAX_OBJECT_GROUP_TVAL] = | |
112 | +{ | |
113 | + TV_FOOD, | |
114 | + TV_POTION, | |
115 | + TV_FLASK, | |
116 | + TV_SCROLL, | |
117 | + TV_RING, | |
118 | + TV_AMULET, | |
119 | + TV_WHISTLE, | |
120 | + TV_LITE, | |
121 | + TV_WAND, | |
122 | + TV_STAFF, | |
123 | + TV_ROD, | |
124 | + TV_CARD, | |
125 | + TV_CAPTURE, | |
126 | + TV_PARCHMENT, | |
127 | + TV_SPIKE, | |
128 | + TV_CHEST, | |
129 | + TV_FIGURINE, | |
130 | + TV_STATUE, | |
131 | + TV_JUNK, | |
132 | + TV_BOTTLE, | |
133 | + TV_SKELETON, | |
134 | + TV_CORPSE, | |
135 | + TV_SWORD, | |
136 | + TV_HAFTED, | |
137 | + TV_POLEARM, | |
138 | + TV_DIGGING, | |
139 | + TV_BOW, | |
140 | + TV_SHOT, | |
141 | + TV_ARROW, | |
142 | + TV_BOLT, | |
143 | + TV_SOFT_ARMOR, | |
144 | + TV_HARD_ARMOR, | |
145 | + TV_DRAG_ARMOR, | |
146 | + TV_SHIELD, | |
147 | + TV_CLOAK, | |
148 | + TV_GLOVES, | |
149 | + TV_HELM, | |
150 | + TV_CROWN, | |
151 | + TV_BOOTS, | |
152 | + TV_LIFE_BOOK, | |
153 | + TV_GOLD, | |
154 | + 0, | |
155 | + 0, | |
156 | +}; |
@@ -0,0 +1,8 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#define MAX_OBJECT_GROUP_TEXT 43 | |
4 | +#define MAX_OBJECT_GROUP_TVAL 43 | |
5 | + | |
6 | +extern concptr object_group_text[MAX_OBJECT_GROUP_TEXT]; | |
7 | +extern byte object_group_tval[MAX_OBJECT_GROUP_TVAL]; | |
8 | + |
@@ -22,6 +22,7 @@ | ||
22 | 22 | |
23 | 23 | #include "birth.h" |
24 | 24 | #include "bldg.h" |
25 | +#include "io/write-diary.h" | |
25 | 26 | #include "cmd/cmd-activate.h" |
26 | 27 | #include "cmd/cmd-dump.h" |
27 | 28 | #include "cmd/cmd-eat.h" |
@@ -101,7 +101,8 @@ | ||
101 | 101 | #include "core.h" |
102 | 102 | #include "bldg.h" |
103 | 103 | |
104 | -#include "cmd-dump.h" | |
104 | +#include "io/write-diary.h" | |
105 | +#include "cmd/cmd-dump.h" | |
105 | 106 | #include "grid.h" |
106 | 107 | #include "rooms.h" |
107 | 108 | #include "dungeon.h" |
@@ -40,7 +40,8 @@ | ||
40 | 40 | #include "player-personality.h" |
41 | 41 | #include "world.h" |
42 | 42 | #include "spells.h" |
43 | -#include "cmd-dump.h" | |
43 | +#include "io/write-diary.h" | |
44 | +#include "cmd/cmd-dump.h" | |
44 | 45 | #include "save.h" |
45 | 46 | |
46 | 47 | #include "view-mainwindow.h" |
@@ -0,0 +1,385 @@ | ||
1 | +/*! | |
2 | + * @brief 日記へのメッセージ追加処理 | |
3 | + * @date 2020/03/08 | |
4 | + * @author Hourier | |
5 | + */ | |
6 | + | |
7 | +#include "io/write-diary.h" | |
8 | +#include "core.h" | |
9 | +#include "quest.h" | |
10 | +#include "files.h" | |
11 | +#include "dungeon.h" | |
12 | +#include "dungeon-file.h" | |
13 | +#include "world.h" | |
14 | + | |
15 | +// todo *抹殺* したい… | |
16 | +bool write_level; | |
17 | + | |
18 | +/*! | |
19 | + * todo files.c に移すことも検討する? | |
20 | + * @brief 日記ファイルを開く | |
21 | + * @param fff ファイルへのポインタ | |
22 | + * @param disable_diary 日記への追加を無効化する場合TRUE | |
23 | + * @return ファイルがあったらTRUE、なかったらFALSE | |
24 | + */ | |
25 | +static bool open_diary_file(FILE **fff, bool *disable_diary) | |
26 | +{ | |
27 | + GAME_TEXT file_name[MAX_NLEN]; | |
28 | + sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base); | |
29 | + char buf[1024]; | |
30 | + path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name); | |
31 | + FILE_TYPE(FILE_TYPE_TEXT); | |
32 | + *fff = my_fopen(buf, "a"); | |
33 | + if (*fff) return TRUE; | |
34 | + | |
35 | + msg_format(_("%s を開くことができませんでした。プレイ記録を一時停止します。", "Failed to open %s. Play-Record is disabled temporarily."), buf); | |
36 | + msg_format(NULL); | |
37 | + *disable_diary = TRUE; | |
38 | + return FALSE; | |
39 | +} | |
40 | + | |
41 | + | |
42 | +/*! | |
43 | + * @brief フロア情報を日記に追加する | |
44 | + * @param creature_ptr プレーヤーへの参照ポインタ | |
45 | + * @return クエストID | |
46 | + */ | |
47 | +static QUEST_IDX write_floor(player_type *creature_ptr, concptr *note_level) | |
48 | +{ | |
49 | + floor_type *floor_ptr = creature_ptr->current_floor_ptr; | |
50 | + QUEST_IDX q_idx = quest_number(creature_ptr, floor_ptr->dun_level); | |
51 | + if (!write_level) return q_idx; | |
52 | + | |
53 | + if (floor_ptr->inside_arena) | |
54 | + *note_level = _("アリーナ:", "Arane:"); | |
55 | + else if (!floor_ptr->dun_level) | |
56 | + *note_level = _("地上:", "Surface:"); | |
57 | + else if (q_idx && (is_fixed_quest_idx(q_idx) && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT)))) | |
58 | + *note_level = _("クエスト:", "Quest:"); | |
59 | + else | |
60 | + { | |
61 | + char note_level_buf[40]; | |
62 | +#ifdef JP | |
63 | + sprintf(note_level_buf, "%d階(%s):", (int)floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name); | |
64 | +#else | |
65 | + sprintf(note_level_buf, "%s L%d:", d_name + d_info[creature_ptr->dungeon_idx].name, (int)floor_ptr->dun_level); | |
66 | +#endif | |
67 | + *note_level = note_level_buf; | |
68 | + } | |
69 | + | |
70 | + return q_idx; | |
71 | +} | |
72 | + | |
73 | + | |
74 | +/*! | |
75 | + * @brief ペットに関する日記を追加する | |
76 | + * @param fff 日記ファイル | |
77 | + * @param num 日記へ追加する内容番号 | |
78 | + * @param note 日記内容のIDに応じた文字列参照ポインタ | |
79 | + * @return なし | |
80 | + */ | |
81 | +static void write_diary_pet(FILE *fff, int num, concptr note) | |
82 | +{ | |
83 | + switch (num) | |
84 | + { | |
85 | + case RECORD_NAMED_PET_NAME: | |
86 | + fprintf(fff, _("%sを旅の友にすることに決めた。\n", "decided to travel together with %s.\n"), note); | |
87 | + break; | |
88 | + case RECORD_NAMED_PET_UNNAME: | |
89 | + fprintf(fff, _("%sの名前を消した。\n", "unnamed %s.\n"), note); | |
90 | + break; | |
91 | + case RECORD_NAMED_PET_DISMISS: | |
92 | + fprintf(fff, _("%sを解放した。\n", "dismissed %s.\n"), note); | |
93 | + break; | |
94 | + case RECORD_NAMED_PET_DEATH: | |
95 | + fprintf(fff, _("%sが死んでしまった。\n", "%s died.\n"), note); | |
96 | + break; | |
97 | + case RECORD_NAMED_PET_MOVED: | |
98 | + fprintf(fff, _("%sをおいて別のマップへ移動した。\n", "moved to another map leaving %s behind.\n"), note); | |
99 | + break; | |
100 | + case RECORD_NAMED_PET_LOST_SIGHT: | |
101 | + fprintf(fff, _("%sとはぐれてしまった。\n", "lost sight of %s.\n"), note); | |
102 | + break; | |
103 | + case RECORD_NAMED_PET_DESTROY: | |
104 | + fprintf(fff, _("%sが*破壊*によって消え去った。\n", "%s was killed by *destruction*.\n"), note); | |
105 | + break; | |
106 | + case RECORD_NAMED_PET_EARTHQUAKE: | |
107 | + fprintf(fff, _("%sが岩石に押し潰された。\n", "%s was crushed by falling rocks.\n"), note); | |
108 | + break; | |
109 | + case RECORD_NAMED_PET_GENOCIDE: | |
110 | + fprintf(fff, _("%sが抹殺によって消え去った。\n", "%s was a victim of genocide.\n"), note); | |
111 | + break; | |
112 | + case RECORD_NAMED_PET_WIZ_ZAP: | |
113 | + fprintf(fff, _("%sがデバッグコマンドによって消え去った。\n", "%s was removed by debug command.\n"), note); | |
114 | + break; | |
115 | + case RECORD_NAMED_PET_TELE_LEVEL: | |
116 | + fprintf(fff, _("%sがテレポート・レベルによって消え去った。\n", "%s was lost after teleporting a level.\n"), note); | |
117 | + break; | |
118 | + case RECORD_NAMED_PET_BLAST: | |
119 | + fprintf(fff, _("%sを爆破した。\n", "blasted %s.\n"), note); | |
120 | + break; | |
121 | + case RECORD_NAMED_PET_HEAL_LEPER: | |
122 | + fprintf(fff, _("%sの病気が治り旅から外れた。\n", "%s was healed and left.\n"), note); | |
123 | + break; | |
124 | + case RECORD_NAMED_PET_COMPACT: | |
125 | + fprintf(fff, _("%sがモンスター情報圧縮によって消え去った。\n", "%s was lost when the monster list was pruned.\n"), note); | |
126 | + break; | |
127 | + case RECORD_NAMED_PET_LOSE_PARENT: | |
128 | + fprintf(fff, _("%sの召喚者が既にいないため消え去った。\n", "%s disappeared because its summoner left.\n"), note); | |
129 | + break; | |
130 | + default: | |
131 | + fprintf(fff, "\n"); | |
132 | + break; | |
133 | + } | |
134 | +} | |
135 | + | |
136 | + | |
137 | +/*! | |
138 | + * @brief 日記にメッセージを追加する / | |
139 | + * Take note to the diary. | |
140 | + * @param type 日記内容のID | |
141 | + * @param num 日記内容のIDに応じた数値 | |
142 | + * @param note 日記内容のIDに応じた文字列参照ポインタ | |
143 | + * @return エラーコード | |
144 | + */ | |
145 | +errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note) | |
146 | +{ | |
147 | + static bool disable_diary = FALSE; | |
148 | + | |
149 | + int day, hour, min; | |
150 | + extract_day_hour_min(creature_ptr, &day, &hour, &min); | |
151 | + | |
152 | + if (disable_diary) return -1; | |
153 | + | |
154 | + if (type == DIARY_FIX_QUEST_C || | |
155 | + type == DIARY_FIX_QUEST_F || | |
156 | + type == DIARY_RAND_QUEST_C || | |
157 | + type == DIARY_RAND_QUEST_F || | |
158 | + type == DIARY_TO_QUEST) | |
159 | + { | |
160 | + QUEST_IDX old_quest = creature_ptr->current_floor_ptr->inside_quest; | |
161 | + creature_ptr->current_floor_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num; | |
162 | + init_flags = INIT_NAME_ONLY; | |
163 | + process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0); | |
164 | + creature_ptr->current_floor_ptr->inside_quest = old_quest; | |
165 | + } | |
166 | + | |
167 | + FILE *fff = NULL; | |
168 | + if (!open_diary_file(&fff, &disable_diary)) return -1; | |
169 | + | |
170 | + concptr note_level = ""; | |
171 | + QUEST_IDX q_idx = write_floor(creature_ptr, ¬e_level); | |
172 | + | |
173 | + bool do_level = TRUE; | |
174 | + switch (type) | |
175 | + { | |
176 | + case DIARY_DIALY: | |
177 | + { | |
178 | + if (day < MAX_DAYS) | |
179 | + fprintf(fff, _("%d日目\n", "Day %d\n"), day); | |
180 | + else | |
181 | + fputs(_("*****日目\n", "Day *****\n"), fff); | |
182 | + | |
183 | + do_level = FALSE; | |
184 | + break; | |
185 | + } | |
186 | + case DIARY_DESCRIPTION: | |
187 | + { | |
188 | + if (num) | |
189 | + { | |
190 | + fprintf(fff, "%s\n", note); | |
191 | + do_level = FALSE; | |
192 | + } | |
193 | + else | |
194 | + fprintf(fff, " %2d:%02d %20s %s\n", hour, min, note_level, note); | |
195 | + | |
196 | + break; | |
197 | + } | |
198 | + case DIARY_ART: | |
199 | + { | |
200 | + fprintf(fff, _(" %2d:%02d %20s %sを発見した。\n", " %2d:%02d %20s discovered %s.\n"), hour, min, note_level, note); | |
201 | + break; | |
202 | + } | |
203 | + case DIARY_ART_SCROLL: | |
204 | + { | |
205 | + fprintf(fff, _(" %2d:%02d %20s 巻物によって%sを生成した。\n", " %2d:%02d %20s created %s by scroll.\n"), hour, min, note_level, note); | |
206 | + break; | |
207 | + } | |
208 | + case DIARY_UNIQUE: | |
209 | + { | |
210 | + fprintf(fff, _(" %2d:%02d %20s %sを倒した。\n", " %2d:%02d %20s defeated %s.\n"), hour, min, note_level, note); | |
211 | + break; | |
212 | + } | |
213 | + case DIARY_FIX_QUEST_C: | |
214 | + { | |
215 | + if (quest[num].flags & QUEST_FLAG_SILENT) break; | |
216 | + | |
217 | + fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n", | |
218 | + " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest[num].name); | |
219 | + break; | |
220 | + } | |
221 | + case DIARY_FIX_QUEST_F: | |
222 | + { | |
223 | + if (quest[num].flags & QUEST_FLAG_SILENT) break; | |
224 | + | |
225 | + fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n", | |
226 | + " %2d:%02d %20s run away from quest '%s'.\n"), hour, min, note_level, quest[num].name); | |
227 | + break; | |
228 | + } | |
229 | + case DIARY_RAND_QUEST_C: | |
230 | + { | |
231 | + GAME_TEXT name[MAX_NLEN]; | |
232 | + strcpy(name, r_name + r_info[quest[num].r_idx].name); | |
233 | + fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)を達成した。\n", | |
234 | + " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name); | |
235 | + break; | |
236 | + } | |
237 | + case DIARY_RAND_QUEST_F: | |
238 | + { | |
239 | + GAME_TEXT name[MAX_NLEN]; | |
240 | + strcpy(name, r_name + r_info[quest[num].r_idx].name); | |
241 | + fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)から逃げ出した。\n", | |
242 | + " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name); | |
243 | + break; | |
244 | + } | |
245 | + case DIARY_MAXDEAPTH: | |
246 | + { | |
247 | + fprintf(fff, _(" %2d:%02d %20s %sの最深階%d階に到達した。\n", | |
248 | + " %2d:%02d %20s reached level %d of %s for the first time.\n"), hour, min, note_level, | |
249 | + _(d_name + d_info[creature_ptr->dungeon_idx].name, num), | |
250 | + _(num, d_name + d_info[creature_ptr->dungeon_idx].name)); | |
251 | + break; | |
252 | + } | |
253 | + case DIARY_TRUMP: | |
254 | + { | |
255 | + fprintf(fff, _(" %2d:%02d %20s %s%sの最深階を%d階にセットした。\n", | |
256 | + " %2d:%02d %20s reset recall level of %s to %d %s.\n"), hour, min, note_level, note, | |
257 | + _(d_name + d_info[num].name, (int)max_dlv[num]), | |
258 | + _((int)max_dlv[num], d_name + d_info[num].name)); | |
259 | + break; | |
260 | + } | |
261 | + case DIARY_STAIR: | |
262 | + { | |
263 | + concptr to = q_idx && (is_fixed_quest_idx(q_idx) | |
264 | + && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))) | |
265 | + ? _("地上", "the surface") | |
266 | + : !(creature_ptr->current_floor_ptr->dun_level + num) | |
267 | + ? _("地上", "the surface") | |
268 | + : format(_("%d階", "level %d"), creature_ptr->current_floor_ptr->dun_level + num); | |
269 | + fprintf(fff, _(" %2d:%02d %20s %sへ%s。\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to)); | |
270 | + break; | |
271 | + } | |
272 | + case DIARY_RECALL: | |
273 | + { | |
274 | + if (!num) | |
275 | + fprintf(fff, _(" %2d:%02d %20s 帰還を使って%sの%d階へ下りた。\n", " %2d:%02d %20s recalled to dungeon level %d of %s.\n"), | |
276 | + hour, min, note_level, _(d_name + d_info[creature_ptr->dungeon_idx].name, (int)max_dlv[creature_ptr->dungeon_idx]), | |
277 | + _((int)max_dlv[creature_ptr->dungeon_idx], d_name + d_info[creature_ptr->dungeon_idx].name)); | |
278 | + else | |
279 | + fprintf(fff, _(" %2d:%02d %20s 帰還を使って地上へと戻った。\n", " %2d:%02d %20s recalled from dungeon to surface.\n"), hour, min, note_level); | |
280 | + | |
281 | + break; | |
282 | + } | |
283 | + case DIARY_TO_QUEST: | |
284 | + { | |
285 | + if (quest[num].flags & QUEST_FLAG_SILENT) break; | |
286 | + | |
287 | + fprintf(fff, _(" %2d:%02d %20s クエスト「%s」へと突入した。\n", " %2d:%02d %20s entered the quest '%s'.\n"), | |
288 | + hour, min, note_level, quest[num].name); | |
289 | + break; | |
290 | + } | |
291 | + case DIARY_TELEPORT_LEVEL: | |
292 | + { | |
293 | + fprintf(fff, _(" %2d:%02d %20s レベル・テレポートで脱出した。\n", " %2d:%02d %20s Got out using teleport level.\n"), | |
294 | + hour, min, note_level); | |
295 | + break; | |
296 | + } | |
297 | + case DIARY_BUY: | |
298 | + { | |
299 | + fprintf(fff, _(" %2d:%02d %20s %sを購入した。\n", " %2d:%02d %20s bought %s.\n"), hour, min, note_level, note); | |
300 | + break; | |
301 | + } | |
302 | + case DIARY_SELL: | |
303 | + { | |
304 | + fprintf(fff, _(" %2d:%02d %20s %sを売却した。\n", " %2d:%02d %20s sold %s.\n"), hour, min, note_level, note); | |
305 | + break; | |
306 | + } | |
307 | + case DIARY_ARENA: | |
308 | + { | |
309 | + if (num < 0) | |
310 | + { | |
311 | + int n = -num; | |
312 | + fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦で、%sの前に敗れ去った。\n", " %2d:%02d %20s beaten by %s in the %d%s fight.\n"), | |
313 | + hour, min, note_level, _(n, note), _("", n), _(note, get_ordinal_number_suffix(n))); | |
314 | + break; | |
315 | + } | |
316 | + | |
317 | + fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦(%s)に勝利した。\n", " %2d:%02d %20s won the %d%s fight (%s).\n"), | |
318 | + hour, min, note_level, num, _("", get_ordinal_number_suffix(num)), note); | |
319 | + | |
320 | + if (num == MAX_ARENA_MONS) | |
321 | + { | |
322 | + fprintf(fff, _(" 闘技場のすべての敵に勝利し、チャンピオンとなった。\n", | |
323 | + " won all fights to become a Champion.\n")); | |
324 | + do_level = FALSE; | |
325 | + } | |
326 | + | |
327 | + break; | |
328 | + } | |
329 | + case DIARY_FOUND: | |
330 | + { | |
331 | + fprintf(fff, _(" %2d:%02d %20s %sを識別した。\n", " %2d:%02d %20s identified %s.\n"), hour, min, note_level, note); | |
332 | + break; | |
333 | + } | |
334 | + case DIARY_WIZ_TELE: | |
335 | + { | |
336 | + concptr to = !creature_ptr->current_floor_ptr->dun_level | |
337 | + ? _("地上", "the surface") | |
338 | + : format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name); | |
339 | + fprintf(fff, _(" %2d:%02d %20s %sへとウィザード・テレポートで移動した。\n", | |
340 | + " %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to); | |
341 | + break; | |
342 | + } | |
343 | + case DIARY_PAT_TELE: | |
344 | + { | |
345 | + concptr to = !creature_ptr->current_floor_ptr->dun_level | |
346 | + ? _("地上", "the surface") | |
347 | + : format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name); | |
348 | + fprintf(fff, _(" %2d:%02d %20s %sへとパターンの力で移動した。\n", | |
349 | + " %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to); | |
350 | + break; | |
351 | + } | |
352 | + case DIARY_LEVELUP: | |
353 | + { | |
354 | + fprintf(fff, _(" %2d:%02d %20s レベルが%dに上がった。\n", " %2d:%02d %20s reached player level %d.\n"), hour, min, note_level, num); | |
355 | + break; | |
356 | + } | |
357 | + case DIARY_GAMESTART: | |
358 | + { | |
359 | + time_t ct = time((time_t*)0); | |
360 | + do_level = FALSE; | |
361 | + if (num) | |
362 | + fprintf(fff, "%s %s", note, ctime(&ct)); | |
363 | + else | |
364 | + fprintf(fff, " %2d:%02d %20s %s %s", hour, min, note_level, note, ctime(&ct)); | |
365 | + | |
366 | + break; | |
367 | + } | |
368 | + case DIARY_NAMED_PET: | |
369 | + { | |
370 | + fprintf(fff, " %2d:%02d %20s ", hour, min, note_level); | |
371 | + write_diary_pet(fff, num, note); | |
372 | + break; | |
373 | + } | |
374 | + case DIARY_WIZARD_LOG: | |
375 | + fprintf(fff, "%s\n", note); | |
376 | + break; | |
377 | + default: | |
378 | + break; | |
379 | + } | |
380 | + | |
381 | + my_fclose(fff); | |
382 | + if (do_level) write_level = FALSE; | |
383 | + | |
384 | + return 0; | |
385 | +} |
@@ -0,0 +1,49 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#include "angband.h" | |
4 | + | |
5 | +#define DIARY_DIALY 0 | |
6 | +#define DIARY_DESCRIPTION 1 | |
7 | +#define DIARY_ART 2 | |
8 | +#define DIARY_UNIQUE 3 | |
9 | +#define DIARY_FIX_QUEST_C 4 | |
10 | +#define DIARY_FIX_QUEST_F 5 | |
11 | +#define DIARY_RAND_QUEST_C 6 | |
12 | +#define DIARY_RAND_QUEST_F 7 | |
13 | +#define DIARY_MAXDEAPTH 8 | |
14 | +#define DIARY_TRUMP 9 | |
15 | +#define DIARY_STAIR 10 | |
16 | +#define DIARY_RECALL 11 | |
17 | +#define DIARY_TO_QUEST 12 | |
18 | +#define DIARY_TELEPORT_LEVEL 13 | |
19 | +#define DIARY_BUY 14 | |
20 | +#define DIARY_SELL 15 | |
21 | +#define DIARY_ARENA 16 | |
22 | +#define DIARY_FOUND 17 | |
23 | +#define DIARY_LEVELUP 18 | |
24 | +#define DIARY_GAMESTART 19 | |
25 | +#define DIARY_WIZ_TELE 20 | |
26 | +#define DIARY_NAMED_PET 21 | |
27 | +#define DIARY_PAT_TELE 22 | |
28 | +#define DIARY_ART_SCROLL 23 | |
29 | +#define DIARY_WIZARD_LOG 24 | |
30 | + | |
31 | +#define RECORD_NAMED_PET_NAME 0 | |
32 | +#define RECORD_NAMED_PET_UNNAME 1 | |
33 | +#define RECORD_NAMED_PET_DISMISS 2 | |
34 | +#define RECORD_NAMED_PET_DEATH 3 | |
35 | +#define RECORD_NAMED_PET_MOVED 4 | |
36 | +#define RECORD_NAMED_PET_LOST_SIGHT 5 | |
37 | +#define RECORD_NAMED_PET_DESTROY 6 | |
38 | +#define RECORD_NAMED_PET_EARTHQUAKE 7 | |
39 | +#define RECORD_NAMED_PET_GENOCIDE 8 | |
40 | +#define RECORD_NAMED_PET_WIZ_ZAP 9 | |
41 | +#define RECORD_NAMED_PET_TELE_LEVEL 10 | |
42 | +#define RECORD_NAMED_PET_BLAST 11 | |
43 | +#define RECORD_NAMED_PET_HEAL_LEPER 12 | |
44 | +#define RECORD_NAMED_PET_COMPACT 13 | |
45 | +#define RECORD_NAMED_PET_LOSE_PARENT 14 | |
46 | + | |
47 | +extern bool write_level; | |
48 | + | |
49 | +errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note); |
@@ -99,6 +99,7 @@ | ||
99 | 99 | #include "inet.h" |
100 | 100 | #include "chuukei.h" |
101 | 101 | |
102 | +#include "io/write-diary.h" | |
102 | 103 | #include "cmd/cmd-dump.h" |
103 | 104 | #include "cmd/cmd-save.h" |
104 | 105 | #include "view-mainwindow.h" |
@@ -22,8 +22,9 @@ | ||
22 | 22 | #include "monster/monster-update.h" |
23 | 23 | #include "monster/quantum-effect.h" |
24 | 24 | |
25 | -#include "cmd-dump.h" | |
26 | -#include "cmd-pet.h" | |
25 | +#include "io/write-diary.h" | |
26 | +#include "cmd/cmd-dump.h" | |
27 | +#include "cmd/cmd-pet.h" | |
27 | 28 | #include "creature.h" |
28 | 29 | #include "melee.h" |
29 | 30 | #include "spells-summon.h" |
@@ -3,7 +3,8 @@ | ||
3 | 3 | #include "util.h" |
4 | 4 | |
5 | 5 | #include "creature.h" |
6 | -#include "cmd-dump.h" | |
6 | +#include "io/write-diary.h" | |
7 | +#include "cmd/cmd-dump.h" | |
7 | 8 | #include "dungeon.h" |
8 | 9 | #include "floor.h" |
9 | 10 | #include "grid.h" |
@@ -14,7 +14,8 @@ | ||
14 | 14 | #include "util.h" |
15 | 15 | #include "term.h" |
16 | 16 | |
17 | -#include "cmd-dump.h" | |
17 | +#include "io/write-diary.h" | |
18 | +#include "cmd/cmd-dump.h" | |
18 | 19 | #include "bldg.h" |
19 | 20 | #include "cmd-pet.h" |
20 | 21 | #include "floor.h" |
@@ -14,7 +14,8 @@ | ||
14 | 14 | #include "util.h" |
15 | 15 | #include "core.h" |
16 | 16 | |
17 | -#include "cmd-dump.h" | |
17 | +#include "io/write-diary.h" | |
18 | +#include "cmd/cmd-dump.h" | |
18 | 19 | #include "cmd-pet.h" |
19 | 20 | #include "dungeon.h" |
20 | 21 | #include "floor.h" |
@@ -16,6 +16,7 @@ | ||
16 | 16 | #include "core/show-file.h" |
17 | 17 | #include "util.h" |
18 | 18 | |
19 | +#include "io/write-diary.h" | |
19 | 20 | #include "cmd/cmd-dump.h" |
20 | 21 | #include "mutation.h" |
21 | 22 |
@@ -18,8 +18,9 @@ | ||
18 | 18 | |
19 | 19 | #include "object.h" |
20 | 20 | |
21 | -#include "cmd-dump.h" | |
22 | -#include "cmd-spell.h" | |
21 | +#include "io/write-diary.h" | |
22 | +#include "cmd/cmd-dump.h" | |
23 | +#include "cmd/cmd-spell.h" | |
23 | 24 | #include "spells.h" |
24 | 25 | #include "dungeon.h" |
25 | 26 | #include "floor.h" |
@@ -2,7 +2,8 @@ | ||
2 | 2 | #include "angband.h" |
3 | 3 | #include "util.h" |
4 | 4 | |
5 | -#include "cmd-dump.h" | |
5 | +#include "io/write-diary.h" | |
6 | +#include "cmd/cmd-dump.h" | |
6 | 7 | #include "patron.h" |
7 | 8 | #include "cmd-pet.h" |
8 | 9 | #include "object-curse.h" |
@@ -5,7 +5,8 @@ | ||
5 | 5 | |
6 | 6 | #include "avatar.h" |
7 | 7 | #include "bldg.h" |
8 | -#include "cmd-dump.h" | |
8 | +#include "io/write-diary.h" | |
9 | +#include "cmd/cmd-dump.h" | |
9 | 10 | #include "realm-song.h" |
10 | 11 | #include "floor.h" |
11 | 12 | #include "artifact.h" |
@@ -29,13 +29,14 @@ | ||
29 | 29 | #include "patron.h" |
30 | 30 | #include "realm-hex.h" |
31 | 31 | #include "realm-song.h" |
32 | -#include "cmd-pet.h" | |
33 | -#include "cmd-spell.h" | |
32 | +#include "cmd/cmd-pet.h" | |
33 | +#include "cmd/cmd-spell.h" | |
34 | 34 | #include "dungeon.h" |
35 | 35 | #include "objectkind.h" |
36 | 36 | #include "monsterrace.h" |
37 | 37 | #include "autopick.h" |
38 | -#include "cmd-dump.h" | |
38 | +#include "io/write-diary.h" | |
39 | +#include "cmd/cmd-dump.h" | |
39 | 40 | #include "melee.h" |
40 | 41 | #include "world.h" |
41 | 42 | #include "view-mainwindow.h" |
@@ -15,7 +15,8 @@ | ||
15 | 15 | #include "artifact.h" |
16 | 16 | #include "feature.h" |
17 | 17 | #include "world.h" |
18 | -#include "cmd-dump.h" | |
18 | +#include "io/write-diary.h" | |
19 | +#include "cmd/cmd-dump.h" | |
19 | 20 | #include "english.h" |
20 | 21 | #include "view-mainwindow.h" |
21 | 22 |
@@ -27,7 +27,8 @@ | ||
27 | 27 | #include "scores.h" |
28 | 28 | #include "floor.h" |
29 | 29 | #include "world.h" |
30 | -#include "cmd-dump.h" | |
30 | +#include "io/write-diary.h" | |
31 | +#include "cmd/cmd-dump.h" | |
31 | 32 | #include "report.h" |
32 | 33 | #include "japanese.h" |
33 | 34 |
@@ -10,6 +10,7 @@ | ||
10 | 10 | #include "save.h" |
11 | 11 | #include "world.h" |
12 | 12 | #include "term.h" |
13 | +#include "io/write-diary.h" | |
13 | 14 | #include "cmd/cmd-dump.h" |
14 | 15 | #include "floor-events.h" |
15 | 16 |
@@ -10,8 +10,9 @@ | ||
10 | 10 | #include "object-flavor.h" |
11 | 11 | #include "object-hook.h" |
12 | 12 | |
13 | -#include "cmd-basic.h" | |
14 | -#include "cmd-dump.h" | |
13 | +#include "io/write-diary.h" | |
14 | +#include "cmd/cmd-basic.h" | |
15 | +#include "cmd/cmd-dump.h" | |
15 | 16 | |
16 | 17 | #include "floor-events.h" |
17 | 18 | #include "floor-save.h" |
@@ -15,8 +15,9 @@ | ||
15 | 15 | #include "core.h" |
16 | 16 | #include "util.h" |
17 | 17 | |
18 | -#include "cmd-pet.h" | |
19 | -#include "cmd-dump.h" | |
18 | +#include "io/write-diary.h" | |
19 | +#include "cmd/cmd-pet.h" | |
20 | +#include "cmd/cmd-dump.h" | |
20 | 21 | #include "floor.h" |
21 | 22 | #include "trap.h" |
22 | 23 | #include "autopick.h" |
@@ -18,8 +18,9 @@ | ||
18 | 18 | #include "creature.h" |
19 | 19 | |
20 | 20 | #include "artifact.h" |
21 | -#include "cmd-pet.h" | |
22 | -#include "cmd-dump.h" | |
21 | +#include "io/write-diary.h" | |
22 | +#include "cmd/cmd-pet.h" | |
23 | +#include "cmd/cmd-dump.h" | |
23 | 24 | #include "floor.h" |
24 | 25 | #include "grid.h" |
25 | 26 | #include "trap.h" |
@@ -42,6 +42,7 @@ | ||
42 | 42 | #include "monster-process.h" |
43 | 43 | #include "monster-status.h" |
44 | 44 | #include "monster-spell.h" |
45 | +#include "io/write-diary.h" | |
45 | 46 | #include "cmd/cmd-save.h" |
46 | 47 | #include "cmd/cmd-spell.h" |
47 | 48 | #include "cmd/cmd-dump.h" |
@@ -16,6 +16,7 @@ | ||
16 | 16 | #include "term.h" |
17 | 17 | |
18 | 18 | #include "floor.h" |
19 | +#include "io/write-diary.h" | |
19 | 20 | #include "cmd/cmd-basic.h" |
20 | 21 | #include "cmd/cmd-dump.h" |
21 | 22 | #include "cmd/cmd-help.h" |
@@ -1,6 +1,7 @@ | ||
1 | 1 | #include "angband.h" |
2 | 2 | #include "util.h" |
3 | 3 | |
4 | +#include "io/write-diary.h" | |
4 | 5 | #include "cmd/cmd-dump.h" |
5 | 6 | #include "cmd/cmd-save.h" |
6 | 7 | #include "trap.h" |
@@ -21,7 +21,8 @@ | ||
21 | 21 | #include "quest.h" |
22 | 22 | #include "floor.h" |
23 | 23 | #include "world.h" |
24 | -#include "cmd-dump.h" | |
24 | +#include "io/write-diary.h" | |
25 | +#include "cmd/cmd-dump.h" | |
25 | 26 | #include "japanese.h" |
26 | 27 | #include "player-class.h" |
27 | 28 |
@@ -15,6 +15,7 @@ | ||
15 | 15 | #include "term.h" |
16 | 16 | |
17 | 17 | #include "dungeon.h" |
18 | +#include "io/write-diary.h" | |
18 | 19 | #include "cmd/cmd-dump.h" |
19 | 20 | #include "cmd/cmd-help.h" |
20 | 21 | #include "cmd/cmd-save.h" |