Changeset 156
- Timestamp:
- 06/06/07 09:15:50 (1 year ago)
- Files:
-
- trunk/src/birth.c (modified) (1 diff)
- trunk/src/cmd1.c (modified) (3 diffs)
- trunk/src/cmd2.c (modified) (1 diff)
- trunk/src/cmd3.c (modified) (4 diffs)
- trunk/src/cmd4.c (modified) (9 diffs)
- trunk/src/cmd6.c (modified) (6 diffs)
- trunk/src/defines.h (modified) (8 diffs)
- trunk/src/dungeon.c (modified) (4 diffs)
- trunk/src/externs.h (modified) (4 diffs)
- trunk/src/files.c (modified) (1 diff)
- trunk/src/init2.c (modified) (2 diffs)
- trunk/src/load.c (modified) (5 diffs)
- trunk/src/object1.c (modified) (5 diffs)
- trunk/src/object2.c (modified) (5 diffs)
- trunk/src/save.c (modified) (2 diffs)
- trunk/src/spells2.c (modified) (10 diffs)
- trunk/src/squelch.c (modified) (15 diffs)
- trunk/src/store.c (modified) (3 diffs)
- trunk/src/tables.c (modified) (4 diffs)
- trunk/src/types.h (modified) (2 diffs)
- trunk/src/util.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/birth.c
r136 r156 947 947 /* Set adult options from birth options */ 948 948 for (i = OPT_BIRTH; i < OPT_CHEAT; i++) 949 {950 949 op_ptr->opt[OPT_ADULT + (i - OPT_BIRTH)] = op_ptr->opt[i]; 951 }952 950 953 951 /* Reset score options from cheat options */ 954 952 for (i = OPT_CHEAT; i < OPT_ADULT; i++) 955 {956 953 op_ptr->opt[OPT_SCORE + (i - OPT_CHEAT)] = op_ptr->opt[i]; 957 }958 954 959 955 /* Reset squelch bits */ 960 956 for (i = 0; i < z_info->k_max; i++) 961 k_info[i].squelch = SQUELCH_NEVER;957 k_info[i].squelch = FALSE; 962 958 963 959 /* Clear the squelch bytes */ 964 960 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; 970 962 971 963 trunk/src/cmd1.c
r155 r156 495 495 static bool auto_pickup_okay(const object_type *o_ptr, bool check_pack) 496 496 { 497 cptr s; 497 const char *inscrip = (o_ptr->note ? quark_str(o_ptr->note) : NULL); 498 const char *s; 499 500 /*** Negative checks ***/ 498 501 499 502 /* It can't be carried */ 500 503 if (!inven_carry_okay(o_ptr)) return (FALSE); 501 504 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); 509 514 510 515 /* 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); 512 517 513 518 /* Check inscription */ … … 585 590 /* Get the new object */ 586 591 o_ptr = &inventory[slot]; 592 593 /* Set squelch status */ 594 squelch_set(o_ptr); 587 595 588 596 /* Optionally, display a message */ … … 673 681 /* Nothing to pick up -- return */ 674 682 if (!cave_o_idx[py][px]) return (0); 675 676 /* Automatically destroy squelched items in pile if necessary */677 squelch_pile(py, px);678 683 679 684 trunk/src/cmd2.c
r152 r156 394 394 395 395 /* 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); 401 397 } 402 398 trunk/src/cmd3.c
r155 r156 294 294 /* The object has been "sensed" */ 295 295 o_ptr->ident |= (IDENT_SENSE); 296 297 /* Set squelched status */ 298 squelch_set(o_ptr); 296 299 } 297 300 … … 422 425 { 423 426 int item, amt; 424 int result;425 427 426 428 object_type *o_ptr; … … 434 436 cptr q, s; 435 437 438 const char *inscrip; 436 439 437 440 /* Get an item */ 438 441 q = "Destroy which item? "; 439 442 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 } 441 451 442 452 /* Get the item (in the pack) */ … … 481 491 strnfmt(out_val, sizeof(out_val), "Really destroy %s? ", o_name); 482 492 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")) 552 497 { 553 498 if (!get_check(out_val)) return; trunk/src/cmd4.c
r152 r156 2179 2179 2180 2180 screen_save(); 2181 Term_clear();2181 clear_from(0); 2182 2182 2183 2183 /* Filter the options for this page */ … … 2242 2242 2243 2243 /* Clear screen */ 2244 Term_clear();2244 clear_from(0); 2245 2245 2246 2246 /* Interact */ … … 2963 2963 event_type c; 2964 2964 int evt; 2965 2965 2966 /* Clear screen */ 2966 Term_clear();2967 clear_from(0); 2967 2968 2968 2969 /* No title -- this is a complex menu. */ … … 3447 3448 event_type key; 3448 3449 int evt = -1; 3449 Term_clear();3450 clear_from(0); 3450 3451 key = menu_select(&visual_menu, &cursor, EVT_CMD); 3451 3452 if (key.key == ESCAPE) … … 3618 3619 event_type key; 3619 3620 int evt; 3620 Term_clear();3621 clear_from(0); 3621 3622 key = menu_select(&color_menu, &cursor, EVT_CMD); 3622 3623 … … 3722 3723 3723 3724 /* Clear screen */ 3724 Term_clear();3725 clear_from(0); 3725 3726 } 3726 3727 … … 4093 4094 {{0, 0, 0, 0}}, /* Load and append */ 4094 4095 {{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'}, 4096 4097 {{0, "Set base delay factor", (action_f) do_cmd_delay, 0}, 'D'}, 4097 4098 {{0, "Set hitpoint warning", (action_f) do_cmd_hp_warn, 0}, 'H'}, … … 4135 4136 while (c.key != ESCAPE) 4136 4137 { 4137 Term_clear();4138 clear_from(0); 4138 4139 c = menu_select(&option_menu, &cursor, 0); 4139 4140 } … … 4152 4153 while (c.key != ESCAPE) 4153 4154 { 4154 Term_clear();4155 clear_from(0); 4155 4156 c = menu_select(&knowledge_menu, &cursor, 0); 4156 4157 } trunk/src/cmd6.c
r112 r156 120 120 object_aware(o_ptr); 121 121 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 122 squelch_set(o_ptr); 122 123 } 123 124 … … 205 206 object_aware(o_ptr); 206 207 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 208 squelch_set(o_ptr); 207 209 } 208 210 … … 307 309 object_aware(o_ptr); 308 310 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 311 squelch_set(o_ptr); 309 312 } 310 313 … … 443 446 object_aware(o_ptr); 444 447 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 448 squelch_set(o_ptr); 445 449 } 446 450 … … 539 543 object_aware(o_ptr); 540 544 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 545 squelch_set(o_ptr); 541 546 } 542 547 … … 618 623 object_aware(o_ptr); 619 624 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 625 squelch_set(o_ptr); 620 626 } 621 627 trunk/src/defines.h
r154 r156 50 50 #define VERSION_MAJOR 3 51 51 #define VERSION_MINOR 0 52 #define VERSION_PATCH 852 #define VERSION_PATCH 9 53 53 #define VERSION_EXTRA 0 54 54 … … 415 415 * Total number of inventory slots (hard-coded). 416 416 */ 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 418 424 419 425 … … 1403 1409 /*** Squelch stuff ***/ 1404 1410 1405 /* XXX Too many things beginning with SQUELCH_ */1406 1407 /*1408 * Squelch modes for k_info->squelch1409 */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 -11419 #define SQUELCH_NO 01420 #define SQUELCH_YES 11421 1422 /*1423 * Possible levels of quality squelching1424 */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 191436 1437 1411 /* Number of bytes used in squelch sub-quality array */ 1438 #define SQUELCH_BYTES 24 1412 #define SQUELCH_BYTES 6 1413 1439 1414 1440 1415 … … 1573 1548 #define USE_INVEN 0x02 /* Allow inven items */ 1574 1549 #define USE_FLOOR 0x04 /* Allow floor items */ 1575 1550 #define CAN_SQUELCH 0x08 /* Allow selection of all squelched items */ 1576 1551 1577 1552 … … 1713 1688 */ 1714 1689 #define IDENT_SENSE 0x01 /* Item has been "sensed" */ 1715 /* XXX*/1690 /* ... */ 1716 1691 #define IDENT_EMPTY 0x04 /* Item charges are known */ 1717 1692 #define IDENT_KNOWN 0x08 /* Item abilities are known */ … … 1736 1711 #define INSCRIP_UNCURSED 9 1737 1712 #define INSCRIP_INDESTRUCTIBLE 10 1713 #define INSCRIP_SQUELCH 11 1738 1714 1739 1715 /* … … 2416 2392 #define OPT_use_old_target 4 2417 2393 #define OPT_always_pickup 5 2418 2394 #define OPT_pickup_inven 6 2419 2395 #define OPT_depth_in_feet 7 2420 2396 … … 2508 2484 #define use_old_target op_ptr->opt[OPT_use_old_target] 2509 2485 #define always_pickup op_ptr->opt[OPT_always_pickup] 2486 #define pickup_inven op_ptr->opt[OPT_pickup_inven] 2510 2487 #define depth_in_feet op_ptr->opt[OPT_depth_in_feet] 2511 2488 #define show_labels op_ptr->opt[OPT_show_labels] trunk/src/dungeon.c
r154 r156 126 126 for (i = 0; i < INVEN_TOTAL; i++) 127 127 { 128 int squelch = SQUELCH_NO;129 128 bool okay = FALSE; 130 129 … … 186 185 if (!feel) continue; 187 186 188 /* Squelch it? */189 if (i < INVEN_WIELD)190 squelch = squelch_item_ok(o_ptr, feel, FALSE);191 192 187 /* Stop everything */ 193 188 if (disturb_minor) disturb(0, 0); … … 210 205 else 211 206 { 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...", 213 208 o_name, index_to_label(i), 214 209 ((o_ptr->number == 1) ? "is" : "are"), 215 inscrip_text[feel - INSCRIP_NULL], 216 squelch_to_label(squelch)); 210 inscrip_text[feel - INSCRIP_NULL]); 217 211 } 218 212 … … 223 217 o_ptr->ident |= (IDENT_SENSE); 224 218 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); 227 222 228 223 trunk/src/externs.h
r141 r156 254 254 extern byte squelch_level[SQUELCH_BYTES]; 255 255 256 256 257 /* 257 258 * Automatically generated "function declarations" … … 466 467 extern void floor_item_increase(int item, int num); 467 468 extern void floor_item_optimize(int item); 469 extern bool inven_stack_okay(const object_type *o_ptr); 468 470 extern bool inven_carry_okay(const object_type *o_ptr); 469 471 extern s16b inven_carry(object_type *o_ptr); … … 527 529 extern bool enchant(object_type *o_ptr, int n, int eflag); 528 530 extern bool enchant_spell(int num_hit, int num_dam, int num_ac); 529 extern intdo_ident_item(int item, object_type *o_ptr);531 extern void do_ident_item(int item, object_type *o_ptr); 530 532 extern bool ident_spell(void); 531 533 extern bool identify_fully(void); … … 590 592 void autoinscribe_pack(void); 591 593 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); 594 void squelch_set(object_type *o_ptr); 595 void squelch_items(void); 596 void do_cmd_options_item(void); 598 597 599 598 /* store.c */ trunk/src/files.c
r155 r156 4496 4496 { 4497 4497 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); 4500 4500 fprintf(htm, " <title>%s</title>\n", name); 4501 4501 fprintf(htm, "</head>\n\n"); trunk/src/init2.c
r155 r156 1098 1098 inscriptions = 0; 1099 1099 inscriptions_count = 0; 1100 1101 C_MAKE(inscriptions, AUTOINSCRIPTIONS_MAX, autoinscription); 1100 1102 } 1101 1103 … … 1118 1120 1119 1121 /* Initialize squelch things */ 1120 squelch_init();1121 1122 autoinscribe_init(); 1122 C_MAKE(inscriptions, AUTOINSCRIPTIONS_MAX, autoinscription);1123 1123 1124 1124 /* Initialize the "message" package */ trunk/src/load.c
r155 r156 485 485 } 486 486 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) 488 492 { 489 493 o_ptr->timeout = o_ptr->pval; … … 970 974 { 971 975 int i; 972 byte tmp8u; 973 u16b file_e_max; 976 byte tmp8u = 24; 974 977 975 978 /* Handle old versions, and Pete Mack's patch */ … … 977 980 return 0; 978 981 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)) 1005 985 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); 1007 1006 } 1008 1007 … … 1947 1946 { 1948 1947 byte tmp8u; 1949 1950 1948 object_kind *k_ptr = &k_info[i]; 1951 1949 … … 1954 1952 k_ptr->aware = (tmp8u & 0x01) ? TRUE : FALSE; 1955 1953 k_ptr->tried = (tmp8u & 0x02) ? TRUE : FALSE; 1954 k_ptr->squelch = (tmp8u & 0x04) ? TRUE : FALSE; 1956 1955 k_ptr->everseen = (tmp8u & 0x08) ? TRUE : FALSE; 1957 1956 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 1961 1969 if (arg_fiddle) note("Loaded Object Memory"); 1962 1970 trunk/src/object1.c
r136 r156 1488 1488 1489 1489 1490 1490 1491 /* Use special inscription, if any */ 1491 1492 if (o_ptr->pseudo) … … 2734 2735 bool oops = FALSE; 2735 2736 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); 2739 2741 2740 2742 bool allow_inven = FALSE; … … 2959 2961 /* Indicate legality of the "floor" */ 2960 2962 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)); 2961 2966 } 2962 2967 … … 3018 3023 /* Append */ 3019 3024 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)); 3020 3028 } 3021 3029 … … 3274 3282 } 3275 3283 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 3276 3298 default: 3277 3299 { trunk/src/object2.c
r155 r156 342 342 343 343 /* 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) 345 345 continue; 346 346 … … 358 358 359 359 /* Monsters protect their objects */ 360 if ((rand_int(100) < 90) && (k_ptr->squelch != SQUELCH_ALWAYS))360 if ((rand_int(100) < 90) && !k_ptr->squelch) 361 361 continue; 362 362 } … … 371 371 372 372 /* 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) 375 374 continue; 376 375 … … 379 378 380 379 /* 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; 382 381 383 382 … … 3756 3755 bool inven_carry_okay(const object_type *o_ptr) 3757 3756 { 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 */ 3770 bool inven_stack_okay(const object_type *o_ptr) 3771 { 3758 3772 int j; 3759 3760 /* Empty slot? */3761 if (p_ptr->inven_cnt < INVEN_PACK) return (TRUE);3762 3773 3763 3774 /* Similar slot? */ trunk/src/save.c
r155 r156 233 233 if (k_ptr->aware) tmp8u |= 0x01; 234 234 if (k_ptr->tried) tmp8u |= 0x02; 235 if (k_ptr->squelch) tmp8u |= 0x04; 235 236 if (k_ptr->everseen) tmp8u |= 0x08; 236 237 237 238 wr_byte(tmp8u); 238 239 wr_byte(k_ptr->squelch);240 239 } 241 240 … … 416 415 int i; 417 416 417 /* Write number of squelch bytes */ 418 wr_byte(SQUELCH_BYTES); 418 419 for (i = 0; i < SQUELCH_BYTES; i++) 419 420 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 }435 421 436 422 /* Write the current number of auto-inscriptions */ trunk/src/spells2.c
r155 r156 234 234 for (i = 0; i < INVEN_TOTAL; i++) 235 235 { 236 int squelch;237 236 object_type *o_ptr = &inventory[i]; 238 237 … … 241 240 242 241 /* 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); 256 246 257 247 /* repeat with same slot */ … … 1890 1880 int item; 1891 1881 1892 int squelch;1893 1894 1882 object_type *o_ptr; 1895 1883 … … 1917 1905 1918 1906 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); 1924 1909 1925 1910 … … 1938 1923 { 1939 1924 int item; 1940 int squelch;1941 1925 1942 1926 object_type *o_ptr; … … 1965 1949 } 1966 1950 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); 1969 1953 1970 1954 /* Mark the item as fully known */ … … 1974 1958 handle_stuff(); 1975 1959 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); 1987 1962 1988 1963 … … 3874 3849 * Any negative value assigned to "item" can be used for specifying an object 3875 3850 * on the floor. 3876 * 3877 * Returns squelch_item_ok(o_ptr). 3878 */ 3879 int do_ident_item(int item, object_type *o_ptr) 3851 */ 3852 void do_ident_item(int item, object_type *o_ptr) 3880 3853 { 3881 3854 char o_name[80]; 3882 int squelch = SQUELCH_NO;3883 3855 3884 3856 /* Identify it */ … … 3889 3861 apply_autoinscription(o_ptr); 3890 3862 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); 3894 3865 3895 3866 /* Recalculate bonuses */ … … 3930 3901 else if (item >= 0) 3931 3902 { 3932 msg_format("In your pack: %s (%c). %s", 3933 o_name, index_to_label(item), 3934 squelch_to_label(squelch)); 3903 &nb
