Changeset 265

Show
Ignore:
Timestamp:
07/04/07 13:00:11 (1 year ago)
Author:
takkaria
Message:

Fix squelch according to #168.

Files:

Legend:

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

    r251 r265  
    685685 
    686686        /* Set squelch status */ 
    687         squelch_set(o_ptr)
     687        p_ptr->notice = PN_SQUELCH
    688688 
    689689        /* Optionally, display a message */ 
  • trunk/src/cmd2.c

    r245 r265  
    394394 
    395395                /* Squelch chest if autosquelch calls for it */ 
    396                 squelch_set(o_ptr)
     396                p_ptr->notice = PN_SQUELCH
    397397        } 
    398398 
  • trunk/src/cmd3.c

    r261 r265  
    296296 
    297297                /* Set squelched status */ 
    298                 squelch_set(o_ptr)
     298                p_ptr->notice = PN_SQUELCH
    299299        } 
    300300 
  • trunk/src/cmd6.c

    r203 r265  
    120120                object_aware(o_ptr); 
    121121                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
    122                 squelch_set(o_ptr)
     122                p_ptr->notice = PN_SQUELCH
    123123        } 
    124124 
     
    206206                object_aware(o_ptr); 
    207207                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
    208                 squelch_set(o_ptr)
     208                p_ptr->notice = PN_SQUELCH
    209209        } 
    210210 
     
    317317                object_aware(o_ptr); 
    318318                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
    319                 squelch_set(o_ptr)
     319                p_ptr->notice = PN_SQUELCH
    320320        } 
    321321 
     
    455455                object_aware(o_ptr); 
    456456                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
    457                 squelch_set(o_ptr)
     457                p_ptr->notice = PN_SQUELCH
    458458        } 
    459459 
     
    554554                object_aware(o_ptr); 
    555555                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
    556                 squelch_set(o_ptr)
     556                p_ptr->notice = PN_SQUELCH
    557557        } 
    558558 
     
    634634                object_aware(o_ptr); 
    635635                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
    636                 squelch_set(o_ptr)
     636                p_ptr->notice = PN_SQUELCH
    637637        } 
    638638 
  • trunk/src/defines.h

    r248 r265  
    24272427#define OPT_hp_changes_color            74 
    24282428#define OPT_hide_squelchable            75 
    2429 #define OPT_auto_squelch                76 
    24302429#define OPT_mouse_movement              77 
    24312430 
     
    25182517#define hp_changes_color                OPTION(hp_changes_color) 
    25192518#define hide_squelchable                OPTION(hide_squelchable) 
    2520 #define auto_squelch                    OPTION(auto_squelch) 
    25212519#define mouse_movement                  OPTION(mouse_movement) 
    25222520 
  • trunk/src/dungeon.c

    r245 r265  
    219219                /* Set squelch flag as appropriate */ 
    220220                if (i < INVEN_WIELD) 
    221                         squelch_set(o_ptr)
     221                        p_ptr->notice = PN_SQUELCH
    222222 
    223223 
  • trunk/src/externs.h

    r262 r265  
    600600 
    601601bool squelch_item_ok(const object_type *o_ptr); 
    602 void squelch_set(object_type *o_ptr); 
    603602bool squelch_hide_item(object_type *o_ptr); 
    604603void squelch_items(void); 
  • trunk/src/object1.c

    r257 r265  
    680680                { 
    681681                        k_ptr->squelch = TRUE; 
    682                         squelch_set((object_type *) o_ptr)
     682                        p_ptr->notice = PN_SQUELCH
    683683                } 
    684684        } 
     
    15631563        } 
    15641564 
     1565        /* Add squelch marker */ 
     1566        if (!hide_squelchable && squelch_item_ok(o_ptr)) 
     1567                object_desc_str_macro(t, " (squelch)"); 
     1568 
    15651569 
    15661570object_desc_done: 
  • trunk/src/spells2.c

    r250 r265  
    38193819 
    38203820        /* Set squelch flag */ 
    3821         squelch_set(o_ptr)
     3821        p_ptr->notice = PN_SQUELCH
    38223822 
    38233823        /* Recalculate bonuses */ 
  • trunk/src/squelch.c

    r262 r265  
    2727 * much impossible to work with. 
    2828 * 
    29  * Luckily, though, it's been cleaned up.  Here's a quick overview of the 
    30  * options available now: 
     29 * Luckily, though, it's been cleaned up.  There is now only sval-dependent 
     30 * squelch and quality-based squelch, and the two don't interact -- quality-based 
     31 * is for items that get pseudo-id'd and sval-dependent is for potions and the 
     32 * like. 
    3133 * 
    32  * Squelched items are not automatically destroyed -- they're instead marked 
    33  * "{squelch}", and destroyed with a special command on the "item destruction" 
    34  * screen.  This is much cleaner. 
    35  * 
    36  * There is now only sval-dependent squelch and quality-based squelch, and the 
    37  * two don't interact -- quality-based is for items that get pseudo-id'd and 
    38  * sval-dependent is for potions and the like. 
    39  * 
    40  * The squelch code figures most things out itself.  If you want to make the 
    41  * code see if it should add the squelch flag to an object, simply call 
    42  * squelch_set(o_ptr), and it will do the rest. 
     34 * The squelch code figures most things out itself.  Simply do: 
     35 *     p_ptr->notice = PN_SQUELCH; 
     36 * whenever you want to make the game check for squelched items. 
    4337 * 
    4438 * The quality-dependent squelch is much reduced in scope from how it used to 
     
    426420} 
    427421 
     422 
    428423/*  
    429424 * Returns TRUE if an item should be hidden due to the player's 
     
    434429        return (hide_squelchable ? squelch_item_ok(o_ptr) : FALSE); 
    435430} 
    436  
    437  
    438 /* 
    439  * Set squelch inscription on an object. 
    440  */ 
    441 void squelch_set(object_type *o_ptr) 
    442 { 
    443         /* Set squelch inscription unless there's already one */ 
    444         if (squelch_item_ok(o_ptr)) 
    445                 p_ptr->notice = PN_SQUELCH; 
    446  
    447         /* Done */ 
    448         return; 
    449 } 
    450  
    451431 
    452432 
     
    518498} 
    519499 
     500 
     501/* 
     502 * Drop all {squelch}able items. 
     503 */ 
     504void squelch_drop(void) 
     505{ 
     506        int floor_list[MAX_FLOOR_STACK]; 
     507        int floor_num, n; 
     508        int count = 0; 
     509 
     510        object_type *o_ptr; 
     511 
     512        /* Scan through the slots backwards */ 
     513        for (n = INVEN_PACK - 1; n >= 0; n--) 
     514        { 
     515                o_ptr = &inventory[n]; 
     516 
     517                /* Skip non-objects and unsquelchable objects */ 
     518                if (!o_ptr->k_idx) continue; 
     519                if (!squelch_item_ok(o_ptr)) continue; 
     520 
     521                /* Drop item */ 
     522                inven_drop(n, o_ptr->number); 
     523        } 
     524 
     525        /* Combine/reorder the pack */ 
     526        p_ptr->notice |= (PN_COMBINE | PN_REORDER); 
     527} 
    520528 
    521529 
  • trunk/src/store.c

    r264 r265  
    21992199 
    22002200                /* Set squelch flag */ 
    2201                 squelch_set(o_ptr)
     2201                p_ptr->notice = PN_SQUELCH
    22022202 
    22032203                /* Take the object from the player */ 
  • trunk/src/tables.c

    r260 r265  
    14731473        "hp_changes_color",                     /* OPT_hp_changes_color */ 
    14741474        "hide_squelchable",                     /* OPT_hide_squelchable */ 
    1475         "auto_squelch",                                /* OPT_auto_squelch */ 
     1475        NULL,                                          /* xxx */ 
    14761476        "mouse_movement",                       /* OPT_mouse_movement */ 
    14771477        NULL,                                           /* xxx */ 
     
    17361736        NULL,                                                                           /* xxx smart_packs */ 
    17371737        "Player color indicates low hit points",        /* OPT_hp_changes_color */ 
    1738         "Hide items set as squelchable",                      /* OPT_hide_squelchable */ 
    1739         "Destroy items marked as squelch automatically",       /* OPT_auto_squelch */ 
    1740         "Allow mouse clicks to move the player",       /* OPT_mouse_movement */ 
     1738        "Hide items set as squelchable",                      /* OPT_hide_squelchable */ 
     1739        NULL,                                                                          /* xxx */ 
     1740        "Allow mouse clicks to move the player",       /* OPT_mouse_movement */ 
    17411741        NULL,                                                                           /* xxx */ 
    17421742        NULL,                                                                           /* xxx */ 
     
    20012001        FALSE,          /* OPT_hp_changes_color */ 
    20022002        FALSE,          /* OPT_hide_squelchable */ 
    2003         FALSE,          /* OPT_auto_squelch */ 
     2003        FALSE,          /* xxx */ 
    20042004        FALSE,          /* OPT_mouse_movement */ 
    20052005        FALSE,          /* xxx */ 
     
    21972197                OPT_pickup_inven, 
    21982198                OPT_pickup_detail, 
    2199                 OPT_auto_squelch
     2199                OPT_hide_squelchable
    22002200                OPT_easy_alter, 
    22012201                OPT_easy_open, 
     
    22142214                OPT_hilite_player, 
    22152215                OPT_center_player, 
    2216                 OPT_hide_squelchable, 
    22172216                OPT_show_piles, 
    22182217                OPT_show_flavors, 
     
    22242223                OPT_view_perma_grids, 
    22252224                OPT_view_torch_grids, 
     2225                OPT_NONE, 
    22262226                OPT_NONE, 
    22272227        }, 
  • trunk/src/xtra1.c

    r235 r265  
    26832683        { 
    26842684                p_ptr->notice &= ~(PN_SQUELCH); 
    2685                 if (auto_squelch) squelch_items(); 
     2685                if (hide_squelchable) squelch_drop(); 
    26862686        } 
    26872687