OSDN Git Service

[Refactor] #37353 monster1~monster-hook間整理。 / Refactor between monster1 and monster...
[hengband/hengband.git] / src / monster1.c
index 73581cd..913332a 100644 (file)
@@ -52,10 +52,8 @@ static cptr wd_his[3] =
 static bool know_armour(MONRACE_IDX r_idx)
 {
        monster_race *r_ptr = &r_info[r_idx];
-
-       s32b level = r_ptr->level;
-
-       s32b kills = r_ptr->r_tkills;
+       DEPTH level = r_ptr->level;
+       MONSTER_NUMBER kills = r_ptr->r_tkills;
 
     bool known = (r_ptr->r_cast_spell == MAX_UCHAR)? TRUE: FALSE;
 
@@ -210,11 +208,8 @@ void set_damage(MONRACE_IDX r_idx, int SPELL_NUM, char* msg, char* tmp)
 static void roff_aux(MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        monster_race    *r_ptr = &r_info[r_idx];
-
        bool            old = FALSE;
-
        int             m, n, r;
-
        cptr            p, q;
 
 #ifdef JP
@@ -225,7 +220,7 @@ static void roff_aux(MONRACE_IDX r_idx, BIT_FLAGS mode)
        int             msex = 0;
 
        bool nightmare = ironman_nightmare && !(mode & 0x02);
-       int speed = nightmare ? r_ptr->speed + 5 : r_ptr->speed;
+       SPEED speed = nightmare ? r_ptr->speed + 5 : r_ptr->speed;
 
        bool            breath = FALSE;
        bool            magic = FALSE;
@@ -588,8 +583,6 @@ static void roff_aux(MONRACE_IDX r_idx, BIT_FLAGS mode)
                        hooked_roff(format(_("%^sは", "%^s "), wd_he[msex]));
                        old = TRUE;
                }
-
-               /* Describe */
                hooked_roff(_("侵入者を追跡しない", "does not deign to chase intruders"));
        }
 
@@ -1705,7 +1698,6 @@ static void roff_aux(MONRACE_IDX r_idx, BIT_FLAGS mode)
 #endif
                }
 
-               /* Okay */
                else
                {
                        p = NULL;
@@ -2002,7 +1994,7 @@ void roff_top(MONRACE_IDX r_idx)
 {
        monster_race    *r_ptr = &r_info[r_idx];
 
-       byte            a1, a2;
+       TERM_COLOR      a1, a2;
        char            c1, c2;
 
 
@@ -2174,7 +2166,7 @@ monster_hook_type get_monster_hook(void)
  * @brief 指定された広域マップ座標の地勢を元にモンスターの生成条件関数を返す
  * @return 地勢にあったモンスターの生成条件関数
  */
-monster_hook_type get_monster_hook2(int y, int x)
+monster_hook_type get_monster_hook2(POSITION y, POSITION x)
 {
        feature_type *f_ptr = &f_info[cave[y][x].feat];
 
@@ -2283,7 +2275,7 @@ void anger_monster(monster_type *m_ptr)
  * @param mode オプション
  * @return 踏破可能ならばTRUEを返す
  */
-bool monster_can_cross_terrain(s16b feat, monster_race *r_ptr, u16b mode)
+bool monster_can_cross_terrain(FEAT_IDX feat, monster_race *r_ptr, u16b mode)
 {
        feature_type *f_ptr = &f_info[feat];
 
@@ -2348,7 +2340,7 @@ bool monster_can_cross_terrain(s16b feat, monster_race *r_ptr, u16b mode)
  * @param mode オプション
  * @return 踏破可能ならばTRUEを返す
  */
-bool monster_can_enter(int y, int x, monster_race *r_ptr, u16b mode)
+bool monster_can_enter(POSITION y, POSITION x, monster_race *r_ptr, u16b mode)
 {
        cave_type *c_ptr = &cave[y][x];
 
@@ -2457,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;
-       }
-}