OSDN Git Service

Add new option -- show_ammo_detail / show_ammo_no_crit
[hengband/hengband.git] / src / melee2.c
index 6dfbc19..a49737d 100644 (file)
@@ -212,7 +212,7 @@ void mon_take_hit_mon(int m_idx, int dam, bool *fear, cptr note, int who)
        /* Wake it up */
        (void)set_monster_csleep(m_idx, 0);
 
-       if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 0);
+       if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
 
        if (MON_INVULNER(m_ptr) && randint0(PENETRATE_INVULNERABILITY))
        {
@@ -1434,7 +1434,7 @@ static bool monst_attack_monst(int m_idx, int t_idx)
        int             ap_cnt;
        int             ac, rlev, pt;
        char            m_name[80], t_name[80];
-       char            temp[80];
+       char            temp[MAX_NLEN];
        bool            blinked;
        bool            explode = FALSE, touched = FALSE, fear = FALSE;
        int             y_saver = t_ptr->fy;
@@ -1477,7 +1477,7 @@ static bool monst_attack_monst(int m_idx, int t_idx)
                mon_fight = TRUE;
        }
 
-       if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 0);
+       if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
 
        /* Scan through all four blows */
        for (ap_cnt = 0; ap_cnt < 4; ap_cnt++)
@@ -1706,7 +1706,7 @@ act = "%s
 
                        case RBM_EXPLODE:
                                {
-                                       if (see_either) disturb(1, 0);
+                                       if (see_either) disturb(1, 1);
 #ifdef JP
 act = "Çúȯ¤·¤¿¡£";
 #else
@@ -1942,6 +1942,14 @@ act = "%s
                                effect_type = BLOW_EFFECT_TYPE_HEAL;
                                break;
 
+                       case RBE_INERTIA:
+                               pt = GF_INERTIA;
+                               break;
+
+                       case RBE_STUN:
+                               pt = GF_SOUND;
+                               break;
+
                        default:
                                pt = 0;
                                break;
@@ -2149,20 +2157,38 @@ act = "%s
        /* Blink away */
        if (blinked && m_ptr->r_idx)
        {
-               if (see_m)
+               if (teleport_barrier(m_idx))
                {
+                       if (see_m)
+                       {
 #ifdef JP
-                       msg_print("Å¥ËÀ¤Ï¾Ð¤Ã¤Æƨ¤²¤¿¡ª");
+                               msg_print("Å¥ËÀ¤Ï¾Ð¤Ã¤Æƨ¤²...¤è¤¦¤È¤·¤¿¤¬¥Ð¥ê¥¢¤ËËɤ¬¤ì¤¿¡£");
 #else
-                       msg_print("The thief flees laughing!");
+                               msg_print("The thief flees laughing...? But magic barrier obstructs it.");
 #endif
+                       }
+                       else if (known)
+                       {
+                               mon_fight = TRUE;
+                       }
                }
-               else if (known)
+               else
                {
-                       mon_fight = TRUE;
-               }
+                       if (see_m)
+                       {
+#ifdef JP
+                               msg_print("Å¥ËÀ¤Ï¾Ð¤Ã¤Æƨ¤²¤¿¡ª");
+#else
+                               msg_print("The thief flees laughing!");
+#endif
+                       }
+                       else if (known)
+                       {
+                               mon_fight = TRUE;
+                       }
 
-               teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
+                       teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
+               }
        }
 
        return TRUE;
@@ -2376,7 +2402,7 @@ static void process_monster(int m_idx)
                                msg_format("%^s seems to be in so much pain, and trying to escape from your restriction.", m_name);
 #endif
                                riding_pinch++;
-                               disturb(1, 0);
+                               disturb(1, 1);
                        }
                        else
                        {
@@ -2540,6 +2566,9 @@ static void process_monster(int m_idx)
                        }
                }
 
+               /* Hex */
+               if (multiply_barrier(m_idx)) k = 8;
+
                /* Hack -- multiply slower in crowded areas */
                if ((k < 4) && (!k || !randint0(k * MON_MULT_ADJ)))
                {
@@ -3326,7 +3355,7 @@ msg_format("%^s%s", m_name, monmessage);
                        {
                                /* Disturb */
                                if (is_hostile(m_ptr))
-                                       disturb(0, 0);
+                                       disturb(0, 1);
                        }
 
                        /* Take or Kill objects on the floor */
@@ -4550,11 +4579,22 @@ bool process_the_world(int num, int who, bool vs_player)
 
 void monster_gain_exp(int m_idx, int s_idx)
 {
-       monster_type *m_ptr = &m_list[m_idx];
-       monster_race *r_ptr = &r_info[m_ptr->r_idx];
-       monster_race *s_ptr = &r_info[s_idx];
+       monster_type *m_ptr;
+       monster_race *r_ptr;
+       monster_race *s_ptr;
        int new_exp;
 
+       /* Paranoia */
+       if (m_idx <= 0 || s_idx <= 0) return;
+
+       m_ptr = &m_list[m_idx];
+
+       /* Paranoia -- Skip dead monsters */
+       if (!m_ptr->r_idx) return;
+
+       r_ptr = &r_info[m_ptr->r_idx];
+       s_ptr = &r_info[s_idx];
+
        if (p_ptr->inside_battle) return;
 
        if (!r_ptr->next_exp) return;
@@ -4601,6 +4641,9 @@ void monster_gain_exp(int m_idx, int s_idx)
                }
                m_ptr->maxhp = m_ptr->max_maxhp;
                m_ptr->hp = old_hp * m_ptr->maxhp / old_maxhp;
+               
+               /* dealt damage is 0 at initial*/
+               m_ptr->dealt_damage = 0;
 
                /* Extract the monster base speed */
                m_ptr->mspeed = get_mspeed(r_ptr);