Changeset 229

Show
Ignore:
Timestamp:
06/27/07 21:43:07 (1 year ago)
Author:
ajps
Message:

Added a new display option 'hide_squelchable' which does its best to hide any evidence of an item existing if it would be squelched when you picked it up, as judged by the current squelch settings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cave.c

    r227 r229  
    843843        { 
    844844                /* Memorized objects */ 
    845                 if (o_ptr->marked
     845                if (o_ptr->marked && !squelch_hide_item(o_ptr)
    846846                { 
    847847                        /* Hack -- object hallucination */ 
  • trunk/src/cmd1.c

    r227 r229  
    769769 
    770770                /* Ignore all hidden objects */ 
    771                 if (!o_ptr->marked) continue; 
     771                if ((!o_ptr->marked) || squelch_hide_item(o_ptr)) continue; 
    772772 
    773773                /* Paranoia -- ignore all dead objects  XXX */ 
     
    20522052                { 
    20532053                        /* Visible object */ 
    2054                         if (o_ptr->marked) return (TRUE); 
     2054                        if (o_ptr->marked && !squelch_hide_item(o_ptr)) return (TRUE); 
    20552055                } 
    20562056 
  • trunk/src/defines.h

    r227 r229  
    24252425#define OPT_auto_more                           71 
    24262426#define OPT_hp_changes_color            74 
     2427#define OPT_hide_squelchable            75 
    24272428 
    24282429 
     
    24792480 * Hack -- Option symbols 
    24802481 */ 
     2482#define OPTION(opt_name)        op_ptr->opt[OPT_##opt_name] 
     2483 
    24812484#define rogue_like_commands             op_ptr->opt[OPT_rogue_like_commands] 
    24822485#define quick_messages                  op_ptr->opt[OPT_quick_messages] 
     
    25112514#define auto_more                               op_ptr->opt[OPT_auto_more] 
    25122515#define hp_changes_color                op_ptr->opt[OPT_hp_changes_color] 
    2513  
     2516#define hide_squelchable                OPTION(hide_squelchable) 
    25142517#define birth_maximize                  op_ptr->opt[OPT_birth_maximize] 
    25152518#define birth_randarts                  op_ptr->opt[OPT_birth_randarts] 
  • trunk/src/externs.h

    r227 r229  
    600600 
    601601void squelch_set(object_type *o_ptr); 
     602bool squelch_hide_item(object_type *o_ptr); 
    602603void squelch_items(void); 
    603604void do_cmd_options_item(void *, cptr); 
  • trunk/src/melee2.c

    r204 r229  
    39813981 
    39823982                                                        /* Describe observable situations */ 
    3983                                                         if (m_ptr->ml && player_has_los_bold(ny, nx)
     3983                                                        if (m_ptr->ml && player_has_los_bold(ny, nx) && !squelch_hide_item(o_ptr)
    39843984                                                        { 
    39853985                                                                /* Dump a message */ 
     
    40004000 
    40014001                                                /* Describe observable situations */ 
    4002                                                 if (player_has_los_bold(ny, nx)
     4002                                                if (player_has_los_bold(ny, nx) && !squelch_hide_item(o_ptr)
    40034003                                                { 
    40044004                                                        /* Dump a message */ 
     
    40264026 
    40274027                                                /* Describe observable situations */ 
    4028                                                 if (player_has_los_bold(ny, nx)
     4028                                                if (player_has_los_bold(ny, nx) && !squelch_hide_item(o_ptr)
    40294029                                                { 
    40304030                                                        /* Dump a message */ 
  • trunk/src/object1.c

    r199 r229  
    18921892 * Valid flags are any combination of the bits: 
    18931893 *   0x01 -- Verify item tester 
    1894  *   0x02 -- Marked items only 
     1894 *   0x02 -- Marked/visible items only 
    18951895 *   0x04 -- Only the top item 
    18961896 */ 
     
    19211921 
    19221922                /* Marked */ 
    1923                 if ((mode & 0x02) && !o_ptr->marked) continue; 
     1923                if ((mode & 0x02) && (!o_ptr->marked || squelch_hide_item(o_ptr))) 
     1924                        continue; 
    19241925 
    19251926                /* Accept this item */ 
  • trunk/src/squelch.c

    r221 r229  
    421421} 
    422422 
     423/*  
     424 * Returns TRUE if an item should be hidden due to the player's 
     425 * current settings. 
     426 */ 
     427bool squelch_hide_item(object_type *o_ptr) 
     428{ 
     429  return (hide_squelchable ? squelch_item_ok(o_ptr) : FALSE); 
     430} 
    423431 
    424432/* 
  • trunk/src/tables.c

    r156 r229  
    14721472        NULL,                                           /* xxx smart_packs */ 
    14731473        "hp_changes_color",                     /* OPT_hp_changes_color */ 
    1474         NULL,                                          /* xxx */ 
     1474        "hide_squelchable",                    /* OPT_hide_squelchable */ 
    14751475        NULL,                                           /* xxx */ 
    14761476        NULL,                                           /* xxx */ 
     
    17361736        NULL,                                                                           /* xxx smart_packs */ 
    17371737        "Player color indicates low hit points",        /* OPT_hp_changes_color */ 
    1738         NULL,                                                                          /* xxx */ 
     1738        "Hide items set as squelchable",                       /* OPT_hide_squelchable */ 
    17391739        NULL,                                                                           /* xxx */ 
    17401740        NULL,                                                                           /* xxx */ 
     
    20002000        FALSE,          /* xxx smart_packs */ 
    20012001        FALSE,          /* OPT_hp_changes_color */ 
    2002         FALSE,          /* xxx */ 
     2002        FALSE,          /* OPT_hide_squelchable */ 
    20032003        FALSE,          /* xxx */ 
    20042004        FALSE,          /* xxx */ 
     
    22142214                OPT_hilite_player, 
    22152215                OPT_center_player, 
     2216                OPT_hide_squelchable, 
    22162217                OPT_show_piles, 
    22172218                OPT_show_flavors, 
     
    22232224                OPT_view_perma_grids, 
    22242225                OPT_view_torch_grids, 
    2225                 OPT_NONE, 
    22262226                OPT_NONE, 
    22272227        }, 
  • trunk/src/xtra2.c

    r224 r229  
    22632263        { 
    22642264                /* Memorized object */ 
    2265                 if (o_ptr->marked) return (TRUE); 
     2265                if (o_ptr->marked && !squelch_hide_item(o_ptr)) return (TRUE); 
    22662266        } 
    22672267 
     
    26942694 
    26952695                        /* Describe it */ 
    2696                         if (o_ptr->marked
     2696                        if (o_ptr->marked && !squelch_hide_item(o_ptr)
    26972697                        { 
    26982698                                char o_name[80];