OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
authorDeskull <deskull@users.sourceforge.jp>
Tue, 6 Nov 2018 16:33:51 +0000 (01:33 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Tue, 6 Nov 2018 16:33:51 +0000 (01:33 +0900)
src/externs.h
src/init1.c
src/load.c
src/monster-status.c
src/mspells4.c
src/spells1.c
src/types.h
src/wizard2.c
src/xtra2.c

index 08fee24..ae79305 100644 (file)
@@ -720,7 +720,7 @@ extern void dispel_monster_status(MONSTER_IDX m_idx);
 extern u32b get_curse(int power, object_type *o_ptr);
 extern void curse_equipment(int chance, int heavy_chance);
 extern void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note, IDX who);
-extern bool process_the_world(int num, int who, bool vs_player);
+extern bool process_the_world(int num, MONSTER_IDX who, bool vs_player);
 extern void monster_gain_exp(MONSTER_IDX m_idx, IDX s_idx);
 
 /* monster1.c */
index 6362f70..22e17ca 100644 (file)
@@ -3674,7 +3674,7 @@ static errr parse_line_feature(char *buf)
                {
                        /* Special */
                        case 9:
-                               letter[index].special = atoi(zz[8]);
+                               letter[index].special = (s16b)atoi(zz[8]);
                                /* Fall through */
                        /* Trap */
                        case 8:
index 5ae5d29..7350aff 100644 (file)
@@ -869,7 +869,7 @@ static void rd_monster_old(monster_type *m_ptr)
        }
        else
        {
-               rd_u32b(&m_ptr->dealt_damage); 
+               rd_s32b(&m_ptr->dealt_damage); 
        }
        
        rd_s16b(&m_ptr->mtimed[MTIMED_CSLEEP]);
@@ -1014,7 +1014,7 @@ static void rd_monster(monster_type *m_ptr)
        }
        else
        {
-               rd_u32b(&m_ptr->dealt_damage); 
+               rd_s32b(&m_ptr->dealt_damage); 
        }
 
        /* Monster race index of its appearance */
index 5f40ba9..3cf4809 100644 (file)
@@ -678,7 +678,7 @@ void dispel_monster_status(MONSTER_IDX m_idx)
 * @param vs_player TRUEならば時間停止開始処理を行う
 * @return 時間停止が行われている状態ならばTRUEを返す
 */
-bool process_the_world(int num, int who, bool vs_player)
+bool process_the_world(int num, MONSTER_IDX who, bool vs_player)
 {
        monster_type *m_ptr = &m_list[hack_m_idx];  /* the world monster */
 
@@ -811,9 +811,8 @@ void monster_gain_exp(MONSTER_IDX m_idx, IDX s_idx)
                }
                if (ironman_nightmare)
                {
-                       u32b hp = m_ptr->max_maxhp * 2L;
-
-                       m_ptr->max_maxhp = (s16b)MIN(30000, hp);
+                       HIT_POINT hp = m_ptr->max_maxhp * 2L;
+                       m_ptr->max_maxhp = MIN(30000, hp);
                }
                m_ptr->maxhp = m_ptr->max_maxhp;
                m_ptr->hp = old_hp * m_ptr->maxhp / old_maxhp;
index bf703f8..1e06f66 100644 (file)
@@ -1942,7 +1942,7 @@ void spell_RF6_TPORT(MONSTER_IDX m_idx, int TARGET_TYPE)
 HIT_POINT spell_RF6_WORLD(MONSTER_IDX m_idx)
 {
        monster_type    *m_ptr = &m_list[m_idx];
-       int who = 0;
+       MONSTER_IDX who = 0;
        char m_name[80];
        monster_name(m_idx, m_name);
 
index 36680f9..e8dc024 100644 (file)
@@ -704,7 +704,7 @@ static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
  * XXX XXX XXX Perhaps we should affect doors?
  * </pre>
  */
-static bool project_f(int who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
+static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
 {
        cave_type *c_ptr = &cave[y][x];
        feature_type *f_ptr = &f_info[c_ptr->feat];
@@ -5161,7 +5161,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
  * We return "TRUE" if any "obvious" effects were observed.  XXX XXX Actually,
  * we just assume that the effects were obvious, for historical reasons.
  */
-static bool project_p(int who, cptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
+static bool project_p(MONSTER_IDX who, cptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
 {
        int k = 0;
        int rlev = 0;
index 72f0ddc..1890e69 100644 (file)
@@ -593,7 +593,7 @@ typedef struct monster_type monster_type;
 struct monster_type
 {
        MONRACE_IDX r_idx;              /* Monster race index */
-       IDX ap_r_idx;           /* Monster race appearance index */
+       MONRACE_IDX ap_r_idx;   /* Monster race appearance index */
        byte sub_align;         /* Sub-alignment for a neutral monster */
 
        POSITION fy;            /* Y location on map */
@@ -602,7 +602,7 @@ struct monster_type
        HIT_POINT hp;           /* Current Hit points */
        HIT_POINT maxhp;                /* Max Hit points */
        HIT_POINT max_maxhp;            /* Max Max Hit points */
-       u32b dealt_damage;              /* Sum of damages dealt by player */
+       HIT_POINT dealt_damage;         /* Sum of damages dealt by player */
 
        TIME_EFFECT mtimed[MAX_MTIMED]; /* Timed status counter */
 
index 25f07e6..1db3c79 100644 (file)
@@ -203,8 +203,8 @@ static void do_cmd_summon_horde(void)
  */
 static void prt_binary(u32b flags, int row, int col)
 {
-       int             i;
-       u32b        bitmask;
+       int i;
+       u32b bitmask;
 
        /* Scan the flags */
        for (i = bitmask = 1; i <= 32; i++, bitmask *= 2)
index 818ce74..f2af3b4 100644 (file)
@@ -1522,7 +1522,7 @@ static void get_exp_from_mon(HIT_POINT dam, monster_type *m_ptr)
        }
        
        /* Special penalty for rest_and_shoot exp scum */
-       if ((m_ptr->dealt_damage > (u32b)m_ptr->max_maxhp) && (m_ptr->hp >= 0))
+       if ((m_ptr->dealt_damage > m_ptr->max_maxhp) && (m_ptr->hp >= 0))
        {
                int over_damage = m_ptr->dealt_damage / m_ptr->max_maxhp;
                if (over_damage > 32) over_damage = 32;
@@ -1613,7 +1613,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note)
        m_ptr->hp -= dam;
        
        m_ptr->dealt_damage += dam;
-       if(m_ptr->dealt_damage > (u32b)m_ptr->max_maxhp * 100) m_ptr->dealt_damage = m_ptr->max_maxhp * 100;
+       if(m_ptr->dealt_damage > m_ptr->max_maxhp * 100) m_ptr->dealt_damage = m_ptr->max_maxhp * 100;
        if (p_ptr->wizard)
        {
                msg_format( _("合計%d/%dのダメージを与えた。","You do %d (out of %d) damage."),