OSDN Git Service

[Refactor] #38997 set_hostile() にplayer_type * 引数追加 / Added player_type * argument...
[hengband/hengband.git] / src / monster.h
index 91b4866..6b1ba0f 100644 (file)
@@ -412,13 +412,13 @@ struct monster_type
 #define PM_KAGE           0x00000200    /*!< モンスター生成フラグ: 必ずあやしい影として生成する */
 #define PM_MULTIPLY       0x00000400    /*!< モンスター生成フラグ: 増殖処理時として生成する */
 
-extern bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
-extern bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode);
-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 bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
+extern bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
+extern bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x);
+extern bool alloc_guardian(player_type *player_ptr, bool def_val);
+extern bool alloc_monster(player_type *player_ptr, POSITION dis, BIT_FLAGS mode);
 
-extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode);
+extern void monster_desc(player_type *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode);
 /* Bit flags for monster_desc() */
 #define MD_OBJECTIVE      0x00000001 /* Objective (or Reflexive) */
 #define MD_POSSESSIVE     0x00000002 /* Possessive (or Reflexive) */
@@ -433,20 +433,20 @@ extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode);
 
 #define MD_WRONGDOER_NAME (MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE) /* 加害明記向け */
 
-extern void monster_name(MONSTER_IDX m_idx, char* m_name);
+extern void monster_name(player_type *player_ptr, MONSTER_IDX m_idx, char* m_name);
 
 extern void roff_top(MONRACE_IDX r_idx);
-extern void screen_roff(MONRACE_IDX r_idx, BIT_FLAGS mode);
-extern void display_roff(MONRACE_IDX r_idx);
-extern void output_monster_spoiler(MONRACE_IDX r_idx, void(*roff_func)(TERM_COLOR attr, concptr str));
+extern void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS mode);
+extern void display_roff(player_type *player_ptr);
+extern void output_monster_spoiler(player_type *player_ptr, MONRACE_IDX r_idx, void(*roff_func)(TERM_COLOR attr, concptr str));
 extern concptr extract_note_dies(MONRACE_IDX r_idx);
-extern void monster_death(MONSTER_IDX m_idx, bool drop_item);
-extern monsterrace_hook_type get_monster_hook(void);
-extern monsterrace_hook_type get_monster_hook2(POSITION y, POSITION x);
+extern void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item);
+extern monsterrace_hook_type get_monster_hook(player_type *player_ptr);
+extern monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POSITION x);
 extern void set_friendly(monster_type *m_ptr);
-extern void set_pet(monster_type *m_ptr);
-extern void set_hostile(monster_type *m_ptr);
-extern void anger_monster(monster_type *m_ptr);
+extern void set_pet(player_type *player_ptr, monster_type *m_ptr);
+extern void set_hostile(player_type *player_ptr, monster_type *m_ptr);
+extern void anger_monster(player_type *player_ptr, monster_type *m_ptr);
 
 /*
  * Bit flags for the *_can_enter() and monster_can_cross_terrain()
@@ -460,8 +460,8 @@ 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);
-extern int get_monster_crowd_number(MONSTER_IDX m_idx);
-extern void message_pain(MONSTER_IDX m_idx, HIT_POINT dam);
+extern int get_monster_crowd_number(player_type *player_ptr, MONSTER_IDX m_idx);
+extern void message_pain(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam);
 
 /* monster2.c */
 extern void set_target(monster_type *m_ptr, POSITION y, POSITION x);
@@ -469,17 +469,18 @@ extern void reset_target(monster_type *m_ptr);
 extern monster_race *real_r_ptr(monster_type *m_ptr);
 extern MONRACE_IDX real_r_idx(monster_type *m_ptr);
 extern void delete_monster_idx(MONSTER_IDX i);
-extern void compact_monsters(int size);
-extern void wipe_m_list(void);
-extern MONSTER_IDX m_pop(void);
-extern errr get_mon_num_prep(monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2);
-extern MONRACE_IDX get_mon_num(DEPTH level);
-extern int lore_do_probe(MONRACE_IDX r_idx);
-extern void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
+extern void compact_monsters(player_type *player_ptr, int size);
+extern void wipe_monsters_list(player_type *player_ptr);
+extern MONSTER_IDX m_pop(player_type *player_ptr);
+extern errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2);
+extern MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level);
+extern int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx);
+extern void lore_treasure(player_type *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
 extern void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full);
-extern void update_monsters(bool full);
-extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
-
+extern void update_monsters(player_type *player_ptr, bool full);
+extern bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
+extern bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
+extern bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
 
 /*
  * Some things which induce learning
@@ -503,18 +504,16 @@ extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
 #define DRS_FREE        30
 #define DRS_MANA        31
 #define DRS_REFLECT     32
-extern void update_smart_learn(MONSTER_IDX m_idx, int what);
+extern void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what);
 
-extern void choose_new_monster(MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
-extern SPEED get_mspeed(monster_race *r_ptr);
-extern void monster_drop_carried_objects(monster_type *m_ptr);
+extern void choose_new_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
+extern SPEED get_mspeed(player_type *player_ptr, monster_race *r_ptr);
+extern void monster_drop_carried_objects(player_type *player_ptr, monster_type *m_ptr);
+extern bool is_original_ap_and_seen(player_type *player_ptr, monster_type *m_ptr);
 
 #define is_friendly(A) \
         (bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE)
 
-#define is_friendly_idx(MONSTER_IDX) \
-        (bool)((MONSTER_IDX) > 0 && is_friendly(&p_ptr->current_floor_ptr->m_list[(MONSTER_IDX)]))
-
 #define is_pet(A) \
         (bool)(((A)->smart & SM_PET) ? TRUE : FALSE)
 
@@ -524,6 +523,3 @@ extern void monster_drop_carried_objects(monster_type *m_ptr);
 /* 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)
-
-#define is_original_ap_and_seen(A) \
-        (bool)((A)->ml && !p_ptr->image && ((A)->ap_r_idx == (A)->r_idx))