OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / melee1.c
index 40abe19..d911517 100644 (file)
@@ -25,7 +25,7 @@
  * @return 命中と判定された場合TRUEを返す
  * @note Always miss 5%, always hit 5%, otherwise random.
  */
-bool test_hit_norm(int chance, int ac, int vis)
+bool test_hit_norm(int chance, ARMOUR_CLASS ac, int vis)
 {
        int k;
 
@@ -62,7 +62,7 @@ bool test_hit_norm(int chance, int ac, int vis)
 * @param mode オプションフラグ
 * @return クリティカル修正が入ったダメージ値
 */
-HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode)
+HIT_POINT critical_norm(WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode)
 {
        int i, k;
 
@@ -116,7 +116,7 @@ HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, BIT_F
  * and which also do at least 20 damage, or, sometimes, N damage.
  * This is used only to determine "cuts" and "stuns".
  */
-static int monster_critical(int dice, int sides, HIT_POINT dam)
+static int monster_critical(DICE_NUMBER dice, DICE_SID sides, HIT_POINT dam)
 {
        int max = 0;
        int total = dice * sides;
@@ -156,7 +156,7 @@ static int monster_critical(int dice, int sides, HIT_POINT dam)
  * Always miss 5% of the time, Always hit 5% of the time.
  * Otherwise, match monster power against player armor.
  */
-static int check_hit(int power, int level, int stun)
+static int check_hit(int power, DEPTH level, int stun)
 {
        int i, k, ac;
 
@@ -416,7 +416,6 @@ static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
        {
                sound(SOUND_MISS);
 
-               /* Message */
                msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
        }
 }
@@ -463,7 +462,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
        bool            can_drain = FALSE;
        int             num_blow;
        int             drain_left = MAX_VAMPIRIC_DRAIN;
-       u32b flgs[TR_FLAG_SIZE]; /* A massive hack -- life-draining weapons */
+       BIT_FLAGS flgs[TR_FLAG_SIZE]; /* A massive hack -- life-draining weapons */
        bool            is_human = (r_ptr->d_char == 'p');
        bool            is_lowlevel = (r_ptr->level < (p_ptr->lev - 15));
        bool            zantetsu_mukou, e_j_mukou;
@@ -603,7 +602,6 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
 
                        sound(SOUND_HIT);
 
-                       /* Message */
                        if (backstab) msg_format(_("あなたは冷酷にも眠っている無力な%sを突き刺した!", "You cruelly stab the helpless, sleeping %s!"), m_name);
                        else if (fuiuchi) msg_format(_("不意を突いて%sに強烈な一撃を喰らわせた!", "You make surprise attack, and hit %s with a powerful blow!"), m_name);
                        else if (stab_fleeing) msg_format(_("逃げる%sを背中から突き刺した!", "You backstab the fleeing %s!"), m_name);
@@ -667,7 +665,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
                                int min_level = 1;
                                const martial_arts *ma_ptr = &ma_blows[0], *old_ptr = &ma_blows[0];
                                int resist_stun = 0;
-                               int weight = 8;
+                               WEIGHT weight = 8;
 
                                if (r_ptr->flags1 & RF1_UNIQUE) resist_stun += 88;
                                if (r_ptr->flags3 & RF3_NO_STUN) resist_stun += 66;
@@ -1198,9 +1196,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
 
                                sound(SOUND_HIT);
 
-                               /* Message */
                                msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
-                               /* Message */
                                msg_print(_("振り回した大鎌が自分自身に返ってきた!", "Your scythe returns to you!"));
 
                                /* Extract the flags */
@@ -1294,7 +1290,6 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
                        {
                                sound(SOUND_MISS);
 
-                               /* Message */
                                msg_format(_("ミス! %sにかわされた。", "You miss %s."), m_name);
                        }
                }
@@ -1343,8 +1338,7 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
        monster_race    *r_ptr = &r_info[m_ptr->r_idx];
        char            m_name[80];
 
-       /* Disturb the player */
-       disturb(0, 1);
+       disturb(FALSE, TRUE);
 
        p_ptr->energy_use = 100;
 
@@ -1420,7 +1414,6 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
        /* Handle player fear */
        if (p_ptr->afraid)
        {
-               /* Message */
                if (m_ptr->ml)
                        msg_format(_("恐くて%sを攻撃できない!", "You are too afraid to attack %s!"), m_name);
                else
@@ -1429,7 +1422,6 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
                /* Disturb the monster */
                (void)set_monster_csleep(c_ptr->m_idx, 0);
 
-               /* Done */
                return FALSE;
        }
 
@@ -1509,7 +1501,6 @@ bool py_attack(POSITION y, POSITION x, BIT_FLAGS mode)
        {
                sound(SOUND_FLEE);
 
-               /* Message */
                msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
        }
 
@@ -1634,7 +1625,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                if (!effect || check_hit(power, rlev, MON_STUNNED(m_ptr)))
                {
                        /* Always disturbing */
-                       disturb(1, 1);
+                       disturb(TRUE, TRUE);
 
 
                        /* Hack -- Apply "protection from evil" */
@@ -1646,7 +1637,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                /* Remember the Evil-ness */
                                if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
 
-                               /* Message */
 #ifdef JP
                                if (abbreviate)
                                    msg_format("撃退した。");
@@ -1934,7 +1924,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                }
                        }
 
-                       /* Message */
                        if (act)
                        {
                                if (do_silly_attack)
@@ -2089,7 +2078,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                        /* Don't heal more than max hp */
                                                        heal = MIN(heal, m_ptr->maxhp - m_ptr->hp);
 
-                                                       /* Message */
                                                        msg_print(_("ザックからエネルギーが吸い取られた!", "Energy drains from your pack!"));
 
                                                        /* Obvious */
@@ -2108,10 +2096,8 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                        /* Combine / Reorder the pack */
                                                        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-                                                       /* Window stuff */
                                                        p_ptr->window |= (PW_INVEN);
 
-                                                       /* Done */
                                                        break;
                                                }
                                        }
@@ -2172,7 +2158,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                /* Redraw gold */
                                                p_ptr->redraw |= (PR_GOLD);
 
-                                               /* Window stuff */
                                                p_ptr->window |= (PW_PLAYER);
 
                                                /* Blink away */
@@ -2206,7 +2191,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                /* Obvious */
                                                obvious = TRUE;
 
-                                               /* Done */
                                                break;
                                        }
 
@@ -2230,7 +2214,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                /* Get a description */
                                                object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
 
-                                               /* Message */
 #ifdef JP
                                                msg_format("%s(%c)を%s盗まれた!",
                                                           o_name, index_to_label(i),
@@ -2294,7 +2277,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                /* Blink away */
                                                blinked = TRUE;
 
-                                               /* Done */
                                                break;
                                        }
 
@@ -2326,7 +2308,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                /* Get a description */
                                                object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
-                                               /* Message */
 #ifdef JP
                                                msg_format("%s(%c)を%s食べられてしまった!",
                                                          o_name, index_to_label(i),
@@ -2345,7 +2326,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                /* Obvious */
                                                obvious = TRUE;
 
-                                               /* Done */
                                                break;
                                        }
 
@@ -2369,14 +2349,12 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                                o_ptr->xtra4 -= (s16b)(250 + randint1(250));
                                                if (o_ptr->xtra4 < 1) o_ptr->xtra4 = 1;
 
-                                               /* Notice */
                                                if (!p_ptr->blind)
                                                {
                                                        msg_print(_("明かりが暗くなってしまった。", "Your light dims."));
                                                        obvious = TRUE;
                                                }
 
-                                               /* Window stuff */
                                                p_ptr->window |= (PW_EQUIP);
                                        }
 
@@ -2389,7 +2367,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                        /* Obvious */
                                        obvious = TRUE;
 
-                                       /* Message */
                                        msg_print(_("酸を浴びせられた!", "You are covered in acid!"));
 
                                        /* Special damage */
@@ -2410,7 +2387,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                        /* Obvious */
                                        obvious = TRUE;
 
-                                       /* Message */
                                        msg_print(_("電撃を浴びせられた!", "You are struck by electricity!"));
 
                                        /* Special damage */
@@ -2428,7 +2404,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                        /* Obvious */
                                        obvious = TRUE;
 
-                                       /* Message */
                                        msg_print(_("全身が炎に包まれた!", "You are enveloped in flames!"));
 
                                        /* Special damage */
@@ -2446,7 +2421,6 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                        /* Obvious */
                                        obvious = TRUE;
 
-                                       /* Message */
                                        msg_print(_("全身が冷気で覆われた!", "You are covered with frost!"));
 
                                        /* Special damage */
@@ -3356,9 +3330,8 @@ bool make_attack_normal(MONSTER_IDX m_idx)
                                if (m_ptr->ml)
                                {
                                        /* Disturbing */
-                                       disturb(1, 1);
+                                       disturb(TRUE, TRUE);
 
-                                       /* Message */
 #ifdef JP
                                        if (abbreviate)
                                            msg_format("%sかわした。", (p_ptr->special_attack & ATTACK_SUIKEN) ? "奇妙な動きで" : "");