OSDN Git Service

射撃武器の熟練度の記号定数化を間違えており, 熟練度が[初心者]から上が
[hengband/hengband.git] / src / cmd2.c
index 0e89baa..0a40e15 100644 (file)
@@ -3250,7 +3250,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
                            (r_ptr->flags3 & RF3_ANIMAL))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ANIMAL;
                                }
@@ -3262,7 +3262,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_ANIMAL)) &&
                            (r_ptr->flags3 & RF3_ANIMAL))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ANIMAL;
                                }
@@ -3274,7 +3274,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_EVIL)) &&
                            (r_ptr->flags3 & RF3_EVIL))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_EVIL;
                                }
@@ -3286,7 +3286,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_EVIL)) &&
                            (r_ptr->flags3 & RF3_EVIL))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_EVIL;
                                }
@@ -3298,7 +3298,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_HUMAN)) &&
                            (r_ptr->flags2 & RF2_HUMAN))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags2 |= RF2_HUMAN;
                                }
@@ -3310,7 +3310,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_HUMAN)) &&
                            (r_ptr->flags2 & RF2_HUMAN))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags2 |= RF2_HUMAN;
                                }
@@ -3322,7 +3322,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_UNDEAD)) &&
                            (r_ptr->flags3 & RF3_UNDEAD))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_UNDEAD;
                                }
@@ -3334,7 +3334,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_UNDEAD)) &&
                            (r_ptr->flags3 & RF3_UNDEAD))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_UNDEAD;
                                }
@@ -3346,7 +3346,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_DEMON)) &&
                            (r_ptr->flags3 & RF3_DEMON))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DEMON;
                                }
@@ -3358,7 +3358,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_DEMON)) &&
                            (r_ptr->flags3 & RF3_DEMON))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DEMON;
                                }
@@ -3370,7 +3370,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_ORC)) &&
                            (r_ptr->flags3 & RF3_ORC))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ORC;
                                }
@@ -3382,7 +3382,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_ORC)) &&
                            (r_ptr->flags3 & RF3_ORC))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_ORC;
                                }
@@ -3394,7 +3394,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_TROLL)) &&
                            (r_ptr->flags3 & RF3_TROLL))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_TROLL;
                                }
@@ -3406,7 +3406,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_TROLL)) &&
                            (r_ptr->flags3 & RF3_TROLL))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_TROLL;
                                }
@@ -3418,7 +3418,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_GIANT)) &&
                            (r_ptr->flags3 & RF3_GIANT))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_GIANT;
                                }
@@ -3430,7 +3430,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_GIANT)) &&
                            (r_ptr->flags3 & RF3_GIANT))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_GIANT;
                                }
@@ -3442,7 +3442,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_SLAY_DRAGON)) &&
                            (r_ptr->flags3 & RF3_DRAGON))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DRAGON;
                                }
@@ -3454,7 +3454,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        if ((have_flag(flgs, TR_KILL_DRAGON)) &&
                            (r_ptr->flags3 & RF3_DRAGON))
                        {
-                               if (m_ptr->ml)
+                               if (m_ptr->ml && is_original_ap(m_ptr))
                                {
                                        r_ptr->r_flags3 |= RF3_DRAGON;
                                }
@@ -3468,14 +3468,14 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        }
 
                        /* Brand (Acid) */
-                       if ((have_flag(flgs, TR_BRAND_ACID)) || (p_ptr->special_attack & (ATTACK_ACID)))
+                       if (have_flag(flgs, TR_BRAND_ACID))
                        {
                                /* Notice immunity */
-                               if (r_ptr->flags3 & RF3_EFF_IM_ACID_MASK)
+                               if (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK)
                                {
-                                       if (m_ptr->ml)
+                                       if (m_ptr->ml && is_original_ap(m_ptr))
                                        {
-                                               r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_ACID_MASK);
+                                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK);
                                        }
                                }
 
@@ -3487,14 +3487,14 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        }
 
                        /* Brand (Elec) */
-                       if ((have_flag(flgs, TR_BRAND_ELEC)) || (p_ptr->special_attack & (ATTACK_ELEC)))
+                       if (have_flag(flgs, TR_BRAND_ELEC))
                        {
                                /* Notice immunity */
-                               if (r_ptr->flags3 & RF3_EFF_IM_ELEC_MASK)
+                               if (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK)
                                {
-                                       if (m_ptr->ml)
+                                       if (m_ptr->ml && is_original_ap(m_ptr))
                                        {
-                                               r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_ELEC_MASK);
+                                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK);
                                        }
                                }
 
@@ -3506,51 +3506,67 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
                        }
 
                        /* Brand (Fire) */
-                       if ((have_flag(flgs, TR_BRAND_FIRE)) || (p_ptr->special_attack & (ATTACK_FIRE)))
+                       if (have_flag(flgs, TR_BRAND_FIRE))
                        {
                                /* Notice immunity */
-                               if (r_ptr->flags3 & RF3_EFF_IM_FIRE_MASK)
+                               if (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK)
                                {
-                                       if (m_ptr->ml)
+                                       if (m_ptr->ml && is_original_ap(m_ptr))
                                        {
-                                               r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_FIRE_MASK);
+                                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK);
                                        }
                                }
 
                                /* Otherwise, take the damage */
                                else
                                {
-                                       if (mult < 17) mult = 17;
+                                       if (r_ptr->flags3 & RF3_HURT_FIRE)
+                                       {
+                                               if (mult < 25) mult = 25;
+                                               if (m_ptr->ml && is_original_ap(m_ptr))
+                                               {
+                                                       r_ptr->r_flags3 |= RF3_HURT_FIRE;
+                                               }
+                                       }
+                                       else if (mult < 17) mult = 17;
                                }
                        }
 
                        /* Brand (Cold) */
-                       if ((have_flag(flgs, TR_BRAND_COLD)) || (p_ptr->special_attack & (ATTACK_COLD)))
+                       if (have_flag(flgs, TR_BRAND_COLD))
                        {
                                /* Notice immunity */
-                               if (r_ptr->flags3 & RF3_EFF_IM_COLD_MASK)
+                               if (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK)
                                {
-                                       if (m_ptr->ml)
+                                       if (m_ptr->ml && is_original_ap(m_ptr))
                                        {
-                                               r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_COLD_MASK);
+                                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_COLD_MASK);
                                        }
                                }
                                /* Otherwise, take the damage */
                                else
                                {
-                                       if (mult < 17) mult = 17;
+                                       if (r_ptr->flags3 & RF3_HURT_COLD)
+                                       {
+                                               if (mult < 25) mult = 25;
+                                               if (m_ptr->ml && is_original_ap(m_ptr))
+                                               {
+                                                       r_ptr->r_flags3 |= RF3_HURT_COLD;
+                                               }
+                                       }
+                                       else if (mult < 17) mult = 17;
                                }
                        }
 
                        /* Brand (Poison) */
-                       if ((have_flag(flgs, TR_BRAND_POIS)) || (p_ptr->special_attack & (ATTACK_POIS)))
+                       if (have_flag(flgs, TR_BRAND_POIS))
                        {
                                /* Notice immunity */
-                               if (r_ptr->flags3 & RF3_EFF_IM_POIS_MASK)
+                               if (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK)
                                {
-                                       if (m_ptr->ml)
+                                       if (m_ptr->ml && is_original_ap(m_ptr))
                                        {
-                                               r_ptr->r_flags3 |= (r_ptr->flags3 & RF3_EFF_IM_POIS_MASK);
+                                               r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK);
                                        }
                                }
 
@@ -3810,9 +3826,9 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                                if (now_exp < s_info[p_ptr->pclass].w_max[0][j_ptr->sval])
                                {
                                        int amount = 0;
-                                       if (now_exp < SPELL_EXP_BEGINNER) amount = 80;
-                                       else if (now_exp < SPELL_EXP_SKILLED) amount = 25;
-                                       else if ((now_exp < SPELL_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 10;
+                                       if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
+                                       else if (now_exp < WEAPON_EXP_SKILLED) amount = 25;
+                                       else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 10;
                                        else if (p_ptr->lev > 34) amount = 2;
                                        p_ptr->weapon_exp[0][j_ptr->sval] += amount;
                                        p_ptr->update |= (PU_BONUS);
@@ -3835,40 +3851,6 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                        {
                                bool fear = FALSE;
 
-                               /* Assume a default death */
-#ifdef JP
-                               cptr note_dies = "¤Ï»à¤ó¤À¡£";
-#else
-                               cptr note_dies = " dies.";
-#endif
-
-                               /* Some monsters get "destroyed" */
-                               if (!monster_living(r_ptr))
-                               {
-                                       int i;
-                                       bool explode = FALSE;
-
-                                       for (i = 0; i < 4; i++)
-                                       {
-                                               if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE;
-                                       }
-
-                                       /* Special note at death */
-                                       if (explode)
-#ifdef JP
-note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
-#else
-                                               note_dies = " explodes into tiny shreds.";
-#endif
-                                       else
-#ifdef JP
-                                               note_dies = "¤òÅݤ·¤¿¡£";
-#else
-                                               note_dies = " is destroyed.";
-#endif
-
-                               }
-
                                /* Handle unseen monster */
                                if (!visible)
                                {
@@ -3928,7 +3910,7 @@ note_dies = "
                                }
 
                                /* Hit the monster, check for death */
-                               if (mon_take_hit(c_ptr->m_idx, tdam, &fear, note_dies))
+                               if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr))))
                                {
                                        /* Dead monster */
                                }
@@ -4413,42 +4395,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                        {
                                bool fear = FALSE;
 
-                               /* Assume a default death */
-#ifdef JP
-                               cptr note_dies = "¤Ï»à¤ó¤À¡£";
-#else
-                               cptr note_dies = " dies.";
-#endif
-
-
-                               /* Some monsters get "destroyed" */
-                               if (!monster_living(r_ptr))
-                               {
-                                       int i;
-                                       bool explode = FALSE;
-
-                                       for (i = 0; i < 4; i++)
-                                       {
-                                               if (r_ptr->blow[i].method == RBM_EXPLODE) explode = TRUE;
-                                       }
-
-                                       /* Special note at death */
-                                       if (explode)
-#ifdef JP
-note_dies = "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
-#else
-                                               note_dies = " explodes into tiny shreds.";
-#endif
-                                       else
-#ifdef JP
-                                               note_dies = "¤òÅݤ·¤¿¡£";
-#else
-                                               note_dies = " is destroyed.";
-#endif
-
-                               }
-
-
                                /* Handle unseen monster */
                                if (!visible)
                                {
@@ -4487,7 +4433,7 @@ note_dies = "
                                /* Hack -- Base damage from thrown object */
                                tdam = damroll(q_ptr->dd, q_ptr->ds);
                                /* Apply special damage XXX XXX XXX */
-                               tdam = tot_dam_aux(q_ptr, tdam, m_ptr, 0);
+                               tdam = tot_dam_aux(q_ptr, tdam, m_ptr, 0, TRUE);
                                tdam = critical_shot(q_ptr->weight, q_ptr->to_h, tdam);
                                if (q_ptr->to_d > 0)
                                        tdam += q_ptr->to_d;
@@ -4533,7 +4479,7 @@ note_dies = "
                                }
 
                                /* Hit the monster, check for death */
-                               if (mon_take_hit(c_ptr->m_idx, tdam, &fear, note_dies))
+                               if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr))))
                                {
                                        /* Dead monster */
                                }