OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / xtra2.c
index 9193f69..0dad02e 100644 (file)
@@ -102,7 +102,6 @@ void check_experience(void)
 
                sound(SOUND_LEVEL);
 
-               /* Message */
                msg_format(_("レベル %d にようこそ。", "Welcome to level %d."), p_ptr->lev);
 
                /* Update some stuff */
@@ -394,7 +393,7 @@ static bool kind_is_hafted(KIND_OBJECT_IDX k_idx)
  * @param quest_num 達成状態にしたいクエストのID
  * @return なし
  */
-void complete_quest(int quest_num)
+void complete_quest(QUEST_IDX quest_num)
 {
        quest_type* const q_ptr = &quest[quest_num];
 
@@ -455,8 +454,7 @@ static MONSTER_NUMBER count_all_hostile_monsters(void)
 void check_quest_completion(monster_type *m_ptr)
 {
        POSITION y, x;
-
-       int quest_num;
+       QUEST_IDX quest_num;
 
        bool create_stairs = FALSE;
        bool reward = FALSE;
@@ -469,12 +467,12 @@ void check_quest_completion(monster_type *m_ptr)
        x = m_ptr->fx;
 
        /* Inside a quest */
-       quest_num = p_ptr->inside_quest;                
+       quest_num = p_ptr->inside_quest;
 
        /* Search for an active quest on this dungeon level */
        if (!quest_num)
        {
-               int i;
+               QUEST_IDX i;
 
                for (i = max_q_idx - 1; i > 0; i--)
                {
@@ -673,13 +671,13 @@ void check_quest_completion(monster_type *m_ptr)
  */
 void check_find_art_quest_completion(object_type *o_ptr)
 {
-       int i;
+       QUEST_IDX i;
        /* Check if completed a quest */
        for (i = 0; i < max_q_idx; i++)
        {
-               if ((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
-                   (quest[i].status == QUEST_STATUS_TAKEN) &&
-                          (quest[i].k_idx == o_ptr->name1))
+               if((quest[i].type == QUEST_TYPE_FIND_ARTIFACT) &&
+                       (quest[i].status == QUEST_STATUS_TAKEN) &&
+                       (quest[i].k_idx == o_ptr->name1))
                {
                        complete_quest(i);
                }
@@ -788,7 +786,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                if (r_ptr->blow[i].method == RBM_EXPLODE)
                {
                        BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-                       int typ = mbe_info[r_ptr->blow[i].effect].explode_type;
+                       EFFECT_ID typ = mbe_info[r_ptr->blow[i].effect].explode_type;
                        DICE_NUMBER d_dice = r_ptr->blow[i].d_dice;
                        DICE_SID d_side = r_ptr->blow[i].d_side;
                        HIT_POINT damage = damroll(d_dice, d_side);
@@ -1273,7 +1271,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
 
                if ((r_ptr->flags7 & RF7_GUARDIAN) && (d_info[dungeon_type].final_guardian == m_ptr->r_idx))
                {
-                       IDX k_idx = d_info[dungeon_type].final_object ? d_info[dungeon_type].final_object
+                       KIND_OBJECT_IDX k_idx = d_info[dungeon_type].final_object ? d_info[dungeon_type].final_object
                                : lookup_kind(TV_SCROLL, SV_SCROLL_ACQUIREMENT);
 
                        if (d_info[dungeon_type].final_artifact)
@@ -1522,7 +1520,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 +1611,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."),
@@ -2025,7 +2023,7 @@ msg_format("%sを葬り去った。", m_name);
  * @param hgt_p コンソールの表示行数を返す
  * @return なし
  */
-void get_screen_size(int *wid_p, int *hgt_p)
+void get_screen_size(TERM_LEN *wid_p, TERM_LEN *hgt_p)
 {
        Term_get_size(wid_p, hgt_p);
        *hgt_p -= ROW_MAP + 2;
@@ -2137,10 +2135,10 @@ void redraw_window(void)
  * Also used in do_cmd_locate
  * @return 実際に再描画が必要だった場合TRUEを返す
  */
-bool change_panel(int dy, int dx)
+bool change_panel(POSITION dy, POSITION dx)
 {
-       int y, x;
-       int wid, hgt;
+       POSITION y, x;
+       TERM_LEN wid, hgt;
 
        /* Get size */
        get_screen_size(&wid, &hgt);
@@ -2197,7 +2195,7 @@ bool change_panel(int dy, int dx)
 static bool change_panel_xy(POSITION y, POSITION x)
 {
        POSITION dy = 0, dx = 0;
-       TERM_POSITION wid, hgt;
+       TERM_LEN wid, hgt;
 
        /* Get size */
        get_screen_size(&wid, &hgt);
@@ -2761,7 +2759,7 @@ static POSITION_IDX target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION
 /*
  * Hack -- determine if a given location is "interesting"
  */
-static bool target_set_accept(int y, int x)
+static bool target_set_accept(POSITION y, POSITION x)
 {
        cave_type *c_ptr;
        OBJECT_IDX this_o_idx, next_o_idx = 0;
@@ -2987,10 +2985,10 @@ bool show_gold_on_floor = FALSE;
 static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info)
 {
        cave_type *c_ptr = &cave[y][x];
-       s16b this_o_idx, next_o_idx = 0;
+       OBJECT_IDX this_o_idx, next_o_idx = 0;
        cptr s1 = "", s2 = "", s3 = "", x_info = "";
        bool boring = TRUE;
-       s16b feat;
+       FEAT_IDX feat;
        feature_type *f_ptr;
        char query = '\001';
        char out_val[MAX_NLEN+80];
@@ -3226,7 +3224,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info)
                                /* Describe the object */
                                object_desc(o_name, o_ptr, 0);
 
-                               /* Message */
 #ifdef JP
                                sprintf(out_val, "%s%s%s%s[%s]",
                                        s1, o_name, s2, s3, info);
@@ -3274,7 +3271,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info)
                        while (1)
                        {
                                int i;
-                               IDX o_idx;
+                               OBJECT_IDX o_idx;
 
                                /* Save screen */
                                screen_save();
@@ -3774,8 +3771,8 @@ bool target_set(BIT_FLAGS mode)
                        if (d)
                        {
                                /* Modified to scroll to monster */
-                               int y2 = panel_row_min;
-                               int x2 = panel_col_min;
+                               POSITION y2 = panel_row_min;
+                               POSITION x2 = panel_col_min;
 
                                /* Find a new monster */
                                i = target_pick(temp_y[m], temp_x[m], ddy[d], ddx[d]);
@@ -5700,9 +5697,9 @@ void display_rumor(bool ex)
                                        r_ptr->r_sights++;
                                }
                        }
-                       else if  (strcmp(zz[0], "DUNGEON") == 0)
+                       else if (strcmp(zz[0], "DUNGEON") == 0)
                        {
-                               int d_idx;
+                               DUNGEON_IDX d_idx;
                                dungeon_info_type *d_ptr;
 
                                while (1)