OSDN Git Service

In Vault Quest, target weapons must not be auto-picked by diceboost.
authordis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 14 Feb 2013 11:18:32 +0000 (11:18 +0000)
committerdis- <dis-@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 14 Feb 2013 11:18:32 +0000 (11:18 +0000)
src/autopick.c
src/externs.h
src/flavor.c

index ecb2a2e..1a7904f 100644 (file)
@@ -1061,6 +1061,12 @@ static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_nam
                /* Require boosted dice */
                if ((o_ptr->dd == k_ptr->dd) && (o_ptr->ds == k_ptr->ds))
                        return FALSE;
+               
+               /* In Vault Quest, Dice must be hide.*/
+               if(!object_is_known(o_ptr) && object_is_quest_target(o_ptr))
+               {
+                       return FALSE;
+               }
        }
 
        /*** Weapons which dd*ds is more than nn ***/
index 7aebec5..08cc1d9 100644 (file)
@@ -873,6 +873,7 @@ extern errr counts_write(int where, u32b count);
 extern u32b counts_read(int where);
 
 /* flavor.c */
+extern bool object_is_quest_target(object_type *o_ptr);
 extern void get_table_name_aux(char *out_string);
 extern void get_table_name(char *out_string);
 extern void get_table_sindarin_aux(char *out_string);
index a11ab49..50b056f 100644 (file)
@@ -1154,6 +1154,26 @@ static void get_inscription(char *buff, object_type *o_ptr)
        *ptr = '\0';
 }
 
+bool object_is_quest_target(object_type *o_ptr)
+{
+       if (p_ptr->inside_quest)
+       {
+               int a_idx = quest[p_ptr->inside_quest].k_idx;
+               if (a_idx)
+               {
+                       artifact_type *a_ptr = &a_info[a_idx];
+                       if (!(a_ptr->gen_flags & TRG_INSTA_ART))
+                       {
+                               if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
+                               {
+                                       return TRUE;
+                               }
+                       }
+               }
+       }
+       return FALSE;
+}
+
 
 /*
  * Creates a description of the item "o_ptr", and stores it in "out_val".
@@ -2314,20 +2334,9 @@ void object_desc(char *buf, object_type *o_ptr, u32b mode)
            case TV_DIGGING:
                
                /* In Vault Quest, hide the dice of target weapon. */
-               if (!known && p_ptr->inside_quest)
+               if(object_is_quest_target(o_ptr) && !known)
                {
-                       int a_idx = quest[p_ptr->inside_quest].k_idx;
-                       if (a_idx)
-                       {
-                               artifact_type *a_ptr = &a_info[a_idx];
-                               if (!(a_ptr->gen_flags & TRG_INSTA_ART))
-                               {
-                                       if((o_ptr->tval == a_ptr->tval) && (o_ptr->sval == a_ptr->sval))
-                                       {
-                                               break;
-                                       }
-                               }
-                       }
+                       break;
                }
 
                /* Append a "damage" string */