OSDN Git Service

Add some Heavy Crossbow Artifacts.
[hengband/hengband.git] / src / object1.c
index 43440e1..ce3ab3b 100644 (file)
@@ -1182,6 +1182,7 @@ return "
                }
                case ART_AVAVIR:
                case ART_MAGATAMA:
+               case ART_HEAVENLY_MAIDEN:
                {
 #ifdef JP
 return "µ¢´Ô¤Î¾Û : 200 ¥¿¡¼¥óËè";
@@ -1236,6 +1237,7 @@ return "
 
                }
                case ART_BRAND:
+               case ART_HELLFIRE:
                {
 #ifdef JP
 return "¿ÏÀè¤Î¥Õ¥¡¥¤¥¢¡¦¥Ü¥ë¥È : 999 ¥¿¡¼¥óËè";
@@ -1852,6 +1854,14 @@ return "
 #endif
 
                }
+               case ART_AESCULAPIUS:
+               {
+#ifdef JP
+                       return "Á´¥¹¥Æ¡¼¥¿¥¹¤È·Ð¸³ÃÍÉü³è : 750 ¥¿¡¼¥óËè";
+#else
+                       return "restore stats and life levels every 750 turns";
+#endif
+               }
        }
 
 
@@ -2353,6 +2363,7 @@ bool screen_object(object_type *o_ptr, u32b mode)
 
        u32b flgs[TR_FLAG_SIZE];
 
+       char temp[70 * 20];
        cptr            info[128];
        char o_name[MAX_NLEN];
        int wid, hgt;
@@ -2364,8 +2375,6 @@ bool screen_object(object_type *o_ptr, u32b mode)
 
        /* Extract the description */
        {
-               char temp[70 * 20];
-
                roff_to_buf(o_ptr->name1 ? (a_text + a_info[o_ptr->name1].text) :
                            (k_text + k_info[o_ptr->k_idx].text),
                            77 - 15, temp, sizeof(temp));
@@ -2525,11 +2534,18 @@ info[i++] = "
                        info[i++] = "It provides no light.";
 #endif
 
-                       if (o_ptr->sval == SV_LITE_FEANOR ||
-                           o_ptr->sval == SV_LITE_LANTERN)
+                       if (o_ptr->sval == SV_LITE_FEANOR)
+                       {
+#ifdef JP
+                               info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-3)¡£";
+#else
+                               info[i++] = "It decreases radius of light source by 3.";
+#endif
+                       }
+                       else if (o_ptr->sval == SV_LITE_LANTERN)
                        {
 #ifdef JP
-                               info[i++] = "¤½¤ì¤ÏÌÀ¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
+                               info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-2)¡£";
 #else
                                info[i++] = "It decreases radius of light source by 2.";
 #endif
@@ -2537,7 +2553,7 @@ info[i++] = "
                        else
                        {
 #ifdef JP
-                               info[i++] = "¤½¤ì¤ÏÌÀ¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
+                               info[i++] = "¤½¤ì¤ÏÌÀ¤«¤ê¤ÎȾ·Â¤ò¶¹¤á¤ë(Ⱦ·Â¤Ë-1)¡£";
 #else
                                info[i++] = "It decreases radius of light source by 1.";
 #endif
@@ -4305,7 +4321,13 @@ bool item_tester_okay(object_type *o_ptr)
        if (!o_ptr->k_idx) return (FALSE);
 
        /* Hack -- ignore "gold" */
-       if (o_ptr->tval == TV_GOLD) return (FALSE);
+       if (o_ptr->tval == TV_GOLD)
+       {
+               /* See xtra2.c */
+               extern bool show_gold_on_floor;
+
+               if (!show_gold_on_floor) return (FALSE);
+       }
 
        /* Check the tval */
        if (item_tester_tval)
@@ -4402,7 +4424,7 @@ void display_inven(void)
                Term_erase(3+n, i, 255);
 
                /* Display the weight if needed */
-               if (show_weights && o_ptr->weight)
+               if (show_weights)
                {
                        int wgt = o_ptr->weight * o_ptr->number;
 #ifdef JP
@@ -4494,7 +4516,7 @@ void display_equip(void)
                Term_erase(3+n, i - INVEN_RARM, 255);
 
                /* Display the weight (if needed) */
-               if (show_weights && o_ptr->weight)
+               if (show_weights)
                {
                        int wgt = o_ptr->weight * o_ptr->number;
 #ifdef JP
@@ -5430,6 +5452,13 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
        int max_inven = 0;
        int max_equip = 0;
 
+#ifdef ALLOW_REPEAT
+
+       static char prev_tag = '\0';
+       char cur_tag = '\0';
+
+#endif /* ALLOW_REPEAT */
+
 #ifdef ALLOW_EASY_FLOOR /* TNB */
 
        if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
@@ -5469,35 +5498,52 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
                        /* Validate the item */
                        if (item_tester_okay(o_ptr))
                        {
-                               /* Forget the item_tester_tval restriction */
+                               /* Forget restrictions */
                                item_tester_tval = 0;
-
-                               /* Forget the item_tester_hook restriction */
                                item_tester_hook = NULL;
-
                                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
 
                                /* Success */
-                               return (TRUE);
+                               return TRUE;
                        }
                }
 
                else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
                         (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
                {
+                       if (prev_tag && command_cmd)
+                       {
+                               /* Look up the tag and validate the item */
+                               if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
+                               else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
+                               else if (!get_item_okay(k)) /* Reject */;
+                               else
+                               {
+                                       /* Accept that choice */
+                                       (*cp) = k;
+
+                                       /* Forget restrictions */
+                                       item_tester_tval = 0;
+                                       item_tester_hook = NULL;
+                                       command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+
+                                       /* Success */
+                                       return TRUE;
+                               }
+
+                               prev_tag = '\0'; /* prev_tag is no longer effective */
+                       }
+
                        /* Verify the item */
-                       if (get_item_okay(*cp))
+                       else if (get_item_okay(*cp))
                        {
-                               /* Forget the item_tester_tval restriction */
+                               /* Forget restrictions */
                                item_tester_tval = 0;
-
-                               /* Forget the item_tester_hook restriction */
                                item_tester_hook = NULL;
-
                                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
 
                                /* Success */
-                               return (TRUE);
+                               return TRUE;
                        }
                }
        }
@@ -6052,6 +6098,9 @@ if (other_query_flag && !verify("
                                (*cp) = k;
                                item = TRUE;
                                done = TRUE;
+#ifdef ALLOW_REPEAT
+                               cur_tag = which;
+#endif /* ALLOW_REPEAT */
                                break;
                        }
 
@@ -6134,6 +6183,9 @@ if (other_query_flag && !verify("
                                        (*cp) = k;
                                        item = TRUE;
                                        done = TRUE;
+#ifdef ALLOW_REPEAT
+                                       cur_tag = which;
+#endif /* ALLOW_REPEAT */
                                        break;
                                }
 
@@ -6235,6 +6287,7 @@ if (ver && !verify("
        {
 #ifdef ALLOW_REPEAT
                repeat_push(*cp);
+               if (command_cmd) prev_tag = cur_tag;
 #endif /* ALLOW_REPEAT */
 
                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
@@ -6322,6 +6375,8 @@ int show_floor(int target_item, int y, int x, int *min_width)
        int wid, hgt;
        char floor_label[52 + 1];
 
+       bool dont_need_to_show_weights = TRUE;
+
        /* Get size */
        Term_get_size(&wid, &hgt);
 
@@ -6355,6 +6410,8 @@ int show_floor(int target_item, int y, int x, int *min_width)
                /* Be sure to account for the weight */
                if (show_weights) l += 9;
 
+               if (o_ptr->tval != TV_GOLD) dont_need_to_show_weights = FALSE;
+
                /* Maintain the maximum length */
                if (l > len) len = l;
 
@@ -6362,6 +6419,8 @@ int show_floor(int target_item, int y, int x, int *min_width)
                k++;
        }
 
+       if (show_weights && dont_need_to_show_weights) len -= 9;
+
        /* Save width */
        *min_width = len;
 
@@ -6408,7 +6467,7 @@ int show_floor(int target_item, int y, int x, int *min_width)
                c_put_str(out_color[j], out_desc[j], j + 1, col + 3);
 
                /* Display the weight if needed */
-               if (show_weights)
+               if (show_weights && (o_ptr->tval != TV_GOLD))
                {
                        int wgt = o_ptr->weight * o_ptr->number;
 #ifdef JP
@@ -6466,6 +6525,9 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
 
 #ifdef ALLOW_REPEAT
 
+       static char prev_tag = '\0';
+       char cur_tag = '\0';
+
        /* Get the item index */
        if (repeat_pull(cp))
        {
@@ -6481,46 +6543,78 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                /* Floor item? */
                else if (floor && (*cp < 0))
                {
-                       object_type *o_ptr;
+                       if (prev_tag && command_cmd)
+                       {
+                               /* Scan all objects in the grid */
+                               floor_num = scan_floor(floor_list, py, px, 0x03);
 
-                       /* Special index */
-                       k = 0 - (*cp);
+                               /* Look up the tag */
+                               if (get_tag_floor(&k, prev_tag, floor_list, floor_num))
+                               {
+                                       /* Accept that choice */
+                                       (*cp) = 0 - floor_list[k];
 
-                       /* Acquire object */
-                       o_ptr = &o_list[k];
+                                       /* Forget restrictions */
+                                       item_tester_tval = 0;
+                                       item_tester_hook = NULL;
+                                       command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+
+                                       /* Success */
+                                       return TRUE;
+                               }
+
+                               prev_tag = '\0'; /* prev_tag is no longer effective */
+                       }
 
                        /* Validate the item */
-                       if (item_tester_okay(o_ptr))
+                       else if (item_tester_okay(&o_list[0 - (*cp)]))
                        {
-                               /* Forget the item_tester_tval restriction */
+                               /* Forget restrictions */
                                item_tester_tval = 0;
-
-                               /* Forget the item_tester_hook restriction */
                                item_tester_hook = NULL;
-
                                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
 
                                /* Success */
-                               return (TRUE);
+                               return TRUE;
                        }
                }
 
                else if ((inven && (*cp >= 0) && (*cp < INVEN_PACK)) ||
                         (equip && (*cp >= INVEN_RARM) && (*cp < INVEN_TOTAL)))
                {
+                       if (prev_tag && command_cmd)
+                       {
+                               /* Look up the tag and validate the item */
+                               if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
+                               else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
+                               else if (!get_item_okay(k)) /* Reject */;
+                               else
+                               {
+                                       /* Accept that choice */
+                                       (*cp) = k;
+
+                                       /* Forget restrictions */
+                                       item_tester_tval = 0;
+                                       item_tester_hook = NULL;
+                                       command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+
+                                       /* Success */
+                                       return TRUE;
+                               }
+
+                               prev_tag = '\0'; /* prev_tag is no longer effective */
+                       }
+
                        /* Verify the item */
-                       if (get_item_okay(*cp))
+                       else if (get_item_okay(*cp))
                        {
-                               /* Forget the item_tester_tval restriction */
+                               /* Forget restrictions */
                                item_tester_tval = 0;
-
-                               /* Forget the item_tester_hook restriction */
                                item_tester_hook = NULL;
-
                                command_cmd = 0; /* Hack -- command_cmd is no longer effective */
 
                                /* Success */
-                               return (TRUE);
+                               return TRUE;
                        }
                }
        }
@@ -7423,6 +7517,9 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                                (*cp) = k;
                                item = TRUE;
                                done = TRUE;
+#ifdef ALLOW_REPEAT
+                               cur_tag = which;
+#endif /* ALLOW_REPEAT */
                                break;
                        }
 
@@ -7531,6 +7628,9 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                                                (*cp) = k;
                                                item = TRUE;
                                                done = TRUE;
+#ifdef ALLOW_REPEAT
+                                               cur_tag = which;
+#endif /* ALLOW_REPEAT */
                                                break;
                                        }
                                }
@@ -7546,6 +7646,9 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                                                (*cp) = k;
                                                item = TRUE;
                                                done = TRUE;
+#ifdef ALLOW_REPEAT
+                                               cur_tag = which;
+#endif /* ALLOW_REPEAT */
                                                break;
                                        }
                                }
@@ -7661,6 +7764,7 @@ if (ver && !verify("
        {
 #ifdef ALLOW_REPEAT
                repeat_push(*cp);
+               if (command_cmd) prev_tag = cur_tag;
 #endif /* ALLOW_REPEAT */
 
                command_cmd = 0; /* Hack -- command_cmd is no longer effective */