From: dis- Date: Thu, 14 Feb 2013 11:18:32 +0000 (+0000) Subject: In Vault Quest, target weapons must not be auto-picked by diceboost. X-Git-Tag: v2.1.2~87 X-Git-Url: http://git.osdn.net/view?p=hengband%2Fhengband.git;a=commitdiff_plain;h=4c1a6c7f571b1ba707fbc5f5dd0d35b6e3b275b4 In Vault Quest, target weapons must not be auto-picked by diceboost. --- diff --git a/src/autopick.c b/src/autopick.c index ecb2a2ec8..1a7904f76 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -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 ***/ diff --git a/src/externs.h b/src/externs.h index 7aebec505..08cc1d9fb 100644 --- a/src/externs.h +++ b/src/externs.h @@ -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); diff --git a/src/flavor.c b/src/flavor.c index a11ab49b1..50b056f72 100644 --- a/src/flavor.c +++ b/src/flavor.c @@ -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 */