From 173486e98ebda7cea506594e968668fac4ea8ffe Mon Sep 17 00:00:00 2001 From: Deskull Date: Wed, 9 Jan 2019 13:07:23 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20have=5Fnightmare()=20?= =?utf8?q?=E9=96=A2=E6=95=B0=E3=82=92=20monsterace-hook.c=20=E3=81=AB?= =?utf8?q?=E7=A7=BB=E5=8B=95=E3=80=82=20/=20Move=20have=5Fnightmare()=20to?= =?utf8?q?=20monsterrace-hook.c.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/bldg.c | 19 ------------------- src/externs.h | 1 - src/monsterrace-hook.c | 19 +++++++++++++++++++ src/monsterrace-hook.h | 1 + 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index 81edb2d27..8e191b731 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -1930,25 +1930,6 @@ static bool kankin(void) } /*! - * @brief 悪夢の元凶となるモンスターかどうかを返す。 - * @param r_idx 判定対象となるモンスターのID - * @return 悪夢の元凶となり得るか否か。 - */ -bool get_nightmare(MONRACE_IDX r_idx) -{ - monster_race *r_ptr = &r_info[r_idx]; - - /* Require eldritch horrors */ - if (!(r_ptr->flags2 & (RF2_ELDRITCH_HORROR))) return (FALSE); - - /* Require high level */ - if (r_ptr->level <= p_ptr->lev) return (FALSE); - - /* Accept this monster */ - return (TRUE); -} - -/*! * @brief 宿屋の利用サブルーチン * @details inn commands\n * Note that resting for the night was a perfect way to avoid player\n diff --git a/src/externs.h b/src/externs.h index b5dde240b..b0b2ba1d7 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1069,7 +1069,6 @@ extern bool eat_lock(void); extern bool shock_power(void); /* bldg.c */ -extern bool get_nightmare(MONRACE_IDX r_idx); extern void battle_monsters(void); extern void do_cmd_bldg(void); extern void do_cmd_quest(void); diff --git a/src/monsterrace-hook.c b/src/monsterrace-hook.c index 81144113d..b211eff35 100644 --- a/src/monsterrace-hook.c +++ b/src/monsterrace-hook.c @@ -679,3 +679,22 @@ bool monster_hook_human(MONRACE_IDX r_idx) return FALSE; } + +/*! + * @brief 悪夢の元凶となるモンスターかどうかを返す。 + * @param r_idx 判定対象となるモンスターのID + * @return 悪夢の元凶となり得るか否か。 + */ +bool get_nightmare(MONRACE_IDX r_idx) +{ + monster_race *r_ptr = &r_info[r_idx]; + + /* Require eldritch horrors */ + if (!(r_ptr->flags2 & (RF2_ELDRITCH_HORROR))) return (FALSE); + + /* Require high level */ + if (r_ptr->level <= p_ptr->lev) return (FALSE); + + /* Accept this monster */ + return (TRUE); +} diff --git a/src/monsterrace-hook.h b/src/monsterrace-hook.h index 656e249e6..7f4368597 100644 --- a/src/monsterrace-hook.h +++ b/src/monsterrace-hook.h @@ -61,3 +61,4 @@ extern bool vault_aux_dark_elf(MONRACE_IDX r_idx); extern bool monster_living(MONRACE_IDX r_idx); extern bool no_questor_or_bounty_uniques(MONRACE_IDX r_idx); extern bool monster_hook_human(MONRACE_IDX r_idx); +extern bool get_nightmare(MONRACE_IDX r_idx); -- 2.11.0