Changeset 156

Show
Ignore:
Timestamp:
06/06/07 09:15:50 (1 year ago)
Author:
takkaria
Message:

Fix #56:

  • Stop squelching items in the pack without choice. Mark items as {squelch} instead of actually being squelched, Ey-style. Auto-mark items as squelch when we find out they're bad (e.g. potions). 'k!' squelches items marked {squelch}. Remove choice of empty chest squelching.
  • Remove ego-item squelching. Remove individual item squelch groups for pseudo-id-able items.
  • Remove item-based autopickup/neverpickup options, and add "Always pickup items matching those in inventory".
  • Rewrite squelch UI using new menus, except for main menu.
  • Simplify quality squelch to give choice of weapons/missiles/armour/lights/etc rather than. Remove "all items" and "just this item" UI junk.
Files:

Legend:

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

    r136 r156  
    947947        /* Set adult options from birth options */ 
    948948        for (i = OPT_BIRTH; i < OPT_CHEAT; i++) 
    949         { 
    950949                op_ptr->opt[OPT_ADULT + (i - OPT_BIRTH)] = op_ptr->opt[i]; 
    951         } 
    952950 
    953951        /* Reset score options from cheat options */ 
    954952        for (i = OPT_CHEAT; i < OPT_ADULT; i++) 
    955         { 
    956953                op_ptr->opt[OPT_SCORE + (i - OPT_CHEAT)] = op_ptr->opt[i]; 
    957         } 
    958954 
    959955        /* Reset squelch bits */ 
    960956        for (i = 0; i < z_info->k_max; i++) 
    961                 k_info[i].squelch = SQUELCH_NEVER
     957                k_info[i].squelch = FALSE
    962958 
    963959        /* Clear the squelch bytes */ 
    964960        for (i = 0; i < SQUELCH_BYTES; i++) 
    965                 squelch_level[i] = SQUELCH_NONE; 
    966  
    967         /* Clear the ego-item flags */ 
    968         for (i = 0; i < z_info->e_max; i++) 
    969                 e_info[i].squelch = FALSE; 
     961                squelch_level[i] = 0; 
    970962 
    971963 
  • trunk/src/cmd1.c

    r155 r156  
    495495static bool auto_pickup_okay(const object_type *o_ptr, bool check_pack) 
    496496{ 
    497         cptr s; 
     497        const char *inscrip = (o_ptr->note ? quark_str(o_ptr->note) : NULL); 
     498        const char *s; 
     499 
     500        /*** Negative checks ***/ 
    498501 
    499502        /* It can't be carried */ 
    500503        if (!inven_carry_okay(o_ptr)) return (FALSE); 
    501504 
    502         /* Object is marked to pickup */ 
    503         if ((k_info[o_ptr->k_idx].squelch == NO_SQUELCH_NEVER_PICKUP) && 
    504                 object_aware_p(o_ptr)) return (FALSE); 
    505  
    506         /* Object is marked to not pickup */ 
    507         if ((k_info[o_ptr->k_idx].squelch == NO_SQUELCH_ALWAYS_PICKUP) && 
    508                 object_aware_p(o_ptr)) return (TRUE); 
     505        /* Ignore squelched items */ 
     506        if (inscrip && streq(inscrip, "squelch")) return (FALSE); 
     507 
     508 
     509 
     510        /*** Positive checks ***/ 
     511 
     512        /* Pickup if it matches the inventory */ 
     513        if (pickup_inven && inven_stack_okay(o_ptr)) return (TRUE); 
    509514 
    510515        /* Option to vacuum up things on the floor (not recommended) */ 
    511         if ((always_pickup) && (!query_floor)) return (TRUE); 
     516        if (always_pickup && !query_floor) return (TRUE); 
    512517 
    513518        /* Check inscription */ 
     
    585590        /* Get the new object */ 
    586591        o_ptr = &inventory[slot]; 
     592 
     593        /* Set squelch status */ 
     594        squelch_set(o_ptr); 
    587595 
    588596        /* Optionally, display a message */ 
     
    673681        /* Nothing to pick up -- return */ 
    674682        if (!cave_o_idx[py][px]) return (0); 
    675  
    676         /* Automatically destroy squelched items in pile if necessary */ 
    677         squelch_pile(py, px); 
    678683 
    679684 
  • trunk/src/cmd2.c

    r152 r156  
    394394 
    395395                /* Squelch chest if autosquelch calls for it */ 
    396                 if ((squelch_level[CHEST_INDEX]) == SQUELCH_OPENED_CHESTS) 
    397                 { 
    398                         delete_object_idx(o_idx); 
    399                         msg_print("Chest squelched after it was opened."); 
    400                 } 
     396                squelch_set(o_ptr); 
    401397        } 
    402398 
  • trunk/src/cmd3.c

    r155 r156  
    294294                /* The object has been "sensed" */ 
    295295                o_ptr->ident |= (IDENT_SENSE); 
     296 
     297                /* Set squelched status */ 
     298                squelch_set(o_ptr); 
    296299        } 
    297300 
     
    422425{ 
    423426        int item, amt; 
    424         int result; 
    425427 
    426428        object_type *o_ptr; 
     
    434436        cptr q, s; 
    435437 
     438        const char *inscrip; 
    436439 
    437440        /* Get an item */ 
    438441        q = "Destroy which item? "; 
    439442        s = "You have nothing to destroy."; 
    440         if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return; 
     443        if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR | CAN_SQUELCH))) return; 
     444 
     445        /* Deal with squelched items */ 
     446        if (item == ALL_SQUELCHED) 
     447        { 
     448                squelch_items(); 
     449                return; 
     450        } 
    441451 
    442452        /* Get the item (in the pack) */ 
     
    481491        strnfmt(out_val, sizeof(out_val), "Really destroy %s? ", o_name); 
    482492 
    483         /* Check for known ego-items */ 
    484         if (ego_item_p(o_ptr) && object_known_p(o_ptr)) 
    485         { 
    486                 /* XXX Hook for context help here to explain 'E' */ 
    487   
    488                 /* Prompt */ 
    489                 result = get_check_other(out_val, 'E'); 
    490  
    491                 /* No */ 
    492                 if (result == 0) 
    493                         return; 
    494   
    495                 /* Squelch */ 
    496                 else if (result == 2) 
    497                 { 
    498                         /* Get the ego item type */ 
    499                         ego_item_type *e_ptr = &e_info[o_ptr->name2]; 
    500   
    501                         /* Set to squelch */ 
    502                         e_ptr->squelch = TRUE; 
    503   
    504                         /* Tell user */ 
    505                         msg_format("Ego-item type '%s' will always be squelched.", e_name + e_ptr->name); 
    506                 } 
    507         } 
    508  
    509         /* Check for aware objects */ 
    510         else if (object_aware_p(o_ptr) && !(k_info[o_ptr->k_idx].flags3 & (TR3_INSTA_ART))) 
    511         { 
    512                 result = get_check_other(out_val, 'S'); 
    513  
    514                 /* returned "no" */ 
    515                 if (!result) return; 
    516  
    517                 /* Return of 2 sets item to squelch */ 
    518                 else if (result == 2) 
    519                 { 
    520                         object_kind *k_ptr = &k_info[o_ptr->k_idx]; 
    521                         char o_name2[80]; 
    522  
    523                         /* Make a fake object so we can give a proper message */ 
    524                         object_type object_type_body; 
    525                         object_type *i_ptr = &object_type_body; 
    526  
    527                         /* Wipe the object */ 
    528                         object_wipe(i_ptr); 
    529  
    530                         /* Create the object */ 
    531                         object_prep(i_ptr, o_ptr->k_idx); 
    532  
    533                         /* Make it plural */ 
    534                         i_ptr->number = 2; 
    535  
    536                         /* Now describe with correct amount */ 
    537                         object_desc(o_name2, sizeof(o_name2), i_ptr, FALSE, 0); 
    538  
    539                         /* Set to squelch */ 
    540                         k_ptr->squelch = SQUELCH_ALWAYS; 
    541  
    542                         /* Message - no good routine for extracting the plain name*/ 
    543                         msg_format("All %^s will always be squelched.", o_name2); 
    544  
    545                         /*Mark the view to be updated*/ 
    546                         p_ptr->update |= (PU_FORGET_VIEW | PU_UPDATE_VIEW); 
    547                 } 
    548         } 
    549  
    550         /* Everything else */ 
    551         else 
     493        inscrip = (o_ptr->note ? quark_str(o_ptr->note) : NULL); 
     494 
     495        /* Destroying a squelched item is prompt-free */ 
     496        if (!inscrip || !streq(inscrip, "squelch")) 
    552497        { 
    553498                if (!get_check(out_val)) return; 
  • trunk/src/cmd4.c

    r152 r156  
    21792179 
    21802180        screen_save(); 
    2181         Term_clear(); 
     2181        clear_from(0); 
    21822182 
    21832183        /* Filter the options for this page */ 
     
    22422242 
    22432243        /* Clear screen */ 
    2244         Term_clear(); 
     2244        clear_from(0); 
    22452245 
    22462246        /* Interact */ 
     
    29632963                event_type c; 
    29642964                int evt; 
     2965 
    29652966                /* Clear screen */ 
    2966                 Term_clear(); 
     2967                clear_from(0); 
    29672968 
    29682969                /* No title -- this is a complex menu. */ 
     
    34473448                event_type key; 
    34483449                int evt = -1; 
    3449                 Term_clear(); 
     3450                clear_from(0); 
    34503451                key = menu_select(&visual_menu, &cursor, EVT_CMD); 
    34513452                if (key.key == ESCAPE)  
     
    36183619                event_type key; 
    36193620                int evt; 
    3620                 Term_clear(); 
     3621                clear_from(0); 
    36213622                key = menu_select(&color_menu, &cursor, EVT_CMD); 
    36223623 
     
    37223723 
    37233724                /* Clear screen */ 
    3724                 Term_clear(); 
     3725                clear_from(0); 
    37253726        } 
    37263727 
     
    40934094        {{0, 0, 0, 0}}, /* Load and append */ 
    40944095        {{0, "Subwindow display settings", (action_f) do_cmd_options_win, 0}, 'W'}, 
    4095         {{0, "Item squelch and Autoinscribe settings", (action_f) do_cmd_squelch_autoinsc, 0}, 'S'}, 
     4096        {{0, "Item squelch and Autoinscribe settings", (action_f) do_cmd_options_item, 0}, 'S'}, 
    40964097        {{0, "Set base delay factor", (action_f) do_cmd_delay, 0}, 'D'}, 
    40974098        {{0, "Set hitpoint warning", (action_f) do_cmd_hp_warn, 0}, 'H'}, 
     
    41354136        while (c.key != ESCAPE) 
    41364137        { 
    4137                 Term_clear(); 
     4138                clear_from(0); 
    41384139                c = menu_select(&option_menu, &cursor, 0); 
    41394140        } 
     
    41524153        while (c.key != ESCAPE) 
    41534154        { 
    4154                 Term_clear(); 
     4155                clear_from(0); 
    41554156                c = menu_select(&knowledge_menu, &cursor, 0); 
    41564157        } 
  • trunk/src/cmd6.c

    r112 r156  
    120120                object_aware(o_ptr); 
    121121                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
     122                squelch_set(o_ptr); 
    122123        } 
    123124 
     
    205206                object_aware(o_ptr); 
    206207                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
     208                squelch_set(o_ptr); 
    207209        } 
    208210 
     
    307309                object_aware(o_ptr); 
    308310                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
     311                squelch_set(o_ptr); 
    309312        } 
    310313 
     
    443446                object_aware(o_ptr); 
    444447                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
     448                squelch_set(o_ptr); 
    445449        } 
    446450 
     
    539543                object_aware(o_ptr); 
    540544                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
     545                squelch_set(o_ptr); 
    541546        } 
    542547 
     
    618623                object_aware(o_ptr); 
    619624                gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 
     625                squelch_set(o_ptr); 
    620626        } 
    621627 
  • trunk/src/defines.h

    r154 r156  
    5050#define VERSION_MAJOR   3 
    5151#define VERSION_MINOR   0 
    52 #define VERSION_PATCH   8 
     52#define VERSION_PATCH   9 
    5353#define VERSION_EXTRA   0 
    5454 
     
    415415 * Total number of inventory slots (hard-coded). 
    416416 */ 
    417 #define INVEN_TOTAL     36 
     417#define INVEN_TOTAL             36 
     418 
     419 
     420/* 
     421 * Special return code corresponding to squelched items. 
     422 */ 
     423#define ALL_SQUELCHED   101 
    418424 
    419425 
     
    14031409/*** Squelch stuff ***/ 
    14041410 
    1405 /* XXX Too many things beginning with SQUELCH_ */ 
    1406  
    1407 /* 
    1408  * Squelch modes for k_info->squelch 
    1409  */ 
    1410 #define SQUELCH_NEVER               0 /* Allow pickup, defer to OPT_always_pickup */ 
    1411 #define NO_SQUELCH_NEVER_PICKUP     1 /* Never pickup, override OPT_always_pickup */ 
    1412 #define NO_SQUELCH_ALWAYS_PICKUP    2 /* Always pickup, override all other options */ 
    1413 #define SQUELCH_ALWAYS              3 /* Destroy when player walks over */ 
    1414  
    1415 /* 
    1416  * These are the return values of squelch_item_ok(). 
    1417  */ 
    1418 #define SQUELCH_FAILED -1 
    1419 #define SQUELCH_NO      0 
    1420 #define SQUELCH_YES     1 
    1421  
    1422 /* 
    1423  * Possible levels of quality squelching 
    1424  */ 
    1425 #define SQUELCH_NONE            0 /* No squelch */ 
    1426 #define SQUELCH_CURSED          1 /* Squelch only cursed items */ 
    1427 #define SQUELCH_AVERAGE         2 /* Squelch average and worse items */ 
    1428 #define SQUELCH_GOOD_STRONG     3 /* Squelch good and worse items */ 
    1429 #define SQUELCH_GOOD_WEAK       4 /* Squelch good and worse items (weak pseudo-id) */ 
    1430 #define SQUELCH_ALL             5 /* Squelch everything save artifacts */ 
    1431  
    1432 #define SQUELCH_OPENED_CHESTS   6 /* Squelch open chests */ 
    1433  
    1434 /* XXX Others defined at beginning of squelch.c */ 
    1435 #define CHEST_INDEX     19 
    1436  
    14371411/* Number of bytes used in squelch sub-quality array */ 
    1438 #define SQUELCH_BYTES    24 
     1412#define SQUELCH_BYTES    6 
     1413 
    14391414 
    14401415 
     
    15731548#define USE_INVEN               0x02    /* Allow inven items */ 
    15741549#define USE_FLOOR               0x04    /* Allow floor items */ 
    1575  
     1550#define CAN_SQUELCH             0x08    /* Allow selection of all squelched items */ 
    15761551 
    15771552 
     
    17131688 */ 
    17141689#define IDENT_SENSE     0x01    /* Item has been "sensed" */ 
    1715 /* XXX */ 
     1690/* ... */ 
    17161691#define IDENT_EMPTY     0x04    /* Item charges are known */ 
    17171692#define IDENT_KNOWN     0x08    /* Item abilities are known */ 
     
    17361711#define INSCRIP_UNCURSED        9 
    17371712#define INSCRIP_INDESTRUCTIBLE  10 
     1713#define INSCRIP_SQUELCH                 11 
    17381714 
    17391715/* 
     
    24162392#define OPT_use_old_target                      4 
    24172393#define OPT_always_pickup                       5 
    2418  
     2394#define OPT_pickup_inven                        6 
    24192395#define OPT_depth_in_feet                       7 
    24202396 
     
    25082484#define use_old_target                  op_ptr->opt[OPT_use_old_target] 
    25092485#define always_pickup                   op_ptr->opt[OPT_always_pickup] 
     2486#define pickup_inven                    op_ptr->opt[OPT_pickup_inven] 
    25102487#define depth_in_feet                   op_ptr->opt[OPT_depth_in_feet] 
    25112488#define show_labels                             op_ptr->opt[OPT_show_labels] 
  • trunk/src/dungeon.c

    r154 r156  
    126126        for (i = 0; i < INVEN_TOTAL; i++) 
    127127        { 
    128                 int squelch = SQUELCH_NO; 
    129128                bool okay = FALSE; 
    130129 
     
    186185                if (!feel) continue; 
    187186 
    188                 /* Squelch it? */ 
    189                 if (i < INVEN_WIELD) 
    190                         squelch = squelch_item_ok(o_ptr, feel, FALSE); 
    191  
    192187                /* Stop everything */ 
    193188                if (disturb_minor) disturb(0, 0); 
     
    210205                else 
    211206                { 
    212                         msg_format("You feel the %s (%c) in your pack %s %s... %s", 
     207                        msg_format("You feel the %s (%c) in your pack %s %s...", 
    213208                                   o_name, index_to_label(i), 
    214209                                   ((o_ptr->number == 1) ? "is" : "are"), 
    215                                    inscrip_text[feel - INSCRIP_NULL], 
    216                                            squelch_to_label(squelch)); 
     210                                   inscrip_text[feel - INSCRIP_NULL]); 
    217211                } 
    218212 
     
    223217                o_ptr->ident |= (IDENT_SENSE); 
    224218 
    225                 /* Squelch it if necessary */ 
    226                 squelch_item(squelch, i, o_ptr); 
     219                /* Set squelch flag as appropriate */ 
     220                if (i < INVEN_WIELD) 
     221                        squelch_set(o_ptr); 
    227222 
    228223 
  • trunk/src/externs.h

    r141 r156  
    254254extern byte squelch_level[SQUELCH_BYTES]; 
    255255 
     256 
    256257/* 
    257258 * Automatically generated "function declarations" 
     
    466467extern void floor_item_increase(int item, int num); 
    467468extern void floor_item_optimize(int item); 
     469extern bool inven_stack_okay(const object_type *o_ptr); 
    468470extern bool inven_carry_okay(const object_type *o_ptr); 
    469471extern s16b inven_carry(object_type *o_ptr); 
     
    527529extern bool enchant(object_type *o_ptr, int n, int eflag); 
    528530extern bool enchant_spell(int num_hit, int num_dam, int num_ac); 
    529 extern int do_ident_item(int item, object_type *o_ptr); 
     531extern void do_ident_item(int item, object_type *o_ptr); 
    530532extern bool ident_spell(void); 
    531533extern bool identify_fully(void); 
     
    590592void autoinscribe_pack(void); 
    591593 
    592 void squelch_init(void); 
    593 int squelch_item_ok(object_type *o_ptr, byte feel, bool fullid); 
    594 int squelch_item(int squelch, int item, object_type *o_ptr); 
    595 void squelch_pile(int y, int x); 
    596 const char *squelch_to_label(int squelch); 
    597 void do_cmd_squelch_autoinsc(void); 
     594void squelch_set(object_type *o_ptr); 
     595void squelch_items(void); 
     596void do_cmd_options_item(void); 
    598597 
    599598/* store.c */ 
  • trunk/src/files.c

    r155 r156  
    44964496        { 
    44974497                fprintf(htm, "<!DOCTYPE html><html><head>\n"); 
    4498                 fprintf(htm, "  <meta='generator' content='%s %d.%d.%d'>\n", 
    4499                         VERSION_NAME, VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); 
     4498                fprintf(htm, "  <meta='generator' content='%s %s'>\n", 
     4499                        VERSION_NAME, VERSION_STRING); 
    45004500                fprintf(htm, "  <title>%s</title>\n", name); 
    45014501                fprintf(htm, "</head>\n\n"); 
  • trunk/src/init2.c

    r155 r156  
    10981098        inscriptions = 0; 
    10991099        inscriptions_count = 0; 
     1100 
     1101        C_MAKE(inscriptions, AUTOINSCRIPTIONS_MAX, autoinscription); 
    11001102} 
    11011103 
     
    11181120 
    11191121        /* Initialize squelch things */ 
    1120         squelch_init(); 
    11211122        autoinscribe_init(); 
    1122         C_MAKE(inscriptions, AUTOINSCRIPTIONS_MAX, autoinscription); 
    11231123 
    11241124        /* Initialize the "message" package */ 
  • trunk/src/load.c

    r155 r156  
    485485        } 
    486486 
    487         if(older_than(3, 0, 9) && o_ptr->tval == TV_LITE && !artifact_p(o_ptr) && !ego_item_p(o_ptr) && o_ptr->pval) 
     487        if (older_than(3, 0, 9) && 
     488            o_ptr->tval == TV_LITE && 
     489            !artifact_p(o_ptr) && 
     490            !ego_item_p(o_ptr) && 
     491            o_ptr->pval) 
    488492        { 
    489493                o_ptr->timeout = o_ptr->pval; 
     
    970974{ 
    971975        int i; 
    972         byte tmp8u; 
    973         u16b file_e_max; 
     976        byte tmp8u = 24; 
    974977 
    975978        /* Handle old versions, and Pete Mack's patch */ 
     
    977980                return 0; 
    978981 
    979         /* Read item-quality squelch sub-menu */ 
    980         for (i = 0; i < SQUELCH_BYTES; i++) 
    981                 rd_byte(&squelch_level[i]); 
    982  
    983         /* Read the number of saved ego-item types */ 
    984         rd_u16b(&file_e_max); 
    985  
    986         /* Read ego-item squelch settings */ 
    987         for (i = 0; i < z_info->e_max; i++) 
    988         { 
    989                 ego_item_type *e_ptr = &e_info[i]; 
    990                 tmp8u = 0; 
    991  
    992                 if (i < file_e_max) 
    993                         rd_byte(&tmp8u); 
    994  
    995                 e_ptr->squelch |= (tmp8u & 0x01); 
    996                 e_ptr->everseen |= (tmp8u & 0x02); 
    997  
    998                 /* Hack - Repair the savefile */ 
    999                 if (!e_ptr->everseen) e_ptr->squelch = FALSE; 
    1000         } 
    1001  
    1002         /* Read possible extra elements */ 
    1003         while (i < file_e_max) 
    1004         { 
     982 
     983        /* Read how many squelch bytes we have */ 
     984        if (!older_than(3, 0, 9)) 
    1005985                rd_byte(&tmp8u); 
    1006                 i++; 
     986 
     987        /* Check against current number */ 
     988        if (tmp8u != SQUELCH_BYTES) 
     989        { 
     990                strip_bytes(tmp8u); 
     991        } 
     992        else 
     993        { 
     994                for (i = 0; i < SQUELCH_BYTES; i++) 
     995                        rd_byte(&squelch_level[i]); 
     996        } 
     997 
     998        /* Handle pre-cleanup squelch */ 
     999        if (older_than(3, 0, 9)) 
     1000        { 
     1001                u16b tmp16u; 
     1002 
     1003                /* Read the number of saved ego-item types and ignore them all */ 
     1004                rd_u16b(&tmp16u); 
     1005                strip_bytes(tmp16u); 
    10071006        } 
    10081007 
     
    19471946        { 
    19481947                byte tmp8u; 
    1949  
    19501948                object_kind *k_ptr = &k_info[i]; 
    19511949 
     
    19541952                k_ptr->aware = (tmp8u & 0x01) ? TRUE : FALSE; 
    19551953                k_ptr->tried = (tmp8u & 0x02) ? TRUE : FALSE; 
     1954                k_ptr->squelch = (tmp8u & 0x04) ? TRUE : FALSE; 
    19561955                k_ptr->everseen = (tmp8u & 0x08) ? TRUE : FALSE; 
    19571956 
    1958                 if (!older_than(3, 0, 6)) 
    1959                         rd_byte(&k_ptr->squelch); 
    1960         } 
     1957                /* Read the (old) squelch bit */ 
     1958                if (older_than(3, 0, 9) && !older_than(3, 0, 6)) 
     1959                { 
     1960                        rd_byte(&tmp8u); 
     1961 
     1962                        if (tmp8u == 3) 
     1963                                k_ptr->squelch = TRUE; 
     1964                        else 
     1965                                k_ptr->squelch = FALSE; 
     1966                } 
     1967        } 
     1968 
    19611969        if (arg_fiddle) note("Loaded Object Memory"); 
    19621970 
  • trunk/src/object1.c

    r136 r156  
    14881488 
    14891489 
     1490 
    14901491        /* Use special inscription, if any */ 
    14911492        if (o_ptr->pseudo) 
     
    27342735        bool oops = FALSE; 
    27352736 
    2736         bool use_inven = ((mode & (USE_INVEN)) ? TRUE : FALSE); 
    2737         bool use_equip = ((mode & (USE_EQUIP)) ? TRUE : FALSE); 
    2738         bool use_floor = ((mode & (USE_FLOOR)) ? TRUE : FALSE); 
     2737        bool use_inven = ((mode & USE_INVEN) ? TRUE : FALSE); 
     2738        bool use_equip = ((mode & USE_EQUIP) ? TRUE : FALSE); 
     2739        bool use_floor = ((mode & USE_FLOOR) ? TRUE : FALSE); 
     2740        bool can_squelch = ((mode & CAN_SQUELCH) ? TRUE : FALSE); 
    27392741 
    27402742        bool allow_inven = FALSE; 
     
    29592961                        /* Indicate legality of the "floor" */ 
    29602962                        if (allow_floor) my_strcat(out_val, " - for floor,", sizeof(out_val)); 
     2963 
     2964                        /* Indicate that squelched items can be selected */ 
     2965                        if (can_squelch) my_strcat(out_val, " ! for squelched,", sizeof(out_val)); 
    29612966                } 
    29622967 
     
    30183023                        /* Append */ 
    30193024                        else if (use_equip) my_strcat(out_val, " / for Equip,", sizeof(out_val)); 
     3025 
     3026                        /* Indicate that squelched items can be selected */ 
     3027                        if (can_squelch) my_strcat(out_val, " ! for squelched,", sizeof(out_val)); 
    30203028                } 
    30213029 
     
    32743282                        } 
    32753283 
     3284                        case '!': 
     3285                        { 
     3286                                /* Try squelched items */ 
     3287                                if (can_squelch) 
     3288                                { 
     3289                                        (*cp) = ALL_SQUELCHED; 
     3290                                        item = TRUE; 
     3291                                        done = TRUE; 
     3292                                        break; 
     3293                                } 
     3294 
     3295                                /* Just fall through */ 
     3296                        } 
     3297 
    32763298                        default: 
    32773299                        { 
  • trunk/src/object2.c

    r155 r156  
    342342 
    343343                        /* Hack -- High level objects start out "immune" */ 
    344                         if (k_ptr->level > cur_lev && (k_ptr->squelch != SQUELCH_ALWAYS)
     344                        if (k_ptr->level > cur_lev && !k_ptr->squelch
    345345                                continue; 
    346346 
     
    358358 
    359359                                /* Monsters protect their objects */ 
    360                                 if ((rand_int(100) < 90) && (k_ptr->squelch != SQUELCH_ALWAYS)
     360                                if ((rand_int(100) < 90) && !k_ptr->squelch
    361361                                        continue; 
    362362                        } 
     
    371371 
    372372                        /* Nearby objects start out "immune" */ 
    373                         if ((cur_dis > 0) && (distance(py, px, y, x) < cur_dis) && 
    374                             (k_ptr->squelch != SQUELCH_ALWAYS)) 
     373                        if ((cur_dis > 0) && (distance(py, px, y, x) < cur_dis) && !k_ptr->squelch) 
    375374                                continue; 
    376375 
     
    379378 
    380379                        /* Squelched items get compacted */ 
    381                         if ((k_ptr->aware) && (k_ptr->squelch == SQUELCH_ALWAYS)) chance = 0; 
     380                        if (k_ptr->aware && k_ptr->squelch) chance = 0; 
    382381 
    383382 
     
    37563755bool inven_carry_okay(const object_type *o_ptr) 
    37573756{ 
     3757        /* Empty slot? */ 
     3758        if (p_ptr->inven_cnt < INVEN_PACK) return TRUE; 
     3759 
     3760        /* Check if it can stack */ 
     3761        if (inven_stack_okay(o_ptr)) return TRUE; 
     3762 
     3763        /* Nope */ 
     3764        return FALSE; 
     3765} 
     3766 
     3767/* 
     3768 * Check to see if an item is stackable in the inventory 
     3769 */ 
     3770bool inven_stack_okay(const object_type *o_ptr) 
     3771{ 
    37583772        int j; 
    3759  
    3760         /* Empty slot? */ 
    3761         if (p_ptr->inven_cnt < INVEN_PACK) return (TRUE); 
    37623773 
    37633774        /* Similar slot? */ 
  • trunk/src/save.c

    r155 r156  
    233233        if (k_ptr->aware) tmp8u |= 0x01; 
    234234        if (k_ptr->tried) tmp8u |= 0x02; 
     235        if (k_ptr->squelch) tmp8u |= 0x04; 
    235236        if (k_ptr->everseen) tmp8u |= 0x08; 
    236237 
    237238        wr_byte(tmp8u); 
    238  
    239         wr_byte(k_ptr->squelch); 
    240239} 
    241240 
     
    416415        int i; 
    417416 
     417        /* Write number of squelch bytes */ 
     418        wr_byte(SQUELCH_BYTES); 
    418419        for (i = 0; i < SQUELCH_BYTES; i++) 
    419420                wr_byte(squelch_level[i]); 
    420  
    421         /* Save the current number of ego-item types */ 
    422         wr_u16b(z_info->e_max); 
    423  
    424         /* Save ego-item squelch settings */ 
    425         for (i = 0; i < z_info->e_max; i++) 
    426         { 
    427                 ego_item_type *e_ptr = &e_info[i]; 
    428                 byte tmp8u = 0; 
    429  
    430                 if (e_ptr->squelch) tmp8u |= 0x01; 
    431                 if (e_ptr->everseen) tmp8u |= 0x02; 
    432  
    433                 wr_byte(tmp8u); 
    434         } 
    435421 
    436422        /* Write the current number of auto-inscriptions */ 
  • trunk/src/spells2.c

    r155 r156  
    234234        for (i = 0; i < INVEN_TOTAL; i++) 
    235235        { 
    236                 int squelch; 
    237236                object_type *o_ptr = &inventory[i]; 
    238237 
     
    241240 
    242241                /* Aware and Known */ 
    243                 if(object_known_p(o_ptr)) continue; 
    244  
    245                 /* Identify it and get the squelch setting */ 
    246                 squelch = do_ident_item(i, o_ptr); 
    247  
    248                 /* 
    249                  * If the object was squelched, keep analyzing 
    250                  * the same slot (the inventory was displaced). -DG- 
    251                  */ 
    252                 if (squelch != SQUELCH_YES || i < INVEN_WIELD) continue; 
    253  
    254                 /* Now squelch the object */ 
    255                 squelch_item(squelch, i, o_ptr); 
     242                if (object_known_p(o_ptr)) continue; 
     243 
     244                /* Identify it */ 
     245                do_ident_item(i, o_ptr); 
    256246 
    257247                /* repeat with same slot */ 
     
    18901880        int item; 
    18911881 
    1892         int squelch; 
    1893  
    18941882        object_type *o_ptr; 
    18951883 
     
    19171905 
    19181906 
    1919         /* Identify the object and get squelch setting */ 
    1920         squelch = do_ident_item(item, o_ptr); 
    1921  
    1922         /* Squelch it (if needed) */ 
    1923         squelch_item(squelch, item, o_ptr); 
     1907        /* Identify the object */ 
     1908        do_ident_item(item, o_ptr); 
    19241909 
    19251910 
     
    19381923{ 
    19391924        int item; 
    1940         int squelch; 
    19411925 
    19421926        object_type *o_ptr; 
     
    19651949        } 
    19661950 
    1967         /* Identify the object and get the squelch setting */ 
    1968         squelch = do_ident_item(item, o_ptr); 
     1951        /* Identify the object */ 
     1952        do_ident_item(item, o_ptr); 
    19691953 
    19701954        /* Mark the item as fully known */ 
     
    19741958        handle_stuff(); 
    19751959 
    1976         /* Now squelch it if needed */ 
    1977         if (squelch == SQUELCH_YES) 
    1978         { 
    1979                 squelch_item(squelch, item, o_ptr); 
    1980         } 
    1981  
    1982         else 
    1983         { 
    1984                 /* Describe it fully */ 
    1985                 object_info_screen(o_ptr); 
    1986         } 
     1960        /* Describe it fully */ 
     1961        object_info_screen(o_ptr); 
    19871962 
    19881963 
     
    38743849 * Any negative value assigned to "item" can be used for specifying an object 
    38753850 * on the floor. 
    3876  * 
    3877  * Returns squelch_item_ok(o_ptr). 
    3878  */ 
    3879 int do_ident_item(int item, object_type *o_ptr) 
     3851 */ 
     3852void do_ident_item(int item, object_type *o_ptr) 
    38803853{ 
    38813854        char o_name[80]; 
    3882         int squelch = SQUELCH_NO; 
    38833855 
    38843856        /* Identify it */ 
     
    38893861        apply_autoinscription(o_ptr); 
    38903862 
    3891         /* Squelch it? */ 
    3892         if (item < INVEN_WIELD) 
    3893                 squelch = squelch_item_ok(o_ptr, 0, TRUE); 
     3863        /* Set squelch flag */ 
     3864        squelch_set(o_ptr); 
    38943865 
    38953866        /* Recalculate bonuses */ 
     
    39303901        else if (item >= 0) 
    39313902        { 
    3932                 msg_format("In your pack: %s (%c).  %s", 
    3933                           o_name, index_to_label(item), 
    3934                           squelch_to_label(squelch)); 
     3903&nb