OSDN Git Service

move_player_effect()の処理をbitフラグで制御するように変更. また, プレ
[hengbandforosx/hengbandosx.git] / src / object1.c
index 2aebce0..dd7b325 100644 (file)
@@ -33,7 +33,7 @@
  */
 void reset_visuals(void)
 {
-       int i;
+       int i, j;
 
        /* Extract some info about terrain features */
        for (i = 0; i < max_f_idx; i++)
@@ -41,8 +41,11 @@ void reset_visuals(void)
                feature_type *f_ptr = &f_info[i];
 
                /* Assume we will use the underlying values */
-               f_ptr->x_attr = f_ptr->d_attr;
-               f_ptr->x_char = f_ptr->d_char;
+               for (j = 0; j < F_LIT_MAX; j++)
+               {
+                       f_ptr->x_attr[j] = f_ptr->d_attr[j];
+                       f_ptr->x_char[j] = f_ptr->d_char[j];
+               }
        }
 
        /* Extract default attr/char code for objects */
@@ -328,40 +331,6 @@ void object_flags_known(object_type *o_ptr, u32b flgs[TR_FLAG_SIZE])
 
 
 /*
- * Hack -- describe an item currently in a store's inventory
- * This allows an item to *look* like the player is "aware" of it
- */
-void object_desc_store(char *buf, object_type *o_ptr, int pref, int mode)
-{
-       /* Save the "aware" flag */
-       bool hack_aware = object_aware_p(o_ptr);
-
-       /* Save the "known" flag */
-       bool hack_known = (o_ptr->ident & (IDENT_KNOWN)) ? TRUE : FALSE;
-
-
-       /* Set the "known" flag */
-       o_ptr->ident |= (IDENT_KNOWN);
-
-       /* Force "aware" for description */
-       k_info[o_ptr->k_idx].aware = TRUE;
-
-
-       /* Describe the object */
-       object_desc(buf, o_ptr, pref, mode);
-
-
-       /* Restore "aware" flag */
-       k_info[o_ptr->k_idx].aware = hack_aware;
-
-       /* Clear the known flag */
-       if (!hack_known) o_ptr->ident &= ~(IDENT_KNOWN);
-}
-
-
-
-
-/*
  * Determine the "Activation" (if any) for an artifact
  * Return a string, or NULL for "no activation"
  */
@@ -2388,6 +2357,8 @@ bool screen_object(object_type *o_ptr, bool real)
        char o_name[MAX_NLEN];
        int wid, hgt;
 
+       int trivial_info = 0;
+
        /* Extract the flags */
        object_flags(o_ptr, flgs);
 
@@ -2402,6 +2373,12 @@ bool screen_object(object_type *o_ptr, bool real)
                { info[i] = &temp[j]; i++;}
        }
 
+       if (TV_EQUIP_BEGIN <= o_ptr->tval && o_ptr->tval <= TV_EQUIP_END)
+       {
+               /* Descriptions of a basic equipment is just a flavor */
+               trivial_info = i;
+       }
+
        /* Mega-Hack -- describe activation */
        if (have_flag(flgs, TR_ACTIVATE))
        {
@@ -2657,12 +2634,15 @@ info[i++] = "
                        info[i++] = "It is made for use while riding.";
 #endif
                else
+               {
 #ifdef JP
-info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
+                       info[i++] = "¤½¤ì¤Ï¾èÇÏÃæ¤Ç¤â»È¤¤¤ä¤¹¤¤¡£";
 #else
                        info[i++] = "It is suitable for use while riding.";
 #endif
-
+                       /* This information is not important enough */
+                       trivial_info++;
+               }
        }
        if (have_flag(flgs, TR_STR))
        {
@@ -3614,6 +3594,11 @@ info[i++] = "
                        info[i++] = "It is cursed.";
 #endif
 
+                       /*
+                        * It's a trivial infomation since there is
+                        * fake inscription {cursed}
+                        */
+                       trivial_info++;
                }
        }
 
@@ -3870,8 +3855,8 @@ info[i++] = "
                }
        }
 
-       /* No special effects */
-       if (!i) return (FALSE);
+       /* No relevant informations */
+       if (i <= trivial_info) return (FALSE);
 
        /* Save the screen */
        screen_save();
@@ -3881,9 +3866,9 @@ info[i++] = "
 
        /* Display Item name */
        if (real)
-               object_desc(o_name, o_ptr, TRUE, 3);
+               object_desc(o_name, o_ptr, 0);
        else
-               object_desc_store(o_name, o_ptr, TRUE, 0);
+               object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
 
        prt(o_name, 0, 0);
 
@@ -4463,7 +4448,7 @@ void display_inven(void)
                Term_putstr(0, i, 3, TERM_WHITE, tmp_val);
 
                /* Obtain an item description */
-               object_desc(o_name, o_ptr, TRUE, 3);
+               object_desc(o_name, o_ptr, 0);
 
                /* Obtain the length of the description */
                n = strlen(o_name);
@@ -4556,7 +4541,7 @@ void display_equip(void)
                }
                else
                {
-                       object_desc(o_name, o_ptr, TRUE, 3);
+                       object_desc(o_name, o_ptr, 0);
                        attr = tval_to_attr[o_ptr->tval % 128];
                }
 
@@ -4927,7 +4912,7 @@ int show_inven(int target_item)
                if (!item_tester_okay(o_ptr)) continue;
 
                /* Describe the object */
-               object_desc(o_name, o_ptr, TRUE, 3);
+               object_desc(o_name, o_ptr, 0);
 
                /* Save the object index, color, and description */
                out_index[k] = i;
@@ -5086,7 +5071,7 @@ int show_equip(int target_item)
                if (!item_tester_okay(o_ptr) && (!((i == INVEN_LARM) && p_ptr->ryoute) || item_tester_no_ryoute)) continue;
 
                /* Description */
-               object_desc(o_name, o_ptr, TRUE, 3);
+               object_desc(o_name, o_ptr, 0);
 
                if ((i == INVEN_LARM) && p_ptr->ryoute)
                {
@@ -5321,7 +5306,7 @@ static bool verify(cptr prompt, int item)
        }
 
        /* Describe */
-       object_desc(o_name, o_ptr, TRUE, 3);
+       object_desc(o_name, o_ptr, 0);
 
        /* Prompt */
 #ifdef JP
@@ -6416,7 +6401,7 @@ int show_floor(int target_item, int y, int x, int *min_width)
                o_ptr = &o_list[floor_list[i]];
 
                /* Describe the object */
-               object_desc(o_name, o_ptr, TRUE, 3);
+               object_desc(o_name, o_ptr, 0);
 
                /* Save the index */
                out_index[k] = i;
@@ -7798,7 +7783,7 @@ static bool py_pickup_floor_aux(void)
  *
  * This is called by py_pickup() when easy_floor is TRUE.
  */
-void py_pickup_floor(int pickup)
+void py_pickup_floor(bool pickup)
 {
        s16b this_o_idx, next_o_idx = 0;
 
@@ -7818,7 +7803,7 @@ void py_pickup_floor(int pickup)
                o_ptr = &o_list[this_o_idx];
 
                /* Describe the object */
-               object_desc(o_name, o_ptr, TRUE, 3);
+               object_desc(o_name, o_ptr, 0);
 
                /* Access the next object */
                next_o_idx = o_ptr->next_o_idx;
@@ -7904,7 +7889,7 @@ void py_pickup_floor(int pickup)
 #endif /* ALLOW_EASY_SENSE */
 
                        /* Describe the object */
-                       object_desc(o_name, o_ptr, TRUE, 3);
+                       object_desc(o_name, o_ptr, 0);
 
                        /* Message */
 #ifdef JP
@@ -7952,7 +7937,7 @@ void py_pickup_floor(int pickup)
 #endif /* ALLOW_EASY_SENSE */
 
                        /* Describe the object */
-                       object_desc(o_name, o_ptr, TRUE, 3);
+                       object_desc(o_name, o_ptr, 0);
 
                        /* Message */
 #ifdef JP
@@ -8002,7 +7987,7 @@ void py_pickup_floor(int pickup)
 #endif /* ALLOW_EASY_SENSE */
 
                        /* Describe the object */
-                       object_desc(o_name, o_ptr, TRUE, 3);
+                       object_desc(o_name, o_ptr, 0);
 
                        /* Build a prompt */
 #ifdef JP