OSDN Git Service

[Refactor] #37353 quest_discovery() を quest.c へ移動。 / Move quest_discovery() in bldg...
authorDeskull <deskull@users.sourceforge.jp>
Sun, 20 Jan 2019 15:14:41 +0000 (00:14 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sun, 20 Jan 2019 15:14:41 +0000 (00:14 +0900)
src/bldg.c
src/quest.c
src/quest.h

index e367331..c3d1f6e 100644 (file)
@@ -4385,66 +4385,3 @@ void do_cmd_bldg(void)
        p_ptr->redraw |= (PR_BASIC | PR_EXTRA | PR_EQUIPPY | PR_MAP);
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 }
-
-
-/*!
- * @brief クエスト突入時のメッセージテーブル / Array of places to find an inscription
- */
-static concptr find_quest[] =
-{
-       _("床にメッセージが刻まれている:", "You find the following inscription in the floor"),
-       _("壁にメッセージが刻まれている:", "You see a message inscribed in the wall"),
-       _("メッセージを見つけた:", "There is a sign saying"),
-       _("何かが階段の上に書いてある:", "Something is written on the staircase"),
-       _("巻物を見つけた。メッセージが書いてある:", "You find a scroll with the following message"),
-};
-
-
-/*!
- * @brief クエストの導入メッセージを表示する / Discover quest
- * @param q_idx 開始されたクエストのID
- */
-void quest_discovery(QUEST_IDX q_idx)
-{
-       quest_type *q_ptr = &quest[q_idx];
-       monster_race *r_ptr = &r_info[q_ptr->r_idx];
-       MONSTER_NUMBER q_num = q_ptr->max_num;
-       GAME_TEXT name[MAX_NLEN];
-
-       /* No quest index */
-       if (!q_idx) return;
-
-       strcpy(name, (r_name + r_ptr->name));
-
-       msg_print(find_quest[rand_range(0, 4)]);
-       msg_print(NULL);
-
-       if (q_num == 1)
-       {
-               /* Unique */
-
-               /* Hack -- "unique" monsters must be "unique" */
-               if ((r_ptr->flags1 & RF1_UNIQUE) && (0 == r_ptr->max_num))
-               {
-                       msg_print(_("この階は以前は誰かによって守られていたようだ…。", "It seems that this level was protected by someone before..."));
-                       /* The unique is already dead */
-                       quest[q_idx].status = QUEST_STATUS_FINISHED;
-                       q_ptr->complev = 0;
-                       update_playtime();
-                       q_ptr->comptime = playtime;
-               }
-               else
-               {
-                       msg_format(_("注意せよ!この階は%sによって守られている!", "Beware, this level is protected by %s!"), name);
-               }
-       }
-       else
-       {
-               /* Normal monsters */
-#ifndef JP
-               plural_aux(name);
-#endif
-               msg_format(_("注意しろ!この階は%d体の%sによって守られている!", "Be warned, this level is guarded by %d %s!"), q_num, name);
-
-       }
-}
index 0ec1728..e6d79c0 100644 (file)
@@ -5,6 +5,18 @@
 
 
 /*!
+ * @brief クエスト突入時のメッセージテーブル / Array of places to find an inscription
+ */
+static concptr find_quest[] =
+{
+       _("床にメッセージが刻まれている:", "You find the following inscription in the floor"),
+       _("壁にメッセージが刻まれている:", "You see a message inscribed in the wall"),
+       _("メッセージを見つけた:", "There is a sign saying"),
+       _("何かが階段の上に書いてある:", "Something is written on the staircase"),
+       _("巻物を見つけた。メッセージが書いてある:", "You find a scroll with the following message"),
+};
+
+/*!
  * @brief ランダムクエストの討伐ユニークを決める / Determine the random quest uniques
  * @param q_ptr クエスト構造体の参照ポインタ
  * @return なし
@@ -311,6 +323,55 @@ void check_find_art_quest_completion(object_type *o_ptr)
 }
 
 
+/*!
+ * @brief クエストの導入メッセージを表示する / Discover quest
+ * @param q_idx 開始されたクエストのID
+ */
+void quest_discovery(QUEST_IDX q_idx)
+{
+       quest_type *q_ptr = &quest[q_idx];
+       monster_race *r_ptr = &r_info[q_ptr->r_idx];
+       MONSTER_NUMBER q_num = q_ptr->max_num;
+       GAME_TEXT name[MAX_NLEN];
+
+       /* No quest index */
+       if (!q_idx) return;
+
+       strcpy(name, (r_name + r_ptr->name));
+
+       msg_print(find_quest[rand_range(0, 4)]);
+       msg_print(NULL);
+
+       if (q_num == 1)
+       {
+               /* Unique */
+
+               /* Hack -- "unique" monsters must be "unique" */
+               if ((r_ptr->flags1 & RF1_UNIQUE) && (0 == r_ptr->max_num))
+               {
+                       msg_print(_("この階は以前は誰かによって守られていたようだ…。", "It seems that this level was protected by someone before..."));
+                       /* The unique is already dead */
+                       quest[q_idx].status = QUEST_STATUS_FINISHED;
+                       q_ptr->complev = 0;
+                       update_playtime();
+                       q_ptr->comptime = playtime;
+               }
+               else
+               {
+                       msg_format(_("注意せよ!この階は%sによって守られている!", "Beware, this level is protected by %s!"), name);
+               }
+       }
+       else
+       {
+               /* Normal monsters */
+#ifndef JP
+               plural_aux(name);
+#endif
+               msg_format(_("注意しろ!この階は%d体の%sによって守られている!", "Be warned, this level is guarded by %d %s!"), q_num, name);
+
+       }
+}
+
 
 /*!
  * @brief 新しく入ったダンジョンの階層に固定されている一般のクエストを探し出しIDを返す。
index e2e0181..0b62f05 100644 (file)
@@ -22,5 +22,6 @@ extern void determine_random_questor(quest_type *q_ptr);
 extern void complete_quest(QUEST_IDX quest_num);
 extern void check_quest_completion(monster_type *m_ptr);
 extern void check_find_art_quest_completion(object_type *o_ptr);
+void quest_discovery(QUEST_IDX q_idx);
 extern QUEST_IDX quest_number(DEPTH level);
 extern QUEST_IDX random_quest_number(DEPTH level);