Changeset 265
- Timestamp:
- 07/04/07 13:00:11 (1 year ago)
- Files:
-
- trunk/src/cmd1.c (modified) (1 diff)
- trunk/src/cmd2.c (modified) (1 diff)
- trunk/src/cmd3.c (modified) (1 diff)
- trunk/src/cmd6.c (modified) (6 diffs)
- trunk/src/defines.h (modified) (2 diffs)
- trunk/src/dungeon.c (modified) (1 diff)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/object1.c (modified) (2 diffs)
- trunk/src/spells2.c (modified) (1 diff)
- trunk/src/squelch.c (modified) (4 diffs)
- trunk/src/store.c (modified) (1 diff)
- trunk/src/tables.c (modified) (6 diffs)
- trunk/src/xtra1.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd1.c
r251 r265 685 685 686 686 /* Set squelch status */ 687 squelch_set(o_ptr);687 p_ptr->notice = PN_SQUELCH; 688 688 689 689 /* Optionally, display a message */ trunk/src/cmd2.c
r245 r265 394 394 395 395 /* Squelch chest if autosquelch calls for it */ 396 squelch_set(o_ptr);396 p_ptr->notice = PN_SQUELCH; 397 397 } 398 398 trunk/src/cmd3.c
r261 r265 296 296 297 297 /* Set squelched status */ 298 squelch_set(o_ptr);298 p_ptr->notice = PN_SQUELCH; 299 299 } 300 300 trunk/src/cmd6.c
r203 r265 120 120 object_aware(o_ptr); 121 121 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 122 squelch_set(o_ptr);122 p_ptr->notice = PN_SQUELCH; 123 123 } 124 124 … … 206 206 object_aware(o_ptr); 207 207 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 208 squelch_set(o_ptr);208 p_ptr->notice = PN_SQUELCH; 209 209 } 210 210 … … 317 317 object_aware(o_ptr); 318 318 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 319 squelch_set(o_ptr);319 p_ptr->notice = PN_SQUELCH; 320 320 } 321 321 … … 455 455 object_aware(o_ptr); 456 456 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 457 squelch_set(o_ptr);457 p_ptr->notice = PN_SQUELCH; 458 458 } 459 459 … … 554 554 object_aware(o_ptr); 555 555 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 556 squelch_set(o_ptr);556 p_ptr->notice = PN_SQUELCH; 557 557 } 558 558 … … 634 634 object_aware(o_ptr); 635 635 gain_exp((lev + (p_ptr->lev / 2)) / p_ptr->lev); 636 squelch_set(o_ptr);636 p_ptr->notice = PN_SQUELCH; 637 637 } 638 638 trunk/src/defines.h
r248 r265 2427 2427 #define OPT_hp_changes_color 74 2428 2428 #define OPT_hide_squelchable 75 2429 #define OPT_auto_squelch 762430 2429 #define OPT_mouse_movement 77 2431 2430 … … 2518 2517 #define hp_changes_color OPTION(hp_changes_color) 2519 2518 #define hide_squelchable OPTION(hide_squelchable) 2520 #define auto_squelch OPTION(auto_squelch)2521 2519 #define mouse_movement OPTION(mouse_movement) 2522 2520 trunk/src/dungeon.c
r245 r265 219 219 /* Set squelch flag as appropriate */ 220 220 if (i < INVEN_WIELD) 221 squelch_set(o_ptr);221 p_ptr->notice = PN_SQUELCH; 222 222 223 223 trunk/src/externs.h
r262 r265 600 600 601 601 bool squelch_item_ok(const object_type *o_ptr); 602 void squelch_set(object_type *o_ptr);603 602 bool squelch_hide_item(object_type *o_ptr); 604 603 void squelch_items(void); trunk/src/object1.c
r257 r265 680 680 { 681 681 k_ptr->squelch = TRUE; 682 squelch_set((object_type *) o_ptr);682 p_ptr->notice = PN_SQUELCH; 683 683 } 684 684 } … … 1563 1563 } 1564 1564 1565 /* Add squelch marker */ 1566 if (!hide_squelchable && squelch_item_ok(o_ptr)) 1567 object_desc_str_macro(t, " (squelch)"); 1568 1565 1569 1566 1570 object_desc_done: trunk/src/spells2.c
r250 r265 3819 3819 3820 3820 /* Set squelch flag */ 3821 squelch_set(o_ptr);3821 p_ptr->notice = PN_SQUELCH; 3822 3822 3823 3823 /* Recalculate bonuses */ trunk/src/squelch.c
r262 r265 27 27 * much impossible to work with. 28 28 * 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. 31 33 * 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. 43 37 * 44 38 * The quality-dependent squelch is much reduced in scope from how it used to … … 426 420 } 427 421 422 428 423 /* 429 424 * Returns TRUE if an item should be hidden due to the player's … … 434 429 return (hide_squelchable ? squelch_item_ok(o_ptr) : FALSE); 435 430 } 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 451 431 452 432 … … 518 498 } 519 499 500 501 /* 502 * Drop all {squelch}able items. 503 */ 504 void 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 } 520 528 521 529 trunk/src/store.c
r264 r265 2199 2199 2200 2200 /* Set squelch flag */ 2201 squelch_set(o_ptr);2201 p_ptr->notice = PN_SQUELCH; 2202 2202 2203 2203 /* Take the object from the player */ trunk/src/tables.c
r260 r265 1473 1473 "hp_changes_color", /* OPT_hp_changes_color */ 1474 1474 "hide_squelchable", /* OPT_hide_squelchable */ 1475 "auto_squelch", /* OPT_auto_squelch*/1475 NULL, /* xxx */ 1476 1476 "mouse_movement", /* OPT_mouse_movement */ 1477 1477 NULL, /* xxx */ … … 1736 1736 NULL, /* xxx smart_packs */ 1737 1737 "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 */ 1741 1741 NULL, /* xxx */ 1742 1742 NULL, /* xxx */ … … 2001 2001 FALSE, /* OPT_hp_changes_color */ 2002 2002 FALSE, /* OPT_hide_squelchable */ 2003 FALSE, /* OPT_auto_squelch*/2003 FALSE, /* xxx */ 2004 2004 FALSE, /* OPT_mouse_movement */ 2005 2005 FALSE, /* xxx */ … … 2197 2197 OPT_pickup_inven, 2198 2198 OPT_pickup_detail, 2199 OPT_ auto_squelch,2199 OPT_hide_squelchable, 2200 2200 OPT_easy_alter, 2201 2201 OPT_easy_open, … … 2214 2214 OPT_hilite_player, 2215 2215 OPT_center_player, 2216 OPT_hide_squelchable,2217 2216 OPT_show_piles, 2218 2217 OPT_show_flavors, … … 2224 2223 OPT_view_perma_grids, 2225 2224 OPT_view_torch_grids, 2225 OPT_NONE, 2226 2226 OPT_NONE, 2227 2227 }, trunk/src/xtra1.c
r235 r265 2683 2683 { 2684 2684 p_ptr->notice &= ~(PN_SQUELCH); 2685 if ( auto_squelch) squelch_items();2685 if (hide_squelchable) squelch_drop(); 2686 2686 } 2687 2687
