OSDN Git Service

#37353 SINGING_SONG_IDとINTERUPTING_SONG_IDを定義。 / Define SINGING_SONG_ID and INTERUPTI...
[hengband/hengband.git] / src / monster2.c
index bfc70f3..0d3692a 100644 (file)
@@ -428,8 +428,9 @@ static void compact_monsters_aux(IDX i1, IDX i2)
  */
 void compact_monsters(int size)
 {
-       int             i, num, cnt;
-       int             cur_lev, cur_dis, chance;
+       MONSTER_IDX i;
+       int num, cnt;
+       int cur_lev, cur_dis, chance;
 
        /* Message (only if compacting) */
        if (size) msg_print(_("モンスター情報を圧縮しています...", "Compacting monsters..."));
@@ -592,9 +593,9 @@ void wipe_m_list(void)
  * @details
  * This routine should almost never fail, but it *can* happen.
  */
-s16b m_pop(void)
+MONSTER_IDX m_pop(void)
 {
-       int i;
+       MONSTER_IDX i;
 
 
        /* Normal allocation */
@@ -1297,7 +1298,7 @@ static int mysqrt(int n)
  * Note that if no monsters are "appropriate", then this function will
  * fail, and return zero, but this should *almost* never happen.
  */
-s16b get_mon_num(int level)
+MONRACE_IDX get_mon_num(DEPTH level)
 {
        int                     i, j, p;
        int                     r_idx;
@@ -1512,7 +1513,7 @@ s16b get_mon_num(int level)
  *  MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE
  *    --> Reflexive, genderized if visable ("himself") or "itself"
  */
-void monster_desc(char *desc, monster_type *m_ptr, int mode)
+void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode)
 {
        cptr            res;
        monster_race    *r_ptr;
@@ -1923,7 +1924,7 @@ int lore_do_probe(MONRACE_IDX r_idx)
  * gold and items are dropped, and remembers that information to be
  * described later by the monster recall code.
  */
-void lore_treasure(MONSTER_IDX m_idx, int num_item, int num_gold)
+void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold)
 {
        monster_type *m_ptr = &m_list[m_idx];
 
@@ -2971,8 +2972,8 @@ static IDX initial_r_appearance(MONRACE_IDX r_idx)
 {
        int attempts = 1000;
 
-       int ap_r_idx;
-       int min = MIN(base_level-5, 50);
+       IDX ap_r_idx;
+       DEPTH min = MIN(base_level-5, 50);
 
        if (!(r_info[r_idx].flags7 & RF7_TANUKI))
                return r_idx;
@@ -3038,7 +3039,7 @@ byte get_mspeed(monster_race *r_ptr)
  * This is the only function which may place a monster in the dungeon,
  * except for the savefile loading code.
  */
-static bool place_monster_one(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
+static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        /* Access the location */
        cave_type               *c_ptr = &cave[y][x];
@@ -3435,7 +3436,7 @@ static bool place_monster_one(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx
  * @return 成功したらtrue
  *  
  */
-static bool mon_scatter(MONRACE_IDX r_idx, int *yp, int *xp, int y, int x, int max_dist)
+static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist)
 {
        int place_x[MON_SCAT_MAXD];
        int place_y[MON_SCAT_MAXD];
@@ -3515,7 +3516,7 @@ static bool mon_scatter(MONRACE_IDX r_idx, int *yp, int *xp, int y, int x, int m
  * @param mode 生成オプション
  * @return 成功したらtrue
  */
-static bool place_monster_group(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, u32b mode)
+static bool place_monster_group(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        monster_race *r_ptr = &r_info[r_idx];
 
@@ -3677,7 +3678,7 @@ static bool place_monster_can_escort(MONRACE_IDX r_idx)
  * Note the use of the new "monster allocation table" code to restrict
  * the "get_mon_num()" function to "legal" escort types.
  */
-bool place_monster_aux(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
+bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        int             i, j, n;
        monster_race    *r_ptr = &r_info[r_idx];
@@ -3723,7 +3724,7 @@ bool place_monster_aux(IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_F
                for (i = 0; i < 32; i++)
                {
                        POSITION nx, ny, d = 3;
-                       int z; 
+                       MONRACE_IDX z; 
 
                        /* Pick a location */
                        scatter(&ny, &nx, y, x, d, 0);
@@ -3860,7 +3861,7 @@ bool alloc_horde(POSITION y, POSITION x)
  */
 bool alloc_guardian(bool def_val)
 {
-       int guardian = d_info[dungeon_type].final_guardian;
+       MONRACE_IDX guardian = d_info[dungeon_type].final_guardian;
 
        if (guardian && (d_info[dungeon_type].maxdepth == dun_level) && (r_info[guardian].cur_num < r_info[guardian].max_num))
        {
@@ -3903,7 +3904,7 @@ bool alloc_guardian(bool def_val)
  * Use "slp" to choose the initial "sleep" status
  * Use "monster_level" for the monster level
  */
-bool alloc_monster(int dis, u32b mode)
+bool alloc_monster(int dis, BIT_FLAGS mode)
 {
        int                     y = 0, x = 0;
        int         attempts_left = 10000;
@@ -4047,9 +4048,10 @@ static bool summon_specific_okay(MONRACE_IDX r_idx)
  *
  * Note that this function may not succeed, though this is very rare.
  */
-bool summon_specific(int who, int y1, int x1, int lev, int type, u32b mode)
+bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode)
 {
-       int x, y, r_idx;
+       POSITION x, y;
+       MONRACE_IDX r_idx;
 
        if (p_ptr->inside_arena) return (FALSE);
 
@@ -4100,9 +4102,9 @@ bool summon_specific(int who, int y1, int x1, int lev, int type, u32b mode)
  * @param mode 生成オプション 
  * @return 召喚できたらtrueを返す
  */
-bool summon_named_creature (int who, int oy, int ox, MONRACE_IDX r_idx, u32b mode)
+bool summon_named_creature (MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
-       int x, y;
+       POSITION x, y;
 
        /* Paranoia */
        /* if (!r_idx) return; */
@@ -4128,11 +4130,11 @@ bool summon_named_creature (int who, int oy, int ox, MONRACE_IDX r_idx, u32b mod
  * @details
  * Note that "reproduction" REQUIRES empty space.
  */
-bool multiply_monster(MONSTER_IDX m_idx, bool clone, u32b mode)
+bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
 {
        monster_type    *m_ptr = &m_list[m_idx];
 
-       int y, x;
+       POSITION y, x;
 
        if (!mon_scatter(m_ptr->r_idx, &y, &x, m_ptr->fy, m_ptr->fx, 1))
                return FALSE;
@@ -4163,7 +4165,7 @@ bool multiply_monster(MONSTER_IDX m_idx, bool clone, u32b mode)
  * @details
  * Technically should attempt to treat "Beholder"'s as jelly's
  */
-void message_pain(MONSTER_IDX m_idx, int dam)
+void message_pain(MONSTER_IDX m_idx, HIT_POINT dam)
 {
        long oldhp, newhp, tmp;
        int percentage;