OSDN Git Service

ガラスのドアを破壊する際のHP判定が抜けていたので追加. 地形破壊の際の
[hengband/hengband.git] / src / xtra2.c
index a20caf5..696f156 100644 (file)
@@ -823,8 +823,7 @@ msg_print("
 
        /* Drop a dead corpse? */
        if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) &&
-           ((r_ptr->flags9 & RF9_DROP_CORPSE) ||
-            (r_ptr->flags9 & RF9_DROP_SKELETON)) &&
+           (r_ptr->flags9 & (RF9_DROP_CORPSE | RF9_DROP_SKELETON)) &&
            !(p_ptr->inside_arena || p_ptr->inside_battle || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
        {
                /* Assume skeleton */
@@ -836,7 +835,7 @@ msg_print("
                 */
                if (!(r_ptr->flags9 & RF9_DROP_SKELETON))
                        corpse = TRUE;
-               else if ((r_ptr->flags9 & RF9_DROP_CORPSE) && (r_ptr->flags1 && RF1_UNIQUE))
+               else if ((r_ptr->flags9 & RF9_DROP_CORPSE) && (r_ptr->flags1 & RF1_UNIQUE))
                        corpse = TRUE;
 
                /* Else, a corpse is more likely unless we did a "lot" of damage */
@@ -999,6 +998,7 @@ msg_print("
                if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
                {
                        int a_idx = 0;
+                       artifact_type *a_ptr = NULL;
 
                        if (!drop_chosen_item) break;
 
@@ -1016,15 +1016,20 @@ msg_print("
                                        a_idx = ART_NAMAKE_ARMOR;
                                        break;
                                }
+
+                               a_ptr = &a_info[a_idx];
                        }
-                       while (a_info[a_idx].cur_num);
+                       while (a_ptr->cur_num);
 
-                       if (a_info[a_idx].cur_num == 0)
+                       /* Create the artifact */
+                       if (create_named_art(a_idx, y, x))
                        {
-                               /* Create the artifact */
-                               create_named_art(a_idx, y, x);
-                               a_info[a_idx].cur_num = 1;
+                               a_ptr->cur_num = 1;
+
+                               /* Hack -- Memorize location of artifact in saved floors */
+                               if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
                        }
+                       else if (!preserve_mode) a_ptr->cur_num = 1;
                }
                break;
 
@@ -1079,7 +1084,7 @@ msg_print("
        case MON_A_GOLD:
        case MON_A_SILVER:
                if (drop_chosen_item && ((m_ptr->r_idx == MON_A_GOLD) ||
-                    ((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_pkills % 5 == 0))))
+                    ((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_akills % 5 == 0))))
                {
                        /* Get local object */
                        q_ptr = &forge;
@@ -1178,7 +1183,7 @@ msg_print("
                                /* Activate restriction */
                                get_obj_num_hook = kind_is_hafted;
 
-                               /* Make a poleweapon */
+                               /* Make a hafted weapon */
                                make_object(q_ptr, mo_mode);
 
                                /* Drop it in the dungeon */
@@ -1387,11 +1392,19 @@ msg_print("
 
                if ((a_idx > 0) && ((randint0(100) < chance) || p_ptr->wizard))
                {
-                       if (a_info[a_idx].cur_num == 0)
+                       artifact_type *a_ptr = &a_info[a_idx];
+
+                       if (!a_ptr->cur_num)
                        {
                                /* Create the artifact */
-                               create_named_art(a_idx, y, x);
-                               a_info[a_idx].cur_num = 1;
+                               if (create_named_art(a_idx, y, x))
+                               {
+                                       a_ptr->cur_num = 1;
+
+                                       /* Hack -- Memorize location of artifact in saved floors */
+                                       if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+                               }
+                               else if (!preserve_mode) a_ptr->cur_num = 1;
                        }
                }
 
@@ -1403,11 +1416,19 @@ msg_print("
                        if (d_info[dungeon_type].final_artifact)
                        {
                                int a_idx = d_info[dungeon_type].final_artifact;
-                               if (!a_info[a_idx].cur_num)
+                               artifact_type *a_ptr = &a_info[a_idx];
+
+                               if (!a_ptr->cur_num)
                                {
                                        /* Create the artifact */
-                                       create_named_art(a_idx, y, x);
-                                       a_info[a_idx].cur_num = 1;
+                                       if (create_named_art(a_idx, y, x))
+                                       {
+                                               a_ptr->cur_num = 1;
+
+                                               /* Hack -- Memorize location of artifact in saved floors */
+                                               if (character_dungeon) a_ptr->floor_id = p_ptr->floor_id;
+                                       }
+                                       else if (!preserve_mode) a_ptr->cur_num = 1;
 
                                        /* Prevent rewarding both artifact and "default" object */
                                        if (!d_info[dungeon_type].final_object) k_idx = 0;
@@ -1642,7 +1663,7 @@ static void get_exp_from_mon(int dam, monster_type *m_ptr)
        /* Special penalty for mutiply-monster */
        if ((r_ptr->flags2 & RF2_MULTIPLY) || (m_ptr->r_idx == MON_DAWN))
        {
-               int monnum_penarty = r_ptr->r_pkills / 400;
+               int monnum_penarty = r_ptr->r_akills / 400;
                if (monnum_penarty > 8) monnum_penarty = 8;
 
                while (monnum_penarty--)
@@ -1758,15 +1779,18 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note)
                                {
                                        r_info[MON_BANORLUPART].max_num = 0;
                                        r_info[MON_BANORLUPART].r_pkills++;
+                                       r_info[MON_BANORLUPART].r_akills++;
                                        if (r_info[MON_BANORLUPART].r_tkills < MAX_SHORT) r_info[MON_BANORLUPART].r_tkills++;
                                }
                                else if (m_ptr->r_idx == MON_BANORLUPART)
                                {
                                        r_info[MON_BANOR].max_num = 0;
                                        r_info[MON_BANOR].r_pkills++;
+                                       r_info[MON_BANOR].r_akills++;
                                        if (r_info[MON_BANOR].r_tkills < MAX_SHORT) r_info[MON_BANOR].r_tkills++;
                                        r_info[MON_LUPART].max_num = 0;
                                        r_info[MON_LUPART].r_pkills++;
+                                       r_info[MON_LUPART].r_akills++;
                                        if (r_info[MON_LUPART].r_tkills < MAX_SHORT) r_info[MON_LUPART].r_tkills++;
                                }
                        }
@@ -1775,6 +1799,9 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note)
                        else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num--;
                }
 
+               /* Count all monsters killed */
+               if (r_ptr->r_akills < MAX_SHORT) r_ptr->r_akills++;
+
                /* Recall even invisible uniques or winners */
                if (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE))
                {
@@ -1910,7 +1937,7 @@ msg_format("%^s
                                chg_virtue(V_HONOUR, 1);
                        }
                }
-               if ((r_ptr->flags2 & RF2_MULTIPLY) && (r_ptr->r_pkills > 1000) && one_in_(10))
+               if ((r_ptr->flags2 & RF2_MULTIPLY) && (r_ptr->r_akills > 1000) && one_in_(10))
                {
                        chg_virtue(V_VALOUR, -1);
                }
@@ -1996,7 +2023,7 @@ msg_format("%s
 #ifdef JP
                                msg_format("%s¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£", m_name);
 #else
-+                              msg_format("%^s explodes into tiny shreds.", m_name);
+                               msg_format("%^s explodes into tiny shreds.", m_name);
 #endif
                        else
                        {