OSDN Git Service

[Refactor] #37353 monster1~monster-hook間整理。 / Refactor between monster1 and monster...
authorDeskull <deskull@users.sourceforge.jp>
Wed, 12 Dec 2018 11:56:26 +0000 (20:56 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 12 Dec 2018 11:56:26 +0000 (20:56 +0900)
13 files changed:
src/birth.c
src/dungeon.c
src/externs.h
src/hissatsu.c
src/melee1.c
src/monster-hook.c
src/monster-hook.h
src/monster-process.c
src/monster1.c
src/realm-hissatsu.c
src/spells1.c
src/spells2.c
src/xtra2.c

index fbac11e..3b81372 100644 (file)
@@ -1891,17 +1891,11 @@ void determine_random_questor(quest_type *q_ptr)
                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;
 
                /*
@@ -1911,7 +1905,7 @@ void determine_random_questor(quest_type *q_ptr)
                if (r_ptr->level > (q_ptr->level + (q_ptr->level / 20))) break;
        }
 
-       q_ptr->r_idx = (s16b)r_idx;
+       q_ptr->r_idx = r_idx;
 }
 
 /*!
@@ -2579,7 +2573,7 @@ static bool get_player_race(void)
 
        }
 
-       sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random");
+       sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
 
        /* Choose */
        k = -1;
index eaf6135..de15c59 100644 (file)
@@ -24,6 +24,7 @@
 #include "floor-events.h"
 #include "object-curse.h"
 #include "store.h"
+#include "monster-hook.h"
 
 static bool load = TRUE; /*!<ロード処理中の分岐フラグ*/
 static int wild_regen = 20; /*!<広域マップ移動時の自然回復処理カウンタ(広域マップ1マス毎に20回処理を基本とする)*/
index f6f7afd..e7e2586 100644 (file)
@@ -737,8 +737,6 @@ extern bool monster_can_cross_terrain(FEAT_IDX feat, monster_race *r_ptr, u16b m
 extern bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, u16b mode);
 extern bool are_enemies(monster_type *m_ptr1, monster_type *m_ptr2);
 extern bool monster_has_hostile_align(monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr);
-extern bool monster_living(monster_race *r_ptr);
-extern bool no_questor_or_bounty_uniques(MONRACE_IDX r_idx);
 extern void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char* msg);
 
 
index e5caa58..5851735 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include "angband.h"
+#include "monster-hook.h"
 
 #define TECHNIC_HISSATSU (REALM_HISSATSU - MIN_TECHNIC)
 
index b612a67..578fc4d 100644 (file)
@@ -14,6 +14,7 @@
 #include "angband.h"
 #include "cmd-pet.h"
 #include "player-damage.h"
+#include "monster-hook.h"
 
 
 
index e51a4de..baebe62 100644 (file)
@@ -618,3 +618,48 @@ bool vault_aux_dark_elf(MONRACE_IDX r_idx)
        for (i = 0; dark_elf_list[i]; i++) if (r_idx == dark_elf_list[i]) return TRUE;
        return FALSE;
 }
+
+
+
+/*!
+ * @brief モンスターが生命体かどうかを返す
+ * Is the monster "alive"?
+ * @param r_ptr 判定するモンスターの種族情報構造体参照ポインタ
+ * @return 生命体ならばTRUEを返す
+ * @details
+ * Used to determine the message to print for a killed monster.
+ * ("dies", "destroyed")
+ */
+bool monster_living(monster_race *r_ptr)
+{
+       /* Non-living, undead, or demon */
+       if (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING))
+               return FALSE;
+       else
+               return TRUE;
+}
+
+/*!
+ * @brief モンスターが特殊能力上、賞金首から排除する必要があるかどうかを返す。
+ * Is the monster "alive"? / Is this monster declined to be questor or bounty?
+ * @param r_idx モンスターの種族ID
+ * @return 賞金首に加えられないならばTRUEを返す
+ * @details
+ * 実質バーノール=ルパート用。
+ */
+bool no_questor_or_bounty_uniques(MONRACE_IDX r_idx)
+{
+       switch (r_idx)
+       {
+               /*
+                * Decline them to be questor or bounty because they use
+                * special motion "split and combine"
+                */
+       case MON_BANORLUPART:
+       case MON_BANOR:
+       case MON_LUPART:
+               return TRUE;
+       default:
+               return FALSE;
+       }
+}
index 87285a9..bc87a6d 100644 (file)
@@ -58,3 +58,5 @@ extern bool vault_aux_demon(MONRACE_IDX r_idx);
 extern bool vault_aux_cthulhu(MONRACE_IDX r_idx);\r
 extern bool vault_aux_dark_elf(MONRACE_IDX r_idx);\r
 \r
+extern bool monster_living(monster_race *r_ptr);\r
+extern bool no_questor_or_bounty_uniques(MONRACE_IDX r_idx);\r
index 4d04039..ab1f74c 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "angband.h"
 #include "cmd-pet.h"
+#include "monster-hook.h"
 
 
 /*!
index 2d0ac5e..913332a 100644 (file)
@@ -2449,48 +2449,3 @@ bool monster_has_hostile_align(monster_type *m_ptr, int pa_good, int pa_evil, mo
        /* Non-hostile alignment */
        return FALSE;
 }
-
-
-/*!
- * @brief モンスターが生命体かどうかを返す
- * Is the monster "alive"?
- * @param r_ptr 判定するモンスターの種族情報構造体参照ポインタ
- * @return 生命体ならばTRUEを返す
- * @details
- * Used to determine the message to print for a killed monster.
- * ("dies", "destroyed")
- */
-bool monster_living(monster_race *r_ptr)
-{
-       /* Non-living, undead, or demon */
-       if (r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING))
-               return FALSE;
-       else
-               return TRUE;
-}
-
-
-/*!
- * @brief モンスターが特殊能力上、賞金首から排除する必要があるかどうかを返す。
- * Is the monster "alive"? / Is this monster declined to be questor or bounty?
- * @param r_idx モンスターの種族ID
- * @return 賞金首に加えられないならばTRUEを返す
- * @details
- * 実質バーノール=ルパート用。
- */
-bool no_questor_or_bounty_uniques(MONRACE_IDX r_idx)
-{
-       switch (r_idx)
-       {
-       /*
-        * Decline them to be questor or bounty because they use
-        * special motion "split and combine"
-        */
-       case MON_BANORLUPART:
-       case MON_BANOR:
-       case MON_LUPART:
-               return TRUE;
-       default:
-               return FALSE;
-       }
-}
index f36d482..01ca7e1 100644 (file)
@@ -1,5 +1,6 @@
 #include "angband.h"
 #include "cmd-spell.h"
+#include "monster-hook.h"
 
 /*!
 * @brief 剣術の各処理を行う
index f01e32e..a09fcdf 100644 (file)
@@ -16,6 +16,7 @@
 #include "trap.h"
 #include "object-curse.h"
 #include "player-damage.h"
+#include "monster-hook.h"
 
 
 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
index ff294f5..354d56b 100644 (file)
@@ -14,6 +14,7 @@
 #include "angband.h"
 #include "grid.h"
 #include "trap.h"
+#include "monster-hook.h"
 
 
 /*!
index be978c4..6e74963 100644 (file)
@@ -14,6 +14,7 @@
 #include "angband.h"
 #include "cmd-pet.h"
 #include "object-curse.h"
+#include "monster-hook.h"
 
 #define REWARD_CHANCE 10