OSDN Git Service

キーワード「修正値n以上の〜」追加。pvalがあるアイテムはpvalだけ、
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 31 May 2002 18:09:09 +0000 (18:09 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 31 May 2002 18:09:09 +0000 (18:09 +0000)
無いアイテムはto-hit to-dam to-ac を見て、どれかが(+n)以上ならマッチ。

autopick.txt
autopick_eng.txt
lib/help/jpref.txt
lib/help/pref.txt
src/autopick.c
src/types.h

index c82e459..ed18efd 100644 (file)
 #      ¡¦Ì¤È½ÌÀ¤Î¡Á        : ¸ú²Ì¤Îʬ¤«¤é¤Ê¤¤¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
 #      ¡¦Ìµ²ÁÃͤΡÁ        : ²ÁÃͤΤʤ¤(ÇäµÑ¤Ç¤­¤Ê¤¤)¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
 #      ¡¦¥À¥¤¥¹Ìܤΰ㤦¡Á  : »¦Ù¤¤ÎÉð´ïÅù¤Ç¥À¥¤¥¹¤ÎÌܤ¬Ä̾ï¤È°Û¤Ê¤ë¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
-#      ¡¦¥À¥¤¥¹ÌÜnn°Ê¾å¤Î¡Á: ¥À¥¤¥¹¿ô¡ßÌÌ¿ô¤¬nn¤Ç»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤Î¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
+#      ¡¦¥À¥¤¥¹ÌÜn°Ê¾å¤Î¡Á : ¥À¥¤¥¹¿ô¡ßÌÌ¿ô¤¬ n °Ê¾å¤Î¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
+#      ¡¦½¤ÀµÃÍn°Ê¾å¤Î¡Á   : Ç½ÎϽ¤ÀµÃͤ¬(+n)°Ê¾å¤Î¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
+#                            Ç½ÎϽ¤Àµ¤¬Ìµ¤¤¾ì¹ç¤Ï¾¤Î¿ôÃͤ¬+n°Ê¾å¤Ê¤éÂоݤˤʤê¤Þ¤¹¡£
 #      ¡¦¾Þ¶â¼ó¤Î¡Á        : ¾Þ¶â¼ó¤Î»àÂΤޤ¿¤Ï¹ü¤¬Âоݤˤʤê¤Þ¤¹¡£
 #      ¡¦¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¡Á¡§ ¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î»àÂΡ¢¹ü¡¢Ä¦Áü¤¬Âоݤˤʤê¤Þ¤¹¡£
 #      ¡¦¿Í´Ö¤Î¡Á          : ¿Í´Ö¤Î»àÂΤޤ¿¤Ï¹ü¤¬Âоݤˤʤê¤Þ¤¹¡£(°­ËâËâË¡¤Ç»ÈÍÑ)
 #      ³Æ¹Ô¤Î¸·Ì©¤Ê½ñ¼°¤Ï¼¡¤Î¤è¤¦¤Ê½çÈ֤Ǥ¹¡£ 
 #      (°Ê²¼¤Î½çÈ֤ǽñ¤¤¤¿¾ì¹ç¤À¤±ÆÃÊÌ°·¤¤¤µ¤ì¤Þ¤¹)
 #
+#         [! ~ (]
 #         [[¤¹¤Ù¤Æ¤Î] [¼ý½¸Ãæ¤Î] [̤´ÕÄê¤Î] [´ÕÄêºÑ¤ß¤Î] [*´ÕÄê*ºÑ¤ß¤Î]
-#          [̵ÌäÎ] [̤ȽÌÀ¤Î] [̵²ÁÃͤÎ] [¥À¥¤¥¹Ìܤΰ㤦] 
-#          [¥À¥¤¥¹ÌÜnn°Ê¾å¤Î] [¾Þ¶â¼ó¤Î] [¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î] [¿Í´Ö¤Î]
+#          [¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È] [¥¨¥´] [̵ÌäÎ] [̤ȽÌÀ¤Î] [̵²ÁÃͤÎ]
+#          [¥À¥¤¥¹Ìܤΰ㤦] [¥À¥¤¥¹ÌÜn°Ê¾å¤Î] [½¤ÀµÃÍn°Ê¾å¤Î]
+#          [¾Þ¶â¼ó¤Î] [¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î] [¿Í´Ö¤Î]
 #         [Æɤá¤Ê¤¤] [Âè°ìÎΰè¤Î] [ÂèÆóÎΰè¤Î] [nºýÌܤÎ]
 #          [¥¢¥¤¥Æ¥à|¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È|Éð´ï|Ëɶñ|Ìð|¸÷¸»|ËâË¡¥¢¥¤¥Æ¥à|
 #           ¤¬¤é¤¯¤¿|ËâË¡½ñ|Æß´ï|½â|µÝ|»ØÎØ|¥¢¥ß¥å¥ì¥Ã¥È|³»|¥¯¥í¡¼¥¯|
index d9ac761..1387fcd 100644 (file)
@@ -72,7 +72,8 @@
 #      unaware           : Items with unknown effects match.
 #      worthless         : Items which you cannot sell match.
 #      dice boosted      : Weapons with boosted damage dice match.
-#      more than nn dice : Weapons with dice (dd * ds) better than nn match.
+#      more than N dice  : Weapons with dice (dd * ds) better than +N match.
+#      more bonus than N : Items which has more magical bonus than (+N) match.
 #      wanted            : Wanted monster's corpses or skeletons match.
 #      unique monster's  : Unique monster's corpses, skeletons or statues match.
 #      human             : Human corpses or skeletons match.
 #
 #      Strict syntax of each line is below.
 #      
+#      [! ~ (]
 #      [[all] [collecting] [unidentified] [identified] [*identified*] 
-#       [nameless] [unaware] [worthless] [dice boosted] [more than nn dice] 
+#       [artifact] [ego] [nameless] [unaware] [worthless] 
+#       [dice boosted] [more than N dice] [more bonus than N] 
 #       [wanted] [unique monster's] [human] [unreadable] 
 #       [first realm's] [second realm's] [first] [second] [third] [fourth] 
-#       [items | artifacts | weapons | armors | missiles | magical devices | 
+#       [items | weapons | armors | missiles | magical devices | 
 #        lights | junks | spellbooks | hafted weapons | shields | bows | 
 #        rings | amulets | suits | cloaks | helms | gloves | boots] :]
 #      [[^]part-of-item-name] [#auto-inscription-string]
index 5c82cab..0dd8711 100644 (file)
@@ -312,7 +312,9 @@ picktype.prf 
 ¡¦Ì¤È½ÌÀ¤Î¡Á        : ¸ú²Ì¤Îʬ¤«¤é¤Ê¤¤¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
 ¡¦Ìµ²ÁÃͤΡÁ        : ²ÁÃͤΤʤ¤(ÇäµÑ¤Ç¤­¤Ê¤¤)¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
 ¡¦¥À¥¤¥¹Ìܤΰ㤦¡Á  : »¦Ù¤¤ÎÉð´ïÅù¤Ç¥À¥¤¥¹¤ÎÌܤ¬Ä̾ï¤È°Û¤Ê¤ë¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
-¡¦¥À¥¤¥¹ÌÜnn°Ê¾å¤Î¡Á: ¥À¥¤¥¹¿ô¡ßÌÌ¿ô¤¬nn¤Ç»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤Î¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
+¡¦¥À¥¤¥¹ÌÜn°Ê¾å¤Î¡Á : ¥À¥¤¥¹¿ô¡ßÌÌ¿ô¤¬ n °Ê¾å¤Î¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
+¡¦½¤ÀµÃÍn°Ê¾å¤Î¡Á   : Ç½ÎϽ¤ÀµÃͤ¬(+n)°Ê¾å¤Î¥¢¥¤¥Æ¥à¤¬Âоݤˤʤê¤Þ¤¹¡£
+                      Ç½ÎϽ¤Àµ¤¬Ìµ¤¤¾ì¹ç¤Ï¾¤Î¿ôÃͤ¬+n°Ê¾å¤Ê¤éÂоݤˤʤê¤Þ¤¹¡£
 ¡¦¾Þ¶â¼ó¤Î¡Á        : ¾Þ¶â¼ó¤Î»àÂΤޤ¿¤Ï¹ü¤¬Âоݤˤʤê¤Þ¤¹¡£
 ¡¦¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î¡Á¡§ ¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î»àÂΡ¢¹ü¡¢Ä¦Áü¤¬Âоݤˤʤê¤Þ¤¹¡£
 ¡¦¿Í´Ö¤Î¡Á          : ¿Í´Ö¤Î»àÂΤޤ¿¤Ï¹ü¤¬Âоݤˤʤê¤Þ¤¹¡£(°­ËâËâË¡¤Ç»ÈÍÑ)
@@ -361,9 +363,10 @@ picktype.prf 
 
    [! ~ (]
    [[¤¹¤Ù¤Æ¤Î] [¼ý½¸Ãæ¤Î] [̤´ÕÄê¤Î] [´ÕÄêºÑ¤ß¤Î] [*´ÕÄê*ºÑ¤ß¤Î]
-    [̵ÌäÎ] [̤ȽÌÀ¤Î] [̵²ÁÃͤÎ] [¥À¥¤¥¹Ìܤΰ㤦] 
-    [¥À¥¤¥¹ÌÜnn°Ê¾å¤Î] [¾Þ¶â¼ó¤Î] [¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î] [¿Í´Ö¤Î]
-    [Æɤá¤Ê¤¤] [Âè°ìÎΰè¤Î] [ÂèÆóÎΰè¤Î] [nºýÌܤÎ]
+    [¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È] [¥¨¥´] [̵ÌäÎ] [̤ȽÌÀ¤Î] [̵²ÁÃͤÎ]
+    [¥À¥¤¥¹Ìܤΰ㤦] [¥À¥¤¥¹ÌÜn°Ê¾å¤Î] [½¤ÀµÃÍn°Ê¾å¤Î]
+    [¾Þ¶â¼ó¤Î] [¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î] [¿Í´Ö¤Î]
+          [Æɤá¤Ê¤¤] [Âè°ìÎΰè¤Î] [ÂèÆóÎΰè¤Î] [nºýÌܤÎ]
     [¥¢¥¤¥Æ¥à|¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È|Éð´ï|Ëɶñ|Ìð|¸÷¸»|ËâË¡¥¢¥¤¥Æ¥à|
      ¤¬¤é¤¯¤¿|ËâË¡½ñ|Æß´ï|½â|µÝ|»ØÎØ|¥¢¥ß¥å¥ì¥Ã¥È|³»|¥¯¥í¡¼¥¯|
      ³õ|äƼê|·¤] :]
index c38a906..9f67630 100644 (file)
@@ -289,7 +289,8 @@ Keywords:
   unaware           : Items with unknown effects match.
   worthless         : Items which you cannot sell match.
   dice boosted      : Weapons with boosted damage dice match.
-  more than nn dice : Weapons with dice (dd * ds) better than nn match.
+  more than N dice  : Weapons with dice (dd * ds) better than +N match.
+  more bonus than N : Items which has more magical bonus than (+N) match.
   wanted            : Wanted monster's corpses or skeletons match.
   unique monster's  : Unique monster's corpses, skeletons or statues match.
   human             : Human corpses or skeletons match.
@@ -381,11 +382,13 @@ Special Notes:
 
   Strict syntax of each line is below.
   
+  [! ~ (]
   [[all] [collecting] [unidentified] [identified] [*identified*] 
-   [nameless] [unaware] [worthless] [dice boosted] [more than nn dice] 
+   [artifact] [ego] [nameless] [unaware] [worthless] 
+   [dice boosted] [more than N dice] [more bonus than N] 
    [wanted] [unique monster's] [human] [unreadable] 
    [first realm's] [second realm's] [first] [second] [third] [fourth] 
-   [items | artifacts | weapons | armors | missiles | magical devices | 
+   [items | weapons | armors | missiles | magical devices | 
     lights | junks | spellbooks | hafted weapons | shields | bows | 
     rings | amulets | suits | cloaks | helms | gloves | boots] :]
   [[^]part-of-item-name] [#auto-inscription-string]
index a556835..2c01ef6 100644 (file)
 #define FLG_BOOSTED        10
 #define FLG_MORE_THAN      11
 #define FLG_DICE           12
-#define FLG_WANTED         13
-#define FLG_UNIQUE         14
-#define FLG_HUMAN          15
-#define FLG_UNREADABLE     16
-#define FLG_REALM1         17
-#define FLG_REALM2         18
-#define FLG_FIRST          19
-#define FLG_SECOND         20
-#define FLG_THIRD          21
-#define FLG_FOURTH         22
+#define FLG_MORE_BONUS     13
+#define FLG_MORE_BONUS2            14
+#define FLG_WANTED         15
+#define FLG_UNIQUE         16
+#define FLG_HUMAN          17
+#define FLG_UNREADABLE     18
+#define FLG_REALM1         19
+#define FLG_REALM2         20
+#define FLG_FIRST          21
+#define FLG_SECOND         22
+#define FLG_THIRD          23
+#define FLG_FOURTH         24
 
 #define FLG_ITEMS          30
 #define FLG_WEAPONS        31
@@ -73,6 +75,8 @@
 #define KEY_BOOSTED "¥À¥¤¥¹Ìܤΰ㤦"
 #define KEY_MORE_THAN  "¥À¥¤¥¹ÌÜ"
 #define KEY_DICE  "°Ê¾å¤Î"
+#define KEY_MORE_BONUS  "½¤ÀµÃͤ¬"
+#define KEY_MORE_BONUS2  "°Ê¾å¤Î"
 #define KEY_WANTED "¾Þ¶â¼ó¤Î"
 #define KEY_UNIQUE "¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤Î"
 #define KEY_HUMAN "¿Í´Ö¤Î"
 #define KEY_UNAWARE "unaware"
 #define KEY_WORTHLESS "worthless"
 #define KEY_BOOSTED "dice boosted"
-#define KEY_MORE_THAN  "more than "
-#define KEY_DICE  " dice "
+#define KEY_MORE_THAN  "more than"
+#define KEY_DICE  " dice"
+#define KEY_MORE_BONUS  "more bonus than"
+#define KEY_MORE_BONUS2  ""
 #define KEY_WANTED "wanted"
 #define KEY_UNIQUE "unique monster's"
 #define KEY_HUMAN "human"
@@ -199,10 +205,17 @@ cptr autopick_line_from_entry(autopick_type *entry)
        if (IS_FLG(FLG_MORE_THAN))
        {
                ADD_KEY(KEY_MORE_THAN);
-               strcat(ptr, format("%2d", entry->dice));
+               strcat(ptr, format("%d", entry->dice));
                ADD_KEY(KEY_DICE);
        }
 
+       if (IS_FLG(FLG_MORE_BONUS))
+       {
+               ADD_KEY(KEY_MORE_BONUS);
+               strcat(ptr, format("%d", entry->bonus));
+               ADD_KEY(KEY_MORE_BONUS2);
+       }
+
        if (IS_FLG(FLG_WANTED)) ADD_KEY(KEY_WANTED);
        if (IS_FLG(FLG_UNIQUE)) ADD_KEY(KEY_UNIQUE);
        if (IS_FLG(FLG_HUMAN)) ADD_KEY(KEY_HUMAN);
@@ -347,13 +360,25 @@ bool autopick_new_entry(autopick_type *entry, cptr str)
        if (MATCH_KEY(KEY_WORTHLESS)) ADD_FLG(FLG_WORTHLESS);
        if (MATCH_KEY(KEY_BOOSTED)) ADD_FLG(FLG_BOOSTED);
 
-       /*** Weapons whic dd*ds is more than nn ***/
+       /*** Weapons whose dd*ds is more than nn ***/
        if (MATCH_KEY(KEY_MORE_THAN))
        {
-               if (isdigit(ptr[0]) && isdigit(ptr[1]))
+               int k = 0;
+               entry->dice = 0;
+
+               /* Drop leading spaces */
+               while (' ' == *ptr) ptr++;
+
+               /* Read number */
+               while (isdigit(*ptr))
+               {
+                       entry->dice = 10 * entry->dice + (*ptr - '0');
+                       ptr++;
+                       k++;
+               }
+
+               if (k > 0 && k <= 2)
                {
-                       entry->dice = (ptr[0] - '0') * 10 + (ptr[1] - '0');
-                       ptr += 2;
                        (void)MATCH_KEY(KEY_DICE);
                        ADD_FLG(FLG_MORE_THAN);
                }
@@ -361,6 +386,32 @@ bool autopick_new_entry(autopick_type *entry, cptr str)
                        ptr = prev_ptr;
        }
 
+       /*** Items whose magical bonus is more than n ***/
+       if (MATCH_KEY(KEY_MORE_BONUS))
+       {
+               int k = 0;
+               entry->bonus = 0;
+
+               /* Drop leading spaces */
+               while (' ' == *ptr) ptr++;
+
+               /* Read number */
+               while (isdigit(*ptr))
+               {
+                       entry->bonus = 10 * entry->bonus + (*ptr - '0');
+                       ptr++;
+                       k++;
+               }
+
+               if (k > 0 && k <= 2)
+               {
+                       (void)MATCH_KEY(KEY_MORE_BONUS2);
+                       ADD_FLG(FLG_MORE_BONUS);
+               }
+               else
+                       ptr = prev_ptr;
+       }
+
        if (MATCH_KEY(KEY_WANTED)) ADD_FLG(FLG_WANTED);
        if (MATCH_KEY(KEY_UNIQUE)) ADD_FLG(FLG_UNIQUE);
        if (MATCH_KEY(KEY_HUMAN)) ADD_FLG(FLG_HUMAN);
@@ -541,6 +592,26 @@ int is_autopick(object_type *o_ptr)
                                continue;
                }
                                
+               /*** Weapons whic dd*ds is more than nn ***/
+               if (IS_FLG(FLG_MORE_BONUS))
+               {
+                       if (!object_known_p(o_ptr)) continue;
+
+                       if (k_info[o_ptr->k_idx].pval ||
+                           (o_ptr->name2 && e_info[o_ptr->name2].max_pval))
+                       {
+                               if (o_ptr->pval < entry->bonus) continue;
+                       }
+                       else
+                       {
+                               if (o_ptr->to_h < entry->bonus &&
+                                   o_ptr->to_d < entry->bonus &&
+                                   o_ptr->to_a < entry->bonus &&
+                                   o_ptr->pval < entry->bonus)
+                                       continue;
+                       }
+               }
+                               
                /*** Wanted monster's corpse/skeletons ***/
                if (IS_FLG(FLG_WANTED) &&
                    (o_ptr->tval != TV_CORPSE || !object_is_shoukinkubi(o_ptr)))
@@ -1031,11 +1102,22 @@ static void describe_autopick(char *buff, autopick_type *entry)
                before_str[before_n++] = "¥À¥á¡¼¥¸¥À¥¤¥¹¤ÎºÇÂçÃͤ¬";
                body_str = "Éð´ï";
                        
-               sprintf(more_than_desc_str,"%2d", entry->dice);
+               sprintf(more_than_desc_str,"%d", entry->dice);
                before_str[before_n++] = more_than_desc_str;
                before_str[before_n++] = "°Ê¾å¤Î";
        }
 
+       /*** Items whose magical bonus is more than nn ***/
+       if (IS_FLG(FLG_MORE_BONUS))
+       {
+               static char more_bonus_desc_str[] = "___";
+               before_str[before_n++] = "½¤ÀµÃͤ¬(+";
+                       
+               sprintf(more_bonus_desc_str,"%d", entry->bonus);
+               before_str[before_n++] = more_bonus_desc_str;
+               before_str[before_n++] = ")°Ê¾å¤Î";
+       }
+
        /*** Wanted monster's corpse/skeletons ***/
        if (IS_FLG(FLG_WANTED))
        {
@@ -1256,7 +1338,7 @@ static void describe_autopick(char *buff, autopick_type *entry)
                whose_str[whose_n++] = "damage dice is bigger than normal";
        }
 
-       /*** Weapons whic dd*ds is more than nn ***/
+       /*** Weapons whose dd*ds is more than nn ***/
        if (IS_FLG(FLG_MORE_THAN))
        {
                static char more_than_desc_str[] =
@@ -1264,10 +1346,21 @@ static void describe_autopick(char *buff, autopick_type *entry)
                body_str = "weapons";
                        
                sprintf(more_than_desc_str + sizeof(more_than_desc_str) - 3,
-                       "%2d", entry->dice);
+                       "%d", entry->dice);
                whose_str[whose_n++] = more_than_desc_str;
        }
 
+       /*** Items whose magical bonus is more than nn ***/
+       if (IS_FLG(FLG_MORE_BONUS))
+       {
+               static char more_bonus_desc_str[] =
+                       "magical bonus is bigger than (+__)";
+                       
+               sprintf(more_bonus_desc_str + sizeof(more_bonus_desc_str) - 4,
+                       "%d)", entry->bonus);
+               whose_str[whose_n++] = more_bonus_desc_str;
+       }
+
        /*** Wanted monster's corpse/skeletons ***/
        if (IS_FLG(FLG_WANTED))
        {
index 89862b4..bf614f6 100644 (file)
@@ -1585,8 +1585,9 @@ struct dungeon_info_type {
 typedef struct {
        cptr name;          /* Items which have 'name' as part of its name match */
        cptr insc;          /* Items will be auto-inscribed as 'insc' */
-       byte action;        /* Auto-pickup or Destroy or Leave items */
        u32b flag[2];       /* Misc. keyword to be matched */
+       byte action;        /* Auto-pickup or Destroy or Leave items */
        byte dice;          /* Weapons which have more than 'dice' dice match */
+       byte bonus;         /* Items which have more than 'bonus' magical bonus match */
 } autopick_type;