From bb3162da7adbd54f98d3ff74809cbf9decaac294 Mon Sep 17 00:00:00 2001 From: deskull Date: Wed, 6 Mar 2019 13:48:59 +0900 Subject: [PATCH] [Refactor] #37353 place_mirror() to spells-floor.c. --- src/externs.h | 1 - src/spells-floor.c | 26 ++++++++++++++++++++++++++ src/spells-floor.h | 1 + src/spells3.c | 27 --------------------------- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/externs.h b/src/externs.h index c0595e9eb..0827a3d9b 100644 --- a/src/externs.h +++ b/src/externs.h @@ -959,7 +959,6 @@ extern void brand_weapon(int brand_type); extern void call_the_(void); extern void fetch(DIRECTION dir, WEIGHT wgt, bool require_los); extern void alter_reality(void); -extern bool place_mirror(void); extern void identify_pack(void); extern int remove_curse(void); extern int remove_all_curse(void); diff --git a/src/spells-floor.c b/src/spells-floor.c index 835ca3c01..6c6aa577e 100644 --- a/src/spells-floor.c +++ b/src/spells-floor.c @@ -213,3 +213,29 @@ bool explosive_rune(void) return TRUE; } + +/*! + * @brief 鏡設置処理 + * @return 実際に設置が行われた場合TRUEを返す + */ +bool place_mirror(void) +{ + if (!cave_clean_bold(p_ptr->y, p_ptr->x)) + { + msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell.")); + return FALSE; + } + + /* Create a mirror */ + current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT; + current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror; + + /* Turn on the light */ + current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW; + + note_spot(p_ptr->y, p_ptr->x); + lite_spot(p_ptr->y, p_ptr->x); + update_local_illumination(p_ptr->y, p_ptr->x); + + return TRUE; +} diff --git a/src/spells-floor.h b/src/spells-floor.h index 1a698071b..4f468dc3b 100644 --- a/src/spells-floor.h +++ b/src/spells-floor.h @@ -4,3 +4,4 @@ extern void wiz_lite(bool ninja); extern void wiz_dark(void); extern bool warding_glyph(void); extern bool explosive_rune(void); +extern bool place_mirror(void); diff --git a/src/spells3.c b/src/spells3.c index f239a60b8..6474b3775 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -1581,33 +1581,6 @@ void alter_reality(void) } /*! - * @brief 鏡設置処理 - * @return 実際に設置が行われた場合TRUEを返す - */ -bool place_mirror(void) -{ - if (!cave_clean_bold(p_ptr->y, p_ptr->x)) - { - msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell.")); - return FALSE; - } - - /* Create a mirror */ - current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT; - current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].mimic = feat_mirror; - - /* Turn on the light */ - current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info |= CAVE_GLOW; - - note_spot(p_ptr->y, p_ptr->x); - lite_spot(p_ptr->y, p_ptr->x); - update_local_illumination(p_ptr->y, p_ptr->x); - - return TRUE; -} - - -/*! * @brief 全所持アイテム鑑定処理 / * Identify everything being carried. * Done by a potion of "self knowledge". -- 2.11.0