OSDN Git Service

[Refactor] #37353 determine_random_questor() を quest.c へ移動。 / Move determine_random_q...
authorDeskull <deskull@users.sourceforge.jp>
Sat, 19 Jan 2019 11:49:36 +0000 (20:49 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 19 Jan 2019 11:49:36 +0000 (20:49 +0900)
src/birth.c
src/externs.h
src/load.c
src/quest.c
src/quest.h

index d476135..fe6fc59 100644 (file)
@@ -15,6 +15,7 @@
 #include "history.h"
 #include "monsterrace-hook.h"
 #include "store.h"
+#include "quest.h"
 
 /*!
  * オートローラーの内容を描画する間隔 / 
@@ -1829,45 +1830,6 @@ static void player_wipe_without_name(void)
 }
 
 
-/*!
- * @brief ランダムクエストの討伐ユニークを決める / Determine the random quest uniques
- * @param q_ptr クエスト構造体の参照ポインタ
- * @return なし
- */
-void determine_random_questor(quest_type *q_ptr)
-{
-       MONRACE_IDX r_idx;
-       monster_race *r_ptr;
-
-       
-       get_mon_num_prep(mon_hook_quest, NULL);
-
-       while (1)
-       {
-               /*
-                * Random monster 5 - 10 levels out of depth
-                * (depending on level)
-                */
-               r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
-               r_ptr = &r_info[r_idx];
-
-               if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
-               if (r_ptr->flags1 & RF1_QUESTOR) continue;
-               if (r_ptr->rarity > 100) continue;
-               if (r_ptr->flags7 & RF7_FRIENDLY) continue;
-               if (r_ptr->flags7 & RF7_AQUATIC) continue;
-               if (r_ptr->flags8 & RF8_WILD_ONLY) continue;
-               if (no_questor_or_bounty_uniques(r_idx)) continue;
-
-               /*
-                * Accept monsters that are 2 - 6 levels
-                * out of depth depending on the quest level
-                */
-               if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
-       }
-
-       q_ptr->r_idx = r_idx;
-}
 
 /*!
  * @brief ダンジョン内部のクエストを初期化する / Initialize random quests and final quests
index ab07772..3deb786 100644 (file)
@@ -468,7 +468,6 @@ extern void add_history_from_pref_line(concptr t);
 extern void player_birth(void);
 extern void get_max_stats(void);
 extern void get_height_weight(void);
-extern void determine_random_questor(quest_type *q_ptr);
 extern void player_outfit(void);
 extern void dump_yourself(FILE *fff);
 
index 037f652..ac452d9 100644 (file)
@@ -44,6 +44,7 @@
 #include "generate.h"
 #include "trap.h"
 #include "mutation.h"
+#include "quest.h"
 
 
 /*
index a958d19..1bfb55a 100644 (file)
@@ -1,9 +1,49 @@
 #include "angband.h"
 #include "floor-events.h"
 #include "quest.h"
+#include "monsterrace-hook.h"
 
 
 /*!
+ * @brief ランダムクエストの討伐ユニークを決める / Determine the random quest uniques
+ * @param q_ptr クエスト構造体の参照ポインタ
+ * @return なし
+ */
+void determine_random_questor(quest_type *q_ptr)
+{
+       MONRACE_IDX r_idx;
+       monster_race *r_ptr;
+
+       get_mon_num_prep(mon_hook_quest, NULL);
+
+       while (1)
+       {
+               /*
+                * Random monster 5 - 10 levels out of depth
+                * (depending on level)
+                */
+               r_idx = get_mon_num(q_ptr->level + 5 + randint1(q_ptr->level / 10));
+               r_ptr = &r_info[r_idx];
+
+               if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
+               if (r_ptr->flags1 & RF1_QUESTOR) continue;
+               if (r_ptr->rarity > 100) continue;
+               if (r_ptr->flags7 & RF7_FRIENDLY) continue;
+               if (r_ptr->flags7 & RF7_AQUATIC) continue;
+               if (r_ptr->flags8 & RF8_WILD_ONLY) continue;
+               if (no_questor_or_bounty_uniques(r_idx)) continue;
+
+               /*
+                * Accept monsters that are 2 - 6 levels
+                * out of depth depending on the quest level
+                */
+               if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
+       }
+
+       q_ptr->r_idx = r_idx;
+}
+
+/*!
  * @brief クエストを達成状態にする /
  * @param quest_num 達成状態にしたいクエストのID
  * @return なし
index 55b3bcb..f9d8011 100644 (file)
@@ -1,4 +1,6 @@
-extern void complete_quest(QUEST_IDX quest_num);
+
+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);