OSDN Git Service

[Refactor] #39962 files.c からprocess-death.c/h を分離 / Separated process-death.c/h from...
authorHourier <hourier@users.sourceforge.jp>
Mon, 24 Feb 2020 00:39:28 +0000 (09:39 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 24 Feb 2020 00:39:28 +0000 (09:39 +0900)
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/core.c
src/files.c
src/files.h
src/view/process-death.c [new file with mode: 0644]
src/view/process-death.h [new file with mode: 0644]

index b2fa638..865d9bb 100644 (file)
     <ClCompile Include="..\..\src\spells3.c" />\r
     <ClCompile Include="..\..\src\uid-checker.c" />\r
     <ClCompile Include="..\..\src\view\display-util.c" />\r
+    <ClCompile Include="..\..\src\view\process-death.c" />\r
     <ClCompile Include="..\..\src\view\status-first-page.c" />\r
     <ClCompile Include="..\..\src\store.c" />\r
     <ClCompile Include="..\..\src\floor-streams.c" />\r
     <ClInclude Include="..\..\src\signal-handlers.h" />\r
     <ClInclude Include="..\..\src\uid-checker.h" />\r
     <ClInclude Include="..\..\src\view\display-util.h" />\r
+    <ClInclude Include="..\..\src\view\process-death.h" />\r
     <ClInclude Include="..\..\src\view\status-first-page.h" />\r
     <ClInclude Include="japanese.h" />\r
   </ItemGroup>\r
index 67f73e6..7fcf634 100644 (file)
     <ClCompile Include="..\..\src\uid-checker.c">
       <Filter>io</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\view\process-death.c">
+      <Filter>view</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\gamevalue.h" />
     <ClInclude Include="..\..\src\uid-checker.h">
       <Filter>io</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\view\process-death.h">
+      <Filter>view</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index da720e7..6d1d499 100644 (file)
@@ -13,6 +13,7 @@ hengband_SOURCES = \
        \
        bldg.c bldg.h chest.c chest.h chuukei.c chuukei.h \
        \
+       view/process-death.c view/process-death.h \
        view/status-first-page.c view/status-first-page.h \
        signal-handlers.c signal-handlers.h core.c core.h files.c files.h \
        \
index a9b57c6..4964ade 100644 (file)
@@ -84,6 +84,7 @@
 #include "view-mainwindow.h"
 #include "dungeon-file.h"
 #include "uid-checker.h"
+#include "view/process-death.h"
 #include "files.h"
 #include "scores.h"
 #include "autopick.h"
@@ -4697,7 +4698,7 @@ void close_game(player_type *player_ptr)
                print_tomb(player_ptr);
                flush();
 
-               show_info(player_ptr);
+               show_info(player_ptr, handle_stuff, file_character, update_playtime, display_player);
                Term_clear();
 
                if (check_score(player_ptr))
index 1a1b336..0cadccb 100644 (file)
 #define DP_IMM     0x02
 #define DP_WP      0x08
 
-#define GRAVE_LINE_WIDTH 31
-
 concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code
 concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms
 concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms
 concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms
 concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms
 concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms.
-concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
 concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms
 concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms
 concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms
@@ -4639,327 +4636,6 @@ void do_cmd_save_and_exit(player_type *creature_ptr)
 
 
 /*!
- * @brief 墓石の真ん中に文字列を書き込む /
- * Centers a string within a GRAVE_LINE_WIDTH character string         -JWT-
- * @return なし
- * @details
- */
-static void center_string(char *buf, concptr str)
-{
-       int i = strlen(str);
-       int j = GRAVE_LINE_WIDTH / 2 - i / 2;
-       (void)sprintf(buf, "%*s%s%*s", j, "", str, GRAVE_LINE_WIDTH - i - j, "");
-}
-
-
-/*
- * Redefinable "print_tombstone" action
- */
-bool(*tombstone_aux)(void) = NULL;
-
-
-/*!
- * @brief 墓石のアスキーアート表示 /
- * Display a "tomb-stone"
- * @param creature_ptr プレーヤーへの参照ポインタ
- * @return なし
- */
-void print_tomb(player_type *dead_ptr)
-{
-       bool done = FALSE;
-       if (tombstone_aux)
-       {
-               done = (*tombstone_aux)();
-       }
-
-       if (done) return;
-
-#ifdef JP
-       int extra_line = 0;
-#endif
-       Term_clear();
-       char buf[1024];
-       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("dead_j.txt", "dead.txt"));
-
-       FILE *fp;
-       fp = my_fopen(buf, "r");
-
-       if (fp)
-       {
-               int i = 0;
-
-               /* Dump the file to the screen */
-               while (my_fgets(fp, buf, sizeof(buf)) == 0)
-               {
-                       put_str(buf, i++, 0);
-               }
-
-               my_fclose(fp);
-       }
-
-       concptr p;
-       if (current_world_ptr->total_winner || (dead_ptr->lev > PY_MAX_LEVEL))
-       {
-#ifdef JP
-               p = "偉大なる者";
-#else
-               p = "Magnificent";
-#endif
-       }
-       else
-       {
-               p = player_title[dead_ptr->pclass][(dead_ptr->lev - 1) / 5];
-       }
-
-       center_string(buf, dead_ptr->name);
-       put_str(buf, 6, 11);
-
-#ifdef JP
-#else
-       center_string(buf, "the");
-       put_str(buf, 7, 11);
-#endif
-
-       center_string(buf, p);
-       put_str(buf, 8, 11);
-
-       center_string(buf, cp_ptr->title);
-       put_str(buf, 10, 11);
-
-       char tmp[160];
-       (void)sprintf(tmp, _("レベル: %d", "Level: %d"), (int)dead_ptr->lev);
-       center_string(buf, tmp);
-       put_str(buf, 11, 11);
-
-       (void)sprintf(tmp, _("経験値: %ld", "Exp: %ld"), (long)dead_ptr->exp);
-       center_string(buf, tmp);
-       put_str(buf, 12, 11);
-
-       (void)sprintf(tmp, _("所持金: %ld", "AU: %ld"), (long)dead_ptr->au);
-       center_string(buf, tmp);
-       put_str(buf, 13, 11);
-
-#ifdef JP
-       /* 墓に刻む言葉をオリジナルより細かく表示 */
-       if (streq(dead_ptr->died_from, "途中終了"))
-       {
-               strcpy(tmp, "<自殺>");
-       }
-       else if (streq(dead_ptr->died_from, "ripe"))
-       {
-               strcpy(tmp, "引退後に天寿を全う");
-       }
-       else if (streq(dead_ptr->died_from, "Seppuku"))
-       {
-               strcpy(tmp, "勝利の後、切腹");
-       }
-       else
-       {
-               roff_to_buf(dead_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
-               char *t;
-               t = tmp + strlen(tmp) + 1;
-               if (*t)
-               {
-                       char dummy[80];
-                       strcpy(dummy, t); /* 2nd line */
-                       if (*(t + strlen(t) + 1)) /* Does 3rd line exist? */
-                       {
-                               for (t = dummy + strlen(dummy) - 2; iskanji(*(t - 1)); t--) /* Loop */;
-                               strcpy(t, "…");
-                       }
-                       else if (my_strstr(tmp, "『") && suffix(dummy, "』"))
-                       {
-                               char dummy2[80];
-                               char *name_head = my_strstr(tmp, "『");
-                               sprintf(dummy2, "%s%s", name_head, dummy);
-                               if (strlen(dummy2) <= GRAVE_LINE_WIDTH)
-                               {
-                                       strcpy(dummy, dummy2);
-                                       *name_head = '\0';
-                               }
-                       }
-                       else if (my_strstr(tmp, "「") && suffix(dummy, "」"))
-                       {
-                               char dummy2[80];
-                               char *name_head = my_strstr(tmp, "「");
-                               sprintf(dummy2, "%s%s", name_head, dummy);
-                               if (strlen(dummy2) <= GRAVE_LINE_WIDTH)
-                               {
-                                       strcpy(dummy, dummy2);
-                                       *name_head = '\0';
-                               }
-                       }
-
-                       center_string(buf, dummy);
-                       put_str(buf, 15, 11);
-                       extra_line = 1;
-               }
-       }
-
-       center_string(buf, tmp);
-       put_str(buf, 14, 11);
-
-       if (!streq(dead_ptr->died_from, "ripe") && !streq(dead_ptr->died_from, "Seppuku"))
-       {
-               if (dead_ptr->current_floor_ptr->dun_level == 0)
-               {
-                       concptr field_name = dead_ptr->town_num ? "街" : "荒野";
-                       if (streq(dead_ptr->died_from, "途中終了"))
-                       {
-                               sprintf(tmp, "%sで死んだ", field_name);
-                       }
-                       else
-                       {
-                               sprintf(tmp, "に%sで殺された", field_name);
-                       }
-               }
-               else
-               {
-                       if (streq(dead_ptr->died_from, "途中終了"))
-                       {
-                               sprintf(tmp, "地下 %d 階で死んだ", (int)dead_ptr->current_floor_ptr->dun_level);
-                       }
-                       else
-                       {
-                               sprintf(tmp, "に地下 %d 階で殺された", (int)dead_ptr->current_floor_ptr->dun_level);
-                       }
-               }
-
-               center_string(buf, tmp);
-               put_str(buf, 15 + extra_line, 11);
-       }
-#else
-       (void)sprintf(tmp, "Killed on Level %d", dead_ptr->current_floor_ptr->dun_level);
-       center_string(buf, tmp);
-       put_str(buf, 14, 11);
-
-       roff_to_buf(format("by %s.", dead_ptr->died_from), GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
-       center_string(buf, tmp);
-       char *t;
-       put_str(buf, 15, 11);
-       t = tmp + strlen(tmp) + 1;
-       if (*t)
-       {
-               char dummy[80];
-               strcpy(dummy, t); /* 2nd line */
-               if (*(t + strlen(t) + 1)) /* Does 3rd line exist? */
-               {
-                       int dummy_len = strlen(dummy);
-                       strcpy(dummy + MIN(dummy_len, GRAVE_LINE_WIDTH - 3), "...");
-               }
-               center_string(buf, dummy);
-               put_str(buf, 16, 11);
-       }
-#endif
-       time_t ct = time((time_t*)0);
-       (void)sprintf(tmp, "%-.24s", ctime(&ct));
-       center_string(buf, tmp);
-       put_str(buf, 17, 11);
-       msg_format(_("さようなら、%s!", "Goodbye, %s!"), dead_ptr->name);
-}
-
-
-/*!
- * @brief 死亡、引退時の簡易ステータス表示 /
- * Display some character info
- * @param creature_ptr プレーヤーへの参照ポインタ
- * @return なし
- */
-void show_info(player_type *creature_ptr)
-{
-       object_type *o_ptr;
-       for (int i = 0; i < INVEN_TOTAL; i++)
-       {
-               o_ptr = &creature_ptr->inventory_list[i];
-               if (!o_ptr->k_idx) continue;
-
-               object_aware(creature_ptr, o_ptr);
-               object_known(o_ptr);
-       }
-
-       store_type *st_ptr;
-       for (int i = 1; i < max_towns; i++)
-       {
-               st_ptr = &town_info[i].store[STORE_HOME];
-
-               /* Hack -- Know everything in the home */
-               for (int j = 0; j < st_ptr->stock_num; j++)
-               {
-                       o_ptr = &st_ptr->stock[j];
-                       if (!o_ptr->k_idx) continue;
-
-                       /* Aware and Known */
-                       object_aware(creature_ptr, o_ptr);
-                       object_known(o_ptr);
-               }
-       }
-
-       creature_ptr->update |= (PU_BONUS);
-       handle_stuff(creature_ptr);
-       flush();
-       msg_erase();
-       prt(_("キャラクターの記録をファイルに書き出すことができます。", "You may now dump a character record to one or more files."), 21, 0);
-       prt(_("リターンキーでキャラクターを見ます。ESCで中断します。", "Then, hit RETURN to see the character, or ESC to abort."), 22, 0);
-       while (TRUE)
-       {
-               char out_val[160];
-               put_str(_("ファイルネーム: ", "Filename: "), 23, 0);
-               strcpy(out_val, "");
-               if (!askfor(out_val, 60)) return;
-               if (!out_val[0]) break;
-               screen_save();
-               (void)file_character(creature_ptr, out_val);
-               screen_load();
-       }
-
-       update_playtime();
-       display_player(creature_ptr, 0);
-       prt(_("何かキーを押すとさらに情報が続きます (ESCで中断): ", "Hit any key to see more information (ESC to abort): "), 23, 0);
-       if (inkey() == ESCAPE) return;
-
-       if (creature_ptr->equip_cnt)
-       {
-               Term_clear();
-               (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
-               prt(_("装備していたアイテム: -続く-", "You are using: -more-"), 0, 0);
-               if (inkey() == ESCAPE) return;
-       }
-
-       if (creature_ptr->inven_cnt)
-       {
-               Term_clear();
-               (void)show_inventory(creature_ptr, 0, USE_FULL, 0);
-               prt(_("持っていたアイテム: -続く-", "You are carrying: -more-"), 0, 0);
-
-               if (inkey() == ESCAPE) return;
-       }
-
-       for (int l = 1; l < max_towns; l++)
-       {
-               st_ptr = &town_info[l].store[STORE_HOME];
-               if (st_ptr->stock_num == 0) continue;
-               for (int i = 0, k = 0; i < st_ptr->stock_num; k++)
-               {
-                       Term_clear();
-                       for (int j = 0; (j < 12) && (i < st_ptr->stock_num); j++, i++)
-                       {
-                               GAME_TEXT o_name[MAX_NLEN];
-                               char tmp_val[80];
-                               o_ptr = &st_ptr->stock[i];
-                               sprintf(tmp_val, "%c) ", I2A(j));
-                               prt(tmp_val, j + 2, 4);
-                               object_desc(creature_ptr, o_name, o_ptr, 0);
-                               c_put_str(tval_to_attr[o_ptr->tval], o_name, j + 2, 7);
-                       }
-
-                       prt(format(_("我が家に置いてあったアイテム ( %d ページ): -続く-", "Your home contains (page %d): -more-"), k + 1), 0, 0);
-                       if (inkey() == ESCAPE) return;
-               }
-       }
-}
-
-
-/*!
  * @brief 異常発生時のゲーム緊急終了処理 /
  * Handle abrupt death of the visual system
  * @param creature_ptr プレーヤーへの参照ポインタ
index d4b68c4..0010352 100644 (file)
@@ -37,8 +37,6 @@ extern void do_cmd_save_game(player_type *creature_ptr, int is_autosave);
 extern void do_cmd_save_and_exit(player_type *player_ptr);
 extern void exit_game_panic(player_type *creature_ptr);
 extern errr get_rnd_line(concptr file_name, int entry, char *output);
-extern void print_tomb(player_type *dead_ptr);
-extern void show_info(player_type *creature_ptr);
 
 #ifdef JP
 extern errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count);
diff --git a/src/view/process-death.c b/src/view/process-death.c
new file mode 100644 (file)
index 0000000..554c280
--- /dev/null
@@ -0,0 +1,343 @@
+/*!
+ * @brief \8e\80\96S\81E\88ø\91Þ\81E\90Ø\95 \8e\9e\82Ì\89æ\96Ê\95\\8e¦
+ * @date 2020/02/24
+ * @author Hourier
+ * @details
+ * core\81Afiles\81Aview-mainwindow\82Ì\8eQ\8fÆ\8bÖ\8e~\81B\83R\81[\83\8b\83o\83b\83N\82Å\91Î\89\9e\82·\82é\82±\82Æ
+ */
+
+#include "process-death.h"
+#include "world.h"
+#include "floor-town.h"
+#include "player-inventory.h"
+#include "object-flavor.h"
+#include "store.h"
+#include "term.h"
+
+#define GRAVE_LINE_WIDTH 31
+
+concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms
+
+/*!
+ * @brief \95æ\90Î\82Ì\90^\82ñ\92\86\82É\95\8e\9a\97ñ\82ð\8f\91\82«\8d\9e\82Þ /
+ * Centers a string within a GRAVE_LINE_WIDTH character string         -JWT-
+ * @return \82È\82µ
+ * @details
+ */
+static void center_string(char *buf, concptr str)
+{
+       int i = strlen(str);
+       int j = GRAVE_LINE_WIDTH / 2 - i / 2;
+       (void)sprintf(buf, "%*s%s%*s", j, "", str, GRAVE_LINE_WIDTH - i - j, "");
+}
+
+
+/*
+ * Redefinable "print_tombstone" action
+ */
+bool(*tombstone_aux)(void) = NULL;
+
+
+/*!
+ * @brief \95æ\90Î\82Ì\83A\83X\83L\81[\83A\81[\83g\95\\8e¦ /
+ * Display a "tomb-stone"
+ * @param creature_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @return \82È\82µ
+ */
+void print_tomb(player_type *dead_ptr)
+{
+       bool done = FALSE;
+       if (tombstone_aux)
+       {
+               done = (*tombstone_aux)();
+       }
+
+       if (done) return;
+
+#ifdef JP
+       int extra_line = 0;
+#endif
+       Term_clear();
+       char buf[1024];
+       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("dead_j.txt", "dead.txt"));
+
+       FILE *fp;
+       fp = my_fopen(buf, "r");
+
+       if (fp)
+       {
+               int i = 0;
+
+               /* Dump the file to the screen */
+               while (my_fgets(fp, buf, sizeof(buf)) == 0)
+               {
+                       put_str(buf, i++, 0);
+               }
+
+               my_fclose(fp);
+       }
+
+       concptr p;
+       if (current_world_ptr->total_winner || (dead_ptr->lev > PY_MAX_LEVEL))
+       {
+#ifdef JP
+               p = "\88Ì\91å\82È\82é\8eÒ";
+#else
+               p = "Magnificent";
+#endif
+       }
+       else
+       {
+               p = player_title[dead_ptr->pclass][(dead_ptr->lev - 1) / 5];
+       }
+
+       center_string(buf, dead_ptr->name);
+       put_str(buf, 6, 11);
+
+#ifdef JP
+#else
+       center_string(buf, "the");
+       put_str(buf, 7, 11);
+#endif
+
+       center_string(buf, p);
+       put_str(buf, 8, 11);
+
+       center_string(buf, cp_ptr->title);
+       put_str(buf, 10, 11);
+
+       char tmp[160];
+       (void)sprintf(tmp, _("\83\8c\83x\83\8b: %d", "Level: %d"), (int)dead_ptr->lev);
+       center_string(buf, tmp);
+       put_str(buf, 11, 11);
+
+       (void)sprintf(tmp, _("\8co\8c±\92l: %ld", "Exp: %ld"), (long)dead_ptr->exp);
+       center_string(buf, tmp);
+       put_str(buf, 12, 11);
+
+       (void)sprintf(tmp, _("\8f\8a\8e\9d\8bà: %ld", "AU: %ld"), (long)dead_ptr->au);
+       center_string(buf, tmp);
+       put_str(buf, 13, 11);
+
+#ifdef JP
+       /* \95æ\82É\8d\8f\82Þ\8c¾\97t\82ð\83I\83\8a\83W\83i\83\8b\82æ\82è\8d×\82©\82­\95\\8e¦ */
+       if (streq(dead_ptr->died_from, "\93r\92\86\8fI\97¹"))
+       {
+               strcpy(tmp, "<\8e©\8eE>");
+       }
+       else if (streq(dead_ptr->died_from, "ripe"))
+       {
+               strcpy(tmp, "\88ø\91Þ\8cã\82É\93V\8eõ\82ð\91S\82¤");
+       }
+       else if (streq(dead_ptr->died_from, "Seppuku"))
+       {
+               strcpy(tmp, "\8f\9f\97\98\82Ì\8cã\81A\90Ø\95 ");
+       }
+       else
+       {
+               roff_to_buf(dead_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
+               char *t;
+               t = tmp + strlen(tmp) + 1;
+               if (*t)
+               {
+                       char dummy[80];
+                       strcpy(dummy, t); /* 2nd line */
+                       if (*(t + strlen(t) + 1)) /* Does 3rd line exist? */
+                       {
+                               for (t = dummy + strlen(dummy) - 2; iskanji(*(t - 1)); t--) /* Loop */;
+                               strcpy(t, "\81c");
+                       }
+                       else if (my_strstr(tmp, "\81w") && suffix(dummy, "\81x"))
+                       {
+                               char dummy2[80];
+                               char *name_head = my_strstr(tmp, "\81w");
+                               sprintf(dummy2, "%s%s", name_head, dummy);
+                               if (strlen(dummy2) <= GRAVE_LINE_WIDTH)
+                               {
+                                       strcpy(dummy, dummy2);
+                                       *name_head = '\0';
+                               }
+                       }
+                       else if (my_strstr(tmp, "\81u") && suffix(dummy, "\81v"))
+                       {
+                               char dummy2[80];
+                               char *name_head = my_strstr(tmp, "\81u");
+                               sprintf(dummy2, "%s%s", name_head, dummy);
+                               if (strlen(dummy2) <= GRAVE_LINE_WIDTH)
+                               {
+                                       strcpy(dummy, dummy2);
+                                       *name_head = '\0';
+                               }
+                       }
+
+                       center_string(buf, dummy);
+                       put_str(buf, 15, 11);
+                       extra_line = 1;
+               }
+       }
+
+       center_string(buf, tmp);
+       put_str(buf, 14, 11);
+
+       if (!streq(dead_ptr->died_from, "ripe") && !streq(dead_ptr->died_from, "Seppuku"))
+       {
+               if (dead_ptr->current_floor_ptr->dun_level == 0)
+               {
+                       concptr field_name = dead_ptr->town_num ? "\8aX" : "\8dr\96ì";
+                       if (streq(dead_ptr->died_from, "\93r\92\86\8fI\97¹"))
+                       {
+                               sprintf(tmp, "%s\82Å\8e\80\82ñ\82¾", field_name);
+                       }
+                       else
+                       {
+                               sprintf(tmp, "\82É%s\82Å\8eE\82³\82ê\82½", field_name);
+                       }
+               }
+               else
+               {
+                       if (streq(dead_ptr->died_from, "\93r\92\86\8fI\97¹"))
+                       {
+                               sprintf(tmp, "\92n\89º %d \8aK\82Å\8e\80\82ñ\82¾", (int)dead_ptr->current_floor_ptr->dun_level);
+                       }
+                       else
+                       {
+                               sprintf(tmp, "\82É\92n\89º %d \8aK\82Å\8eE\82³\82ê\82½", (int)dead_ptr->current_floor_ptr->dun_level);
+                       }
+               }
+
+               center_string(buf, tmp);
+               put_str(buf, 15 + extra_line, 11);
+       }
+#else
+       (void)sprintf(tmp, "Killed on Level %d", dead_ptr->current_floor_ptr->dun_level);
+       center_string(buf, tmp);
+       put_str(buf, 14, 11);
+
+       roff_to_buf(format("by %s.", dead_ptr->died_from), GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
+       center_string(buf, tmp);
+       char *t;
+       put_str(buf, 15, 11);
+       t = tmp + strlen(tmp) + 1;
+       if (*t)
+       {
+               char dummy[80];
+               strcpy(dummy, t); /* 2nd line */
+               if (*(t + strlen(t) + 1)) /* Does 3rd line exist? */
+               {
+                       int dummy_len = strlen(dummy);
+                       strcpy(dummy + MIN(dummy_len, GRAVE_LINE_WIDTH - 3), "...");
+               }
+               center_string(buf, dummy);
+               put_str(buf, 16, 11);
+       }
+#endif
+       time_t ct = time((time_t*)0);
+       (void)sprintf(tmp, "%-.24s", ctime(&ct));
+       center_string(buf, tmp);
+       put_str(buf, 17, 11);
+       msg_format(_("\82³\82æ\82¤\82È\82ç\81A%s!", "Goodbye, %s!"), dead_ptr->name);
+}
+
+
+/*!
+ * todo handle_stuff\81Adisplay_player\82Ì\88ø\90\94\82Í\8eb\92è\81B\82Ç\82Ì\82æ\82¤\82É\90Ý\8cv\82µ\92¼\82·\82©\8f­\82µ\8dl\82¦\82é
+ * @brief \8e\80\96S\81A\88ø\91Þ\8e\9e\82Ì\8aÈ\88Õ\83X\83e\81[\83^\83X\95\\8e¦
+ * @param creature_ptr \83v\83\8c\81[\83\84\81[\82Ö\82Ì\8eQ\8fÆ\83|\83C\83\93\83^
+ * @param handle_stuff \8dX\90V\8f\88\97\9d\83`\83F\83b\83N\82Ö\82Ì\83R\81[\83\8b\83o\83b\83N
+ * @param file_character \83X\83e\81[\83^\83X\83_\83\93\83v\82Ö\82Ì\83R\81[\83\8b\83o\83b\83N
+ * @param update_playtime \83v\83\8c\83C\8e\9e\8aÔ\8dX\90V\8f\88\97\9d\82Ö\82Ì\83R\81[\83\8b\83o\83b\83N
+ * @param display_player \83X\83e\81[\83^\83X\95\\8e¦\82Ö\82Ì\83R\81[\83\8b\83o\83b\83N
+ * @return \82È\82µ
+ */
+void show_info(player_type *creature_ptr, void(*handle_stuff)(player_type*), errr(*file_character)(player_type*, concptr), void(*update_playtime)(void), void(*display_player)(player_type*, int))
+{
+       object_type *o_ptr;
+       for (int i = 0; i < INVEN_TOTAL; i++)
+       {
+               o_ptr = &creature_ptr->inventory_list[i];
+               if (!o_ptr->k_idx) continue;
+
+               object_aware(creature_ptr, o_ptr);
+               object_known(o_ptr);
+       }
+
+       store_type *st_ptr;
+       for (int i = 1; i < max_towns; i++)
+       {
+               st_ptr = &town_info[i].store[STORE_HOME];
+
+               /* Hack -- Know everything in the home */
+               for (int j = 0; j < st_ptr->stock_num; j++)
+               {
+                       o_ptr = &st_ptr->stock[j];
+                       if (!o_ptr->k_idx) continue;
+
+                       /* Aware and Known */
+                       object_aware(creature_ptr, o_ptr);
+                       object_known(o_ptr);
+               }
+       }
+
+       creature_ptr->update |= (PU_BONUS);
+       handle_stuff(creature_ptr);
+       flush();
+       msg_erase();
+       prt(_("\83L\83\83\83\89\83N\83^\81[\82Ì\8bL\98^\82ð\83t\83@\83C\83\8b\82É\8f\91\82«\8fo\82·\82±\82Æ\82ª\82Å\82«\82Ü\82·\81B", "You may now dump a character record to one or more files."), 21, 0);
+       prt(_("\83\8a\83^\81[\83\93\83L\81[\82Å\83L\83\83\83\89\83N\83^\81[\82ð\8c©\82Ü\82·\81BESC\82Å\92\86\92f\82µ\82Ü\82·\81B", "Then, hit RETURN to see the character, or ESC to abort."), 22, 0);
+       while (TRUE)
+       {
+               char out_val[160];
+               put_str(_("\83t\83@\83C\83\8b\83l\81[\83\80: ", "Filename: "), 23, 0);
+               strcpy(out_val, "");
+               if (!askfor(out_val, 60)) return;
+               if (!out_val[0]) break;
+               screen_save();
+               (void)file_character(creature_ptr, out_val);
+               screen_load();
+       }
+
+       update_playtime();
+       display_player(creature_ptr, 0);
+       prt(_("\89½\82©\83L\81[\82ð\89\9f\82·\82Æ\82³\82ç\82É\8fî\95ñ\82ª\91±\82«\82Ü\82· (ESC\82Å\92\86\92f): ", "Hit any key to see more information (ESC to abort): "), 23, 0);
+       if (inkey() == ESCAPE) return;
+
+       if (creature_ptr->equip_cnt)
+       {
+               Term_clear();
+               (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
+               prt(_("\91\95\94õ\82µ\82Ä\82¢\82½\83A\83C\83e\83\80: -\91±\82­-", "You are using: -more-"), 0, 0);
+               if (inkey() == ESCAPE) return;
+       }
+
+       if (creature_ptr->inven_cnt)
+       {
+               Term_clear();
+               (void)show_inventory(creature_ptr, 0, USE_FULL, 0);
+               prt(_("\8e\9d\82Á\82Ä\82¢\82½\83A\83C\83e\83\80: -\91±\82­-", "You are carrying: -more-"), 0, 0);
+
+               if (inkey() == ESCAPE) return;
+       }
+
+       for (int l = 1; l < max_towns; l++)
+       {
+               st_ptr = &town_info[l].store[STORE_HOME];
+               if (st_ptr->stock_num == 0) continue;
+               for (int i = 0, k = 0; i < st_ptr->stock_num; k++)
+               {
+                       Term_clear();
+                       for (int j = 0; (j < 12) && (i < st_ptr->stock_num); j++, i++)
+                       {
+                               GAME_TEXT o_name[MAX_NLEN];
+                               char tmp_val[80];
+                               o_ptr = &st_ptr->stock[i];
+                               sprintf(tmp_val, "%c) ", I2A(j));
+                               prt(tmp_val, j + 2, 4);
+                               object_desc(creature_ptr, o_name, o_ptr, 0);
+                               c_put_str(tval_to_attr[o_ptr->tval], o_name, j + 2, 7);
+                       }
+
+                       prt(format(_("\89ä\82ª\89Æ\82É\92u\82¢\82Ä\82 \82Á\82½\83A\83C\83e\83\80 ( %d \83y\81[\83W): -\91±\82­-", "Your home contains (page %d): -more-"), k + 1), 0, 0);
+                       if (inkey() == ESCAPE) return;
+               }
+       }
+}
diff --git a/src/view/process-death.h b/src/view/process-death.h
new file mode 100644 (file)
index 0000000..cec00b8
--- /dev/null
@@ -0,0 +1,6 @@
+#pragma once
+
+#include "angband.h"
+
+void print_tomb(player_type *dead_ptr);
+void show_info(player_type *creature_ptr, void(*handle_stuff)(player_type*), errr(*file_character)(player_type*, concptr), void(*update_playtime)(void), void(*displayer_player)(player_type*, int));