OSDN Git Service

[Refactor] #37353 モンスターの状態判定マクロ4種を monster.h へ移動。
authordeskull <deskull@users.sourceforge.jp>
Thu, 4 Apr 2019 14:39:40 +0000 (23:39 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 4 Apr 2019 14:39:40 +0000 (23:39 +0900)
src/defines.h
src/floor-events.c
src/monster.h
src/quest.c
src/warning.c

index 7597f7b..b3a0c30 100644 (file)
 #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(&current_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)
index e3f8bd6..2a79578 100644 (file)
@@ -1,5 +1,6 @@
 #include "angband.h"
 #include "grid.h"
+#include "monster.h"
 
 void day_break()
 {
index 081da44..2768650 100644 (file)
@@ -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(&current_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
index 64a68bc..00a1c4b 100644 (file)
@@ -3,6 +3,7 @@
 #include "floor-events.h"
 #include "quest.h"
 #include "monsterrace-hook.h"
+#include "monster.h"
 
 
 /*!
index 2ec588f..f1c111f 100644 (file)
@@ -6,6 +6,7 @@
 #include "feature.h"
 #include "warning.h"
 #include "player-status.h"
+#include "monster.h"
 
 /*!
  * @brief 警告を放つアイテムを選択する /