OSDN Git Service

Add some Heavy Crossbow Artifacts.
[hengband/hengband.git] / src / object1.c
index d976967..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));
@@ -4415,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
@@ -4507,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
@@ -5443,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);
@@ -5482,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;
                        }
                }
        }
@@ -6065,6 +6098,9 @@ if (other_query_flag && !verify("
                                (*cp) = k;
                                item = TRUE;
                                done = TRUE;
+#ifdef ALLOW_REPEAT
+                               cur_tag = which;
+#endif /* ALLOW_REPEAT */
                                break;
                        }
 
@@ -6147,6 +6183,9 @@ if (other_query_flag && !verify("
                                        (*cp) = k;
                                        item = TRUE;
                                        done = TRUE;
+#ifdef ALLOW_REPEAT
+                                       cur_tag = which;
+#endif /* ALLOW_REPEAT */
                                        break;
                                }
 
@@ -6248,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 */
@@ -6485,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))
        {
@@ -6500,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;
                        }
                }
        }
@@ -7442,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;
                        }
 
@@ -7550,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;
                                        }
                                }
@@ -7565,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;
                                        }
                                }
@@ -7680,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 */