OSDN Git Service

branch-nothere-terrainflags、゙。シ・ク.
[hengband/hengband.git] / src / xtra2.c
index af94651..a7c2c5a 100644 (file)
@@ -28,19 +28,20 @@ void check_experience(void)
 
        /* Hack -- lower limit */
        if (p_ptr->exp < 0) p_ptr->exp = 0;
-
-       /* Hack -- lower limit */
        if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
+       if (p_ptr->max_max_exp < 0) p_ptr->max_max_exp = 0;
 
        /* Hack -- upper limit */
        if (p_ptr->exp > PY_MAX_EXP) p_ptr->exp = PY_MAX_EXP;
-
-       /* Hack -- upper limit */
        if (p_ptr->max_exp > PY_MAX_EXP) p_ptr->max_exp = PY_MAX_EXP;
+       if (p_ptr->max_max_exp > PY_MAX_EXP) p_ptr->max_max_exp = PY_MAX_EXP;
 
        /* Hack -- maintain "max" experience */
        if (p_ptr->exp > p_ptr->max_exp) p_ptr->max_exp = p_ptr->exp;
 
+       /* Hack -- maintain "max max" experience */
+       if (p_ptr->max_exp > p_ptr->max_max_exp) p_ptr->max_max_exp = p_ptr->max_exp;
+
        /* Redraw experience */
        p_ptr->redraw |= (PR_EXP);
 
@@ -103,16 +104,17 @@ void check_experience(void)
 msg_format("¥ì¥Ù¥ë %d ¤Ë¤è¤¦¤³¤½¡£", p_ptr->lev);
 #else
                msg_format("Welcome to level %d.", p_ptr->lev);
+
 #endif
 
                /* Update some stuff */
                p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
 
                /* Redraw some stuff */
-               p_ptr->redraw |= (PR_LEV | PR_TITLE);
+               p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP);
 
                /* Window stuff */
-               p_ptr->window |= (PW_PLAYER | PW_SPELL);
+               p_ptr->window |= (PW_PLAYER | PW_SPELL | PW_INVEN);
 
                /* HP¤ÈMP¤Î¾å¾ºÎ̤òɽ¼¨ */
                level_up = 1;
@@ -230,24 +232,19 @@ msg_print("
  */
 static int get_coin_type(int r_idx)
 {
-       monster_race    *r_ptr = &r_info[r_idx];
-
-       /* Analyze "coin" monsters */
-       if (r_ptr->d_char == '$')
+       /* Analyze monsters */
+       switch (r_idx)
        {
-               /* Look for textual clues */
-               switch (r_idx)
-               {
-               case MON_COPPER_COINS: return (2);
-               case MON_SILVER_COINS: return (5);
-               case MON_GOLD_COINS: return (10);
-               case MON_MITHRIL_COINS: return (16);
-               case MON_ADAMANT_COINS: return (17);
-               }
+       case MON_COPPER_COINS: return 2;
+       case MON_SILVER_COINS: return 5;
+       case MON_GOLD_COINS: return 10;
+       case MON_MITHRIL_COINS:
+       case MON_MITHRIL_GOLEM: return 16;
+       case MON_ADAMANT_COINS: return 17;
        }
 
        /* Assume nothing */
-       return (0);
+       return 0;
 }
 
 
@@ -360,6 +357,24 @@ static bool kind_is_armor(int k_idx)
 
 
 /*
+ * Hack -- determine if a template is hafted weapon
+ */
+static bool kind_is_hafted(int k_idx)
+{
+       object_kind *k_ptr = &k_info[k_idx];
+
+       /* Analyze the item type */
+       if (k_ptr->tval == TV_HAFTED)
+       {
+               return (TRUE);
+       }
+
+       /* Assume not good */
+       return (FALSE);
+}
+
+
+/*
  * Check for "Quest" completion when a quest monster is killed or charmed.
  */
 void check_quest_completion(monster_type *m_ptr)
@@ -686,7 +701,7 @@ void monster_death(int m_idx, bool drop_item)
 
        bool do_gold = (!(r_ptr->flags1 & RF1_ONLY_ITEM));
        bool do_item = (!(r_ptr->flags1 & RF1_ONLY_GOLD));
-       bool cloned = FALSE;
+       bool cloned = (m_ptr->smart & SM_CLONED) ? TRUE : FALSE;
        int force_coin = get_coin_type(m_ptr->r_idx);
 
        object_type forge;
@@ -695,8 +710,8 @@ void monster_death(int m_idx, bool drop_item)
        bool drop_chosen_item = drop_item && !cloned && !p_ptr->inside_arena
                && !p_ptr->inside_battle && !is_pet(m_ptr);
 
-
-       if (world_monster) world_monster = FALSE;
+       /* The caster is dead? */
+       if (world_monster && world_monster == m_idx) world_monster = 0;
 
        /* Notice changes in view */
        if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
@@ -709,9 +724,6 @@ void monster_death(int m_idx, bool drop_item)
        y = m_ptr->fy;
        x = m_ptr->fx;
 
-       if (m_ptr->smart & SM_CLONED)
-               cloned = TRUE;
-
        if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
        {
                char m_name[80];
@@ -810,7 +822,7 @@ msg_print("
        if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) &&
            ((r_ptr->flags9 & RF9_DROP_CORPSE) ||
             (r_ptr->flags9 & RF9_DROP_SKELETON)) &&
-           !(p_ptr->inside_arena || p_ptr->inside_battle || (m_ptr->smart & SM_CLONED) || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
+           !(p_ptr->inside_arena || p_ptr->inside_battle || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
        {
                /* Assume skeleton */
                bool corpse = FALSE;
@@ -922,9 +934,6 @@ msg_print("
                        else
                                get_obj_num_hook = kind_is_book;
 
-                       /* Prepare allocation table */
-                       get_obj_num_prep();
-
                        /* Make a book */
                        make_object(q_ptr, mo_mode);
 
@@ -942,13 +951,13 @@ msg_print("
                {
                        if (!one_in_(7))
                        {
-                               int wy = py, wx = px;
+                               int wy = y, wx = x;
                                int attempts = 100;
                                bool pet = is_pet(m_ptr);
 
                                do
                                {
-                                       scatter(&wy, &wx, py, px, 20, 0);
+                                       scatter(&wy, &wx, y, x, 20, 0);
                                }
                                while (!(in_bounds(wy, wx) && cave_empty_bold2(wy, wx)) && --attempts);
 
@@ -1067,7 +1076,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 + 1) % 5))))
+                    ((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_pkills % 5 == 0))))
                {
                        /* Get local object */
                        q_ptr = &forge;
@@ -1106,9 +1115,6 @@ msg_print("
                                /* Activate restriction */
                                get_obj_num_hook = kind_is_cloak;
 
-                               /* Prepare allocation table */
-                               get_obj_num_prep();
-
                                /* Make a cloak */
                                make_object(q_ptr, mo_mode);
 
@@ -1129,9 +1135,6 @@ msg_print("
                                /* Activate restriction */
                                get_obj_num_hook = kind_is_polearm;
 
-                               /* Prepare allocation table */
-                               get_obj_num_prep();
-
                                /* Make a poleweapon */
                                make_object(q_ptr, mo_mode);
 
@@ -1152,9 +1155,6 @@ msg_print("
                                /* Activate restriction */
                                get_obj_num_hook = kind_is_armor;
 
-                               /* Prepare allocation table */
-                               get_obj_num_prep();
-
                                /* Make a hard armor */
                                make_object(q_ptr, mo_mode);
 
@@ -1163,6 +1163,26 @@ msg_print("
                        }
                        break;
 
+               case '\\':
+                       if (dun_level > 4)
+                       {
+                               /* Get local object */
+                               q_ptr = &forge;
+
+                               /* Wipe the object */
+                               object_wipe(q_ptr);
+
+                               /* Activate restriction */
+                               get_obj_num_hook = kind_is_hafted;
+
+                               /* Make a poleweapon */
+                               make_object(q_ptr, mo_mode);
+
+                               /* Drop it in the dungeon */
+                               (void)drop_near(q_ptr, -1, y, x);
+                       }
+                       break;
+
                case '|':
                        if (m_ptr->r_idx != MON_STORMBRINGER)
                        {
@@ -1175,9 +1195,6 @@ msg_print("
                                /* Activate restriction */
                                get_obj_num_hook = kind_is_sword;
 
-                               /* Prepare allocation table */
-                               get_obj_num_prep();
-
                                /* Make a sword */
                                make_object(q_ptr, mo_mode);
 
@@ -1773,12 +1790,34 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note)
                        if (r_ptr->r_sights < MAX_SHORT) r_ptr->r_sights++;
                }
 
-               /* When the player kills a Unique, it stays dead */
-               if (r_ptr->flags1 & RF1_UNIQUE && !(m_ptr->smart & SM_CLONED))
-                       r_ptr->max_num = 0;
+               if (!(m_ptr->smart & SM_CLONED))
+               {
+                       /* When the player kills a Unique, it stays dead */
+                       if (r_ptr->flags1 & RF1_UNIQUE)
+                       {
+                               r_ptr->max_num = 0;
+
+                               /* Mega-Hack -- Banor & Lupart */
+                               if ((m_ptr->r_idx == MON_BANOR) || (m_ptr->r_idx == MON_LUPART))
+                               {
+                                       r_info[MON_BANORLUPART].max_num = 0;
+                                       r_info[MON_BANORLUPART].r_pkills++;
+                                       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++;
+                                       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++;
+                                       if (r_info[MON_LUPART].r_tkills < MAX_SHORT) r_info[MON_LUPART].r_tkills++;
+                               }
+                       }
 
-               /* When the player kills a Nazgul, it stays dead */
-               if (r_ptr->flags7 & RF7_UNIQUE_7) r_ptr->max_num--;
+                       /* When the player kills a Nazgul, it stays dead */
+                       else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num--;
+               }
 
                /* Recall even invisible uniques or winners */
                if (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE))
@@ -1861,19 +1900,18 @@ msg_format("%^s
                                chg_virtue(V_VALOUR, 2);
                }
 
-               if ((r_ptr->flags1 & RF1_UNIQUE) && ((r_ptr->flags3 & RF3_EVIL) ||
-                       (r_ptr->flags3 & RF3_GOOD)))
-                       
-                       chg_virtue(V_HARMONY, 2);
-
-               if ((r_ptr->flags1 & RF1_UNIQUE) && (r_ptr->flags3 & RF3_GOOD))
+               if (r_ptr->flags1 & RF1_UNIQUE)
                {
-                       chg_virtue(V_UNLIFE, 2);
-                       chg_virtue(V_VITALITY, -2);
-               }
+                       if (r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) chg_virtue(V_HARMONY, 2);
 
-               if ((r_ptr->flags1 & RF1_UNIQUE) && one_in_(3))
-                       chg_virtue(V_INDIVIDUALISM, -1);
+                       if (r_ptr->flags3 & RF3_GOOD)
+                       {
+                               chg_virtue(V_UNLIFE, 2);
+                               chg_virtue(V_VITALITY, -2);
+                       }
+
+                       if (one_in_(3)) chg_virtue(V_INDIVIDUALISM, -1);
+               }
 
                if (m_ptr->r_idx == MON_BEGGAR || m_ptr->r_idx == MON_LEPER)
                {
@@ -1882,7 +1920,6 @@ msg_format("%^s
 
                if ((r_ptr->flags3 & RF3_GOOD) &&
                        ((r_ptr->level) / 10 + (3 * dun_level) >= randint1(100)))
-                       
                        chg_virtue(V_UNLIFE, 1);
 
                if (r_ptr->d_char == 'A')
@@ -1921,14 +1958,14 @@ msg_format("%^s
                {
                        chg_virtue(V_VALOUR, -1);
                }
-               
+
                for (i = 0; i < 4; i++)
                {
-                       if(r_ptr->blow[i].d_dice != 0) innocent = FALSE; /* Murderer! */
-               
+                       if (r_ptr->blow[i].d_dice != 0) innocent = FALSE; /* Murderer! */
+
                        if ((r_ptr->blow[i].effect == RBE_EAT_ITEM)
                                || (r_ptr->blow[i].effect == RBE_EAT_GOLD))
-                       
+
                                thief = TRUE; /* Thief! */
                }
 
@@ -1941,7 +1978,6 @@ msg_format("%^s
                                chg_virtue(V_JUSTICE, 3);
                        else if (1+((r_ptr->level) / 10 + (2 * dun_level))
                                >= randint1(100))
-                               
                                chg_virtue(V_JUSTICE, 1);
                }
                else if (innocent)
@@ -1956,13 +1992,13 @@ msg_format("%^s
 
                if ((r_ptr->flags1 & RF1_UNIQUE) && record_destroy_uniq)
                {
-                       char m_name[160];
+                       char note_buf[160];
 #ifdef JP
-                       sprintf(m_name, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(¥¯¥í¡¼¥ó)" : "");
+                       sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(¥¯¥í¡¼¥ó)" : "");
 #else
-                       sprintf(m_name, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(Clone)" : "");
+                       sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(Clone)" : "");
 #endif
-                       do_cmd_write_nikki(NIKKI_UNIQUE, 0, m_name);
+                       do_cmd_write_nikki(NIKKI_UNIQUE, 0, note_buf);
                }
 
                /* Make a sound */
@@ -2032,7 +2068,7 @@ msg_format("%s
 #endif
 
                }
-               if (r_ptr->flags1 & RF1_UNIQUE && !(m_ptr->smart & SM_CLONED))
+               if ((r_ptr->flags1 & RF1_UNIQUE) && !(m_ptr->smart & SM_CLONED) && !vanilla_town)
                {
                        for (i = 0; i < MAX_KUBI; i++)
                        {
@@ -2050,22 +2086,6 @@ msg_format("%s
 
                /* Generate treasure */
                monster_death(m_idx, TRUE);
-               if ((m_ptr->r_idx == MON_BANOR) || (m_ptr->r_idx == MON_LUPART))
-               {
-                       r_info[MON_BANORLUPART].max_num = 0;
-                       r_info[MON_BANORLUPART].r_pkills++;
-                       if (r_info[MON_BANORLUPART].r_tkills < MAX_SHORT) r_info[MON_BANORLUPART].r_tkills++;
-               }
-
-               if (m_ptr->r_idx == MON_BANORLUPART)
-               {
-                       r_info[MON_BANOR].max_num = 0;
-                       r_info[MON_BANOR].r_pkills++;
-                       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++;
-                       if (r_info[MON_LUPART].r_tkills < MAX_SHORT) r_info[MON_LUPART].r_tkills++;
-               }
 
                /* Mega hack : replace IKETA to BIKETAL */
                if ((m_ptr->r_idx == MON_IKETA) &&
@@ -2899,64 +2919,11 @@ static bool target_set_accept(int y, int x)
        /* Interesting memorized features */
        if (c_ptr->info & (CAVE_MARK))
        {
-               byte feat;
-
-               /* Feature code (applying "mimic" field) */
-               feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
-
-               /* Notice glyphs */
+               /* Notice object features */
                if (c_ptr->info & CAVE_OBJECT) return (TRUE);
 
-               /* Notice the Pattern */
-               if ((feat <= FEAT_PATTERN_XTRA2) &&
-                   (feat >= FEAT_PATTERN_START))
-                       return (TRUE);
-
-               /* Notice doors */
-               if (feat == FEAT_OPEN) return (TRUE);
-               if (feat == FEAT_BROKEN) return (TRUE);
-
-               /* Notice stairs */
-               if (feat == FEAT_LESS) return (TRUE);
-               if (feat == FEAT_MORE) return (TRUE);
-               if (feat == FEAT_LESS_LESS) return (TRUE);
-               if (feat == FEAT_MORE_MORE) return (TRUE);
-
-               /* Notice shops */
-               if ((feat >= FEAT_SHOP_HEAD) &&
-                   (feat <= FEAT_SHOP_TAIL)) return (TRUE);
-
-               if (feat == FEAT_MUSEUM) return (TRUE);
-
-               /* Notice buildings -KMW- */
-               if ((feat >= FEAT_BLDG_HEAD) &&
-                   (feat <= FEAT_BLDG_TAIL)) return (TRUE);
-
-               /* Notice traps */
-               if (is_trap(feat)) return (TRUE);
-
-               /* Notice doors */
-               if ((feat >= FEAT_DOOR_HEAD) &&
-                   (feat <= FEAT_DOOR_TAIL)) return (TRUE);
-
-#if 0
-               /* Notice rubble */
-               /* I think FEAT_RUBBLEs should not be "interesting" */
-               if (feat == FEAT_RUBBLE) return (TRUE);
-
-               /* Notice veins with treasure */
-               /* Now veins with treasure are too many */
-               if (feat == FEAT_MAGMA_K) return (TRUE);
-               if (feat == FEAT_QUARTZ_K) return (TRUE);
-#endif
-
-               /* Notice quest features */
-               if (feat == FEAT_QUEST_ENTER) return (TRUE);
-               if (feat == FEAT_QUEST_EXIT) return (TRUE);
-               if (feat == FEAT_QUEST_DOWN) return (TRUE);
-               if (feat == FEAT_QUEST_UP) return (TRUE);
-               if (feat == FEAT_TOWN) return (TRUE);
-               if (feat == FEAT_ENTRANCE) return (TRUE);
+               /* Feature code (applying "mimic" field) */
+               if (have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_NOTICE)) return TRUE;
        }
 
        /* Nope */
@@ -2983,9 +2950,6 @@ static void target_set_prepare(int mode)
                {
                        cave_type *c_ptr;
 
-                       /* Require line of sight, unless "look" is "expanded" */
-                       if (!expand_look && !player_has_los_bold(y, x)) continue;
-
                        /* Require "interesting" contents */
                        if (!target_set_accept(y, x)) continue;
 
@@ -3112,7 +3076,8 @@ static int target_set_aux(int y, int x, int mode, cptr info)
        s16b this_o_idx, next_o_idx = 0;
        cptr s1 = "", s2 = "", s3 = "", x_info = "";
        bool boring = TRUE;
-       byte feat;
+       s16b feat;
+       feature_type *f_ptr;
        int query = '\001';
        char out_val[MAX_NLEN+80];
 
@@ -3326,7 +3291,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                        next_o_idx = o_ptr->next_o_idx;
 
                        /* Obtain an object description */
-                       object_desc(o_name, o_ptr, TRUE, 3);
+                       object_desc(o_name, o_ptr, 0);
 
                        /* Describe the object */
 #ifdef JP
@@ -3380,7 +3345,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                                o_ptr = &o_list[floor_list[0]];
 
                                /* Describe the object */
-                               object_desc(o_name, o_ptr, TRUE, 3);
+                               object_desc(o_name, o_ptr, 0);
 
                                /* Message */
 #ifdef JP
@@ -3506,7 +3471,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                        boring = FALSE;
 
                        /* Obtain an object description */
-                       object_desc(o_name, o_ptr, TRUE, 3);
+                       object_desc(o_name, o_ptr, 0);
 
                        /* Describe the object */
 #ifdef JP
@@ -3554,7 +3519,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
 
 
        /* Feature code (applying "mimic" field) */
-       feat = f_info[c_ptr->mimic ? c_ptr->mimic : c_ptr->feat].mimic;
+       feat = get_feat_mimic(c_ptr);
 
        /* Require knowledge about grid, or ability to see grid */
        if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x))
@@ -3563,17 +3528,19 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                feat = FEAT_NONE;
        }
 
+       f_ptr = &f_info[feat];
+
        /* Terrain feature if needed */
        if (boring || (feat > FEAT_INVIS))
        {
                cptr name;
 
                /* Hack -- special handling for building doors */
-               if ((feat >= FEAT_BLDG_HEAD) && (feat <= FEAT_BLDG_TAIL))
+               if (have_flag(f_ptr->flags, FF_BLDG))
                {
-                       name = building[feat - FEAT_BLDG_HEAD].name;
+                       name = building[f_ptr->power].name;
                }
-               else if (feat == FEAT_ENTRANCE)
+               else if (have_flag(f_ptr->flags, FF_ENTRANCE))
                {
 #ifdef JP
                        name = format("%s(%d³¬ÁêÅö)", d_text + d_info[c_ptr->special].text, d_info[c_ptr->special].mindepth);
@@ -3581,7 +3548,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                        name = format("%s(level %d)", d_text + d_info[c_ptr->special].text, d_info[c_ptr->special].mindepth);
 #endif
                }
-               else if (feat == FEAT_TOWN)
+               else if (have_flag(f_ptr->flags, FF_TOWN))
                {
                        name = town[c_ptr->special].name;
                }
@@ -3595,80 +3562,59 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                }
                else
                {
-                       name = f_name + f_info[feat].name;
+                       name = f_name + f_ptr->name;
                }
 
 
                /* Pick a prefix */
-               if (*s2 && ((feat >= FEAT_MINOR_GLYPH) &&
-                           (feat <= FEAT_PATTERN_XTRA2)))
-               {
-#ifdef JP
-                       s2 = "¤Î¾å";
-#else
-                       s2 = "on ";
-#endif
-
-               }
-               else if (*s2 && ((feat >= FEAT_DOOR_HEAD) &&
-                                (feat <= FEAT_PERM_SOLID)))
-               {
-#ifdef JP
-                       s2 = "¤ÎÃæ";
-#else
-                       s2 = "in ";
-#endif
-
-               }
-               else if (*s2 && (feat == FEAT_TOWN))
+               if (*s2 &&
+                   (!have_flag(f_ptr->flags, FF_MOVE) ||
+                   (!have_flag(f_ptr->flags, FF_LOS) &&
+                    !have_flag(f_ptr->flags, FF_TREE)) ||
+                    have_flag(f_ptr->flags, FF_TOWN)))
                {
 #ifdef JP
                        s2 = "¤ÎÃæ";
 #else
                        s2 = "in ";
 #endif
-
                }
 
                /* Hack -- special introduction for store & building doors -KMW- */
-               if (((feat >= FEAT_SHOP_HEAD) && (feat <= FEAT_SHOP_TAIL)) ||
-                   ((feat >= FEAT_BLDG_HEAD) && (feat <= FEAT_BLDG_TAIL)) ||
-                   (feat == FEAT_MUSEUM) ||
-                   (feat == FEAT_ENTRANCE))
+               if (have_flag(f_ptr->flags, FF_STORE) ||
+                   have_flag(f_ptr->flags, FF_BLDG) ||
+                   have_flag(f_ptr->flags, FF_ENTRANCE))
                {
 #ifdef JP
                        s2 = "¤ÎÆþ¸ý";
 #else
                        s3 = "";
 #endif
-
                }
-               else if ((feat == FEAT_TOWN) || (feat == FEAT_FLOOR) || (feat == FEAT_DIRT) || (feat == FEAT_FLOWER))
-               {
 #ifndef JP
+               else if (have_flag(f_ptr->flags, FF_FLOOR) || have_flag(f_ptr->flags, FF_TOWN))
+               {
                        s3 ="";
-#endif
                }
                else
                {
                        /* Pick proper indefinite article */
-#ifndef JP
                        s3 = (is_a_vowel(name[0])) ? "an " : "a ";
-#endif
                }
+#endif
 
                /* Display a message */
                if (p_ptr->wizard)
 #ifdef JP
                        sprintf(out_val, "%s%s%s%s[%s] %x %d %d %d %d (%d,%d)", s1, name, s2, s3, info, c_ptr->info, c_ptr->feat, c_ptr->dist, c_ptr->cost, c_ptr->when, x, y);
 #else
-               sprintf(out_val, "%s%s%s%s [%s] %x %d %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, c_ptr->feat, c_ptr->dist, c_ptr->cost, c_ptr->when, x, y);
+                       sprintf(out_val, "%s%s%s%s [%s] %x %d %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, c_ptr->feat, c_ptr->dist, c_ptr->cost, c_ptr->when, x, y);
 #endif
                else
 #ifdef JP
                        sprintf(out_val, "%s%s%s%s[%s]", s1, name, s2, s3, info);
 #else
-               sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, name, info);
+                       sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, name, info);
 #endif
 
                prt(out_val, 0, 0);
@@ -4619,12 +4565,6 @@ msg_print("
 }
 
 
-int get_chaos_patron(void)
-{
-       return ((p_ptr->age + p_ptr->sc) % MAX_PATRON);
-}
-
-
 void gain_level_reward(int chosen_reward)
 {
        object_type *q_ptr;
@@ -5274,7 +5214,7 @@ msg_print("
                        msg_print("'Thou reliest too much on thy weapon.'");
 #endif
 
-                       object_desc(o_name, &inventory[INVEN_RARM], TRUE, 0);
+                       object_desc(o_name, &inventory[INVEN_RARM], OD_NAME_ONLY);
                        (void)curse_weapon(FALSE, INVEN_RARM);
 #ifdef JP
                        reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);
@@ -5298,7 +5238,7 @@ msg_print("
                        msg_print("'Thou reliest too much on thine equipment.'");
 #endif
 
-                       object_desc(o_name, &inventory[INVEN_BODY], TRUE, 0);
+                       object_desc(o_name, &inventory[INVEN_BODY], OD_NAME_ONLY);
                        (void)curse_armor();
 #ifdef JP
                        reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);
@@ -5343,7 +5283,7 @@ msg_print("
                                        if (one_in_(2))
                                        {
                                                if (!buki_motteruka(INVEN_RARM)) break;
-                                               object_desc(o_name, &inventory[INVEN_RARM], TRUE, 0);
+                                               object_desc(o_name, &inventory[INVEN_RARM], OD_NAME_ONLY);
                                                (void)curse_weapon(FALSE, INVEN_RARM);
 #ifdef JP
                                                reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);
@@ -5354,7 +5294,7 @@ msg_print("
                                        else
                                        {
                                                if (!inventory[INVEN_BODY].k_idx) break;
-                                               object_desc(o_name, &inventory[INVEN_BODY], TRUE, 0);
+                                               object_desc(o_name, &inventory[INVEN_BODY], OD_NAME_ONLY);
                                                (void)curse_armor();
 #ifdef JP
                                                reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);