Changeset 235

Show
Ignore:
Timestamp:
06/27/07 22:53:39 (1 year ago)
Author:
takkaria
Message:
  • Make worthless items on first sight set the squelch bit
  • Add auto_squelch option, which squelches things that are marked to squelch automatically.
  • Make all options use the OPTION() macro.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/defines.h

    r229 r235  
    15631563#define PN_AUTOINSCRIBE 0x00000004L     /* Autoinscribe items */ 
    15641564#define PN_PICKUP       0x00000008L     /* Pick stuff up */ 
     1565#define PN_SQUELCH      0x00000010L     /* Squelch stuff */ 
    15651566/* xxx (many) */ 
    15661567 
     
    24262427#define OPT_hp_changes_color            74 
    24272428#define OPT_hide_squelchable            75 
     2429#define OPT_auto_squelch                76 
    24282430 
    24292431 
     
    24822484#define OPTION(opt_name)        op_ptr->opt[OPT_##opt_name] 
    24832485 
    2484 #define rogue_like_commands             op_ptr->opt[OPT_rogue_like_commands] 
    2485 #define quick_messages                  op_ptr->opt[OPT_quick_messages] 
    2486 #define use_sound                               op_ptr->opt[OPT_use_sound] 
    2487 #define query_floor                             op_ptr->opt[OPT_query_floor] 
    2488 #define use_old_target                  op_ptr->opt[OPT_use_old_target] 
    2489 #define always_pickup                   op_ptr->opt[OPT_always_pickup] 
    2490 #define pickup_inven                    op_ptr->opt[OPT_pickup_inven] 
    2491 #define depth_in_feet                   op_ptr->opt[OPT_depth_in_feet] 
    2492 #define show_labels                             op_ptr->opt[OPT_show_labels] 
    2493 #define ring_bell                               op_ptr->opt[OPT_ring_bell] 
    2494 #define show_flavors                    op_ptr->opt[OPT_show_flavors] 
    2495 #define run_ignore_doors                op_ptr->opt[OPT_run_ignore_doors] 
    2496 #define disturb_move                    op_ptr->opt[OPT_disturb_move] 
    2497 #define disturb_near                    op_ptr->opt[OPT_disturb_near] 
    2498 #define disturb_panel                   op_ptr->opt[OPT_disturb_panel] 
    2499 #define disturb_state                   op_ptr->opt[OPT_disturb_state] 
    2500 #define disturb_minor                   op_ptr->opt[OPT_disturb_minor] 
    2501 #define view_perma_grids                op_ptr->opt[OPT_view_perma_grids] 
    2502 #define view_torch_grids                op_ptr->opt[OPT_view_torch_grids] 
    2503 #define flush_failure                   op_ptr->opt[OPT_flush_failure] 
    2504 #define flush_disturb                   op_ptr->opt[OPT_flush_disturb] 
    2505 #define hilite_player                   op_ptr->opt[OPT_hilite_player] 
    2506 #define view_yellow_lite                op_ptr->opt[OPT_view_yellow_lite] 
    2507 #define view_bright_lite                op_ptr->opt[OPT_view_bright_lite] 
    2508 #define view_granite_lite               op_ptr->opt[OPT_view_granite_lite] 
    2509 #define view_special_lite               op_ptr->opt[OPT_view_special_lite] 
    2510 #define easy_open                               op_ptr->opt[OPT_easy_open] 
    2511 #define easy_alter                              op_ptr->opt[OPT_easy_alter] 
    2512 #define show_piles                              op_ptr->opt[OPT_show_piles] 
    2513 #define center_player                   op_ptr->opt[OPT_center_player] 
    2514 #define auto_more                               op_ptr->opt[OPT_auto_more] 
    2515 #define hp_changes_color                op_ptr->opt[OPT_hp_changes_color] 
     2486#define rogue_like_commands             OPTION(rogue_like_commands) 
     2487#define quick_messages                  OPTION(quick_messages) 
     2488#define use_sound                               OPTION(use_sound) 
     2489#define query_floor                             OPTION(query_floor) 
     2490#define use_old_target                  OPTION(use_old_target) 
     2491#define always_pickup                   OPTION(always_pickup) 
     2492#define pickup_inven                    OPTION(pickup_inven) 
     2493#define depth_in_feet                   OPTION(depth_in_feet) 
     2494#define show_labels                             OPTION(show_labels) 
     2495#define ring_bell                               OPTION(ring_bell) 
     2496#define show_flavors                    OPTION(show_flavors) 
     2497#define run_ignore_doors                OPTION(run_ignore_doors) 
     2498#define disturb_move                    OPTION(disturb_move) 
     2499#define disturb_near                    OPTION(disturb_near) 
     2500#define disturb_panel                   OPTION(disturb_panel) 
     2501#define disturb_state                   OPTION(disturb_state) 
     2502#define disturb_minor                   OPTION(disturb_minor) 
     2503#define view_perma_grids                OPTION(view_perma_grids) 
     2504#define view_torch_grids                OPTION(view_torch_grids) 
     2505#define flush_failure                   OPTION(flush_failure) 
     2506#define flush_disturb                   OPTION(flush_disturb) 
     2507#define hilite_player                   OPTION(hilite_player) 
     2508#define view_yellow_lite                OPTION(view_yellow_lite) 
     2509#define view_bright_lite                OPTION(view_bright_lite) 
     2510#define view_granite_lite               OPTION(view_granite_lite) 
     2511#define view_special_lite               OPTION(view_special_lite) 
     2512#define easy_open                               OPTION(easy_open) 
     2513#define easy_alter                              OPTION(easy_alter) 
     2514#define show_piles                              OPTION(show_piles) 
     2515#define center_player                   OPTION(center_player) 
     2516#define auto_more                               OPTION(auto_more) 
     2517#define hp_changes_color                OPTION(hp_changes_color) 
    25162518#define hide_squelchable                OPTION(hide_squelchable) 
    2517 #define birth_maximize                  op_ptr->opt[OPT_birth_maximize] 
    2518 #define birth_randarts                  op_ptr->opt[OPT_birth_randarts] 
    2519 #define birth_autoscum                  op_ptr->opt[OPT_birth_autoscum] 
    2520 #define birth_ironman                   op_ptr->opt[OPT_birth_ironman] 
    2521 #define birth_no_stores                 op_ptr->opt[OPT_birth_no_stores] 
    2522 #define birth_no_artifacts              op_ptr->opt[OPT_birth_no_artifacts] 
    2523 #define birth_no_stacking       op_ptr->opt[OPT_birth_no_stacking] 
    2524 #define birth_no_preserve       op_ptr->opt[OPT_birth_no_preserve] 
    2525 #define birth_no_stairs                 op_ptr->opt[OPT_birth_no_stairs] 
    2526 #define birth_ai_sound                  op_ptr->opt[OPT_birth_ai_sound] 
    2527 #define birth_ai_smell                  op_ptr->opt[OPT_birth_ai_smell] 
    2528 #define birth_ai_packs                  op_ptr->opt[OPT_birth_ai_packs] 
    2529 #define birth_ai_learn                  op_ptr->opt[OPT_birth_ai_learn] 
    2530 #define birth_ai_cheat                  op_ptr->opt[OPT_birth_ai_cheat] 
    2531 #define birth_ai_smart                  op_ptr->opt[OPT_birth_ai_smart] 
    2532  
    2533 #define cheat_peek                              op_ptr->opt[OPT_cheat_peek] 
    2534 #define cheat_hear                              op_ptr->opt[OPT_cheat_hear] 
    2535 #define cheat_room                              op_ptr->opt[OPT_cheat_room] 
    2536 #define cheat_xtra                              op_ptr->opt[OPT_cheat_xtra] 
    2537 #define cheat_know                              op_ptr->opt[OPT_cheat_know] 
    2538 #define cheat_live                              op_ptr->opt[OPT_cheat_live] 
    2539  
    2540 #define adult_maximize                  op_ptr->opt[OPT_adult_maximize] 
    2541 #define adult_randarts                  op_ptr->opt[OPT_adult_randarts] 
    2542 #define adult_autoscum                  op_ptr->opt[OPT_adult_autoscum] 
    2543 #define adult_ironman                   op_ptr->opt[OPT_adult_ironman] 
    2544 #define adult_no_stores                 op_ptr->opt[OPT_adult_no_stores] 
    2545 #define adult_no_artifacts              op_ptr->opt[OPT_adult_no_artifacts] 
    2546 #define adult_no_stacking       op_ptr->opt[OPT_adult_no_stacking] 
    2547 #define adult_no_preserve               op_ptr->opt[OPT_adult_no_preserve] 
    2548 #define adult_no_stairs                 op_ptr->opt[OPT_adult_no_stairs] 
    2549 #define adult_ai_sound                  op_ptr->opt[OPT_adult_ai_sound] 
    2550 #define adult_ai_smell                  op_ptr->opt[OPT_adult_ai_smell] 
    2551 #define adult_ai_packs                  op_ptr->opt[OPT_adult_ai_packs] 
    2552 #define adult_ai_learn                  op_ptr->opt[OPT_adult_ai_learn] 
    2553 #define adult_ai_cheat                  op_ptr->opt[OPT_adult_ai_cheat] 
    2554 #define adult_ai_smart                  op_ptr->opt[OPT_adult_ai_smart] 
    2555  
    2556 #define score_peek                              op_ptr->opt[OPT_score_peek] 
    2557 #define score_hear                              op_ptr->opt[OPT_score_hear] 
    2558 #define score_room                              op_ptr->opt[OPT_score_room] 
    2559 #define score_xtra                              op_ptr->opt[OPT_score_xtra] 
    2560 #define score_know                              op_ptr->opt[OPT_score_know] 
    2561 #define score_live                              op_ptr->opt[OPT_score_live] 
     2519#define auto_squelch                    OPTION(auto_squelch) 
     2520 
     2521#define birth_maximize                  OPTION(birth_maximize) 
     2522#define birth_randarts                  OPTION(birth_randarts) 
     2523#define birth_autoscum                  OPTION(birth_autoscum) 
     2524#define birth_ironman                   OPTION(birth_ironman) 
     2525#define birth_no_stores                 OPTION(birth_no_stores) 
     2526#define birth_no_artifacts              OPTION(birth_no_artifacts) 
     2527#define birth_no_stacking       OPTION(birth_no_stacking) 
     2528#define birth_no_preserve       OPTION(birth_no_preserve) 
     2529#define birth_no_stairs                 OPTION(birth_no_stairs) 
     2530#define birth_ai_sound                  OPTION(birth_ai_sound) 
     2531#define birth_ai_smell                  OPTION(birth_ai_smell) 
     2532#define birth_ai_packs                  OPTION(birth_ai_packs) 
     2533#define birth_ai_learn                  OPTION(birth_ai_learn) 
     2534#define birth_ai_cheat                  OPTION(birth_ai_cheat) 
     2535#define birth_ai_smart                  OPTION(birth_ai_smart) 
     2536 
     2537#define cheat_peek                              OPTION(cheat_peek) 
     2538#define cheat_hear                              OPTION(cheat_hear) 
     2539#define cheat_room                              OPTION(cheat_room) 
     2540#define cheat_xtra                              OPTION(cheat_xtra) 
     2541#define cheat_know                              OPTION(cheat_know) 
     2542#define cheat_live                              OPTION(cheat_live) 
     2543 
     2544#define adult_maximize                  OPTION(adult_maximize) 
     2545#define adult_randarts                  OPTION(adult_randarts) 
     2546#define adult_autoscum                  OPTION(adult_autoscum) 
     2547#define adult_ironman                   OPTION(adult_ironman) 
     2548#define adult_no_stores                 OPTION(adult_no_stores) 
     2549#define adult_no_artifacts              OPTION(adult_no_artifacts) 
     2550#define adult_no_stacking               OPTION(adult_no_stacking) 
     2551#define adult_no_preserve               OPTION(adult_no_preserve) 
     2552#define adult_no_stairs                 OPTION(adult_no_stairs) 
     2553#define adult_ai_sound                  OPTION(adult_ai_sound) 
     2554#define adult_ai_smell                  OPTION(adult_ai_smell) 
     2555#define adult_ai_packs                  OPTION(adult_ai_packs) 
     2556#define adult_ai_learn                  OPTION(adult_ai_learn) 
     2557#define adult_ai_cheat                  OPTION(adult_ai_cheat) 
     2558#define adult_ai_smart                  OPTION(adult_ai_smart) 
     2559 
     2560#define score_peek                              OPTION(score_peek) 
     2561#define score_hear                              OPTION(score_hear) 
     2562#define score_room                              OPTION(score_room) 
     2563#define score_xtra                              OPTION(score_xtra) 
     2564#define score_know                              OPTION(score_know) 
     2565#define score_live                              OPTION(score_live) 
    25622566 
    25632567 
  • trunk/src/object1.c

    r229 r235  
    673673        /* Allow flavors to be hidden when aware */ 
    674674        if (aware && !show_flavors) flavor = FALSE; 
     675 
     676        /* Hack -- mark-to-squelch worthless items XXX */ 
     677        if (!k_ptr->everseen && aware) 
     678        { 
     679                if (object_value(o_ptr) == 0) 
     680                { 
     681                        k_ptr->squelch = TRUE; 
     682                        squelch_set((object_type *) o_ptr); 
     683                } 
     684        } 
    675685 
    676686        /* We've seen it at least once now we're aware of it */ 
  • trunk/src/squelch.c

    r232 r235  
    1818 */ 
    1919#include "angband.h" 
     20 
    2021 
    2122/* 
     
    320321        int num = -1; 
    321322 
    322         bool fullid = object_aware_p(o_ptr); 
     323        bool fullid = object_known_p(o_ptr); 
    323324        bool sensed = (o_ptr->ident & IDENT_SENSE) || fullid; 
    324325        byte feel   = fullid ? value_check_aux1(o_ptr) : o_ptr->pseudo; 
     
    331332        if (!sensed) return FALSE; 
    332333 
    333  
    334         /* Auto-squelch junk items */ 
    335         if (object_value(o_ptr) == 0) return TRUE; 
    336334 
    337335        /* Auto-squelch dead chests */ 
     
    339337                return TRUE; 
    340338 
    341  
    342339        /* Do squelching by type */ 
    343         if (k_info[o_ptr->k_idx].squelch) 
    344         { 
    345                 if (fullid) return TRUE; 
    346         } 
     340        if (k_info[o_ptr->k_idx].squelch && fullid) 
     341                return TRUE; 
     342 
    347343 
    348344        /* Find the appropriate squelch group */ 
     
    427423bool squelch_hide_item(object_type *o_ptr) 
    428424{ 
    429   return (hide_squelchable ? squelch_item_ok(o_ptr) : FALSE); 
    430 
     425        return (hide_squelchable ? squelch_item_ok(o_ptr) : FALSE); 
     426
     427 
    431428 
    432429/* 
     
    442439        /* Set squelch inscription unless there's already one */ 
    443440        if (!o_ptr->note && can_squelch) 
     441        { 
    444442                o_ptr->note = quark_add("squelch"); 
     443                p_ptr->notice = PN_SQUELCH; 
     444        } 
    445445 
    446446 
  • trunk/src/tables.c

    r229 r235  
    14731473        "hp_changes_color",                     /* OPT_hp_changes_color */ 
    14741474        "hide_squelchable",                     /* OPT_hide_squelchable */ 
    1475         NULL,                                          /* xxx */ 
     1475        "auto_squelch",                                /* OPT_auto_squelch */ 
    14761476        NULL,                                           /* xxx */ 
    14771477        NULL,                                           /* xxx */ 
     
    17371737        "Player color indicates low hit points",        /* OPT_hp_changes_color */ 
    17381738        "Hide items set as squelchable",                /* OPT_hide_squelchable */ 
    1739         NULL,                                                                          /* xxx */ 
     1739        "Destroy items marked as squelch automatically",       /* OPT_auto_squelch */ 
    17401740        NULL,                                                                           /* xxx */ 
    17411741        NULL,                                                                           /* xxx */ 
     
    20012001        FALSE,          /* OPT_hp_changes_color */ 
    20022002        FALSE,          /* OPT_hide_squelchable */ 
    2003         FALSE,          /* xxx */ 
     2003        FALSE,          /* OPT_auto_squelch */ 
    20042004        FALSE,          /* xxx */ 
    20052005        FALSE,          /* xxx */ 
     
    21972197                OPT_query_floor, 
    21982198                OPT_pickup_inven, 
     2199                OPT_auto_squelch, 
    21992200                OPT_easy_alter, 
    22002201                OPT_easy_open, 
    2201                 OPT_NONE, 
    22022202                OPT_NONE, 
    22032203                OPT_NONE, 
  • trunk/src/xtra1.c

    r163 r235  
    26712671 
    26722672 
    2673         /* Combine the pack */ 
    2674         if (p_ptr->notice & (PN_COMBINE)) 
    2675         { 
    2676                 p_ptr->notice &= ~(PN_COMBINE); 
    2677                 combine_pack(); 
    2678         } 
    2679  
    2680         /* Reorder the pack */ 
    2681         if (p_ptr->notice & (PN_REORDER)) 
    2682         { 
    2683                 p_ptr->notice &= ~(PN_REORDER); 
    2684                 reorder_pack(); 
    2685         } 
    2686  
    26872673        /* Deal with autoinscribe stuff */ 
    26882674        if (p_ptr->notice & PN_AUTOINSCRIBE) 
     
    26912677                autoinscribe_pack(); 
    26922678                autoinscribe_ground(); 
     2679        } 
     2680 
     2681        /* Deal with squelch stuff */ 
     2682        if (p_ptr->notice & PN_SQUELCH) 
     2683        { 
     2684                p_ptr->notice &= ~(PN_SQUELCH); 
     2685                if (auto_squelch) squelch_items(); 
     2686        } 
     2687 
     2688        /* Combine the pack */ 
     2689        if (p_ptr->notice & PN_COMBINE) 
     2690        { 
     2691                p_ptr->notice &= ~(PN_COMBINE); 
     2692                combine_pack(); 
     2693        } 
     2694 
     2695        /* Reorder the pack */ 
     2696        if (p_ptr->notice & PN_REORDER) 
     2697        { 
     2698                p_ptr->notice &= ~(PN_REORDER); 
     2699                reorder_pack(); 
    26932700        } 
    26942701}