• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

変愚蛮怒のメインリポジトリです


Commit MetaInfo

修訂f3edabeafea9ccd198f21e7301b54e91006fe782 (tree)
時間2020-03-14 03:50:36
作者deskull <deskull@user...>
Commiterdeskull

Log Message

Merge remote-tracking branch 'remotes/origin/For2.2.2-Fix-Hourier' into For2.2.2-Refactoring

Change Summary

差異

--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj
@@ -175,6 +175,10 @@
175175 <ClCompile Include="..\..\src\cmd\cmd-usestaff.c" />
176176 <ClCompile Include="..\..\src\cmd\cmd-zaprod.c" />
177177 <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" />
178182 <ClCompile Include="..\..\src\combat\melee1.c" />
179183 <ClCompile Include="..\..\src\combat\shoot.c" />
180184 <ClCompile Include="..\..\src\core.c" />
@@ -199,6 +203,7 @@
199203 <ClCompile Include="..\..\src\io\read-pref-file.c" />
200204 <ClCompile Include="..\..\src\io\special-class-dump.c" />
201205 <ClCompile Include="..\..\src\io\tokenizer.c" />
206+ <ClCompile Include="..\..\src\io\write-diary.c" />
202207 <ClCompile Include="..\..\src\monster-dist-offsets.c" />
203208 <ClCompile Include="..\..\src\monster-process.c" />
204209 <ClCompile Include="..\..\src\monster-status.c" />
@@ -348,6 +353,10 @@
348353 <ClInclude Include="..\..\src\cmd\cmd-usestaff.h" />
349354 <ClInclude Include="..\..\src\cmd\cmd-zaprod.h" />
350355 <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" />
351360 <ClInclude Include="..\..\src\combat\melee.h" />
352361 <ClInclude Include="..\..\src\combat\shoot.h" />
353362 <ClInclude Include="..\..\src\core\show-file.h" />
@@ -359,6 +368,7 @@
359368 <ClInclude Include="..\..\src\io\read-pref-file.h" />
360369 <ClInclude Include="..\..\src\io\special-class-dump.h" />
361370 <ClInclude Include="..\..\src\io\tokenizer.h" />
371+ <ClInclude Include="..\..\src\io\write-diary.h" />
362372 <ClInclude Include="..\..\src\monster-dist-offsets.h" />
363373 <ClInclude Include="..\..\src\monster\monster-attack.h" />
364374 <ClInclude Include="..\..\src\monster\monster-direction.h" />
--- a/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
+++ b/Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
@@ -508,6 +508,21 @@
508508 <ClCompile Include="..\..\src\monster\monster-sweep-grid.c">
509509 <Filter>monster</Filter>
510510 </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>
511526 </ItemGroup>
512527 <ItemGroup>
513528 <ClInclude Include="..\..\src\gamevalue.h" />
@@ -998,6 +1013,21 @@
9981013 <ClInclude Include="..\..\src\monster\monster-sweep-grid.h">
9991014 <Filter>monster</Filter>
10001015 </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>
10011031 </ItemGroup>
10021032 <ItemGroup>
10031033 <None Include="..\..\src\wall.bmp" />
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -131,6 +131,10 @@ hengband_SOURCES = \
131131 z-form.c z-form.h z-rand.c z-rand.h z-term.c z-term.h z-util.c z-util.h \
132132 z-virt.c z-virt.h \
133133 \
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 \
134138 cmd/cmd-activate.c cmd/cmd-activate.h cmd/cmd-basic.c cmd/cmd-basic.h \
135139 cmd/cmd-dump.c cmd/cmd-dump.h cmd/cmd-eat.c cmd/cmd-eat.h \
136140 cmd/cmd-gameoption.c cmd/cmd-gameoption.h cmd/cmd-help.c cmd/cmd-help.h \
--- a/src/birth.c
+++ b/src/birth.c
@@ -22,7 +22,8 @@
2222 #include "object-ego.h"
2323 #include "artifact.h"
2424 #include "avatar.h"
25-#include "cmd-dump.h"
25+#include "io/write-diary.h"
26+#include "cmd/cmd-dump.h"
2627 #include "dungeon.h"
2728 #include "history.h"
2829 #include "monster.h"
--- a/src/bldg.c
+++ b/src/bldg.c
@@ -18,8 +18,9 @@
1818
1919 #include "core.h"
2020 #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"
2324 #include "floor.h"
2425 #include "floor-events.h"
2526 #include "floor-save.h"
--- a/src/cmd/cmd-basic.c
+++ b/src/cmd/cmd-basic.c
@@ -14,6 +14,7 @@
1414 #include "core.h"
1515 #include "term.h"
1616
17+#include "io/write-diary.h"
1718 #include "cmd/cmd-dump.h"
1819 #include "cmd/cmd-save.h"
1920 #include "chest.h"
--- a/src/cmd/cmd-dump.c
+++ b/src/cmd/cmd-dump.c
@@ -45,6 +45,7 @@
4545 #include "core.h"
4646 #include "core/show-file.h"
4747 #include "io/read-pref-file.h"
48+#include "io/write-diary.h"
4849 #include "chuukei.h"
4950
5051 #include "autopick.h"
@@ -76,11 +77,15 @@
7677 #include "spells.h"
7778 #include "objectkind.h"
7879 #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"
7984 #include "view-mainwindow.h" // 暫定。後で消す
8085
8186 #include "english.h"
8287
83- // Mark strings for auto dump
88+// Mark strings for auto dump
8489 static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
8590 static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
8691
@@ -97,16 +102,12 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
97102 static TERM_COLOR attr_idx = 0;
98103 static SYMBOL_CODE char_idx = 0;
99104
100-/* Hack -- for feature lighting */
101105 static TERM_COLOR attr_idx_feat[F_LIT_MAX];
102106 static SYMBOL_CODE char_idx_feat[F_LIT_MAX];
103107
104108 // Encode the screen colors
105109 static char hack[17] = "dwsorgbuDWvyRGBU";
106110
107-// todo *抹殺* したい…
108-bool write_level;
109-
110111 /*!
111112 * @brief prf出力内容を消去する /
112113 * Remove old lines automatically generated before.
@@ -115,7 +116,6 @@ bool write_level;
115116 static void remove_auto_dump(concptr orig_file)
116117 {
117118 FILE *tmp_fff, *orig_fff;
118-
119119 char tmp_file[1024];
120120 char buf[1024];
121121 bool between_mark = FALSE;
@@ -124,23 +124,14 @@ static void remove_auto_dump(concptr orig_file)
124124 long header_location = 0;
125125 char header_mark_str[80];
126126 char footer_mark_str[80];
127- size_t mark_len;
128127
129- /* Prepare a header/footer mark string */
130128 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
131129 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);
136131 orig_fff = my_fopen(orig_file, "r");
137-
138- /* If original file does not exist, nothing to do */
139132 if (!orig_fff) return;
140133
141- /* Open a new (temporary) file */
142134 tmp_fff = my_fopen_temp(tmp_file, 1024);
143-
144135 if (!tmp_fff)
145136 {
146137 msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), tmp_file);
@@ -148,110 +139,62 @@ static void remove_auto_dump(concptr orig_file)
148139 return;
149140 }
150141
151- /* Loop for every line */
152142 while (TRUE)
153143 {
154- /* Read a line */
155144 if (my_fgets(orig_fff, buf, sizeof(buf)))
156145 {
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- */
167146 if (between_mark)
168147 {
169148 fseek(orig_fff, header_location, SEEK_SET);
170149 between_mark = FALSE;
171150 continue;
172151 }
173-
174- /* Success -- End the loop */
175152 else
176153 {
177154 break;
178155 }
179156 }
180157
181- /* We are looking for the header mark of automatic dump */
182158 if (!between_mark)
183159 {
184- /* Is this line a header? */
185160 if (!strcmp(buf, header_mark_str))
186161 {
187- /* Memorise seek point of this line */
188162 header_location = ftell(orig_fff);
189-
190- /* Initialize counter for number of lines */
191163 line_num = 0;
192-
193- /* Look for the footer from now */
194164 between_mark = TRUE;
195-
196- /* There are some changes */
197165 changed = TRUE;
198166 }
199-
200- /* Not a header */
201167 else
202168 {
203- /* Copy orginally lines */
204169 fprintf(tmp_fff, "%s\n", buf);
205170 }
206171
207172 continue;
208173 }
209174
210- /* todo 処理よりもコメントが邪魔でif文を反転できない*/
211- /* We are looking for the footer mark of automatic dump */
212- /* Is this line a footer? */
213175 if (!strncmp(buf, footer_mark_str, mark_len))
214176 {
215177 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- */
228178 if (!sscanf(buf + mark_len, " (%d)", &tmp)
229179 || tmp != line_num)
230180 {
231181 fseek(orig_fff, header_location, SEEK_SET);
232182 }
233183
234- /* Look for another header */
235184 between_mark = FALSE;
236185 continue;
237186 }
238187
239- /* Not a footer */
240- /* Ignore old line, and count number of lines */
241188 line_num++;
242189 }
243190
244- /* Close files */
245191 my_fclose(orig_fff);
246192 my_fclose(tmp_fff);
247193
248- /* If there are some changes, overwrite the original file with new one */
249194 if (changed)
250195 {
251- /* Copy contents of temporary file */
252196 tmp_fff = my_fopen(tmp_file, "r");
253197 orig_fff = my_fopen(orig_file, "w");
254-
255198 while (!my_fgets(tmp_fff, buf, sizeof(buf)))
256199 fprintf(orig_fff, "%s\n", buf);
257200
@@ -270,27 +213,16 @@ static void remove_auto_dump(concptr orig_file)
270213 */
271214 static void auto_dump_printf(concptr fmt, ...)
272215 {
273- concptr p;
274216 va_list vp;
275-
276217 char buf[1024];
277-
278- /* Begin the Varargs Stuff */
279218 va_start(vp, fmt);
280-
281- /* Format the args, save the length */
282219 (void)vstrnfmt(buf, sizeof(buf), fmt, vp);
283-
284- /* End the Varargs Stuff */
285220 va_end(vp);
286-
287- /* Count number of lines */
288- for (p = buf; *p; p++)
221+ for (concptr p = buf; *p; p++)
289222 {
290223 if (*p == '\n') auto_dump_line_num++;
291224 }
292225
293- /* Dump it */
294226 fprintf(auto_dump_stream, "%s", buf);
295227 }
296228
@@ -305,35 +237,19 @@ static void auto_dump_printf(concptr fmt, ...)
305237 static bool open_auto_dump(concptr buf, concptr mark)
306238 {
307239 char header_mark_str[80];
308-
309- /* Save the mark string */
310240 auto_dump_mark = mark;
311-
312- /* Prepare a header mark string */
313241 sprintf(header_mark_str, auto_dump_header, auto_dump_mark);
314-
315- /* Remove old macro dumps */
316242 remove_auto_dump(buf);
317-
318- /* Append to the file */
319243 auto_dump_stream = my_fopen(buf, "a");
320-
321- /* Failure */
322244 if (!auto_dump_stream)
323245 {
324246 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
325247 msg_print(NULL);
326-
327- /* Failed */
328248 return FALSE;
329249 }
330250
331- /* Start dumping */
332251 fprintf(auto_dump_stream, "%s\n", header_mark_str);
333-
334- /* Initialize counter */
335252 auto_dump_line_num = 0;
336-
337253 auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
338254 "# *Warning!* The lines below are an automatic dump.\n"));
339255 auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
@@ -349,17 +265,12 @@ static bool open_auto_dump(concptr buf, concptr mark)
349265 static void close_auto_dump(void)
350266 {
351267 char footer_mark_str[80];
352-
353- /* Prepare a footer mark string */
354268 sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
355-
356269 auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
357270 "# *Warning!* The lines below are an automatic dump.\n"));
358271 auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
359272 "# Don't edit them; changes will be deleted and replaced automatically.\n"));
360- /* End of dump */
361273 fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num);
362-
363274 my_fclose(auto_dump_stream);
364275 }
365276
@@ -390,367 +301,9 @@ concptr get_ordinal_number_suffix(int num)
390301
391302
392303 /*!
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 プレーヤーへの参照ポインタ
751306 * @return なし
752- * @details
753- * 日記のタイトルは本関数の subtitle ローカル変数で定義されている。
754307 */
755308 static void display_diary(player_type *creature_ptr)
756309 {
@@ -758,76 +311,6 @@ static void display_diary(player_type *creature_ptr)
758311 GAME_TEXT file_name[MAX_NLEN];
759312 char buf[1024];
760313 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
831314 sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
832315 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
833316
@@ -843,7 +326,6 @@ static void display_diary(player_type *creature_ptr)
843326 sprintf(diary_title, "Legend of %s %s '%s'", ap_ptr->title, creature_ptr->name, tmp);
844327 #endif
845328
846- /* Display the file contents */
847329 (void)show_file(creature_ptr, FALSE, buf, diary_title, -1, 0);
848330 }
849331
@@ -856,7 +338,6 @@ static void add_diary_note(player_type *creature_ptr)
856338 {
857339 char tmp[80] = "\0";
858340 char bunshou[80] = "\0";
859-
860341 if (get_string(_("内容: ", "diary note: "), tmp, 79))
861342 {
862343 strcpy(bunshou, tmp);
@@ -921,33 +402,20 @@ static void do_cmd_erase_diary(void)
921402 */
922403 void do_cmd_diary(player_type *creature_ptr)
923404 {
924- /* File type is "TEXT" */
925405 FILE_TYPE(FILE_TYPE_TEXT);
926406 screen_save();
927-
928- /* Interact until done */
929407 int i;
930408 while (TRUE)
931409 {
932410 Term_clear();
933-
934- /* Ask for a choice */
935411 prt(_("[ 記録の設定 ]", "[ Play Record ]"), 2, 0);
936-
937- /* Give some choices */
938412 prt(_("(1) 記録を見る", "(1) Display your record"), 4, 5);
939413 prt(_("(2) 文章を記録する", "(2) Add record"), 5, 5);
940414 prt(_("(3) 直前に入手又は鑑定したものを記録する", "(3) Record the last item you got or identified"), 6, 5);
941415 prt(_("(4) 記録を消去する", "(4) Delete your record"), 7, 5);
942-
943416 prt(_("(R) プレイ動画を記録する/中止する", "(R) Record playing movie / or stop it"), 9, 5);
944-
945- /* Prompt */
946417 prt(_("コマンド:", "Command: "), 18, 0);
947-
948- /* Prompt */
949418 i = inkey();
950-
951419 if (i == ESCAPE) break;
952420
953421 switch (i)
@@ -968,7 +436,7 @@ void do_cmd_diary(player_type *creature_ptr)
968436 screen_load();
969437 prepare_movie_hooks();
970438 return;
971- default: /* Unknown option */
439+ default:
972440 bell();
973441 }
974442
@@ -999,7 +467,6 @@ void do_cmd_redraw(player_type *creature_ptr)
999467 {
1000468 Term_xtra(TERM_XTRA_REACT, 0);
1001469
1002- /* Combine and Reorder the pack (later) */
1003470 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
1004471 creature_ptr->update |= (PU_TORCH);
1005472 creature_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
@@ -1014,17 +481,13 @@ void do_cmd_redraw(player_type *creature_ptr)
1014481
1015482 update_playtime();
1016483 handle_stuff(creature_ptr);
1017-
1018484 if (creature_ptr->prace == RACE_ANDROID) calc_android_exp(creature_ptr);
1019485
1020- /* Redraw every window */
1021486 term *old = Term;
1022487 for (int j = 0; j < 8; j++)
1023488 {
1024- /* Dead window */
1025489 if (!angband_term[j]) continue;
1026490
1027- /* Activate */
1028491 Term_activate(angband_term[j]);
1029492 Term_redraw();
1030493 Term_fresh();
@@ -1039,12 +502,9 @@ void do_cmd_redraw(player_type *creature_ptr)
1039502 */
1040503 void do_cmd_player_status(player_type *creature_ptr)
1041504 {
1042- char c;
1043505 int mode = 0;
1044506 char tmp[160];
1045507 screen_save();
1046-
1047- /* Forever */
1048508 while (TRUE)
1049509 {
1050510 update_playtime();
@@ -1056,24 +516,16 @@ void do_cmd_player_status(player_type *creature_ptr)
1056516 display_player(creature_ptr, mode, map_name);
1057517 }
1058518
1059- /* Prompt */
1060519 Term_putstr(2, 23, -1, TERM_WHITE,
1061520 _("['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();
1065522 if (c == ESCAPE) break;
1066523
1067- /* Change name */
1068524 if (c == 'c')
1069525 {
1070526 get_name(creature_ptr);
1071-
1072- /* Process the player name */
1073527 process_player_name(creature_ptr, FALSE);
1074528 }
1075-
1076- /* File dump */
1077529 else if (c == 'f')
1078530 {
1079531 sprintf(tmp, "%s.txt", creature_ptr->base_name);
@@ -1085,7 +537,6 @@ void do_cmd_player_status(player_type *creature_ptr)
1085537 }
1086538 }
1087539 }
1088-
1089540 else if (c == 'h')
1090541 {
1091542 mode++;
@@ -1100,7 +551,6 @@ void do_cmd_player_status(player_type *creature_ptr)
1100551
1101552 screen_load();
1102553 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
1103-
1104554 handle_stuff(creature_ptr);
1105555 }
1106556
@@ -1112,7 +562,6 @@ void do_cmd_player_status(player_type *creature_ptr)
1112562 */
1113563 void do_cmd_message_one(void)
1114564 {
1115- /* Recall one message */
1116565 prt(format("> %s", message_str(0)), 0, 0);
1117566 }
1118567
@@ -1145,107 +594,59 @@ void do_cmd_messages(int num_now)
1145594 char back_str[81];
1146595 concptr shower = NULL;
1147596 int wid, hgt;
1148- int num_lines;
1149-
1150597 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;
1156599 strcpy(finder_str, "");
1157-
1158- /* Wipe shower */
1159600 strcpy(shower_str, "");
1160-
1161- /* Total messages */
1162601 int n = message_num();
1163-
1164- /* Start on first message */
1165602 int i = 0;
1166603 screen_save();
1167604 Term_clear();
1168-
1169- /* Process requests until done */
1170605 while (TRUE)
1171606 {
1172607 int j;
1173608 int skey;
1174-
1175- /* Dump up to 20 lines of messages */
1176609 for (j = 0; (j < num_lines) && (i + j < n); j++)
1177610 {
1178611 concptr msg = message_str(i + j);
1179-
1180- /* Dump the messages, bottom to top */
1181612 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
1182-
1183613 if (!shower || !shower[0]) continue;
1184614
1185- /* Hilite "shower" */
1186615 concptr str = msg;
1187-
1188- /* Display matches */
1189616 while ((str = my_strstr(str, shower)) != NULL)
1190617 {
1191618 int len = strlen(shower);
1192-
1193- /* Display the match */
1194619 Term_putstr(str - msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
1195-
1196- /* Advance */
1197620 str += len;
1198621 }
1199622 }
1200623
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);
1203626
1204- /* Display header */
1205- /* translation */
1206627 prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"),
1207628 i, i + j - 1, n), 0, 0);
1208-
1209- /* Display prompt (not very informative) */
1210629 prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]",
1211630 "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
1212-
1213631 skey = inkey_special(TRUE);
1214-
1215- /* Exit on Escape */
1216632 if (skey == ESCAPE) break;
1217633
1218- /* Hack -- Save the old index */
1219634 j = i;
1220-
1221635 switch (skey)
1222636 {
1223- /* Hack -- handle show */
1224637 case '=':
1225- /* Prompt */
1226638 prt(_("強調: ", "Show: "), hgt - 1, 0);
1227-
1228- /* Get a "shower" string, or continue */
1229639 strcpy(back_str, shower_str);
1230640 if (askfor(shower_str, 80))
1231- {
1232- /* Show it */
1233641 shower = shower_str[0] ? shower_str : NULL;
1234- }
1235- else strcpy(shower_str, back_str);
642+ else
643+ strcpy(shower_str, back_str);
1236644
1237645 continue;
1238-
1239- /* Hack -- handle find */
1240646 case '/':
1241647 case KTRL('s'):
1242648 {
1243- int z;
1244-
1245- /* Prompt */
1246649 prt(_("検索: ", "Find: "), hgt - 1, 0);
1247-
1248- /* Get a "finder" string, or continue */
1249650 strcpy(back_str, finder_str);
1250651 if (!askfor(finder_str, 80))
1251652 {
@@ -1254,89 +655,59 @@ void do_cmd_messages(int num_now)
1254655 }
1255656 else if (!finder_str[0])
1256657 {
1257- shower = NULL; /* Stop showing */
658+ shower = NULL;
1258659 continue;
1259660 }
1260661
1261- /* Show it */
1262662 shower = finder_str;
1263-
1264- /* Scan messages */
1265- for (z = i + 1; z < n; z++)
663+ for (int z = i + 1; z < n; z++)
1266664 {
1267665 concptr msg = message_str(z);
1268-
1269- /* Search for it */
1270666 if (my_strstr(msg, finder_str))
1271667 {
1272- /* New location */
1273668 i = z;
1274-
1275669 break;
1276670 }
1277671 }
1278672 }
673+
1279674 break;
1280675
1281- /* Recall 1 older message */
1282676 case SKEY_TOP:
1283- /* Go to the oldest line */
1284677 i = n - num_lines;
1285678 break;
1286-
1287- /* Recall 1 newer message */
1288679 case SKEY_BOTTOM:
1289- /* Go to the newest line */
1290680 i = 0;
1291681 break;
1292-
1293- /* Recall 1 older message */
1294682 case '8':
1295683 case SKEY_UP:
1296684 case '\n':
1297685 case '\r':
1298- /* Go older if legal */
1299686 i = MIN(i + 1, n - num_lines);
1300687 break;
1301-
1302- /* Recall 10 older messages */
1303688 case '+':
1304- /* Go older if legal */
1305689 i = MIN(i + 10, n - num_lines);
1306690 break;
1307-
1308- /* Recall 20 older messages */
1309691 case 'p':
1310692 case KTRL('P'):
1311693 case ' ':
1312694 case SKEY_PGUP:
1313- /* Go older if legal */
1314695 i = MIN(i + num_lines, n - num_lines);
1315696 break;
1316-
1317- /* Recall 20 newer messages */
1318697 case 'n':
1319698 case KTRL('N'):
1320699 case SKEY_PGDOWN:
1321- /* Go newer (if able) */
1322700 i = MAX(0, i - num_lines);
1323701 break;
1324-
1325- /* Recall 10 newer messages */
1326702 case '-':
1327- /* Go newer (if able) */
1328703 i = MAX(0, i - 10);
1329704 break;
1330-
1331- /* Recall 1 newer messages */
1332705 case '2':
1333706 case SKEY_DOWN:
1334- /* Go newer (if able) */
1335707 i = MAX(0, i - 1);
1336708 break;
1337709 }
1338710
1339- /* Hack -- Error of some kind */
1340711 if (i == j) bell();
1341712 }
1342713
@@ -1356,11 +727,8 @@ void do_cmd_pref(player_type *creature_ptr)
1356727 {
1357728 char buf[80];
1358729 strcpy(buf, "");
1359-
1360- /* Ask for a "user pref command" */
1361730 if (!get_string(_("設定変更コマンド: ", "Pref: "), buf, 80)) return;
1362731
1363- /* Process that pref command */
1364732 (void)interpret_pref_file(creature_ptr, buf);
1365733 }
1366734
@@ -1372,8 +740,9 @@ void do_cmd_pref(player_type *creature_ptr)
1372740 */
1373741 void do_cmd_reload_autopick(player_type *creature_ptr)
1374742 {
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+
1377746 autopick_load_pref(creature_ptr, TRUE);
1378747 }
1379748
@@ -1388,32 +757,16 @@ static errr macro_dump(concptr fname)
1388757 static concptr mark = "Macro Dump";
1389758 char buf[1024];
1390759 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
1391-
1392- /* File type is "TEXT" */
1393760 FILE_TYPE(FILE_TYPE_TEXT);
1394-
1395- /* Append to the file */
1396761 if (!open_auto_dump(buf, mark)) return -1;
1397762
1398- /* Start dumping */
1399763 auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
1400-
1401- /* Dump them */
1402764 for (int i = 0; i < macro__num; i++)
1403765 {
1404- /* Extract the action */
1405766 ascii_to_text(buf, macro__act[i]);
1406-
1407- /* Dump the macro */
1408767 auto_dump_printf("A:%s\n", buf);
1409-
1410- /* Extract the action */
1411768 ascii_to_text(buf, macro__pat[i]);
1412-
1413- /* Dump normal macros */
1414769 auto_dump_printf("P:%s\n", buf);
1415-
1416- /* End the macro */
1417770 auto_dump_printf("\n");
1418771 }
1419772
@@ -1437,40 +790,21 @@ static errr macro_dump(concptr fname)
1437790 static void do_cmd_macro_aux(char *buf)
1438791 {
1439792 flush();
1440-
1441- /* Do not process macros */
1442793 inkey_base = TRUE;
1443-
1444- /* First key */
1445794 char i = inkey();
1446-
1447- /* Read the pattern */
1448795 int n = 0;
1449796 while (i)
1450797 {
1451- /* Save the key */
1452798 buf[n++] = i;
1453-
1454- /* Do not process macros */
1455799 inkey_base = TRUE;
1456-
1457- /* Do not wait for keys */
1458800 inkey_scan = TRUE;
1459-
1460- /* Attempt to read a key */
1461801 i = inkey();
1462802 }
1463803
1464- /* Terminate */
1465804 buf[n] = '\0';
1466-
1467805 flush();
1468-
1469- /* Convert the trigger */
1470806 char tmp[1024];
1471807 ascii_to_text(tmp, buf);
1472-
1473- /* Hack -- display the trigger */
1474808 Term_addstr(-1, TERM_WHITE, tmp);
1475809 }
1476810
@@ -1489,19 +823,11 @@ static void do_cmd_macro_aux(char *buf)
1489823 static void do_cmd_macro_aux_keymap(char *buf)
1490824 {
1491825 char tmp[1024];
1492-
1493826 flush();
1494-
1495- /* Get a key */
1496827 buf[0] = inkey();
1497828 buf[1] = '\0';
1498-
1499- /* Convert to ascii */
1500829 ascii_to_text(tmp, buf);
1501-
1502- /* Hack -- display the trigger */
1503830 Term_addstr(-1, TERM_WHITE, tmp);
1504-
1505831 flush();
1506832 }
1507833
@@ -1518,52 +844,31 @@ static errr keymap_dump(concptr fname)
1518844 static concptr mark = "Keymap Dump";
1519845 char key[1024];
1520846 char buf[1024];
1521-
1522847 BIT_FLAGS mode;
1523-
1524- /* Roguelike */
1525848 if (rogue_like_commands)
1526849 {
1527850 mode = KEYMAP_MODE_ROGUE;
1528851 }
1529-
1530- /* Original */
1531852 else
1532853 {
1533854 mode = KEYMAP_MODE_ORIG;
1534855 }
1535856
1536857 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
1537-
1538- /* File type is "TEXT" */
1539858 FILE_TYPE(FILE_TYPE_TEXT);
1540-
1541- /* Append to the file */
1542859 if (!open_auto_dump(buf, mark)) return -1;
1543860
1544- /* Start dumping */
1545861 auto_dump_printf(_("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
1546-
1547- /* Dump them */
1548862 for (int i = 0; i < 256; i++)
1549863 {
1550864 concptr act;
1551-
1552- /* Loop up the keymap */
1553865 act = keymap_act[mode][i];
1554-
1555- /* Skip empty keymaps */
1556866 if (!act) continue;
1557867
1558- /* Encode the key */
1559868 buf[0] = (char)i;
1560869 buf[1] = '\0';
1561870 ascii_to_text(key, buf);
1562-
1563- /* Encode the action */
1564871 ascii_to_text(buf, act);
1565-
1566- /* Dump the macro */
1567872 auto_dump_printf("A:%s\n", buf);
1568873 auto_dump_printf("C:%d:%s\n", mode, key);
1569874 }
@@ -1586,45 +891,28 @@ static errr keymap_dump(concptr fname)
1586891 */
1587892 void do_cmd_macros(player_type *creature_ptr)
1588893 {
1589- int i;
1590894 char tmp[1024];
1591895 char buf[1024];
1592896 BIT_FLAGS mode;
1593-
1594- /* Roguelike */
1595897 if (rogue_like_commands)
1596898 {
1597899 mode = KEYMAP_MODE_ROGUE;
1598900 }
1599-
1600- /* Original */
1601901 else
1602902 {
1603903 mode = KEYMAP_MODE_ORIG;
1604904 }
1605905
1606- /* File type is "TEXT" */
1607906 FILE_TYPE(FILE_TYPE_TEXT);
1608-
1609907 screen_save();
1610-
1611- /* Process requests until done */
1612908 while (TRUE)
1613909 {
1614910 Term_clear();
1615911 prt(_("[ マクロの設定 ]", "Interact with Macros"), 2, 0);
1616-
1617- /* Describe that action */
1618912 prt(_("マクロ行動が(もしあれば)下に表示されます:", "Current action (if any) shown below:"), 20, 0);
1619-
1620- /* Analyze the current action */
1621913 ascii_to_text(buf, macro__buf);
1622-
1623- /* Display the current action */
1624914 prt(buf, 22, 0);
1625915
1626-
1627- /* Selections */
1628916 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
1629917 prt(_("(2) ファイルにマクロを追加", "(2) Append macros to a file"), 5, 5);
1630918 prt(_("(3) マクロの確認", "(3) Query a macro"), 6, 5);
@@ -1636,317 +924,145 @@ void do_cmd_macros(player_type *creature_ptr)
1636924 prt(_("(9) キー配置の削除", "(9) Remove a keymap"), 12, 5);
1637925 prt(_("(0) マクロ行動の入力", "(0) Enter a new action"), 13, 5);
1638926
1639- /* Prompt */
1640927 prt(_("コマンド: ", "Command: "), 16, 0);
1641-
1642- i = inkey();
1643-
1644- /* Leave */
928+ int i = inkey();
1645929 if (i == ESCAPE) break;
1646930
1647- /* Load a 'macro' file */
1648931 else if (i == '1')
1649932 {
1650- errr err;
1651-
1652- /* Prompt */
1653933 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 16, 0);
1654-
1655- /* Prompt */
1656934 prt(_("ファイル: ", "File: "), 18, 0);
1657-
1658- /* Default filename */
1659935 sprintf(tmp, "%s.prf", creature_ptr->base_name);
1660-
1661- /* Ask for a file */
1662936 if (!askfor(tmp, 80)) continue;
1663937
1664- /* Process the given filename */
1665- err = process_pref_file(creature_ptr, tmp);
938+ errr err = process_pref_file(creature_ptr, tmp);
1666939 if (-2 == err)
1667- {
1668940 msg_format(_("標準の設定ファイル'%s'を読み込みました。", "Loaded default '%s'."), tmp);
1669- }
1670941 else if (err)
1671- {
1672- /* Prompt */
1673942 msg_format(_("'%s'の読み込みに失敗しました!", "Failed to load '%s'!"), tmp);
1674- }
1675943 else
1676- {
1677944 msg_format(_("'%s'を読み込みました。", "Loaded '%s'."), tmp);
1678- }
1679945 }
1680-
1681- /* Save macros */
1682946 else if (i == '2')
1683947 {
1684- /* Prompt */
1685948 prt(_("コマンド: マクロをファイルに追加する", "Command: Append macros to a file"), 16, 0);
1686-
1687- /* Prompt */
1688949 prt(_("ファイル: ", "File: "), 18, 0);
1689-
1690- /* Default filename */
1691950 sprintf(tmp, "%s.prf", creature_ptr->base_name);
1692-
1693- /* Ask for a file */
1694951 if (!askfor(tmp, 80)) continue;
1695952
1696- /* Dump the macros */
1697953 (void)macro_dump(tmp);
1698-
1699- /* Prompt */
1700954 msg_print(_("マクロを追加しました。", "Appended macros."));
1701955 }
1702-
1703- /* Query a macro */
1704956 else if (i == '3')
1705957 {
1706- int k;
1707-
1708- /* Prompt */
1709958 prt(_("コマンド: マクロの確認", "Command: Query a macro"), 16, 0);
1710-
1711-
1712- /* Prompt */
1713959 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1714-
1715- /* Get a macro trigger */
1716960 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);
1722962 if (k < 0)
1723963 {
1724- /* Prompt */
1725964 msg_print(_("そのキーにはマクロは定義されていません。", "Found no macro."));
1726965 }
1727-
1728- /* Found one */
1729966 else
1730967 {
1731- /* Obtain the action */
1732968 strcpy(macro__buf, macro__act[k]);
1733-
1734- /* Analyze the current action */
1735969 ascii_to_text(buf, macro__buf);
1736-
1737- /* Display the current action */
1738970 prt(buf, 22, 0);
1739-
1740- /* Prompt */
1741971 msg_print(_("マクロを確認しました。", "Found a macro."));
1742972 }
1743973 }
1744-
1745- /* Create a macro */
1746974 else if (i == '4')
1747975 {
1748- /* Prompt */
1749976 prt(_("コマンド: マクロの作成", "Command: Create a macro"), 16, 0);
1750-
1751- /* Prompt */
1752977 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1753-
1754- /* Get a macro trigger */
1755978 do_cmd_macro_aux(buf);
1756979 clear_from(20);
1757-
1758- /* Help message */
1759980 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
1760981 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1761-
1762- /* Prompt */
1763982 prt(_("マクロ行動: ", "Action: "), 20, 0);
1764-
1765- /* Convert to text */
1766983 ascii_to_text(tmp, macro__buf);
1767-
1768- /* Get an encoded action */
1769984 if (askfor(tmp, 80))
1770985 {
1771- /* Convert to ascii */
1772986 text_to_ascii(macro__buf, tmp);
1773-
1774- /* Link the macro */
1775987 macro_add(buf, macro__buf);
1776-
1777- /* Prompt */
1778988 msg_print(_("マクロを追加しました。", "Added a macro."));
1779989 }
1780990 }
1781-
1782- /* Remove a macro */
1783991 else if (i == '5')
1784992 {
1785- /* Prompt */
1786993 prt(_("コマンド: マクロの削除", "Command: Remove a macro"), 16, 0);
1787-
1788- /* Prompt */
1789994 prt(_("トリガーキー: ", "Trigger: "), 18, 0);
1790-
1791- /* Get a macro trigger */
1792995 do_cmd_macro_aux(buf);
1793-
1794- /* Link the macro */
1795996 macro_add(buf, buf);
1796-
1797- /* Prompt */
1798997 msg_print(_("マクロを削除しました。", "Removed a macro."));
1799998 }
1800-
1801- /* Save keymaps */
1802999 else if (i == '6')
18031000 {
1804- /* Prompt */
18051001 prt(_("コマンド: キー配置をファイルに追加する", "Command: Append keymaps to a file"), 16, 0);
1806-
1807- /* Prompt */
18081002 prt(_("ファイル: ", "File: "), 18, 0);
1809-
1810- /* Default filename */
18111003 sprintf(tmp, "%s.prf", creature_ptr->base_name);
1812-
1813- /* Ask for a file */
18141004 if (!askfor(tmp, 80)) continue;
18151005
1816- /* Dump the macros */
18171006 (void)keymap_dump(tmp);
1818-
1819- /* Prompt */
18201007 msg_print(_("キー配置を追加しました。", "Appended keymaps."));
18211008 }
1822-
1823- /* Query a keymap */
18241009 else if (i == '7')
18251010 {
1826- concptr act;
1827-
1828- /* Prompt */
18291011 prt(_("コマンド: キー配置の確認", "Command: Query a keymap"), 16, 0);
1830-
1831- /* Prompt */
18321012 prt(_("押すキー: ", "Keypress: "), 18, 0);
1833-
1834- /* Get a keymap trigger */
18351013 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])];
18411015 if (!act)
18421016 {
1843- /* Prompt */
18441017 msg_print(_("キー配置は定義されていません。", "Found no keymap."));
18451018 }
1846-
1847- /* Found one */
18481019 else
18491020 {
1850- /* Obtain the action */
18511021 strcpy(macro__buf, act);
1852-
1853- /* Analyze the current action */
18541022 ascii_to_text(buf, macro__buf);
1855-
1856- /* Display the current action */
18571023 prt(buf, 22, 0);
1858-
1859- /* Prompt */
18601024 msg_print(_("キー配置を確認しました。", "Found a keymap."));
18611025 }
18621026 }
1863-
1864- /* Create a keymap */
18651027 else if (i == '8')
18661028 {
1867- /* Prompt */
18681029 prt(_("コマンド: キー配置の作成", "Command: Create a keymap"), 16, 0);
1869-
1870- /* Prompt */
18711030 prt(_("押すキー: ", "Keypress: "), 18, 0);
1872-
1873- /* Get a keymap trigger */
18741031 do_cmd_macro_aux_keymap(buf);
18751032 clear_from(20);
1876-
1877- /* Help message */
18781033 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
18791034 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1880-
1881- /* Prompt */
18821035 prt(_("行動: ", "Action: "), 20, 0);
1883-
1884- /* Convert to text */
18851036 ascii_to_text(tmp, macro__buf);
1886-
1887- /* Get an encoded action */
18881037 if (askfor(tmp, 80))
18891038 {
1890- /* Convert to ascii */
18911039 text_to_ascii(macro__buf, tmp);
1892-
1893- /* Free old keymap */
18941040 string_free(keymap_act[mode][(byte)(buf[0])]);
1895-
1896- /* Make new keymap */
18971041 keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf);
1898-
1899- /* Prompt */
19001042 msg_print(_("キー配置を追加しました。", "Added a keymap."));
19011043 }
19021044 }
1903-
1904- /* Remove a keymap */
19051045 else if (i == '9')
19061046 {
1907- /* Prompt */
19081047 prt(_("コマンド: キー配置の削除", "Command: Remove a keymap"), 16, 0);
1909-
1910- /* Prompt */
19111048 prt(_("押すキー: ", "Keypress: "), 18, 0);
1912-
1913- /* Get a keymap trigger */
19141049 do_cmd_macro_aux_keymap(buf);
1915-
1916- /* Free old keymap */
19171050 string_free(keymap_act[mode][(byte)(buf[0])]);
1918-
1919- /* Make new keymap */
19201051 keymap_act[mode][(byte)(buf[0])] = NULL;
1921-
1922- /* Prompt */
19231052 msg_print(_("キー配置を削除しました。", "Removed a keymap."));
19241053 }
1925-
1926- /* Enter a new action */
19271054 else if (i == '0')
19281055 {
1929- /* Prompt */
19301056 prt(_("コマンド: マクロ行動の入力", "Command: Enter a new action"), 16, 0);
19311057 clear_from(20);
1932-
1933- /* Help message */
19341058 c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
19351059 "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
1936-
1937- /* Prompt */
19381060 prt(_("マクロ行動: ", "Action: "), 20, 0);
1939-
1940- /* Hack -- limit the value */
19411061 tmp[80] = '\0';
1942-
1943- /* Get an encoded action */
19441062 if (!askfor(buf, 80)) continue;
19451063
1946- /* Extract an action */
19471064 text_to_ascii(macro__buf, buf);
19481065 }
1949-
19501066 else
19511067 {
19521068 bell();
@@ -1964,15 +1080,9 @@ void do_cmd_macros(player_type *creature_ptr)
19641080 */
19651081 static concptr lighting_level_str[F_LIT_MAX] =
19661082 {
1967-#ifdef JP
1968- "標準色",
1969- "明色",
1970- "暗色",
1971-#else
1972- "standard",
1973- "brightly lit",
1974- "darkened",
1975-#endif
1083+ _("標準色", "standard"),
1084+ _("明色", "brightly lit"),
1085+ _("暗色", "darkened"),
19761086 };
19771087
19781088
@@ -1988,14 +1098,11 @@ static bool cmd_visuals_aux(int i, IDX *num, IDX max)
19881098 if (iscntrl(i))
19891099 {
19901100 char str[10] = "";
1991- IDX tmp;
1992-
19931101 sprintf(str, "%d", *num);
1994-
19951102 if (!get_string(format("Input new number(0-%d): ", max - 1), str, 4))
19961103 return FALSE;
19971104
1998- tmp = (IDX)strtol(str, NULL, 0);
1105+ IDX tmp = (IDX)strtol(str, NULL, 0);
19991106 if (tmp >= 0 && tmp < max)
20001107 *num = tmp;
20011108 }
@@ -2015,8 +1122,6 @@ static bool cmd_visuals_aux(int i, IDX *num, IDX max)
20151122 static void print_visuals_menu(concptr choice_msg)
20161123 {
20171124 prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0);
2018-
2019- /* Give some choices */
20201125 prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5);
20211126 prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5);
20221127 prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5);
@@ -2028,8 +1133,6 @@ static void print_visuals_menu(concptr choice_msg)
20281133 prt(_("(8) アイテムの 色/文字 を変更する (シンボルエディタ)", "(8) Change object attr/chars (visual mode)"), 11, 5);
20291134 prt(_("(9) 地形の 色/文字 を変更する (シンボルエディタ)", "(9) Change feature attr/chars (visual mode)"), 12, 5);
20301135 prt(_("(R) 画面表示方法の初期化", "(R) Reset visuals"), 13, 5);
2031-
2032- /* Prompt */
20331136 prt(format("コマンド: %s", choice_msg ? choice_msg : _("", "")), 15, 0);
20341137 }
20351138
@@ -2039,229 +1142,132 @@ static void print_visuals_menu(concptr choice_msg)
20391142 */
20401143 void do_cmd_visuals(player_type *creature_ptr)
20411144 {
2042- int i;
20431145 char tmp[160];
20441146 char buf[1024];
20451147 bool need_redraw = FALSE;
20461148 concptr empty_symbol = "<< ? >>";
2047-
20481149 if (use_bigtile) empty_symbol = "<< ?? >>";
20491150
2050- /* File type is "TEXT" */
20511151 FILE_TYPE(FILE_TYPE_TEXT);
20521152 screen_save();
2053-
2054- /* Interact until done */
20551153 while (TRUE)
20561154 {
20571155 Term_clear();
2058-
2059- /* Ask for a choice */
20601156 print_visuals_menu(NULL);
2061-
2062- /* Prompt */
2063- i = inkey();
2064-
1157+ int i = inkey();
20651158 if (i == ESCAPE) break;
20661159
20671160 switch (i)
20681161 {
2069- /* Load a 'pref' file */
20701162 case '0':
2071- /* Prompt */
1163+ {
20721164 prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0);
2073-
2074- /* Prompt */
20751165 prt(_("ファイル: ", "File: "), 17, 0);
2076-
2077- /* Default filename */
20781166 sprintf(tmp, "%s.prf", creature_ptr->base_name);
2079-
2080- /* Query */
20811167 if (!askfor(tmp, 70)) continue;
20821168
2083- /* Process the given filename */
20841169 (void)process_pref_file(creature_ptr, tmp);
2085-
20861170 need_redraw = TRUE;
20871171 break;
2088-
2089- /* Dump monster attr/chars */
1172+ }
20901173 case '1':
20911174 {
20921175 static concptr mark = "Monster attr/chars";
2093-
2094- /* Prompt */
20951176 prt(_("コマンド: モンスターの[色/文字]をファイルに書き出します", "Command: Dump monster attr/chars"), 15, 0);
2096-
2097- /* Prompt */
20981177 prt(_("ファイル: ", "File: "), 17, 0);
2099-
2100- /* Default filename */
21011178 sprintf(tmp, "%s.prf", creature_ptr->base_name);
2102-
2103- /* Get a filename */
21041179 if (!askfor(tmp, 70)) continue;
2105- path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
21061180
2107- /* Append to the file */
1181+ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
21081182 if (!open_auto_dump(buf, mark)) continue;
21091183
2110- /* Start dumping */
21111184 auto_dump_printf(_("\n# モンスターの[色/文字]の設定\n\n", "\n# Monster attr/char definitions\n\n"));
2112-
2113- /* Dump monsters */
21141185 for (i = 0; i < max_r_idx; i++)
21151186 {
21161187 monster_race *r_ptr = &r_info[i];
2117-
2118- /* Skip non-entries */
21191188 if (!r_ptr->name) continue;
21201189
2121- /* Dump a comment */
21221190 auto_dump_printf("# %s\n", (r_name + r_ptr->name));
2123-
2124- /* Dump the monster attr/char info */
21251191 auto_dump_printf("R:%d:0x%02X/0x%02X\n\n", i,
21261192 (byte)(r_ptr->x_attr), (byte)(r_ptr->x_char));
21271193 }
21281194
2129- /* Close */
21301195 close_auto_dump();
2131-
21321196 msg_print(_("モンスターの[色/文字]をファイルに書き出しました。", "Dumped monster attr/chars."));
2133-
21341197 break;
21351198 }
2136-
2137- /* Dump object attr/chars */
21381199 case '2':
21391200 {
21401201 static concptr mark = "Object attr/chars";
2141- KIND_OBJECT_IDX k_idx;
2142-
2143- /* Prompt */
21441202 prt(_("コマンド: アイテムの[色/文字]をファイルに書き出します", "Command: Dump object attr/chars"), 15, 0);
2145-
2146- /* Prompt */
21471203 prt(_("ファイル: ", "File: "), 17, 0);
2148-
2149- /* Default filename */
21501204 sprintf(tmp, "%s.prf", creature_ptr->base_name);
2151-
2152- /* Get a filename */
21531205 if (!askfor(tmp, 70)) continue;
2154- path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
21551206
2156- /* Append to the file */
1207+ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
21571208 if (!open_auto_dump(buf, mark)) continue;
21581209
2159- /* Start dumping */
21601210 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++)
21641212 {
21651213 GAME_TEXT o_name[MAX_NLEN];
21661214 object_kind *k_ptr = &k_info[k_idx];
2167-
2168- /* Skip non-entries */
21691215 if (!k_ptr->name) continue;
21701216
21711217 if (!k_ptr->flavor)
21721218 {
2173- /* Tidy name */
21741219 strip_name(o_name, k_idx);
21751220 }
21761221 else
21771222 {
21781223 object_type forge;
2179-
2180- /* Prepare dummy object */
21811224 object_prep(&forge, k_idx);
2182-
2183- /* Get un-shuffled flavor name */
21841225 object_desc(creature_ptr, o_name, &forge, OD_FORCE_FLAVOR);
21851226 }
21861227
2187- /* Dump a comment */
21881228 auto_dump_printf("# %s\n", o_name);
2189-
2190- /* Dump the object attr/char info */
21911229 auto_dump_printf("K:%d:0x%02X/0x%02X\n\n", (int)k_idx,
21921230 (byte)(k_ptr->x_attr), (byte)(k_ptr->x_char));
21931231 }
21941232
2195- /* Close */
21961233 close_auto_dump();
2197-
21981234 msg_print(_("アイテムの[色/文字]をファイルに書き出しました。", "Dumped object attr/chars."));
2199-
22001235 break;
22011236 }
2202-
2203- /* Dump feature attr/chars */
22041237 case '3':
22051238 {
22061239 static concptr mark = "Feature attr/chars";
2207-
2208- /* Prompt */
22091240 prt(_("コマンド: 地形の[色/文字]をファイルに書き出します", "Command: Dump feature attr/chars"), 15, 0);
2210-
2211- /* Prompt */
22121241 prt(_("ファイル: ", "File: "), 17, 0);
2213-
2214- /* Default filename */
22151242 sprintf(tmp, "%s.prf", creature_ptr->base_name);
2216-
2217- /* Get a filename */
22181243 if (!askfor(tmp, 70)) continue;
2219- path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
22201244
2221- /* Append to the file */
1245+ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
22221246 if (!open_auto_dump(buf, mark)) continue;
22231247
2224- /* Start dumping */
22251248 auto_dump_printf(_("\n# 地形の[色/文字]の設定\n\n", "\n# Feature attr/char definitions\n\n"));
2226-
2227- /* Dump features */
22281249 for (i = 0; i < max_f_idx; i++)
22291250 {
22301251 feature_type *f_ptr = &f_info[i];
2231-
2232- /* Skip non-entries */
22331252 if (!f_ptr->name) continue;
2234-
2235- /* Skip mimiccing features */
22361253 if (f_ptr->mimic != i) continue;
22371254
2238- /* Dump a comment */
22391255 auto_dump_printf("# %s\n", (f_name + f_ptr->name));
2240-
2241- /* Dump the feature attr/char info */
22421256 auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
22431257 (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
22441258 (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
22451259 (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
22461260 }
22471261
2248- /* Close */
22491262 close_auto_dump();
2250-
22511263 msg_print(_("地形の[色/文字]をファイルに書き出しました。", "Dumped feature attr/chars."));
2252-
22531264 break;
22541265 }
2255-
2256- /* Modify monster attr/chars (numeric operation) */
22571266 case '4':
22581267 {
22591268 static concptr choice_msg = _("モンスターの[色/文字]を変更します", "Change monster attr/chars");
22601269 static MONRACE_IDX r = 0;
2261-
22621270 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2263-
2264- /* Hack -- query until done */
22651271 while (TRUE)
22661272 {
22671273 monster_race *r_ptr = &r_info[r];
@@ -2273,31 +1279,19 @@ void do_cmd_visuals(player_type *creature_ptr)
22731279 TERM_COLOR ca = r_ptr->x_attr;
22741280 byte cc = r_ptr->x_char;
22751281
2276- /* Label the object */
22771282 Term_putstr(5, 17, -1, TERM_WHITE,
22781283 format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
2279-
2280- /* Label the Default values */
22811284 Term_putstr(10, 19, -1, TERM_WHITE,
22821285 format(_("初期値 色 / 文字 = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc));
2283-
22841286 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
22851287 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2286-
2287- /* Label the Current values */
22881288 Term_putstr(10, 20, -1, TERM_WHITE,
22891289 format(_("現在値 色 / 文字 = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc));
2290-
22911290 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
22921291 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2293-
2294- /* Prompt */
22951292 Term_putstr(0, 22, -1, TERM_WHITE,
22961293 _("コマンド (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-
22981294 i = inkey();
2299-
2300- /* All done */
23011295 if (i == ESCAPE) break;
23021296
23031297 if (iscntrl(i)) c = 'a' + i - KTRL('A');
@@ -2318,6 +1312,7 @@ void do_cmd_visuals(player_type *creature_ptr)
23181312 }
23191313 } while (!r_info[r].name);
23201314 }
1315+
23211316 break;
23221317 case 'a':
23231318 t = (int)r_ptr->x_attr;
@@ -2341,15 +1336,11 @@ void do_cmd_visuals(player_type *creature_ptr)
23411336
23421337 break;
23431338 }
2344-
2345- /* Modify object attr/chars (numeric operation) */
23461339 case '5':
23471340 {
23481341 static concptr choice_msg = _("アイテムの[色/文字]を変更します", "Change object attr/chars");
23491342 static IDX k = 0;
23501343 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2351-
2352- /* Hack -- query until done */
23531344 while (TRUE)
23541345 {
23551346 object_kind *k_ptr = &k_info[k];
@@ -2361,32 +1352,21 @@ void do_cmd_visuals(player_type *creature_ptr)
23611352 TERM_COLOR ca = k_ptr->x_attr;
23621353 SYMBOL_CODE cc = k_ptr->x_char;
23631354
2364- /* Label the object */
23651355 Term_putstr(5, 17, -1, TERM_WHITE,
23661356 format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
23671357 k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
2368-
2369- /* Label the Default values */
23701358 Term_putstr(10, 19, -1, TERM_WHITE,
23711359 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
2372-
23731360 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
23741361 Term_queue_bigchar(43, 19, da, dc, 0, 0);
2375-
2376- /* Label the Current values */
23771362 Term_putstr(10, 20, -1, TERM_WHITE,
23781363 format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
2379-
23801364 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
23811365 Term_queue_bigchar(43, 20, ca, cc, 0, 0);
2382-
2383- /* Prompt */
23841366 Term_putstr(0, 22, -1, TERM_WHITE,
23851367 _("コマンド (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): "));
23861368
23871369 i = inkey();
2388-
2389- /* All done */
23901370 if (i == ESCAPE) break;
23911371
23921372 if (iscntrl(i)) c = 'a' + i - KTRL('A');
@@ -2407,6 +1387,7 @@ void do_cmd_visuals(player_type *creature_ptr)
24071387 }
24081388 } while (!k_info[k].name);
24091389 }
1390+
24101391 break;
24111392 case 'a':
24121393 t = (int)k_ptr->x_attr;
@@ -2430,16 +1411,12 @@ void do_cmd_visuals(player_type *creature_ptr)
24301411
24311412 break;
24321413 }
2433-
2434- /* Modify feature attr/chars (numeric operation) */
24351414 case '6':
24361415 {
24371416 static concptr choice_msg = _("地形の[色/文字]を変更します", "Change feature attr/chars");
24381417 static IDX f = 0;
24391418 static IDX lighting_level = F_LIT_STANDARD;
24401419 prt(format(_("コマンド: %s", "Command: %s"), choice_msg), 15, 0);
2441-
2442- /* Hack -- query until done */
24431420 while (TRUE)
24441421 {
24451422 feature_type *f_ptr = &f_info[f];
@@ -2451,43 +1428,22 @@ void do_cmd_visuals(player_type *creature_ptr)
24511428 TERM_COLOR ca = f_ptr->x_attr[lighting_level];
24521429 byte cc = f_ptr->x_char[lighting_level];
24531430
2454- /* Label the object */
24551431 prt("", 17, 5);
24561432 Term_putstr(5, 17, -1, TERM_WHITE,
24571433 format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
24581434 f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
2459-
2460- /* Label the Default values */
24611435 Term_putstr(10, 19, -1, TERM_WHITE,
24621436 format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
2463-
24641437 Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
24651438 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
24721439 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));
24761441 Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
24771442 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
24841443 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): "));
24871445
24881446 i = inkey();
2489-
2490- /* All done */
24911447 if (i == ESCAPE) break;
24921448
24931449 if (iscntrl(i)) c = 'a' + i - KTRL('A');
@@ -2508,6 +1464,7 @@ void do_cmd_visuals(player_type *creature_ptr)
25081464 }
25091465 } while (!f_info[f].name || (f_info[f].mimic != f));
25101466 }
1467+
25111468 break;
25121469 case 'a':
25131470 t = (int)f_ptr->x_attr[lighting_level];
@@ -2538,36 +1495,24 @@ void do_cmd_visuals(player_type *creature_ptr)
25381495
25391496 break;
25401497 }
2541-
2542- /* Modify monster attr/chars (visual mode) */
25431498 case '7':
25441499 do_cmd_knowledge_monsters(creature_ptr, &need_redraw, TRUE, -1);
25451500 break;
2546-
2547- /* Modify object attr/chars (visual mode) */
25481501 case '8':
25491502 do_cmd_knowledge_objects(creature_ptr, &need_redraw, TRUE, -1);
25501503 break;
2551-
2552- /* Modify feature attr/chars (visual mode) */
25531504 case '9':
25541505 {
25551506 IDX lighting_level = F_LIT_STANDARD;
25561507 do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
25571508 break;
25581509 }
2559-
2560- /* Reset visuals */
25611510 case 'R':
25621511 case 'r':
2563- /* Reset */
25641512 reset_visuals(creature_ptr);
2565-
25661513 msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset."));
25671514 need_redraw = TRUE;
25681515 break;
2569-
2570- /* Unknown option */
25711516 default:
25721517 bell();
25731518 break;
@@ -2577,7 +1522,6 @@ void do_cmd_visuals(player_type *creature_ptr)
25771522 }
25781523
25791524 screen_load();
2580-
25811525 if (need_redraw) do_cmd_redraw(creature_ptr);
25821526 }
25831527
@@ -2590,82 +1534,42 @@ void do_cmd_colors(player_type *creature_ptr)
25901534 int i;
25911535 char tmp[160];
25921536 char buf[1024];
2593-
2594- /* File type is "TEXT" */
25951537 FILE_TYPE(FILE_TYPE_TEXT);
2596-
25971538 screen_save();
2598-
2599- /* Interact until done */
26001539 while (TRUE)
26011540 {
26021541 Term_clear();
2603-
2604- /* Ask for a choice */
26051542 prt(_("[ カラーの設定 ]", "Interact with Colors"), 2, 0);
2606-
2607- /* Give some choices */
26081543 prt(_("(1) ユーザー設定ファイルのロード", "(1) Load a user pref file"), 4, 5);
26091544 prt(_("(2) カラーの設定をファイルに書き出す", "(2) Dump colors"), 5, 5);
26101545 prt(_("(3) カラーの設定を変更する", "(3) Modify colors"), 6, 5);
2611-
2612- /* Prompt */
26131546 prt(_("コマンド: ", "Command: "), 8, 0);
2614- /* Prompt */
26151547 i = inkey();
2616-
26171548 if (i == ESCAPE) break;
26181549
2619- /* Load a 'pref' file */
26201550 if (i == '1')
26211551 {
2622- /* Prompt */
26231552 prt(_("コマンド: ユーザー設定ファイルをロードします", "Command: Load a user pref file"), 8, 0);
2624-
2625- /* Prompt */
26261553 prt(_("ファイル: ", "File: "), 10, 0);
2627-
2628- /* Default file */
26291554 sprintf(tmp, "%s.prf", creature_ptr->base_name);
2630-
2631- /* Query */
26321555 if (!askfor(tmp, 70)) continue;
26331556
2634- /* Process the given filename */
26351557 (void)process_pref_file(creature_ptr, tmp);
2636-
2637- /* Mega-Hack -- react to changes */
26381558 Term_xtra(TERM_XTRA_REACT, 0);
2639-
2640- /* Mega-Hack -- redraw */
26411559 Term_redraw();
26421560 }
2643-
2644- /* Dump colors */
26451561 else if (i == '2')
26461562 {
26471563 static concptr mark = "Colors";
2648-
2649- /* Prompt */
26501564 prt(_("コマンド: カラーの設定をファイルに書き出します", "Command: Dump colors"), 8, 0);
2651-
2652- /* Prompt */
26531565 prt(_("ファイル: ", "File: "), 10, 0);
2654-
2655- /* Default filename */
26561566 sprintf(tmp, "%s.prf", creature_ptr->base_name);
2657-
2658- /* Get a filename */
26591567 if (!askfor(tmp, 70)) continue;
2660- path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
26611568
2662- /* Append to the file */
1569+ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
26631570 if (!open_auto_dump(buf, mark)) continue;
26641571
2665- /* Start dumping */
26661572 auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n"));
2667-
2668- /* Dump colors */
26691573 for (i = 0; i < 256; i++)
26701574 {
26711575 int kv = angband_color_table[i][0];
@@ -2674,77 +1578,46 @@ void do_cmd_colors(player_type *creature_ptr)
26741578 int bv = angband_color_table[i][3];
26751579
26761580 concptr name = _("未知", "unknown");
2677-
2678- /* Skip non-entries */
26791581 if (!kv && !rv && !gv && !bv) continue;
26801582
2681- /* Extract the color name */
26821583 if (i < 16) name = color_names[i];
26831584
2684- /* Dump a comment */
26851585 auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name);
2686-
2687- /* Dump the monster attr/char info */
26881586 auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
26891587 i, kv, rv, gv, bv);
26901588 }
26911589
2692- /* Close */
26931590 close_auto_dump();
2694-
26951591 msg_print(_("カラーの設定をファイルに書き出しました。", "Dumped color redefinitions."));
26961592 }
2697-
2698- /* Edit colors */
26991593 else if (i == '3')
27001594 {
27011595 static byte a = 0;
2702-
2703- /* Prompt */
27041596 prt(_("コマンド: カラーの設定を変更します", "Command: Modify colors"), 8, 0);
2705-
2706- /* Hack -- query until done */
27071597 while (TRUE)
27081598 {
27091599 concptr name;
2710- byte j;
27111600 clear_from(10);
2712-
2713- /* Exhibit the normal colors */
2714- for (j = 0; j < 16; j++)
1601+ for (byte j = 0; j < 16; j++)
27151602 {
2716- /* Exhibit this color */
27171603 Term_putstr(j * 4, 20, -1, a, "###");
2718-
2719- /* Exhibit all colors */
27201604 Term_putstr(j * 4, 22, -1, j, format("%3d", j));
27211605 }
27221606
2723- /* Describe the color */
27241607 name = ((a < 16) ? color_names[a] : _("未定義", "undefined"));
2725-
2726- /* Describe the color */
27271608 Term_putstr(5, 10, -1, TERM_WHITE,
27281609 format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
2729-
2730- /* Label the Current values */
27311610 Term_putstr(5, 12, -1, TERM_WHITE,
27321611 format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
27331612 angband_color_table[a][0],
27341613 angband_color_table[a][1],
27351614 angband_color_table[a][2],
27361615 angband_color_table[a][3]));
2737-
2738- /* Prompt */
27391616 Term_putstr(0, 14, -1, TERM_WHITE,
27401617 _("コマンド (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): "));
2741-
27421618 i = inkey();
2743-
2744- /* All done */
27451619 if (i == ESCAPE) break;
27461620
2747- /* Analyze */
27481621 if (i == 'n') a = (byte)(a + 1);
27491622 if (i == 'N') a = (byte)(a - 1);
27501623 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)
27561629 if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1);
27571630 if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1);
27581631
2759- /* Hack -- react to changes */
27601632 Term_xtra(TERM_XTRA_REACT, 0);
2761-
2762- /* Hack -- redraw */
27631633 Term_redraw();
27641634 }
27651635 }
2766-
2767- /* Unknown option */
27681636 else
27691637 {
27701638 bell();
@@ -2783,17 +1651,10 @@ void do_cmd_colors(player_type *creature_ptr)
27831651 void do_cmd_note(void)
27841652 {
27851653 char buf[80];
2786-
2787- /* Default */
27881654 strcpy(buf, "");
2789-
2790- /* Input */
27911655 if (!get_string(_("メモ: ", "Note: "), buf, 60)) return;
2792-
2793- /* Ignore empty notes */
27941656 if (!buf[0] || (buf[0] == ' ')) return;
27951657
2796- /* Add the note to the message recall */
27971658 msg_format(_("メモ: %s", "Note: %s"), buf);
27981659 }
27991660
@@ -2814,55 +1675,6 @@ void do_cmd_version(void)
28141675
28151676
28161677 /*
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-/*
28661678 * Note that "feeling" is set to zero unless some time has passed.
28671679 * Note that this is done when the level is GENERATED, not entered.
28681680 */
@@ -2870,14 +1682,12 @@ void do_cmd_feeling(player_type *creature_ptr)
28701682 {
28711683 if (creature_ptr->wild_mode) return;
28721684
2873- /* No useful feeling in quests */
28741685 if (creature_ptr->current_floor_ptr->inside_quest && !random_quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level))
28751686 {
28761687 msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level."));
28771688 return;
28781689 }
28791690
2880- /* No useful feeling in town */
28811691 if (creature_ptr->town_num && !creature_ptr->current_floor_ptr->dun_level)
28821692 {
28831693 if (!strcmp(town_info[creature_ptr->town_num].name, _("荒野", "wilderness")))
@@ -2890,14 +1700,12 @@ void do_cmd_feeling(player_type *creature_ptr)
28901700 return;
28911701 }
28921702
2893- /* No useful feeling in the wilderness */
28941703 if (!creature_ptr->current_floor_ptr->dun_level)
28951704 {
28961705 msg_print(_("典型的な荒野のようだ。", "Looks like a typical wilderness."));
28971706 return;
28981707 }
28991708
2900- /* Display the feeling */
29011709 if (creature_ptr->muta3 & MUT3_GOOD_LUCK)
29021710 msg_print(do_cmd_feeling_text_lucky[creature_ptr->feeling]);
29031711 else if (IS_ECHIZEN(creature_ptr))
@@ -2908,208 +1716,6 @@ void do_cmd_feeling(player_type *creature_ptr)
29081716
29091717
29101718 /*
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-/*
31131719 * todo 引数と戻り値について追記求む
31141720 * Build a list of monster indexes in the given group.
31151721 *
@@ -3124,42 +1730,31 @@ static concptr monster_group_char[] =
31241730 */
31251731 static IDX collect_monsters(player_type *creature_ptr, IDX grp_cur, IDX mon_idx[], BIT_FLAGS8 mode)
31261732 {
3127- /* Get a list of x_char in this group */
31281733 concptr group_char = monster_group_char[grp_cur];
3129-
31301734 bool grp_unique = (monster_group_char[grp_cur] == (char *)-1L);
31311735 bool grp_riding = (monster_group_char[grp_cur] == (char *)-2L);
31321736 bool grp_wanted = (monster_group_char[grp_cur] == (char *)-3L);
31331737 bool grp_amberite = (monster_group_char[grp_cur] == (char *)-4L);
31341738
3135- /* Check every race */
31361739 IDX mon_cnt = 0;
31371740 for (IDX i = 0; i < max_r_idx; i++)
31381741 {
3139- /* Access the race */
31401742 monster_race *r_ptr = &r_info[i];
3141-
3142- /* Skip empty race */
31431743 if (!r_ptr->name) continue;
3144-
3145- /* Require known monsters */
31461744 if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
31471745
31481746 if (grp_unique)
31491747 {
31501748 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
31511749 }
3152-
31531750 else if (grp_riding)
31541751 {
31551752 if (!(r_ptr->flags7 & RF7_RIDING)) continue;
31561753 }
3157-
31581754 else if (grp_wanted)
31591755 {
31601756 bool wanted = FALSE;
3161- int j;
3162- for (j = 0; j < MAX_BOUNTY; j++)
1757+ for (int j = 0; j < MAX_BOUNTY; j++)
31631758 {
31641759 if (current_world_ptr->bounty_r_idx[j] == i || current_world_ptr->bounty_r_idx[j] - 10000 == i ||
31651760 (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[
31681763 break;
31691764 }
31701765 }
1766+
31711767 if (!wanted) continue;
31721768 }
3173-
31741769 else if (grp_amberite)
31751770 {
31761771 if (!(r_ptr->flags3 & RF3_AMBERITE)) continue;
31771772 }
3178-
31791773 else
31801774 {
3181- /* Check for race in the group */
31821775 if (!my_strchr(group_char, r_ptr->d_char)) continue;
31831776 }
31841777
3185- /* Add the race */
31861778 mon_idx[mon_cnt++] = i;
3187-
3188- /* XXX Hack -- Just checking for non-empty group */
31891779 if (mode & 0x01) break;
31901780 }
31911781
3192- /* Terminate the list */
31931782 mon_idx[mon_cnt] = -1;
3194-
31951783 int dummy_why;
31961784 ang_sort(mon_idx, &dummy_why, mon_cnt, ang_sort_comp_monster_level, ang_sort_swap_hook);
3197-
3198- /* Return the number of races */
31991785 return mon_cnt;
32001786 }
32011787
32021788
32031789 /*
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-/*
33511790 * Build a list of object indexes in the given group. Return the number
33521791 * of objects in the group.
33531792 *
@@ -3356,63 +1795,47 @@ static byte object_group_tval[] =
33561795 */
33571796 static KIND_OBJECT_IDX collect_objects(int grp_cur, KIND_OBJECT_IDX object_idx[], BIT_FLAGS8 mode)
33581797 {
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;
33631799 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++)
33671801 {
3368- /* Access the object */
33691802 object_kind *k_ptr = &k_info[i];
3370-
3371- /* Skip empty objects */
33721803 if (!k_ptr->name) continue;
33731804
33741805 if (!(mode & 0x02))
33751806 {
33761807 if (!current_world_ptr->wizard)
33771808 {
3378- /* Skip non-flavoured objects */
33791809 if (!k_ptr->flavor) continue;
3380-
3381- /* Require objects ever seen */
33821810 if (!k_ptr->aware) continue;
33831811 }
33841812
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];
33871816 if (!k) continue;
33881817 }
33891818
3390- /* Check for objects in the group */
33911819 if (TV_LIFE_BOOK == group_tval)
33921820 {
3393- /* Hack -- All spell books */
33941821 if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK)
33951822 {
3396- /* Add the object */
33971823 object_idx[object_cnt++] = i;
33981824 }
3399- else continue;
1825+ else
1826+ continue;
34001827 }
34011828 else if (k_ptr->tval == group_tval)
34021829 {
3403- /* Add the object */
34041830 object_idx[object_cnt++] = i;
34051831 }
3406- else continue;
1832+ else
1833+ continue;
34071834
3408- /* XXX Hack -- Just checking for non-empty group */
34091835 if (mode & 0x01) break;
34101836 }
34111837
3412- /* Terminate the list */
34131838 object_idx[object_cnt] = -1;
3414-
3415- /* Return the number of objects */
34161839 return object_cnt;
34171840 }
34181841
@@ -3435,29 +1858,18 @@ static concptr feature_group_text[] =
34351858 */
34361859 static FEAT_IDX collect_features(FEAT_IDX *feat_idx, BIT_FLAGS8 mode)
34371860 {
3438- /* Check every feature */
34391861 FEAT_IDX feat_cnt = 0;
34401862 for (FEAT_IDX i = 0; i < max_f_idx; i++)
34411863 {
34421864 feature_type *f_ptr = &f_info[i];
3443-
3444- /* Skip empty index */
34451865 if (!f_ptr->name) continue;
3446-
3447- /* Skip mimiccing features */
34481866 if (f_ptr->mimic != i) continue;
34491867
3450- /* Add the index */
34511868 feat_idx[feat_cnt++] = i;
3452-
3453- /* XXX Hack -- Just checking for non-empty group */
34541869 if (mode & 0x01) break;
34551870 }
34561871
3457- /* Terminate the list */
34581872 feat_idx[feat_cnt] = -1;
3459-
3460- /* Return the number of races */
34611873 return feat_cnt;
34621874 }
34631875
@@ -3467,20 +1879,15 @@ static FEAT_IDX collect_features(FEAT_IDX *feat_idx, BIT_FLAGS8 mode)
34671879 */
34681880 void do_cmd_load_screen(void)
34691881 {
3470- TERM_LEN y, x;
34711882 TERM_COLOR a = 0;
34721883 SYMBOL_CODE c = ' ';
34731884 bool okay = TRUE;
34741885 FILE *fff;
34751886 char buf[1024];
34761887 TERM_LEN wid, hgt;
3477-
34781888 Term_get_size(&wid, &hgt);
34791889 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
3480-
3481- /* Append to the file */
34821890 fff = my_fopen(buf, "r");
3483-
34841891 if (!fff)
34851892 {
34861893 msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), buf);
@@ -3490,70 +1897,46 @@ void do_cmd_load_screen(void)
34901897
34911898 screen_save();
34921899 Term_clear();
3493-
3494- /* Load the screen */
3495- for (y = 0; okay; y++)
1900+ for (TERM_LEN y = 0; okay; y++)
34961901 {
3497- /* Get a line of data including control code */
34981902 if (!fgets(buf, 1024, fff)) okay = FALSE;
34991903
3500- /* Get the blank line */
35011904 if (buf[0] == '\n' || buf[0] == '\0') break;
3502-
3503- /* Ignore too large screen image */
35041905 if (y >= hgt) continue;
35051906
3506- /* Show each row */
3507- for (x = 0; x < wid - 1; x++)
1907+ for (TERM_LEN x = 0; x < wid - 1; x++)
35081908 {
3509- /* End of line */
35101909 if (buf[x] == '\n' || buf[x] == '\0') break;
35111910
3512- /* Put the attr/char */
35131911 Term_draw(x, y, TERM_WHITE, buf[x]);
35141912 }
35151913 }
35161914
3517- /* Dump the screen */
3518- for (y = 0; okay; y++)
1915+ for (TERM_LEN y = 0; okay; y++)
35191916 {
3520- /* Get a line of data including control code */
35211917 if (!fgets(buf, 1024, fff)) okay = FALSE;
35221918
3523- /* Get the blank line */
35241919 if (buf[0] == '\n' || buf[0] == '\0') break;
3525-
3526- /* Ignore too large screen image */
35271920 if (y >= hgt) continue;
35281921
3529- /* Dump each row */
3530- for (x = 0; x < wid - 1; x++)
1922+ for (TERM_LEN x = 0; x < wid - 1; x++)
35311923 {
3532- /* End of line */
35331924 if (buf[x] == '\n' || buf[x] == '\0') break;
35341925
3535- /* Get the attr/char */
35361926 (void)(Term_what(x, y, &a, &c));
3537-
3538- /* Look up the attr */
35391927 for (int i = 0; i < 16; i++)
35401928 {
3541- /* Use attr matches */
35421929 if (hack[i] == buf[x]) a = (byte)i;
35431930 }
35441931
3545- /* Put the attr/char */
35461932 Term_draw(x, y, a, c);
35471933 }
35481934 }
35491935
35501936 my_fclose(fff);
3551-
35521937 prt(_("ファイルに書き出された画面(記念撮影)をロードしました。", "Screen dump loaded."), 0, 0);
3553-
35541938 flush();
35551939 inkey();
3556-
35571940 screen_load();
35581941 }
35591942
@@ -3577,22 +1960,14 @@ concptr inven_res_label = _(" 酸電火冷毒光
35771960 }
35781961
35791962
3580-/* XTRA HACK RESLIST */
35811963 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)
35821964 {
35831965 GAME_TEXT o_name[MAX_NLEN];
35841966 BIT_FLAGS flgs[TR_FLAG_SIZE];
3585-
35861967 if (!o_ptr->k_idx) return;
35871968 if (o_ptr->tval != tval) return;
3588-
3589- /* Identified items only */
35901969 if (!object_is_known(o_ptr)) return;
35911970
3592- /*
3593- * HACK:Ring of Lordly protection and Dragon equipment
3594- * have random resistances.
3595- */
35961971 bool is_special_item_type = (object_is_wearable(o_ptr) && object_is_ego(o_ptr))
35971972 || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
35981973 || ((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
36081983
36091984 int i = 0;
36101985 object_desc(creature_ptr, o_name, o_ptr, OD_NAME_ONLY);
3611-
36121986 while (o_name[i] && (i < 26))
36131987 {
36141988 #ifdef JP
@@ -3685,12 +2059,9 @@ static void do_cmd_knowledge_inven(player_type *creature_ptr)
36852059 GAME_TEXT file_name[1024];
36862060 store_type *st_ptr;
36872061 OBJECT_TYPE_VALUE tval;
3688- int i = 0;
36892062 int j = 0;
36902063
36912064 char where[32];
3692-
3693- /* Open a new file */
36942065 fff = my_fopen_temp(file_name, 1024);
36952066 if (!fff)
36962067 {
@@ -3700,7 +2071,6 @@ static void do_cmd_knowledge_inven(player_type *creature_ptr)
37002071 }
37012072
37022073 fprintf(fff, "%s\n", inven_res_label);
3703-
37042074 for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
37052075 {
37062076 if (j != 0)
@@ -3711,28 +2081,26 @@ static void do_cmd_knowledge_inven(player_type *creature_ptr)
37112081 }
37122082
37132083 strcpy(where, _("装", "E "));
3714- for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
2084+ for (int i = INVEN_RARM; i < INVEN_TOTAL; i++)
37152085 {
37162086 do_cmd_knowledge_inven_aux(creature_ptr, fff, &creature_ptr->inventory_list[i], &j, tval, where);
37172087 }
37182088
37192089 strcpy(where, _("持", "I "));
3720- for (i = 0; i < INVEN_PACK; i++)
2090+ for (int i = 0; i < INVEN_PACK; i++)
37212091 {
37222092 do_cmd_knowledge_inven_aux(creature_ptr, fff, &creature_ptr->inventory_list[i], &j, tval, where);
37232093 }
37242094
37252095 st_ptr = &town_info[1].store[STORE_HOME];
37262096 strcpy(where, _("家", "H "));
3727- for (i = 0; i < st_ptr->stock_num; i++)
2097+ for (int i = 0; i < st_ptr->stock_num; i++)
37282098 {
37292099 do_cmd_knowledge_inven_aux(creature_ptr, fff, &st_ptr->stock[i], &j, tval, where);
37302100 }
37312101 }
37322102
37332103 my_fclose(fff);
3734-
3735- /* Display the file contents */
37362104 (void)show_file(creature_ptr, TRUE, file_name, _("*鑑定*済み武器/防具の耐性リスト", "Resistances of *identified* equipment"), 0, 0);
37372105 fd_kill(file_name);
37382106 }
@@ -3759,14 +2127,9 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
37592127
37602128 TERM_LEN wid, hgt;
37612129 Term_get_size(&wid, &hgt);
3762-
3763- /* File type is "TEXT" */
37642130 FILE_TYPE(FILE_TYPE_TEXT);
3765-
3766- /* Append to the file */
37672131 FILE *fff;
37682132 fff = my_fopen(filename, "w");
3769-
37702133 if (!fff)
37712134 {
37722135 if (message)
@@ -3779,6 +2142,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
37792142 }
37802143
37812144 if (message) screen_save();
2145+
37822146 char buf[2048];
37832147 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "htmldump.prf");
37842148 FILE *tmpfff;
@@ -3807,21 +2171,16 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
38072171 }
38082172 }
38092173
3810- /* Dump the screen */
38112174 for (TERM_LEN y = 0; y < hgt; y++)
38122175 {
3813- /* Start the row */
38142176 if (y != 0) fprintf(fff, "\n");
38152177
3816- /* Dump each row */
38172178 TERM_COLOR a = 0, old_a = 0;
38182179 char c = ' ';
38192180 for (TERM_LEN x = 0; x < wid - 1; x++)
38202181 {
38212182 concptr cc = NULL;
3822- /* Get the attr/char */
38232183 (void)(Term_what(x, y, &a, &c));
3824-
38252184 switch (c)
38262185 {
38272186 case '&': cc = "&amp;"; break;
@@ -3852,7 +2211,6 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
38522211 }
38532212
38542213 fprintf(fff, "</font>");
3855-
38562214 if (!tmpfff)
38572215 {
38582216 for (int i = 0; html_foot[i]; i++)
@@ -3880,10 +2238,8 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
38802238 my_fclose(tmpfff);
38812239 }
38822240
3883- /* Skip a line */
38842241 fprintf(fff, "\n");
38852242 my_fclose(fff);
3886-
38872243 if (message)
38882244 {
38892245 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
@@ -3894,6 +2250,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message)
38942250 screen_load();
38952251 }
38962252
2253+
38972254 /*
38982255 * Hack -- save a screen dump to a file
38992256 */
@@ -3960,14 +2317,11 @@ void do_cmd_save_screen(player_type *creature_ptr)
39602317 do_cmd_save_screen_html();
39612318 do_cmd_redraw(creature_ptr);
39622319 }
3963-
3964- /* Do we use a special screendump function ? */
39652320 else if (screendump_aux)
39662321 {
3967- /* Dump the screen to a graphics file */
39682322 (*screendump_aux)();
39692323 }
3970- else /* Dump the screen as text */
2324+ else
39712325 {
39722326 TERM_LEN y, x;
39732327 TERM_COLOR a = 0;
@@ -3975,13 +2329,8 @@ void do_cmd_save_screen(player_type *creature_ptr)
39752329 FILE *fff;
39762330 char buf[1024];
39772331 path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
3978-
3979- /* File type is "TEXT" */
39802332 FILE_TYPE(FILE_TYPE_TEXT);
3981-
3982- /* Append to the file */
39832333 fff = my_fopen(buf, "w");
3984-
39852334 if (!fff)
39862335 {
39872336 msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
@@ -3990,55 +2339,33 @@ void do_cmd_save_screen(player_type *creature_ptr)
39902339 }
39912340
39922341 screen_save();
3993-
3994- /* Dump the screen */
39952342 for (y = 0; y < hgt; y++)
39962343 {
3997- /* Dump each row */
39982344 for (x = 0; x < wid - 1; x++)
39992345 {
4000- /* Get the attr/char */
40012346 (void)(Term_what(x, y, &a, &c));
4002-
4003- /* Dump it */
40042347 buf[x] = c;
40052348 }
40062349
4007- /* Terminate */
40082350 buf[x] = '\0';
4009-
4010- /* End the row */
40112351 fprintf(fff, "%s\n", buf);
40122352 }
40132353
4014- /* Skip a line */
40152354 fprintf(fff, "\n");
4016-
4017-
4018- /* Dump the screen */
40192355 for (y = 0; y < hgt; y++)
40202356 {
4021- /* Dump each row */
40222357 for (x = 0; x < wid - 1; x++)
40232358 {
4024- /* Get the attr/char */
40252359 (void)(Term_what(x, y, &a, &c));
4026-
4027- /* Dump it */
40282360 buf[x] = hack[a & 0x0F];
40292361 }
40302362
4031- /* Terminate */
40322363 buf[x] = '\0';
4033-
4034- /* End the row */
40352364 fprintf(fff, "%s\n", buf);
40362365 }
40372366
4038- /* Skip a line */
40392367 fprintf(fff, "\n");
40402368 my_fclose(fff);
4041-
40422369 msg_print(_("画面(記念撮影)をファイルに書き出しました。", "Screen dump saved."));
40432370 msg_print(NULL);
40442371 screen_load();
@@ -4062,7 +2389,6 @@ void do_cmd_save_screen(player_type *creature_ptr)
40622389 */
40632390 static void do_cmd_knowledge_artifacts(player_type *player_ptr)
40642391 {
4065- /* Open a new file */
40662392 FILE *fff;
40672393 GAME_TEXT file_name[1024];
40682394 fff = my_fopen_temp(file_name, 1024);
@@ -4073,75 +2399,47 @@ static void do_cmd_knowledge_artifacts(player_type *player_ptr)
40732399 return;
40742400 }
40752401
4076- /* Allocate the "who" array */
40772402 ARTIFACT_IDX *who;
40782403 C_MAKE(who, max_a_idx, ARTIFACT_IDX);
4079-
4080- /* Allocate the "okay" array */
40812404 bool *okay;
40822405 C_MAKE(okay, max_a_idx, bool);
40832406
4084- /* Scan the artifacts */
40852407 for (ARTIFACT_IDX k = 0; k < max_a_idx; k++)
40862408 {
40872409 artifact_type *a_ptr = &a_info[k];
4088-
4089- /* Default */
40902410 okay[k] = FALSE;
4091-
4092- /* Skip "empty" artifacts */
40932411 if (!a_ptr->name) continue;
4094-
4095- /* Skip "uncreated" artifacts */
40962412 if (!a_ptr->cur_num) continue;
40972413
4098- /* Assume okay */
40992414 okay[k] = TRUE;
41002415 }
41012416
4102- /* Check the dungeon */
41032417 for (POSITION y = 0; y < player_ptr->current_floor_ptr->height; y++)
41042418 {
41052419 for (POSITION x = 0; x < player_ptr->current_floor_ptr->width; x++)
41062420 {
41072421 grid_type *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
4108-
41092422 OBJECT_IDX this_o_idx, next_o_idx = 0;
4110-
4111- /* Scan all objects in the grid */
41122423 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
41132424 {
41142425 object_type *o_ptr;
41152426 o_ptr = &player_ptr->current_floor_ptr->o_list[this_o_idx];
41162427 next_o_idx = o_ptr->next_o_idx;
4117-
4118- /* Ignore non-artifacts */
41192428 if (!object_is_fixed_artifact(o_ptr)) continue;
4120-
4121- /* Ignore known items */
41222429 if (object_is_known(o_ptr)) continue;
41232430
4124- /* Note the artifact */
41252431 okay[o_ptr->name1] = FALSE;
41262432 }
41272433 }
41282434 }
41292435
4130- /* Check the player_ptr->inventory_list and equipment */
41312436 for (ARTIFACT_IDX i = 0; i < INVEN_TOTAL; i++)
41322437 {
41332438 object_type *o_ptr = &player_ptr->inventory_list[i];
4134-
4135- /* Ignore non-objects */
41362439 if (!o_ptr->k_idx) continue;
4137-
4138- /* Ignore non-artifacts */
41392440 if (!object_is_fixed_artifact(o_ptr)) continue;
4140-
4141- /* Ignore known items */
41422441 if (object_is_known(o_ptr)) continue;
41432442
4144- /* Note the artifact */
41452443 okay[o_ptr->name1] = FALSE;
41462444 }
41472445
@@ -4153,49 +2451,29 @@ static void do_cmd_knowledge_artifacts(player_type *player_ptr)
41532451
41542452 u16b why = 3;
41552453 ang_sort(who, &why, n, ang_sort_art_comp, ang_sort_art_swap);
4156-
4157- /* Scan the artifacts */
41582454 for (ARTIFACT_IDX k = 0; k < n; k++)
41592455 {
41602456 artifact_type *a_ptr = &a_info[who[k]];
41612457 GAME_TEXT base_name[MAX_NLEN];
41622458 strcpy(base_name, _("未知の伝説のアイテム", "Unknown Artifact"));
4163-
4164- /* Obtain the base object type */
41652459 ARTIFACT_IDX z = lookup_kind(a_ptr->tval, a_ptr->sval);
4166-
4167- /* Real object */
41682460 if (z)
41692461 {
41702462 object_type forge;
41712463 object_type *q_ptr;
41722464 q_ptr = &forge;
4173-
4174- /* Create fake object */
41752465 object_prep(q_ptr, z);
4176-
4177- /* Make it an artifact */
41782466 q_ptr->name1 = (byte)who[k];
4179-
4180- /* Display as if known */
41812467 q_ptr->ident |= IDENT_STORE;
4182-
4183- /* Describe the artifact */
41842468 object_desc(player_ptr, base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
41852469 }
41862470
4187- /* Hack -- Build the artifact name */
41882471 fprintf(fff, _(" %s\n", " The %s\n"), base_name);
41892472 }
41902473
4191- /* Free the "who" array */
41922474 C_KILL(who, max_a_idx, ARTIFACT_IDX);
4193-
4194- /* Free the "okay" array */
41952475 C_KILL(okay, max_a_idx, bool);
41962476 my_fclose(fff);
4197-
4198- /* Display the file contents */
41992477 (void)show_file(player_ptr, TRUE, file_name, _("既知の伝説のアイテム", "Artifacts Seen"), 0, 0);
42002478 fd_kill(file_name);
42012479 }
@@ -4209,22 +2487,17 @@ static void do_cmd_knowledge_uniques(player_type *creature_ptr)
42092487 {
42102488 u16b why = 2;
42112489 IDX *who;
4212-
4213- FILE *fff;
4214-
42152490 GAME_TEXT file_name[1024];
4216-
42172491 int n_alive[10];
42182492 int n_alive_surface = 0;
42192493 int n_alive_over100 = 0;
42202494 int n_alive_total = 0;
42212495 int max_lev = -1;
2496+ for (IDX i = 0; i < 10; i++)
2497+ n_alive[i] = 0;
42222498
4223- for (IDX i = 0; i < 10; i++) n_alive[i] = 0;
4224-
4225- /* Open a new file */
2499+ FILE *fff;
42262500 fff = my_fopen_temp(file_name, 1024);
4227-
42282501 if (!fff)
42292502 {
42302503 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)
42322505 return;
42332506 }
42342507
4235- /* Allocate the "who" array */
42362508 C_MAKE(who, max_r_idx, MONRACE_IDX);
4237-
4238- /* Scan the monsters */
42392509 int n = 0;
42402510 for (IDX i = 1; i < max_r_idx; i++)
42412511 {
42422512 monster_race *r_ptr = &r_info[i];
4243- int lev;
4244-
42452513 if (!r_ptr->name) continue;
4246-
4247- /* Require unique monsters */
42482514 if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
4249-
4250- /* Only display "known" uniques */
42512515 if (!cheat_know && !r_ptr->r_sights) continue;
4252-
4253- /* Only print rarity <= 100 uniques */
42542516 if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue;
4255-
4256- /* Only "alive" uniques */
42572517 if (r_ptr->max_num == 0) continue;
42582518
42592519 if (r_ptr->level)
42602520 {
4261- lev = (r_ptr->level - 1) / 10;
2521+ int lev = (r_ptr->level - 1) / 10;
42622522 if (lev < 10)
42632523 {
42642524 n_alive[lev]++;
42652525 if (max_lev < lev) max_lev = lev;
42662526 }
4267- else n_alive_over100++;
2527+ else
2528+ n_alive_over100++;
42682529 }
4269- else n_alive_surface++;
2530+ else
2531+ n_alive_surface++;
42702532
4271- /* Collect "appropriate" monsters */
42722533 who[n++] = i;
42732534 }
42742535
4275- /* Sort the array by dungeon depth of monsters */
42762536 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
4277-
42782537 if (n_alive_surface)
42792538 {
42802539 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)
43032562 fputs(_("現在は既知の生存ユニークはいません。\n", "No known uniques alive.\n"), fff);
43042563 }
43052564
4306- /* Scan the monster races */
43072565 for (int k = 0; k < n; k++)
43082566 {
43092567 monster_race *r_ptr = &r_info[who[k]];
43102568 fprintf(fff, _(" %s (レベル%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, (int)r_ptr->level);
43112569 }
43122570
4313- /* Free the "who" array */
43142571 C_KILL(who, max_r_idx, s16b);
43152572 my_fclose(fff);
4316-
4317- /* Display the file contents */
43182573 (void)show_file(creature_ptr, TRUE, file_name, _("まだ生きているユニーク・モンスター", "Alive Uniques"), 0, 0);
43192574 fd_kill(file_name);
43202575 }
@@ -4325,7 +2580,6 @@ static void do_cmd_knowledge_uniques(player_type *creature_ptr)
43252580 */
43262581 static void do_cmd_knowledge_weapon_exp(player_type *creature_ptr)
43272582 {
4328- /* Open a new file */
43292583 FILE *fff;
43302584 GAME_TEXT file_name[1024];
43312585 fff = my_fopen_temp(file_name, 1024);
@@ -4363,8 +2617,6 @@ static void do_cmd_knowledge_weapon_exp(player_type *creature_ptr)
43632617 }
43642618
43652619 my_fclose(fff);
4366-
4367- /* Display the file contents */
43682620 (void)show_file(creature_ptr, TRUE, file_name, _("武器の経験値", "Weapon Proficiency"), 0, 0);
43692621 fd_kill(file_name);
43702622 }
@@ -4377,7 +2629,6 @@ static void do_cmd_knowledge_weapon_exp(player_type *creature_ptr)
43772629 */
43782630 static void do_cmd_knowledge_spell_exp(player_type *creature_ptr)
43792631 {
4380- /* Open a new file */
43812632 FILE *fff;
43822633 GAME_TEXT file_name[1024];
43832634 fff = my_fopen_temp(file_name, 1024);
@@ -4450,8 +2701,6 @@ static void do_cmd_knowledge_spell_exp(player_type *creature_ptr)
44502701 }
44512702
44522703 my_fclose(fff);
4453-
4454- /* Display the file contents */
44552704 (void)show_file(creature_ptr, TRUE, file_name, _("魔法の経験値", "Spell Proficiency"), 0, 0);
44562705 fd_kill(file_name);
44572706 }
@@ -4472,7 +2721,6 @@ static void do_cmd_knowledge_skill_exp(player_type *creature_ptr)
44722721 _("盾 ", "Shield ")
44732722 };
44742723
4475- /* Open a new file */
44762724 FILE *fff;
44772725 char file_name[1024];
44782726 fff = my_fopen_temp(file_name, 1024);
@@ -4495,8 +2743,6 @@ static void do_cmd_knowledge_skill_exp(player_type *creature_ptr)
44952743 }
44962744
44972745 my_fclose(fff);
4498-
4499- /* Display the file contents */
45002746 (void)show_file(creature_ptr, TRUE, file_name, _("技能の経験値", "Miscellaneous Proficiency"), 0, 0);
45012747 fd_kill(file_name);
45022748 }
@@ -4510,7 +2756,6 @@ static void do_cmd_knowledge_skill_exp(player_type *creature_ptr)
45102756 */
45112757 static void do_cmd_knowledge_pets(player_type *creature_ptr)
45122758 {
4513- /* Open a new file */
45142759 GAME_TEXT file_name[1024];
45152760 FILE *fff;
45162761 fff = my_fopen_temp(file_name, 1024);
@@ -4521,18 +2766,13 @@ static void do_cmd_knowledge_pets(player_type *creature_ptr)
45212766 return;
45222767 }
45232768
4524- /* Process the monsters (backwards) */
45252769 monster_type *m_ptr;
45262770 GAME_TEXT pet_name[MAX_NLEN];
45272771 int t_friends = 0;
45282772 for (int i = creature_ptr->current_floor_ptr->m_max - 1; i >= 1; i--)
45292773 {
45302774 m_ptr = &creature_ptr->current_floor_ptr->m_list[i];
4531-
4532- /* Ignore "dead" monsters */
45332775 if (!monster_is_valid(m_ptr)) continue;
4534-
4535- /* Calculate "upkeep" for pets */
45362776 if (!is_pet(m_ptr)) continue;
45372777
45382778 t_friends++;
@@ -4551,8 +2791,6 @@ static void do_cmd_knowledge_pets(player_type *creature_ptr)
45512791 fprintf(fff, _(" 維持コスト: %d%% MP\n", " Upkeep: %d%% mana.\n"), show_upkeep);
45522792
45532793 my_fclose(fff);
4554-
4555- /* Display the file contents */
45562794 (void)show_file(creature_ptr, TRUE, file_name, _("現在のペット", "Current Pets"), 0, 0);
45572795 fd_kill(file_name);
45582796 }
@@ -4567,7 +2805,6 @@ static void do_cmd_knowledge_pets(player_type *creature_ptr)
45672805 */
45682806 static void do_cmd_knowledge_kill_count(player_type *creature_ptr)
45692807 {
4570- /* Open a new file */
45712808 FILE *fff;
45722809 GAME_TEXT file_name[1024];
45732810 fff = my_fopen_temp(file_name, 1024);
@@ -4578,72 +2815,58 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr)
45782815 return;
45792816 }
45802817
4581- /* Allocate the "who" array */
45822818 MONRACE_IDX *who;
45832819 C_MAKE(who, max_r_idx, MONRACE_IDX);
4584-
45852820 s32b total = 0;
2821+ for (int kk = 1; kk < max_r_idx; kk++)
45862822 {
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))
45892826 {
4590- monster_race *r_ptr = &r_info[kk];
2827+ bool dead = (r_ptr->max_num == 0);
45912828
4592- if (r_ptr->flags1 & (RF1_UNIQUE))
2829+ if (dead)
45932830 {
4594- bool dead = (r_ptr->max_num == 0);
4595-
4596- if (dead)
4597- {
4598- total++;
4599- }
2831+ total++;
46002832 }
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;
46042837
4605- if (this_monster > 0)
4606- {
4607- total += this_monster;
4608- }
2838+ if (this_monster > 0)
2839+ {
2840+ total += this_monster;
46092841 }
46102842 }
2843+ }
46112844
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
46152848 #ifdef JP
4616- fprintf(fff, "あなたは%ld体の敵を倒している。\n\n", (long int)total);
2849+ fprintf(fff, "あなたは%ld体の敵を倒している。\n\n", (long int)total);
46172850 #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");
46192852 #endif
4620- }
46212853
46222854 total = 0;
4623-
4624- /* Scan the monsters */
46252855 int n = 0;
46262856 for (MONRACE_IDX i = 1; i < max_r_idx; i++)
46272857 {
46282858 monster_race *r_ptr = &r_info[i];
4629-
4630- /* Use that monster */
46312859 if (r_ptr->name) who[n++] = i;
46322860 }
46332861
4634- /* Sort the array by dungeon depth of monsters */
46352862 u16b why = 2;
46362863 ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
4637-
4638- /* Scan the monster races */
46392864 for (int k = 0; k < n; k++)
46402865 {
46412866 monster_race *r_ptr = &r_info[who[k]];
4642-
46432867 if (r_ptr->flags1 & (RF1_UNIQUE))
46442868 {
46452869 bool dead = (r_ptr->max_num == 0);
4646-
46472870 if (dead)
46482871 {
46492872 fprintf(fff, " %s\n", (r_name + r_ptr->name));
@@ -4654,11 +2877,9 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr)
46542877 }
46552878
46562879 MONSTER_NUMBER this_monster = r_ptr->r_pkills;
4657-
46582880 if (this_monster <= 0) continue;
46592881
46602882 #ifdef JP
4661- /* p,tは人と数える by ita */
46622883 if (my_strchr("pt", r_ptr->d_char))
46632884 fprintf(fff, " %3d 人の %s\n", (int)this_monster, r_name + r_ptr->name);
46642885 else
@@ -4693,11 +2914,8 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr)
46932914 fprintf(fff, " Total: %lu creature%s killed.\n", (unsigned long int)total, (total == 1 ? "" : "s"));
46942915 #endif
46952916
4696- /* Free the "who" array */
46972917 C_KILL(who, max_r_idx, s16b);
46982918 my_fclose(fff);
4699-
4700- /* Display the file contents */
47012919 (void)show_file(creature_ptr, TRUE, file_name, _("倒した敵の数", "Kill Count"), 0, 0);
47022920 fd_kill(file_name);
47032921 }
@@ -4718,19 +2936,11 @@ static void do_cmd_knowledge_kill_count(player_type *creature_ptr)
47182936 */
47192937 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)
47202938 {
4721- /* Display lines until done */
47222939 for (int i = 0; i < per_page && (grp_idx[i] >= 0); i++)
47232940 {
4724- /* Get the group index */
47252941 int grp = grp_idx[grp_top + i];
4726-
4727- /* Choose a color */
47282942 TERM_COLOR attr = (grp_top + i == grp_cur) ? TERM_L_BLUE : TERM_WHITE;
4729-
4730- /* Erase the entire line */
47312943 Term_erase(col, row + i, wid);
4732-
4733- /* Display the group label */
47342944 c_put_str(attr, group_text[grp], row + i, col);
47352945 }
47362946 }
@@ -4739,70 +2949,44 @@ static void display_group_list(int col, int row, int wid, int per_page, IDX grp_
47392949 /*
47402950 * Move the cursor in a browser window
47412951 */
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)
47442953 {
47452954 int d;
47462955 int col = *column;
47472956 IDX grp = *grp_cur;
47482957 IDX list = *list_cur;
4749-
4750- /* Extract direction */
47512958 if (ch == ' ')
4752- {
4753- /* Hack -- scroll up full screen */
47542959 d = 3;
4755- }
47562960 else if (ch == '-')
4757- {
4758- /* Hack -- scroll down full screen */
47592961 d = 9;
4760- }
47612962 else
4762- {
47632963 d = get_keymap_dir(ch);
4764- }
47652964
47662965 if (!d) return;
47672966
4768- /* Diagonals - hack */
47692967 if ((ddx[d] > 0) && ddy[d])
47702968 {
47712969 int browser_rows;
47722970 int wid, hgt;
4773-
47742971 Term_get_size(&wid, &hgt);
4775-
47762972 browser_rows = hgt - 8;
4777-
4778- /* Browse group list */
47792973 if (!col)
47802974 {
47812975 int old_grp = grp;
4782-
4783- /* Move up or down */
47842976 grp += ddy[d] * (browser_rows - 1);
4785-
4786- /* Verify */
47872977 if (grp >= grp_cnt) grp = grp_cnt - 1;
47882978 if (grp < 0) grp = 0;
47892979 if (grp != old_grp) list = 0;
47902980 }
4791-
4792- /* Browse sub-list list */
47932981 else
47942982 {
4795- /* Move up or down */
47962983 list += ddy[d] * browser_rows;
4797-
4798- /* Verify */
47992984 if (list >= list_cnt) list = list_cnt - 1;
48002985 if (list < 0) list = 0;
48012986 }
48022987
48032988 (*grp_cur) = grp;
48042989 (*list_cur) = list;
4805-
48062990 return;
48072991 }
48082992
@@ -4813,31 +2997,20 @@ static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
48132997 if (col > 1) col = 1;
48142998
48152999 (*column) = col;
4816-
48173000 return;
48183001 }
48193002
4820- /* Browse group list */
48213003 if (!col)
48223004 {
48233005 int old_grp = grp;
4824-
4825- /* Move up or down */
48263006 grp += (IDX)ddy[d];
4827-
4828- /* Verify */
48293007 if (grp >= grp_cnt) grp = grp_cnt - 1;
48303008 if (grp < 0) grp = 0;
48313009 if (grp != old_grp) list = 0;
48323010 }
4833-
4834- /* Browse sub-list list */
48353011 else
48363012 {
4837- /* Move up or down */
48383013 list += (IDX)ddy[d];
4839-
4840- /* Verify */
48413014 if (list >= list_cnt) list = list_cnt - 1;
48423015 if (list < 0) list = 0;
48433016 }
@@ -4852,42 +3025,31 @@ static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
48523025 */
48533026 static void display_visual_list(int col, int row, int height, int width, TERM_COLOR attr_top, byte char_left)
48543027 {
4855- /* Clear the display lines */
48563028 for (int i = 0; i < height; i++)
48573029 {
48583030 Term_erase(col, row + i, width);
48593031 }
48603032
4861- /* Bigtile mode uses double width */
48623033 if (use_bigtile) width /= 2;
48633034
4864- /* Display lines until done */
48653035 for (int i = 0; i < height; i++)
48663036 {
4867- /* Display columns until done */
48683037 for (int j = 0; j < width; j++)
48693038 {
48703039 TERM_LEN x = col + j;
48713040 TERM_LEN y = row + i;
4872-
4873- /* Bigtile mode uses double width */
48743041 if (use_bigtile) x += j;
48753042
48763043 TERM_COLOR ia = attr_top + i;
48773044 SYMBOL_CODE ic = char_left + j;
4878-
4879- /* Ignore illegal characters */
48803045 if (ia > 0x7f || ic > 0xff || ic < ' ' ||
48813046 (!use_graphics && ic > 0x7f))
48823047 continue;
48833048
48843049 TERM_COLOR a = ia;
48853050 SYMBOL_CODE c = ic;
4886-
4887- /* Force correct code for both ASCII character and tile */
48883051 if (c & 0x80) a |= 0x80;
48893052
4890- /* Display symbol */
48913053 Term_queue_bigchar(x, y, a, c, 0, 0);
48923054 }
48933055 }
@@ -4904,11 +3066,8 @@ static void place_visual_list_cursor(TERM_LEN col, TERM_LEN row, TERM_COLOR a, b
49043066
49053067 TERM_LEN x = col + j;
49063068 TERM_LEN y = row + i;
4907-
4908- /* Bigtile mode uses double width */
49093069 if (use_bigtile) x += j;
49103070
4911- /* Place the cursor */
49123071 Term_gotoxy(x, y);
49133072 }
49143073
@@ -4929,25 +3088,25 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
49293088 case ESCAPE:
49303089 if (*visual_list_ptr)
49313090 {
4932- /* Cancel change */
49333091 *cur_attr_ptr = attr_old;
49343092 *cur_char_ptr = char_old;
49353093 *visual_list_ptr = FALSE;
49363094
49373095 return TRUE;
49383096 }
3097+
49393098 break;
49403099
49413100 case '\n':
49423101 case '\r':
49433102 if (*visual_list_ptr)
49443103 {
4945- /* Accept change */
49463104 *visual_list_ptr = FALSE;
49473105 *need_redraw = TRUE;
49483106
49493107 return TRUE;
49503108 }
3109+
49513110 break;
49523111
49533112 case 'V':
@@ -4964,31 +3123,27 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
49643123
49653124 return TRUE;
49663125 }
3126+
49673127 break;
49683128
49693129 case 'C':
49703130 case 'c':
49713131 {
4972- int i;
4973-
4974- /* Set the visual */
49753132 attr_idx = *cur_attr_ptr;
49763133 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++)
49803135 {
49813136 attr_idx_feat[i] = 0;
49823137 char_idx_feat[i] = 0;
49833138 }
49843139 }
3140+
49853141 return TRUE;
49863142
49873143 case 'P':
49883144 case 'p':
4989- if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */
3145+ if (attr_idx || (!(char_idx & 0x80) && char_idx))
49903146 {
4991- /* Set the char */
49923147 *cur_attr_ptr = attr_idx;
49933148 *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
49943149 if (!*visual_list_ptr) *need_redraw = TRUE;
@@ -5015,7 +3170,6 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
50153170 if (use_bigtile) eff_width = width / 2;
50163171 else eff_width = width;
50173172
5018- /* Restrict direction */
50193173 if ((a == 0) && (ddy[d] < 0)) d = 0;
50203174 if ((c == 0) && (ddx[d] < 0)) d = 0;
50213175 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
@@ -5023,26 +3177,20 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
50233177
50243178 a += (TERM_COLOR)ddy[d];
50253179 c += (SYMBOL_CODE)ddx[d];
5026-
5027- /* Force correct code for both ASCII character and tile */
50283180 if (c & 0x80) a |= 0x80;
50293181
5030- /* Set the visual */
50313182 *cur_attr_ptr = a;
50323183 *cur_char_ptr = c;
5033-
5034-
5035- /* Move the frame */
50363184 if ((ddx[d] < 0) && *char_left_ptr > MAX(0, (int)c - 10)) (*char_left_ptr)--;
50373185 if ((ddx[d] > 0) && *char_left_ptr + eff_width < MIN(0xff, (int)c + 10)) (*char_left_ptr)++;
50383186 if ((ddy[d] < 0) && *attr_top_ptr > MAX(0, (int)(a & 0x7f) - 4)) (*attr_top_ptr)--;
50393187 if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
50403188 return TRUE;
50413189 }
3190+
50423191 break;
50433192 }
50443193
5045- /* Visual mode command is not used */
50463194 return FALSE;
50473195 }
50483196
@@ -5050,28 +3198,16 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
50503198 /*
50513199 * Display the monsters in a group.
50523200 */
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)
50553202 {
5056- /* Display lines until done */
50573203 int i;
50583204 for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
50593205 {
50603206 TERM_COLOR attr;
5061-
5062- /* Get the race index */
50633207 MONRACE_IDX r_idx = mon_idx[mon_top + i];
5064-
5065- /* Access the race */
50663208 monster_race *r_ptr = &r_info[r_idx];
5067-
5068- /* Choose a color */
50693209 attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
5070-
5071- /* Display the name */
50723210 c_prt(attr, (r_name + r_ptr->name), row + i, col);
5073-
5074- /* Hack -- visual_list mode */
50753211 if (per_page == 1)
50763212 {
50773213 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[],
50823218 c_prt(attr, format("%d", r_idx), row + i, 62);
50833219 }
50843220
5085- /* Erase chars before overwritten by the race letter */
50863221 Term_erase(69, row + i, 255);
5087-
5088- /* Display symbol */
50893222 Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
5090-
50913223 if (!visual_only)
50923224 {
5093- /* Display kills */
50943225 if (!(r_ptr->flags1 & RF1_UNIQUE))
50953226 put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
50963227 else
@@ -5099,7 +3230,6 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
50993230 }
51003231 }
51013232
5102- /* Clear remaining lines */
51033233 for (; i < per_page; i++)
51043234 {
51053235 Term_erase(col, row + i, 255);
@@ -5120,8 +3250,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
51203250 {
51213251 TERM_LEN wid, hgt;
51223252 Term_get_size(&wid, &hgt);
5123-
5124- /* Allocate the "mon_idx" array */
51253253 IDX *mon_idx;
51263254 C_MAKE(mon_idx, max_r_idx, MONRACE_IDX);
51273255
@@ -5137,21 +3265,14 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
51373265 if (direct_r_idx < 0)
51383266 {
51393267 mode = visual_only ? 0x03 : 0x01;
5140-
5141- /* Check every group */
51423268 int len;
51433269 for (IDX i = 0; monster_group_text[i] != NULL; i++)
51443270 {
5145- /* Measure the label */
51463271 len = strlen(monster_group_text[i]);
5147-
5148- /* Save the maximum length */
51493272 if (len > max) max = len;
51503273
5151- /* See if any monsters are known */
51523274 if ((monster_group_char[i] == ((char *)-1L)) || collect_monsters(creature_ptr, i, mon_idx, mode))
51533275 {
5154- /* Build a list of groups with known monsters */
51553276 grp_idx[grp_cnt++] = i;
51563277 }
51573278 }
@@ -5162,17 +3283,13 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
51623283 {
51633284 mon_idx[0] = direct_r_idx;
51643285 mon_cnt = 1;
5165-
5166- /* Terminate the list */
51673286 mon_idx[1] = -1;
51683287
51693288 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
51703289 &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
51713290 }
51723291
5173- /* Terminate the list */
51743292 grp_idx[grp_cnt] = -1;
5175-
51763293 mode = visual_only ? 0x02 : 0x00;
51773294 IDX old_grp_cur = -1;
51783295 IDX grp_cur = 0;
@@ -5212,22 +3329,16 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
52123329
52133330 if (direct_r_idx < 0)
52143331 {
5215- /* Scroll group list */
52163332 if (grp_cur < grp_top) grp_top = grp_cur;
52173333 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
52183334
5219- /* Display a list of monster groups */
52203335 display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
5221-
52223336 if (old_grp_cur != grp_cur)
52233337 {
52243338 old_grp_cur = grp_cur;
5225-
5226- /* Get a list of monsters in the current group */
52273339 mon_cnt = collect_monsters(creature_ptr, grp_idx[grp_cur], mon_idx, mode);
52283340 }
52293341
5230- /* Scroll monster list */
52313342 while (mon_cur < mon_top)
52323343 mon_top = MAX(0, mon_top - browser_rows / 2);
52333344 while (mon_cur >= mon_top + browser_rows)
@@ -5236,34 +3347,26 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
52363347
52373348 if (!visual_list)
52383349 {
5239- /* Display a list of monsters in the current group */
52403350 display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
52413351 }
52423352 else
52433353 {
52443354 mon_top = mon_cur;
5245-
5246- /* Display a monster name */
52473355 display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
5248-
5249- /* Display visual list below first monster */
52503356 display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
52513357 }
52523358
5253- /* Prompt */
52543359 prt(format(_("<方向>%s%s%s, ESC", "<dir>%s%s%s, ESC"),
52553360 (!visual_list && !visual_only) ? _(", 'r'で思い出を見る", ", 'r' to recall") : "",
52563361 visual_list ? _(", ENTERで決定", ", ENTER to accept") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
52573362 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
52583363 hgt - 1, 0);
52593364
5260- /* Get the current monster */
52613365 monster_race *r_ptr;
52623366 r_ptr = &r_info[mon_idx[mon_cur]];
52633367
52643368 if (!visual_only)
52653369 {
5266- /* Mega Hack -- track this monster race */
52673370 if (mon_cnt) monster_race_track(creature_ptr, mon_idx[mon_cur]);
52683371 handle_stuff(creature_ptr);
52693372 }
@@ -5282,8 +3385,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
52823385 }
52833386
52843387 char ch = inkey();
5285-
5286- /* Do visual mode command if needed */
52873388 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))
52883389 {
52893390 if (direct_r_idx >= 0)
@@ -5312,7 +3413,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
53123413 case 'R':
53133414 case 'r':
53143415 {
5315- /* Recall on screen */
53163416 if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
53173417 {
53183418 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
53273427
53283428 default:
53293429 {
5330- /* Move the cursor */
53313430 browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
53323431
53333432 break;
@@ -5335,7 +3434,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
53353434 }
53363435 }
53373436
5338- /* Free the "mon_idx" array */
53393437 C_KILL(mon_idx, max_r_idx, MONRACE_IDX);
53403438 }
53413439
@@ -5346,7 +3444,6 @@ static void do_cmd_knowledge_monsters(player_type *creature_ptr, bool *need_redr
53463444 static void display_object_list(int col, int row, int per_page, IDX object_idx[],
53473445 int object_cur, int object_top, bool visual_only)
53483446 {
5349- /* Display lines until done */
53503447 int i;
53513448 for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
53523449 {
@@ -5354,45 +3451,30 @@ static void display_object_list(int col, int row, int per_page, IDX object_idx[]
53543451 TERM_COLOR a;
53553452 SYMBOL_CODE c;
53563453 object_kind *flavor_k_ptr;
5357-
5358- /* Get the object index */
53593454 KIND_OBJECT_IDX k_idx = object_idx[object_top + i];
5360-
5361- /* Access the object */
53623455 object_kind *k_ptr = &k_info[k_idx];
5363-
5364- /* Choose a color */
53653456 TERM_COLOR attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
53663457 byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
5367-
53683458 if (!visual_only && k_ptr->flavor)
53693459 {
5370- /* Appearance of this object is shuffled */
53713460 flavor_k_ptr = &k_info[k_ptr->flavor];
53723461 }
53733462 else
53743463 {
5375- /* Appearance of this object is very normal */
53763464 flavor_k_ptr = k_ptr;
53773465 }
53783466
53793467 attr = ((i + object_top == object_cur) ? cursor : attr);
5380-
53813468 if (!k_ptr->flavor || (!visual_only && k_ptr->aware))
53823469 {
5383- /* Tidy name */
53843470 strip_name(o_name, k_idx);
53853471 }
53863472 else
53873473 {
5388- /* Flavor name */
53893474 strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
53903475 }
53913476
5392- /* Display the name */
53933477 c_prt(attr, o_name, row + i, col);
5394-
5395- /* Hack -- visual_list mode */
53963478 if (per_page == 1)
53973479 {
53983480 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[]
54063488 a = flavor_k_ptr->x_attr;
54073489 c = flavor_k_ptr->x_char;
54083490
5409- /* Display symbol */
54103491 Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
54113492 }
54123493
5413- /* Clear remaining lines */
54143494 for (; i < per_page; i++)
54153495 {
54163496 Term_erase(col, row + i, 255);
@@ -5429,7 +3509,6 @@ static void desc_obj_fake(player_type *creature_ptr, KIND_OBJECT_IDX k_idx)
54293509 object_wipe(o_ptr);
54303510 object_prep(o_ptr, k_idx);
54313511
5432- /* It's fully know */
54333512 o_ptr->ident |= IDENT_KNOWN;
54343513 handle_stuff(creature_ptr);
54353514
@@ -5459,8 +3538,6 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
54593538 Term_get_size(&wid, &hgt);
54603539
54613540 int browser_rows = hgt - 8;
5462-
5463- /* Allocate the "object_idx" array */
54643541 C_MAKE(object_idx, max_k_idx, KIND_OBJECT_IDX);
54653542
54663543 int len;
@@ -5469,20 +3546,13 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
54693546 if (direct_k_idx < 0)
54703547 {
54713548 mode = visual_only ? 0x03 : 0x01;
5472-
5473- /* Check every group */
54743549 for (IDX i = 0; object_group_text[i] != NULL; i++)
54753550 {
5476- /* Measure the label */
54773551 len = strlen(object_group_text[i]);
5478-
5479- /* Save the maximum length */
54803552 if (len > max) max = len;
54813553
5482- /* See if any monsters are known */
54833554 if (collect_objects(i, object_idx, mode))
54843555 {
5485- /* Build a list of groups with known monsters */
54863556 grp_idx[grp_cnt++] = i;
54873557 }
54883558 }
@@ -5497,29 +3567,22 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
54973567
54983568 if (!visual_only && k_ptr->flavor)
54993569 {
5500- /* Appearance of this object is shuffled */
55013570 flavor_k_ptr = &k_info[k_ptr->flavor];
55023571 }
55033572 else
55043573 {
5505- /* Appearance of this object is very normal */
55063574 flavor_k_ptr = k_ptr;
55073575 }
55083576
55093577 object_idx[0] = direct_k_idx;
55103578 object_old = direct_k_idx;
55113579 object_cnt = 1;
5512-
5513- /* Terminate the list */
55143580 object_idx[1] = -1;
5515-
55163581 (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
55173582 &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
55183583 }
55193584
5520- /* Terminate the list */
55213585 grp_idx[grp_cnt] = -1;
5522-
55233586 mode = visual_only ? 0x02 : 0x00;
55243587 IDX old_grp_cur = -1;
55253588 IDX grp_cur = 0;
@@ -5568,22 +3631,16 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
55683631
55693632 if (direct_k_idx < 0)
55703633 {
5571- /* Scroll group list */
55723634 if (grp_cur < grp_top) grp_top = grp_cur;
55733635 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
55743636
5575- /* Display a list of object groups */
55763637 display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
5577-
55783638 if (old_grp_cur != grp_cur)
55793639 {
55803640 old_grp_cur = grp_cur;
5581-
5582- /* Get a list of objects in the current group */
55833641 object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
55843642 }
55853643
5586- /* Scroll object list */
55873644 while (object_cur < object_top)
55883645 object_top = MAX(0, object_top - browser_rows / 2);
55893646 while (object_cur >= object_top + browser_rows)
@@ -5592,35 +3649,26 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
55923649
55933650 if (!visual_list)
55943651 {
5595- /* Display a list of objects in the current group */
55963652 display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
55973653 }
55983654 else
55993655 {
56003656 object_top = object_cur;
5601-
5602- /* Display a list of objects in the current group */
56033657 display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
5604-
5605- /* Display visual list below first object */
56063658 display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
56073659 }
56083660
5609- /* Get the current object */
56103661 k_ptr = &k_info[object_idx[object_cur]];
56113662
56123663 if (!visual_only && k_ptr->flavor)
56133664 {
5614- /* Appearance of this object is shuffled */
56153665 flavor_k_ptr = &k_info[k_ptr->flavor];
56163666 }
56173667 else
56183668 {
5619- /* Appearance of this object is very normal */
56203669 flavor_k_ptr = k_ptr;
56213670 }
56223671
5623- /* Prompt */
56243672 #ifdef JP
56253673 prt(format("<方向>%s%s%s, ESC",
56263674 (!visual_list && !visual_only) ? ", 'r'で詳細を見る" : "",
@@ -5637,15 +3685,11 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
56373685
56383686 if (!visual_only)
56393687 {
5640- /* Mega Hack -- track this object */
56413688 if (object_cnt) object_kind_track(creature_ptr, object_idx[object_cur]);
56423689
5643- /* The "current" object changed */
56443690 if (object_old != object_idx[object_cur])
56453691 {
56463692 handle_stuff(creature_ptr);
5647-
5648- /* Remember the "current" object */
56493693 object_old = object_idx[object_cur];
56503694 }
56513695 }
@@ -5664,8 +3708,6 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
56643708 }
56653709
56663710 char ch = inkey();
5667-
5668- /* Do visual mode command if needed */
56693711 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))
56703712 {
56713713 if (direct_k_idx >= 0)
@@ -5693,25 +3735,23 @@ static void do_cmd_knowledge_objects(player_type *creature_ptr, bool *need_redra
56933735 case 'R':
56943736 case 'r':
56953737 {
5696- /* Recall on screen */
56973738 if (!visual_list && !visual_only && (grp_cnt > 0))
56983739 {
56993740 desc_obj_fake(creature_ptr, object_idx[object_cur]);
57003741 redraw = TRUE;
57013742 }
3743+
57023744 break;
57033745 }
57043746
57053747 default:
57063748 {
5707- /* Move the cursor */
57083749 browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
57093750 break;
57103751 }
57113752 }
57123753 }
57133754
5714- /* Free the "object_idx" array */
57153755 C_KILL(object_idx, max_k_idx, KIND_OBJECT_IDX);
57163756 }
57173757
@@ -5725,31 +3765,21 @@ static void display_feature_list(int col, int row, int per_page, FEAT_IDX *feat_
57253765 int lit_col[F_LIT_MAX], i;
57263766 int f_idx_col = use_bigtile ? 62 : 64;
57273767
5728- /* Correct columns 1 and 4 */
57293768 lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
57303769 for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
57313770 lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
57323771
5733- /* Display lines until done */
57343772 for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
57353773 {
57363774 TERM_COLOR attr;
57373775 FEAT_IDX f_idx = feat_idx[feat_top + i];
57383776 feature_type *f_ptr = &f_info[f_idx];
57393777 int row_i = row + i;
5740-
5741- /* Choose a color */
57423778 attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
5743-
5744- /* Display the name */
57453779 c_prt(attr, f_name + f_ptr->name, row_i, col);
5746-
5747- /* Hack -- visual_list mode */
57483780 if (per_page == 1)
57493781 {
5750- /* Display lighting level */
57513782 c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
5752-
57533783 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));
57543784 }
57553785 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_
57573787 c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
57583788 }
57593789
5760- /* Display symbol */
57613790 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-
57633791 Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
57643792 for (int j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
57653793 {
57663794 Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
57673795 }
5768- Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
57693796
5770- /* Mega-hack -- Use non-standard colour */
3797+ Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
57713798 for (int j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
57723799 {
57733800 Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
57743801 }
57753802 }
57763803
5777- /* Clear remaining lines */
57783804 for (; i < per_page; i++)
57793805 {
57803806 Term_erase(col, row + i, 255);
@@ -5795,7 +3821,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
57953821 TERM_LEN wid, hgt;
57963822 Term_get_size(&wid, &hgt);
57973823
5798- /* Allocate the "feat_idx" array */
57993824 FEAT_IDX *feat_idx;
58003825 C_MAKE(feat_idx, max_f_idx, FEAT_IDX);
58013826
@@ -5810,19 +3835,13 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
58103835 TERM_LEN browser_rows = hgt - 8;
58113836 if (direct_f_idx < 0)
58123837 {
5813- /* Check every group */
58143838 for (FEAT_IDX i = 0; feature_group_text[i] != NULL; i++)
58153839 {
5816- /* Measure the label */
58173840 len = strlen(feature_group_text[i]);
5818-
5819- /* Save the maximum length */
58203841 if (len > max) max = len;
58213842
5822- /* See if any features are known */
58233843 if (collect_features(feat_idx, 0x01))
58243844 {
5825- /* Build a list of groups with known features */
58263845 grp_idx[grp_cnt++] = i;
58273846 }
58283847 }
@@ -5835,8 +3854,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
58353854
58363855 feat_idx[0] = direct_f_idx;
58373856 feat_cnt = 1;
5838-
5839- /* Terminate the list */
58403857 feat_idx[1] = -1;
58413858
58423859 (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
58493866 }
58503867 }
58513868
5852- /* Terminate the list */
58533869 grp_idx[grp_cnt] = -1;
58543870
58553871 FEAT_IDX old_grp_cur = -1;
@@ -5903,22 +3919,16 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
59033919
59043920 if (direct_f_idx < 0)
59053921 {
5906- /* Scroll group list */
59073922 if (grp_cur < grp_top) grp_top = grp_cur;
59083923 if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
59093924
5910- /* Display a list of feature groups */
59113925 display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
5912-
59133926 if (old_grp_cur != grp_cur)
59143927 {
59153928 old_grp_cur = grp_cur;
5916-
5917- /* Get a list of features in the current group */
59183929 feat_cnt = collect_features(feat_idx, 0x00);
59193930 }
59203931
5921- /* Scroll feature list */
59223932 while (feat_cur < feat_top)
59233933 feat_top = MAX(0, feat_top - browser_rows / 2);
59243934 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
59273937
59283938 if (!visual_list)
59293939 {
5930- /* Display a list of features in the current group */
59313940 display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
59323941 }
59333942 else
59343943 {
59353944 feat_top = feat_cur;
5936-
5937- /* Display a list of features in the current group */
59383945 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 */
59413946 display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
59423947 }
59433948
5944- /* Prompt */
59453949 prt(format(_("<方向>%s, 'd'で標準光源効果%s, ESC", "<dir>%s, 'd' for default lighting%s, ESC"),
59463950 visual_list ? _(", ENTERで決定, 'a'で対象明度変更", ", ENTER to accept, 'a' for lighting level") : _(", 'v'でシンボル変更", ", 'v' for visuals"),
59473951 (attr_idx || char_idx) ? _(", 'c', 'p'でペースト", ", 'c', 'p' to paste") : _(", 'c'でコピー", ", 'c' to copy")),
59483952 hgt - 1, 0);
59493953
5950- /* Get the current feature */
59513954 f_ptr = &f_info[feat_idx[feat_cur]];
59523955 cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
59533956 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
59663969 }
59673970
59683971 ch = inkey();
5969-
59703972 if (visual_list && ((ch == 'A') || (ch == 'a')))
59713973 {
59723974 int prev_lighting_level = *lighting_level;
@@ -5990,7 +3992,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
59903992
59913993 continue;
59923994 }
5993-
59943995 else if ((ch == 'D') || (ch == 'd'))
59953996 {
59963997 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
60104011
60114012 continue;
60124013 }
6013-
6014- /* Do visual mode command if needed */
60154014 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))
60164015 {
60174016 switch (ch)
60184017 {
6019- /* Restore previous visual settings */
60204018 case ESCAPE:
60214019 for (FEAT_IDX i = 0; i < F_LIT_MAX; i++)
60224020 {
@@ -6025,14 +4023,11 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
60254023 }
60264024
60274025 /* Fall through */
6028-
60294026 case '\n':
60304027 case '\r':
60314028 if (direct_f_idx >= 0) flag = TRUE;
60324029 else *lighting_level = F_LIT_STANDARD;
60334030 break;
6034-
6035- /* Preserve current visual settings */
60364031 case 'V':
60374032 case 'v':
60384033 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
60594054 case 'p':
60604055 if (!visual_list)
60614056 {
6062- /* Allow TERM_DARK text */
60634057 for (FEAT_IDX i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
60644058 {
60654059 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
60814075
60824076 default:
60834077 {
6084- /* Move the cursor */
60854078 browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
60864079 break;
60874080 }
60884081 }
60894082 }
60904083
6091- /* Free the "feat_idx" array */
60924084 C_KILL(feat_idx, max_f_idx, FEAT_IDX);
60934085 }
60944086
@@ -6100,7 +4092,6 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, IDX d
61004092 */
61014093 static void do_cmd_knowledge_bounty(player_type *creature_ptr)
61024094 {
6103- /* Open a new file */
61044095 FILE *fff;
61054096 GAME_TEXT file_name[1024];
61064097 fff = my_fopen_temp(file_name, 1024);
@@ -6133,8 +4124,6 @@ static void do_cmd_knowledge_bounty(player_type *creature_ptr)
61334124 }
61344125
61354126 my_fclose(fff);
6136-
6137- /* Display the file contents */
61384127 (void)show_file(creature_ptr, TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0);
61394128 fd_kill(file_name);
61404129 }
@@ -6144,7 +4133,6 @@ static void do_cmd_knowledge_bounty(player_type *creature_ptr)
61444133 */
61454134 static void do_cmd_knowledge_virtues(player_type *creature_ptr)
61464135 {
6147- /* Open a new file */
61484136 FILE *fff;
61494137 GAME_TEXT file_name[1024];
61504138 fff = my_fopen_temp(file_name, 1024);
@@ -6158,8 +4146,6 @@ static void do_cmd_knowledge_virtues(player_type *creature_ptr)
61584146 fprintf(fff, _("現在の属性 : %s\n\n", "Your alignment : %s\n\n"), your_alignment(creature_ptr));
61594147 dump_virtues(creature_ptr, fff);
61604148 my_fclose(fff);
6161-
6162- /* Display the file contents */
61634149 (void)show_file(creature_ptr, TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
61644150 fd_kill(file_name);
61654151 }
@@ -6169,7 +4155,6 @@ static void do_cmd_knowledge_virtues(player_type *creature_ptr)
61694155 */
61704156 static void do_cmd_knowledge_dungeon(player_type *creature_ptr)
61714157 {
6172- /* Open a new file */
61734158 FILE *fff;
61744159 GAME_TEXT file_name[1024];
61754160 fff = my_fopen_temp(file_name, 1024);
@@ -6196,8 +4181,6 @@ static void do_cmd_knowledge_dungeon(player_type *creature_ptr)
61964181 }
61974182
61984183 my_fclose(fff);
6199-
6200- /* Display the file contents */
62014184 (void)show_file(creature_ptr, TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0);
62024185 fd_kill(file_name);
62034186 }
@@ -6209,7 +4192,6 @@ static void do_cmd_knowledge_dungeon(player_type *creature_ptr)
62094192 */
62104193 static void do_cmd_knowledge_stat(player_type *creature_ptr)
62114194 {
6212- /* Open a new file */
62134195 FILE *fff;
62144196 GAME_TEXT file_name[1024];
62154197 fff = my_fopen_temp(file_name, 1024);
@@ -6237,8 +4219,6 @@ static void do_cmd_knowledge_stat(player_type *creature_ptr)
62374219
62384220 dump_yourself(creature_ptr, fff);
62394221 my_fclose(fff);
6240-
6241- /* Display the file contents */
62424222 (void)show_file(creature_ptr, TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
62434223 fd_kill(file_name);
62444224 }
@@ -6269,28 +4249,18 @@ static void do_cmd_knowledge_quests_current(player_type *creature_ptr, FILE *fff
62694249 if (!is_print)
62704250 continue;
62714251
6272- /* Set the quest number temporary */
62734252 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';
62744255
6275- /* Clear the text */
6276- for (int j = 0; j < 10; j++) quest_text[j][0] = '\0';
62774256 quest_text_line = 0;
6278-
62794257 creature_ptr->current_floor_ptr->inside_quest = i;
6280-
6281- /* Get the quest text */
62824258 init_flags = INIT_SHOW_TEXT;
6283-
62844259 process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
6285-
6286- /* Reset the old quest number */
62874260 creature_ptr->current_floor_ptr->inside_quest = old_quest;
6288-
6289- /* No info from "silent" quests */
62904261 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
62914262
62924263 total++;
6293-
62944264 if (quest[i].type != QUEST_TYPE_RANDOM)
62954265 {
62964266 char note[80] = "\0";
@@ -6353,12 +4323,9 @@ static void do_cmd_knowledge_quests_current(player_type *creature_ptr, FILE *fff
63534323 }
63544324 }
63554325
6356- /* Print the quest info */
63574326 sprintf(tmp_str, _(" %s (危険度:%d階相当)%s\n", " %s (Danger level: %d)%s\n"),
63584327 quest[i].name, (int)quest[i].level, note);
6359-
63604328 fputs(tmp_str, fff);
6361-
63624329 if (quest[i].status == QUEST_STATUS_COMPLETED)
63634330 {
63644331 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
63764343 continue;
63774344 }
63784345
6379- /* QUEST_TYPE_RANDOM */
63804346 if (quest[i].level >= rand_level)
63814347 continue;
63824348
6383- /* New random */
63844349 rand_level = quest[i].level;
6385-
63864350 if (max_dlv[DUNGEON_ANGBAND] < rand_level) continue;
63874351
6388- /* Print the quest info */
63894352 r_ptr = &r_info[quest[i].r_idx];
63904353 strcpy(name, r_name + r_ptr->name);
6391-
63924354 if (quest[i].max_num <= 1)
63934355 {
63944356 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
64094371 #endif
64104372 }
64114373
6412- /* Print the current random quest */
64134374 if (rand_tmp_str[0]) fputs(rand_tmp_str, fff);
64144375
64154376 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
64254386 floor_type *floor_ptr = player_ptr->current_floor_ptr;
64264387 if (is_fixed_quest_idx(q_idx))
64274388 {
6428- /* Set the quest number temporary */
64294389 IDX old_quest = floor_ptr->inside_quest;
6430-
64314390 floor_ptr->inside_quest = q_idx;
6432-
6433- /* Get the quest */
64344391 init_flags = INIT_NAME_ONLY;
6435-
64364392 process_dungeon_file(player_ptr, "q_info.txt", 0, 0, 0, 0);
6437-
6438- /* Reset the old quest number */
64394393 floor_ptr->inside_quest = old_quest;
6440-
6441- /* No info from "silent" quests */
64424394 if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE;
64434395 }
64444396
@@ -6447,7 +4399,6 @@ static bool do_cmd_knowledge_quests_aux(player_type *player_ptr, FILE *fff, IDX
64474399
64484400 if (is_fixed_quest_idx(q_idx) || (q_ptr->r_idx == 0))
64494401 {
6450- /* Print the quest info */
64514402 sprintf(tmp_str,
64524403 _(" %-35s (危険度:%3d階相当) - レベル%2d - %s\n",
64534404 " %-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
64564407 return TRUE;
64574408 }
64584409
6459- /* Print the quest info */
64604410 if (q_ptr->complev == 0)
64614411 {
64624412 sprintf(tmp_str,
@@ -6543,14 +4493,11 @@ static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
65434493 QUEST_IDX total = 0;
65444494 for (QUEST_IDX i = 1; i < max_q_idx; i++)
65454495 {
6546- /* No info from "silent" quests */
65474496 if (quest[i].flags & QUEST_FLAG_SILENT) continue;
65484497
65494498 if ((quest[i].type == QUEST_TYPE_RANDOM) && (quest[i].status == QUEST_STATUS_TAKEN))
65504499 {
65514500 total++;
6552-
6553- /* Print the quest info */
65544501 sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"),
65554502 quest[i].name, (int)quest[i].level, r_name + r_info[quest[i].r_idx].name);
65564503 fputs(tmp_str, fff);
@@ -6567,7 +4514,6 @@ static void do_cmd_knowledge_quests_wiz_random(FILE *fff)
65674514 */
65684515 static void do_cmd_knowledge_quests(player_type *creature_ptr)
65694516 {
6570- /* Open a new file */
65714517 FILE *fff;
65724518 GAME_TEXT file_name[1024];
65734519 fff = my_fopen_temp(file_name, 1024);
@@ -6578,16 +4524,15 @@ static void do_cmd_knowledge_quests(player_type *creature_ptr)
65784524 return;
65794525 }
65804526
6581- /* Allocate Memory */
65824527 IDX *quest_num;
65834528 C_MAKE(quest_num, max_q_idx, QUEST_IDX);
65844529
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+
65874533 int dummy;
65884534 ang_sort(quest_num, &dummy, max_q_idx, ang_sort_comp_quest_num, ang_sort_swap_quest_num);
65894535
6590- /* Dump Quest Information */
65914536 do_cmd_knowledge_quests_current(creature_ptr, fff);
65924537 fputc('\n', fff);
65934538 do_cmd_knowledge_quests_completed(creature_ptr, fff, quest_num);
@@ -6600,12 +4545,8 @@ static void do_cmd_knowledge_quests(player_type *creature_ptr)
66004545 }
66014546
66024547 my_fclose(fff);
6603-
6604- /* Display the file contents */
66054548 (void)show_file(creature_ptr, TRUE, file_name, _("クエスト達成状況", "Quest status"), 0, 0);
66064549 fd_kill(file_name);
6607-
6608- /* Free Memory */
66094550 C_KILL(quest_num, max_q_idx, QUEST_IDX);
66104551 }
66114552
@@ -6630,20 +4571,15 @@ static void do_cmd_knowledge_home(player_type *player_ptr)
66304571 return;
66314572 }
66324573
6633- /* Print all homes in the different towns */
66344574 store_type *st_ptr;
66354575 st_ptr = &town_info[1].store[STORE_HOME];
66364576
6637- /* Home -- if anything there */
66384577 if (st_ptr->stock_num)
66394578 {
66404579 #ifdef JP
66414580 TERM_LEN x = 1;
66424581 #endif
6643- /* Header with name of the town */
66444582 fprintf(fff, _(" [ 我が家のアイテム ]\n", " [Home Inventory]\n"));
6645-
6646- /* Dump all available items */
66474583 concptr paren = ")";
66484584 GAME_TEXT o_name[MAX_NLEN];
66494585 for (int i = 0; i < st_ptr->stock_num; i++)
@@ -6672,13 +4608,10 @@ static void do_cmd_knowledge_home(player_type *player_ptr)
66724608 #endif
66734609 }
66744610
6675- /* Add an empty line */
66764611 fprintf(fff, "\n\n");
66774612 }
66784613
66794614 my_fclose(fff);
6680-
6681- /* Display the file contents */
66824615 (void)show_file(player_ptr, TRUE, file_name, _("我が家のアイテム", "Home Inventory"), 0, 0);
66834616 fd_kill(file_name);
66844617 }
@@ -6744,7 +4677,6 @@ static void do_cmd_knowledge_autopick(player_type *creature_ptr)
67444677
67454678 my_fclose(fff);
67464679
6747- /* Display the file contents */
67484680 (void)show_file(creature_ptr, TRUE, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0);
67494681 fd_kill(file_name);
67504682 }
@@ -6757,21 +4689,14 @@ void do_cmd_knowledge(player_type *creature_ptr)
67574689 {
67584690 int i, p = 0;
67594691 bool need_redraw = FALSE;
6760-
6761- /* File type is "TEXT" */
67624692 FILE_TYPE(FILE_TYPE_TEXT);
67634693 screen_save();
6764-
6765- /* Interact until done */
67664694 while (TRUE)
67674695 {
67684696 Term_clear();
6769-
6770- /* Ask for a choice */
67714697 prt(format(_("%d/2 ページ", "page %d/2"), (p + 1)), 2, 65);
67724698 prt(_("現在の知識を確認する", "Display current knowledge"), 3, 0);
67734699
6774- /* Give some choices */
67754700 #ifdef JP
67764701 if (p == 0)
67774702 {
@@ -6825,11 +4750,9 @@ void do_cmd_knowledge(player_type *creature_ptr)
68254750 prt("(i) Display auto pick/destroy", 14, 5);
68264751 }
68274752 #endif
6828- /* Prompt */
68294753 prt(_("-続く-", "-more-"), 17, 8);
68304754 prt(_("ESC) 抜ける", "ESC) Exit menu"), 21, 1);
68314755 prt(_("SPACE) 次ページ", "SPACE) Next page"), 21, 30);
6832- /*prt("-) 前ページ", 21, 60);*/
68334756 prt(_("コマンド:", "Command: "), 20, 0);
68344757 i = inkey();
68354758
@@ -6920,11 +4843,8 @@ void do_cmd_knowledge(player_type *creature_ptr)
69204843 */
69214844 void do_cmd_checkquest(player_type *creature_ptr)
69224845 {
6923- /* File type is "TEXT" */
69244846 FILE_TYPE(FILE_TYPE_TEXT);
69254847 screen_save();
6926-
6927- /* Quest info */
69284848 do_cmd_knowledge_quests(creature_ptr);
69294849 screen_load();
69304850 }
@@ -6950,7 +4870,6 @@ void do_cmd_time(player_type *creature_ptr)
69504870 msg_format(_("%s日目, 時刻は%d:%02d %sです。", "This is day %s. The time is %d:%02d %s."),
69514871 day_buf, (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM");
69524872
6953- /* Find the path */
69544873 char buf[1024];
69554874 if (!randint0(10) || creature_ptr->image)
69564875 {
@@ -6961,54 +4880,40 @@ void do_cmd_time(player_type *creature_ptr)
69614880 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt"));
69624881 }
69634882
6964- /* Open this file */
69654883 FILE *fff;
69664884 fff = my_fopen(buf, "rt");
69674885
69684886 if (!fff) return;
69694887
6970- /* Find this time */
69714888 int full = hour * 100 + min;
69724889 int start = 9999;
69734890 int end = -9999;
69744891 int num = 0;
69754892 while (!my_fgets(fff, buf, sizeof(buf)))
69764893 {
6977- /* Ignore comments */
69784894 if (!buf[0] || (buf[0] == '#')) continue;
6979-
6980- /* Ignore invalid lines */
69814895 if (buf[1] != ':') continue;
69824896
6983- /* Process 'Start' */
69844897 if (buf[0] == 'S')
69854898 {
6986- /* Extract the starting time */
69874899 start = atoi(buf + 2);
6988-
6989- /* Assume valid for an hour */
69904900 end = start + 59;
69914901 continue;
69924902 }
69934903
6994- /* Process 'End' */
69954904 if (buf[0] == 'E')
69964905 {
6997- /* Extract the ending time */
69984906 end = atoi(buf + 2);
69994907 continue;
70004908 }
70014909
7002- /* Ignore incorrect range */
70034910 if ((start > full) || (full > end)) continue;
70044911
7005- /* Process 'Description' */
70064912 if (buf[0] == 'D')
70074913 {
70084914 num++;
7009-
7010- /* Apply the randomizer */
70114915 if (!randint0(num)) strcpy(desc, buf + 2);
4916+
70124917 continue;
70134918 }
70144919 }
--- a/src/cmd/cmd-dump.h
+++ b/src/cmd/cmd-dump.h
@@ -1,54 +1,9 @@
11 #pragma once
22
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 */
473 #ifdef JP
484 #else
495 extern concptr get_ordinal_number_suffix(int num);
506 #endif
51-extern errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note);
527 extern void do_cmd_diary(player_type *creature_ptr);
538 extern void do_cmd_redraw(player_type *creature_ptr);
549 extern void do_cmd_player_status(player_type *creature_ptr);
@@ -78,5 +33,3 @@ extern void do_cmd_spoilers(player_type *creature_ptr);
7833
7934 /* wizard1.c */
8035 extern void spoil_random_artifact(player_type *creature_ptr, concptr fname);
81-
82-extern bool write_level;
--- a/src/cmd/cmd-gameoption.c
+++ b/src/cmd/cmd-gameoption.c
@@ -1,7 +1,8 @@
11 #include "angband.h"
22
33 #include "autopick.h"
4-#include "cmd-gameoption.h"
4+#include "io/write-diary.h"
5+#include "cmd/cmd-gameoption.h"
56 #include "term.h"
67 #include "view-mainwindow.h"
78 #include "cmd/cmd-dump.h"
--- a/src/cmd/cmd-pet.c
+++ b/src/cmd/cmd-pet.c
@@ -2,7 +2,8 @@
22 #include "core.h"
33 #include "util.h"
44
5-#include "cmd-dump.h"
5+#include "io/write-diary.h"
6+#include "cmd/cmd-dump.h"
67 #include "floor.h"
78 #include "grid.h"
89 #include "melee.h"
--- a/src/cmd/cmd-save.c
+++ b/src/cmd/cmd-save.c
@@ -1,4 +1,5 @@
11 #include "signal-handlers.h"
2+#include "io/write-diary.h"
23 #include "cmd/cmd-save.h"
34 #include "cmd/cmd-dump.h"
45 #include "player-move.h"
--- a/src/cmd/cmd-spell.c
+++ b/src/cmd/cmd-spell.c
@@ -9,9 +9,10 @@
99 #include "angband.h"
1010 #include "core.h"
1111 #include "util.h"
12-#include "cmd-spell.h"
12+#include "cmd/cmd-spell.h"
1313
14-#include "cmd-dump.h"
14+#include "io/write-diary.h"
15+#include "cmd/cmd-dump.h"
1516 #include "selfinfo.h"
1617 #include "spells.h"
1718 #include "spells-summon.h"
--- /dev/null
+++ b/src/cmd/diary-subtitle-table.c
@@ -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+};
--- /dev/null
+++ b/src/cmd/diary-subtitle-table.h
@@ -0,0 +1,5 @@
1+#pragma once
2+
3+#define MAX_SUBTITLE 30
4+
5+extern concptr subtitle[MAX_SUBTITLE];
--- /dev/null
+++ b/src/cmd/feeling-table.c
@@ -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+};
--- /dev/null
+++ b/src/cmd/feeling-table.h
@@ -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];
--- /dev/null
+++ b/src/cmd/monster-group-table.c
@@ -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+};
--- /dev/null
+++ b/src/cmd/monster-group-table.h
@@ -0,0 +1,4 @@
1+#pragma once
2+
3+extern concptr monster_group_text[];
4+extern concptr monster_group_char[];
--- /dev/null
+++ b/src/cmd/object-group-table.c
@@ -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+};
--- /dev/null
+++ b/src/cmd/object-group-table.h
@@ -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+
--- a/src/core.c
+++ b/src/core.c
@@ -22,6 +22,7 @@
2222
2323 #include "birth.h"
2424 #include "bldg.h"
25+#include "io/write-diary.h"
2526 #include "cmd/cmd-activate.h"
2627 #include "cmd/cmd-dump.h"
2728 #include "cmd/cmd-eat.h"
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -101,7 +101,8 @@
101101 #include "core.h"
102102 #include "bldg.h"
103103
104-#include "cmd-dump.h"
104+#include "io/write-diary.h"
105+#include "cmd/cmd-dump.h"
105106 #include "grid.h"
106107 #include "rooms.h"
107108 #include "dungeon.h"
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -40,7 +40,8 @@
4040 #include "player-personality.h"
4141 #include "world.h"
4242 #include "spells.h"
43-#include "cmd-dump.h"
43+#include "io/write-diary.h"
44+#include "cmd/cmd-dump.h"
4445 #include "save.h"
4546
4647 #include "view-mainwindow.h"
--- /dev/null
+++ b/src/io/write-diary.c
@@ -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, &note_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+}
--- /dev/null
+++ b/src/io/write-diary.h
@@ -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);
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -99,6 +99,7 @@
9999 #include "inet.h"
100100 #include "chuukei.h"
101101
102+#include "io/write-diary.h"
102103 #include "cmd/cmd-dump.h"
103104 #include "cmd/cmd-save.h"
104105 #include "view-mainwindow.h"
--- a/src/monster-process.c
+++ b/src/monster-process.c
@@ -22,8 +22,9 @@
2222 #include "monster/monster-update.h"
2323 #include "monster/quantum-effect.h"
2424
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"
2728 #include "creature.h"
2829 #include "melee.h"
2930 #include "spells-summon.h"
--- a/src/monster-status.c
+++ b/src/monster-status.c
@@ -3,7 +3,8 @@
33 #include "util.h"
44
55 #include "creature.h"
6-#include "cmd-dump.h"
6+#include "io/write-diary.h"
7+#include "cmd/cmd-dump.h"
78 #include "dungeon.h"
89 #include "floor.h"
910 #include "grid.h"
--- a/src/monster1.c
+++ b/src/monster1.c
@@ -14,7 +14,8 @@
1414 #include "util.h"
1515 #include "term.h"
1616
17-#include "cmd-dump.h"
17+#include "io/write-diary.h"
18+#include "cmd/cmd-dump.h"
1819 #include "bldg.h"
1920 #include "cmd-pet.h"
2021 #include "floor.h"
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -14,7 +14,8 @@
1414 #include "util.h"
1515 #include "core.h"
1616
17-#include "cmd-dump.h"
17+#include "io/write-diary.h"
18+#include "cmd/cmd-dump.h"
1819 #include "cmd-pet.h"
1920 #include "dungeon.h"
2021 #include "floor.h"
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -16,6 +16,7 @@
1616 #include "core/show-file.h"
1717 #include "util.h"
1818
19+#include "io/write-diary.h"
1920 #include "cmd/cmd-dump.h"
2021 #include "mutation.h"
2122
--- a/src/object2.c
+++ b/src/object2.c
@@ -18,8 +18,9 @@
1818
1919 #include "object.h"
2020
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"
2324 #include "spells.h"
2425 #include "dungeon.h"
2526 #include "floor.h"
--- a/src/patron.c
+++ b/src/patron.c
@@ -2,7 +2,8 @@
22 #include "angband.h"
33 #include "util.h"
44
5-#include "cmd-dump.h"
5+#include "io/write-diary.h"
6+#include "cmd/cmd-dump.h"
67 #include "patron.h"
78 #include "cmd-pet.h"
89 #include "object-curse.h"
--- a/src/player-damage.c
+++ b/src/player-damage.c
@@ -5,7 +5,8 @@
55
66 #include "avatar.h"
77 #include "bldg.h"
8-#include "cmd-dump.h"
8+#include "io/write-diary.h"
9+#include "cmd/cmd-dump.h"
910 #include "realm-song.h"
1011 #include "floor.h"
1112 #include "artifact.h"
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -29,13 +29,14 @@
2929 #include "patron.h"
3030 #include "realm-hex.h"
3131 #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"
3434 #include "dungeon.h"
3535 #include "objectkind.h"
3636 #include "monsterrace.h"
3737 #include "autopick.h"
38-#include "cmd-dump.h"
38+#include "io/write-diary.h"
39+#include "cmd/cmd-dump.h"
3940 #include "melee.h"
4041 #include "world.h"
4142 #include "view-mainwindow.h"
--- a/src/quest.c
+++ b/src/quest.c
@@ -15,7 +15,8 @@
1515 #include "artifact.h"
1616 #include "feature.h"
1717 #include "world.h"
18-#include "cmd-dump.h"
18+#include "io/write-diary.h"
19+#include "cmd/cmd-dump.h"
1920 #include "english.h"
2021 #include "view-mainwindow.h"
2122
--- a/src/scores.c
+++ b/src/scores.c
@@ -27,7 +27,8 @@
2727 #include "scores.h"
2828 #include "floor.h"
2929 #include "world.h"
30-#include "cmd-dump.h"
30+#include "io/write-diary.h"
31+#include "cmd/cmd-dump.h"
3132 #include "report.h"
3233 #include "japanese.h"
3334
--- a/src/signal-handlers.c
+++ b/src/signal-handlers.c
@@ -10,6 +10,7 @@
1010 #include "save.h"
1111 #include "world.h"
1212 #include "term.h"
13+#include "io/write-diary.h"
1314 #include "cmd/cmd-dump.h"
1415 #include "floor-events.h"
1516
--- a/src/spells-floor.c
+++ b/src/spells-floor.c
@@ -10,8 +10,9 @@
1010 #include "object-flavor.h"
1111 #include "object-hook.h"
1212
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"
1516
1617 #include "floor-events.h"
1718 #include "floor-save.h"
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -15,8 +15,9 @@
1515 #include "core.h"
1616 #include "util.h"
1717
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"
2021 #include "floor.h"
2122 #include "trap.h"
2223 #include "autopick.h"
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -18,8 +18,9 @@
1818 #include "creature.h"
1919
2020 #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"
2324 #include "floor.h"
2425 #include "grid.h"
2526 #include "trap.h"
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -42,6 +42,7 @@
4242 #include "monster-process.h"
4343 #include "monster-status.h"
4444 #include "monster-spell.h"
45+#include "io/write-diary.h"
4546 #include "cmd/cmd-save.h"
4647 #include "cmd/cmd-spell.h"
4748 #include "cmd/cmd-dump.h"
--- a/src/store.c
+++ b/src/store.c
@@ -16,6 +16,7 @@
1616 #include "term.h"
1717
1818 #include "floor.h"
19+#include "io/write-diary.h"
1920 #include "cmd/cmd-basic.h"
2021 #include "cmd/cmd-dump.h"
2122 #include "cmd/cmd-help.h"
--- a/src/trap.c
+++ b/src/trap.c
@@ -1,6 +1,7 @@
11 #include "angband.h"
22 #include "util.h"
33
4+#include "io/write-diary.h"
45 #include "cmd/cmd-dump.h"
56 #include "cmd/cmd-save.h"
67 #include "trap.h"
--- a/src/util.c
+++ b/src/util.c
@@ -21,7 +21,8 @@
2121 #include "quest.h"
2222 #include "floor.h"
2323 #include "world.h"
24-#include "cmd-dump.h"
24+#include "io/write-diary.h"
25+#include "cmd/cmd-dump.h"
2526 #include "japanese.h"
2627 #include "player-class.h"
2728
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -15,6 +15,7 @@
1515 #include "term.h"
1616
1717 #include "dungeon.h"
18+#include "io/write-diary.h"
1819 #include "cmd/cmd-dump.h"
1920 #include "cmd/cmd-help.h"
2021 #include "cmd/cmd-save.h"