OSDN Git Service

空腹充足の巻物の記述を削除.
[hengband/hengband.git] / src / xtra2.c
index 7986cbb..ca129b2 100644 (file)
@@ -604,7 +604,7 @@ msg_print("
 
 
                /* Create stairs down */
-               cave_set_feat(y, x, FEAT_MORE);
+               cave_set_feat(y, x, feat_down_stair);
 
                /* Remember to update everything */
                p_ptr->update |= (PU_FLOW);
@@ -698,7 +698,7 @@ void monster_death(int m_idx, bool drop_item)
 
        monster_race *r_ptr = &r_info[m_ptr->r_idx];
 
-       bool visible = (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE));
+       bool visible = ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE));
 
        u32b mo_mode = 0L;
 
@@ -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;
@@ -1628,9 +1649,9 @@ static void get_exp_from_mon(int dam, monster_type *m_ptr)
 
        /* Use (average maxhp * 2) as a denominator */
        if (!(r_ptr->flags1 & RF1_FORCE_MAXHP))
-               s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * (r_ptr->hside + 1));
+               s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * (ironman_nightmare ? 2 : 1) * (r_ptr->hside + 1));
        else
-               s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * r_ptr->hside * 2);
+               s64b_mul(&div_h, &div_l, 0, r_ptr->hdice * (ironman_nightmare ? 2 : 1) * r_ptr->hside * 2);
 
        /* Special penalty in the wilderness */
        if (!dun_level && (!(r_ptr->flags8 & RF8_WILD_ONLY) || !(r_ptr->flags1 & RF1_UNIQUE)))
@@ -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,8 +1799,11 @@ 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))
+               if ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE))
                {
                        /* Count kills this life */
                        if ((m_ptr->mflag2 & MFLAG2_KAGE) && (r_info[MON_KAGE].r_pkills < MAX_SHORT)) r_info[MON_KAGE].r_pkills++;
@@ -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);
                }
@@ -1994,9 +2021,9 @@ msg_format("%s
                        /* Special note at death */
                        if (explode)
 #ifdef JP
-msg_format("%s¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£", m_name);
+                               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
                        {
@@ -2738,7 +2765,6 @@ static bool ang_sort_comp_importance(vptr u, vptr v, int a, int b)
        monster_type *ma_ptr = &m_list[ca_ptr->m_idx];
        monster_type *mb_ptr = &m_list[cb_ptr->m_idx];
        monster_race *ap_ra_ptr, *ap_rb_ptr;
-       int la, lb;
 
        /* The player grid */
        if (y[a] == py && x[a] == px) return TRUE;
@@ -3055,6 +3081,8 @@ static void evaluate_monster_exp(char *buf, monster_type *m_ptr)
 }
 
 
+bool show_gold_on_floor = FALSE;
+
 /*
  * Examine a grid, return a keypress.
  *
@@ -3406,7 +3434,9 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                                screen_save();
 
                                /* Display */
+                               show_gold_on_floor = TRUE;
                                (void)show_floor(0, y, x, &min_width);
+                               show_gold_on_floor = FALSE;
 
                                /* Prompt */
 #ifdef JP
@@ -3531,7 +3561,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
        if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x))
        {
                /* Forget feature */
-               feat = FEAT_NONE;
+               feat = feat_none;
        }
 
        f_ptr = &f_info[feat];
@@ -3541,10 +3571,38 @@ static int target_set_aux(int y, int x, int mode, cptr info)
        {
                cptr name;
 
+               /* Hack -- special handling for quest entrances */
+               if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
+               {
+                       /* Set the quest number temporary */
+                       int old_quest = p_ptr->inside_quest;
+                       int j;
+
+                       /* Clear the text */
+                       for (j = 0; j < 10; j++) quest_text[j][0] = '\0';
+                       quest_text_line = 0;
+
+                       p_ptr->inside_quest = c_ptr->special;
+
+                       /* Get the quest text */
+                       init_flags = INIT_SHOW_TEXT;
+
+                       process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+
+#ifdef JP
+                       name = format("¥¯¥¨¥¹¥È¡Ö%s¡×(%d³¬ÁêÅö)", quest[c_ptr->special].name, quest[c_ptr->special].level);
+#else
+                       name = format("the entrance to the quest '%s'(level %d)", quest[c_ptr->special].name, quest[c_ptr->special].level);
+#endif
+
+                       /* Reset the old quest number */
+                       p_ptr->inside_quest = old_quest;
+               }
+
                /* Hack -- special handling for building doors */
-               if (have_flag(f_ptr->flags, FF_BLDG) && !p_ptr->inside_arena)
+               else if (have_flag(f_ptr->flags, FF_BLDG) && !p_ptr->inside_arena)
                {
-                       name = building[f_ptr->power].name;
+                       name = building[f_ptr->subtype].name;
                }
                else if (have_flag(f_ptr->flags, FF_ENTRANCE))
                {
@@ -3558,7 +3616,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                {
                        name = town[c_ptr->special].name;
                }
-               else if (p_ptr->wild_mode && (feat == FEAT_FLOOR))
+               else if (p_ptr->wild_mode && (feat == feat_floor))
                {
 #ifdef JP
                        name = "ƻ";
@@ -3587,6 +3645,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
 
                /* Hack -- special introduction for store & building doors -KMW- */
                if (have_flag(f_ptr->flags, FF_STORE) ||
+                   have_flag(f_ptr->flags, FF_QUEST_ENTER) ||
                    (have_flag(f_ptr->flags, FF_BLDG) && !p_ptr->inside_arena) ||
                    have_flag(f_ptr->flags, FF_ENTRANCE))
                {