OSDN Git Service

[Refactor] #40014 Reshaped monster.h
authorHourier <hourier@users.sourceforge.jp>
Sun, 7 Jun 2020 14:44:14 +0000 (23:44 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 7 Jun 2020 14:51:05 +0000 (23:51 +0900)
src/monster/monster.h

index fbf9689..6bb64ed 100644 (file)
@@ -14,7 +14,6 @@ extern MONSTER_IDX hack_m_idx_ii;
  * The "hold_o_idx" field points to the first object of a stack
  * of objects (if any) being carried by the monster (see above).
  */
-
 typedef struct floor_type floor_type;
 typedef struct monster_type {
        MONRACE_IDX r_idx;              /* Monster race index 0 = dead. */
@@ -51,65 +50,57 @@ typedef struct monster_type {
        MONSTER_IDX parent_m_idx;
 } monster_type;
 
-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(player_type *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode);
-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(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(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(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);
+/* monster1.c */
+void roff_top(MONRACE_IDX r_idx);
+void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS mode);
+void display_roff(player_type *player_ptr);
+void output_monster_spoiler(player_type *player_ptr, MONRACE_IDX r_idx, void(*roff_func)(TERM_COLOR attr, concptr str));
+concptr extract_note_dies(MONRACE_IDX r_idx);
+void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item);
+monsterrace_hook_type get_monster_hook(player_type *player_ptr);
+monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POSITION x);
+void set_friendly(monster_type *m_ptr);
+void set_pet(player_type *player_ptr, monster_type *m_ptr);
+void set_hostile(player_type *player_ptr, monster_type *m_ptr);
+void anger_monster(player_type *player_ptr, monster_type *m_ptr);
 
 /*
  * Bit flags for the *_can_enter() and monster_can_cross_terrain()
  */
 #define CEM_RIDING              0x0001
 #define CEM_P_CAN_ENTER_PATTERN 0x0002
-extern bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode);
-extern bool monster_can_enter(player_type *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode);
-extern bool are_enemies(player_type *player_ptr, monster_type *m_ptr1, monster_type *m_ptr2);
-extern bool monster_has_hostile_align(player_type *player_ptr, 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(player_type *player_ptr, MONSTER_IDX m_idx);
-extern void message_pain(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam);
+bool monster_can_cross_terrain(player_type *player_ptr, FEAT_IDX feat, monster_race *r_ptr, BIT_FLAGS16 mode);
+bool monster_can_enter(player_type *player_ptr, POSITION y, POSITION x, monster_race *r_ptr, BIT_FLAGS16 mode);
+bool are_enemies(player_type *player_ptr, monster_type *m_ptr1, monster_type *m_ptr2);
+bool monster_has_hostile_align(player_type *player_ptr, monster_type *m_ptr, int pa_good, int pa_evil, monster_race *r_ptr);
+void dice_to_string(int base_damage, int dice_num, int dice_side, int dice_mult, int dice_div, char* msg);
+concptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode);
+bool is_original_ap_and_seen(player_type *player_ptr, monster_type *m_ptr);
 
 /* monster2.c */
-extern void set_target(monster_type *m_ptr, POSITION y, POSITION x);
-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(player_type *player_ptr, MONSTER_IDX i);
-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);
+void set_target(monster_type *m_ptr, POSITION y, POSITION x);
+void reset_target(monster_type *m_ptr);
+monster_race *real_r_ptr(monster_type *m_ptr);
+MONRACE_IDX real_r_idx(monster_type *m_ptr);
+void delete_monster_idx(player_type *player_ptr, MONSTER_IDX i);
+void compact_monsters(player_type *player_ptr, int size);
+void wipe_monsters_list(player_type *player_ptr);
+MONSTER_IDX m_pop(player_type *player_ptr);
+errr get_mon_num_prep(player_type *player_ptr, monsterrace_hook_type monster_hook, monsterrace_hook_type monster_hook2);
 
 #define GMN_ARENA 0x00000001 //!< 賭け闘技場向け生成 
-extern MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level, BIT_FLAGS option);
-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(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);
-extern void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what);
-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);
+MONRACE_IDX get_mon_num(player_type *player_ptr, DEPTH level, BIT_FLAGS option);
+int lore_do_probe(player_type *player_ptr, MONRACE_IDX r_idx);
+void lore_treasure(player_type *player_ptr, MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
+void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full);
+void update_monsters(player_type *player_ptr, bool full);
+bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
+bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
+bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
+void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what);
+void choose_new_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool born, MONRACE_IDX r_idx);
+SPEED get_mspeed(player_type *player_ptr, monster_race *r_ptr);
+void monster_drop_carried_objects(player_type *player_ptr, monster_type *m_ptr);
 
 #define is_friendly(A) \
         (bool)(((A)->smart & SM_FRIENDLY) ? TRUE : FALSE)
@@ -123,3 +114,13 @@ extern bool is_original_ap_and_seen(player_type *player_ptr, 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)
+
+int get_monster_crowd_number(player_type *player_ptr, MONSTER_IDX m_idx);
+void message_pain(player_type *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam);
+bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
+bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
+bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x);
+bool alloc_guardian(player_type *player_ptr, bool def_val);
+bool alloc_monster(player_type *player_ptr, POSITION dis, BIT_FLAGS mode);
+void monster_desc(player_type *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode);
+void monster_name(player_type *player_ptr, MONSTER_IDX m_idx, char *m_name);