From ad1278b8006b42802e18a64c2d82d3d3e8f90fcb Mon Sep 17 00:00:00 2001 From: deskull Date: Thu, 4 Apr 2019 23:39:40 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E3=83=A2=E3=83=B3?= =?utf8?q?=E3=82=B9=E3=82=BF=E3=83=BC=E3=81=AE=E7=8A=B6=E6=85=8B=E5=88=A4?= =?utf8?q?=E5=AE=9A=E3=83=9E=E3=82=AF=E3=83=AD4=E7=A8=AE=E3=82=92=E3=80=80?= =?utf8?q?monster.h=E3=80=80=E3=81=B8=E7=A7=BB=E5=8B=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/defines.h | 12 ------------ src/floor-events.c | 1 + src/monster.h | 13 ++++++++++++- src/quest.c | 1 + src/warning.c | 1 + 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/defines.h b/src/defines.h index 7597f7bbe..b3a0c30ba 100644 --- a/src/defines.h +++ b/src/defines.h @@ -2642,18 +2642,6 @@ #define MR1_SINKA 0x01 -#define is_friendly(A) \ - (bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE) - -#define is_friendly_idx(IDX) \ - (bool)((IDX) > 0 && is_friendly(¤t_floor_ptr->m_list[(IDX)])) - -#define is_pet(A) \ - (bool)(((A)->smart & SM_PET) ? TRUE : FALSE) - -#define is_hostile(A) \ - (bool)((is_friendly(A) || is_pet(A)) ? FALSE : TRUE) - /* Hack -- Determine monster race appearance index is same as race index */ #define is_original_ap(A) \ (bool)(((A)->ap_r_idx == (A)->r_idx) ? TRUE : FALSE) diff --git a/src/floor-events.c b/src/floor-events.c index e3f8bd66a..2a7957895 100644 --- a/src/floor-events.c +++ b/src/floor-events.c @@ -1,5 +1,6 @@ #include "angband.h" #include "grid.h" +#include "monster.h" void day_break() { diff --git a/src/monster.h b/src/monster.h index 081da445f..27686507b 100644 --- a/src/monster.h +++ b/src/monster.h @@ -19,7 +19,6 @@ extern bool alloc_horde(POSITION y, POSITION x); extern bool alloc_guardian(bool def_val); extern bool alloc_monster(POSITION dis, BIT_FLAGS mode); - extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode); /* Bit flags for monster_desc() */ #define MD_OBJECTIVE 0x00000001 /* Objective (or Reflexive) */ @@ -55,3 +54,15 @@ 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 void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char* msg); extern concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode); + +#define is_friendly(A) \ + (bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE) + +#define is_friendly_idx(IDX) \ + (bool)((IDX) > 0 && is_friendly(¤t_floor_ptr->m_list[(IDX)])) + +#define is_pet(A) \ + (bool)(((A)->smart & SM_PET) ? TRUE : FALSE) + +#define is_hostile(A) \ + (bool)((is_friendly(A) || is_pet(A)) ? FALSE : TRUE) \ No newline at end of file diff --git a/src/quest.c b/src/quest.c index 64a68bc9e..00a1c4bbb 100644 --- a/src/quest.c +++ b/src/quest.c @@ -3,6 +3,7 @@ #include "floor-events.h" #include "quest.h" #include "monsterrace-hook.h" +#include "monster.h" /*! diff --git a/src/warning.c b/src/warning.c index 2ec588f80..f1c111f31 100644 --- a/src/warning.c +++ b/src/warning.c @@ -6,6 +6,7 @@ #include "feature.h" #include "warning.h" #include "player-status.h" +#include "monster.h" /*! * @brief 警告を放つアイテムを選択する / -- 2.11.0