OSDN Git Service

[Refactor] #37353 check_score() を scores.c/h へ移動.
authordeskull <deskull@users.sourceforge.jp>
Tue, 14 May 2019 15:17:09 +0000 (00:17 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 14 May 2019 15:17:09 +0000 (00:17 +0900)
src/files.c
src/files.h
src/scores.c
src/scores.h

index 22d629e..6468b74 100644 (file)
@@ -64,8 +64,6 @@
 #include "autopick.h"
 #include "save.h"
 
-#include "scores.h"
-
 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
@@ -6543,71 +6541,6 @@ void show_info(void)
        }
 }
 
-/*!
- * @brief スコアファイル出力
- * Display some character info
- * @return なし
- */
-bool check_score(void)
-{
-       Term_clear();
-
-       /* No score file */
-       if (highscore_fd < 0)
-       {
-               msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable."));
-               msg_print(NULL);
-               return FALSE;
-       }
-
-#ifndef SCORE_WIZARDS
-       /* Wizard-mode pre-empts scoring */
-       if (p_ptr->noscore & 0x000F)
-       {
-               msg_print(_("ウィザード・モードではスコアが記録されません。", "Score not registered for wizards."));
-               msg_print(NULL);
-               return FALSE;
-       }
-#endif
-
-#ifndef SCORE_BORGS
-       /* Borg-mode pre-empts scoring */
-       if (p_ptr->noscore & 0x00F0)
-       {
-               msg_print(_("ボーグ・モードではスコアが記録されません。", "Score not registered for borgs."));
-               msg_print(NULL);
-               return FALSE;
-       }
-#endif
-
-#ifndef SCORE_CHEATERS
-       /* Cheaters are not scored */
-       if (p_ptr->noscore & 0xFF00)
-       {
-               msg_print(_("詐欺をやった人はスコアが記録されません。", "Score not registered for cheaters."));
-               msg_print(NULL);
-               return FALSE;
-       }
-#endif
-
-       /* Interupted */
-       if (!p_ptr->total_winner && streq(p_ptr->died_from, _("強制終了", "Interrupting")))
-       {
-               msg_print(_("強制終了のためスコアが記録されません。", "Score not registered due to interruption."));
-               msg_print(NULL);
-               return FALSE;
-       }
-
-       /* Quitter */
-       if (!p_ptr->total_winner && streq(p_ptr->died_from, _("途中終了", "Quitting")))
-       {
-               msg_print(_("途中終了のためスコアが記録されません。", "Score not registered due to quitting."));
-               msg_print(NULL);
-               return FALSE;
-       }
-       return TRUE;
-}
-
 
 /*!
  * @brief 異常発生時のゲーム緊急終了処理 /
index b8a0375..9e2d5a3 100644 (file)
@@ -45,7 +45,6 @@ extern void signals_init(void);
 extern errr get_rnd_line(concptr file_name, int entry, char *output);
 extern void print_tomb(void);
 extern void show_info(void);
-extern bool check_score(void);
 
 #ifdef JP
 extern errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count);
index dc02a4f..fa9b890 100644 (file)
@@ -926,3 +926,69 @@ void kingly(void)
        /* Wait for response */
        pause_line(hgt - 1);
 }
+
+/*!
+ * @brief スコアファイル出力
+ * Display some character info
+ * @return なし
+ */
+bool check_score(void)
+{
+       Term_clear();
+
+       /* No score file */
+       if (highscore_fd < 0)
+       {
+               msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable."));
+               msg_print(NULL);
+               return FALSE;
+       }
+
+#ifndef SCORE_WIZARDS
+       /* Wizard-mode pre-empts scoring */
+       if (p_ptr->noscore & 0x000F)
+       {
+               msg_print(_("ウィザード・モードではスコアが記録されません。", "Score not registered for wizards."));
+               msg_print(NULL);
+               return FALSE;
+       }
+#endif
+
+#ifndef SCORE_BORGS
+       /* Borg-mode pre-empts scoring */
+       if (p_ptr->noscore & 0x00F0)
+       {
+               msg_print(_("ボーグ・モードではスコアが記録されません。", "Score not registered for borgs."));
+               msg_print(NULL);
+               return FALSE;
+       }
+#endif
+
+#ifndef SCORE_CHEATERS
+       /* Cheaters are not scored */
+       if (p_ptr->noscore & 0xFF00)
+       {
+               msg_print(_("詐欺をやった人はスコアが記録されません。", "Score not registered for cheaters."));
+               msg_print(NULL);
+               return FALSE;
+       }
+#endif
+
+       /* Interupted */
+       if (!p_ptr->total_winner && streq(p_ptr->died_from, _("強制終了", "Interrupting")))
+       {
+               msg_print(_("強制終了のためスコアが記録されません。", "Score not registered due to interruption."));
+               msg_print(NULL);
+               return FALSE;
+       }
+
+       /* Quitter */
+       if (!p_ptr->total_winner && streq(p_ptr->died_from, _("途中終了", "Quitting")))
+       {
+               msg_print(_("途中終了のためスコアが記録されません。", "Score not registered due to quitting."));
+               msg_print(NULL);
+               return FALSE;
+       }
+       return TRUE;
+}
+
index 715a7d2..f240bb5 100644 (file)
@@ -47,4 +47,4 @@ extern errr predict_score(void);
 extern void race_legends(void);
 extern void race_score(int race_num);
 extern void show_highclass(void);
-
+extern bool check_score(void);