Changeset 556
- Timestamp:
- 09/14/07 15:00:48 (1 year ago)
- Files:
-
- trunk/src/cmd-obj.c (modified) (1 diff)
- trunk/src/cmd4.c (modified) (3 diffs)
- trunk/src/externs.h (modified) (2 diffs)
- trunk/src/files.c (modified) (7 diffs)
- trunk/src/obj-info.c (modified) (6 diffs)
- trunk/src/object1.c (modified) (1 diff)
- trunk/src/store.c (modified) (2 diffs)
- trunk/src/variable.c (modified) (1 diff)
- trunk/src/wizard1.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd-obj.c
r527 r556 67 67 static void obj_examine(object_type *o_ptr, int item) 68 68 { 69 object_info_screen(o_ptr); 69 text_out_hook = text_out_to_screen; 70 screen_save(); 71 72 object_info_header(o_ptr); 73 if (!object_info_known(o_ptr)) 74 text_out("This item does not seem to possess any special abilities."); 75 76 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 77 (void)anykey(); 78 79 screen_load(); 70 80 } 71 81 trunk/src/cmd4.c
r552 r556 1231 1231 handle_stuff(); 1232 1232 1233 /* Save the screen */1233 text_out_hook = text_out_to_screen; 1234 1234 screen_save(); 1235 1235 1236 1236 Term_gotoxy(0, 0); 1237 object_info_screen(o_ptr); 1238 1239 /* Load the screen */ 1237 object_info_header(o_ptr); 1238 if (!object_info_known(o_ptr)) 1239 text_out("This item does not seem to possess any special abilities."); 1240 1241 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 1242 (void)anykey(); 1243 1240 1244 screen_load(); 1241 1245 } … … 1406 1410 /* List ego flags */ 1407 1411 dummy.name2 = e_idx; 1408 object_info_out_flags = object_flags; 1409 object_info_out(&dummy); 1412 object_info_full(&dummy); 1410 1413 1411 1414 if (e_ptr->xtra) … … 1592 1595 handle_stuff(); 1593 1596 1594 /* Save the screen */ 1597 /* Describe */ 1598 text_out_hook = text_out_to_screen; 1595 1599 screen_save(); 1596 1600 1597 /* Describe */1598 1601 Term_gotoxy(0,0); 1599 object_info_screen(o_ptr); 1600 1601 /* Load the screen */ 1602 object_info_header(o_ptr); 1603 if (!object_info_known(o_ptr)) 1604 text_out("This item does not seem to possess any special abilities."); 1605 1606 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 1607 (void)anykey(); 1608 1602 1609 screen_load(); 1603 1610 } trunk/src/externs.h
r544 r556 237 237 extern bool (*get_mon_num_hook)(int r_idx); 238 238 extern bool (*get_obj_num_hook)(int k_idx); 239 extern void (*object_info_out_flags)(const object_type *o_ptr, u32b *f1, u32b *f2, u32b *f3);240 239 extern ang_file *text_out_file; 241 240 extern void (*text_out_hook)(byte a, cptr str); … … 394 393 395 394 /* obj-info.c */ 396 extern bool object_info_out(const object_type *o_ptr); 397 extern void object_info_screen(const object_type *o_ptr); 395 extern void object_info_header(const object_type *o_ptr); 396 extern bool object_info_known(const object_type *o_ptr); 397 extern bool object_info_full(const object_type *o_ptr); 398 398 399 399 /* object1.c */ trunk/src/files.c
r532 r556 1880 1880 } 1881 1881 1882 1883 /* Set the indent/wrap */ 1884 text_out_indent = 3; 1885 text_out_wrap = 72; 1886 1882 1887 /* Dump the equipment */ 1883 1888 if (p_ptr->equip_cnt) … … 1887 1892 { 1888 1893 object_desc(o_name, sizeof(o_name), &inventory[i], TRUE, 3); 1889 file_putf(fp, "%c) %s\n", 1890 index_to_label(i), o_name); 1891 1892 /* Describe random object attributes */ 1893 identify_random_gen(&inventory[i]); 1894 1895 file_putf(fp, "%c) %s\n", index_to_label(i), o_name); 1896 object_info_known(&inventory[i]); 1894 1897 } 1895 1898 file_putf(fp, "\n\n"); … … 1903 1906 1904 1907 object_desc(o_name, sizeof(o_name), &inventory[i], TRUE, 3); 1905 file_putf(fp, "%c) %s\n", 1906 index_to_label(i), o_name); 1907 1908 /* Describe random object attributes */ 1909 identify_random_gen(&inventory[i]); 1908 1909 file_putf(fp, "%c) %s\n", index_to_label(i), o_name); 1910 object_info_known(&inventory[i]); 1910 1911 } 1911 1912 file_putf(fp, "\n\n"); … … 1924 1925 file_putf(fp, "%c) %s\n", I2A(i), o_name); 1925 1926 1926 /* Describe random object attributes */ 1927 identify_random_gen(&st_ptr->stock[i]); 1927 object_info_known(&st_ptr->stock[i]); 1928 1928 } 1929 1929 … … 1931 1931 file_putf(fp, "\n\n"); 1932 1932 } 1933 1934 text_out_indent = text_out_wrap = 0; 1933 1935 1934 1936 … … 2929 2931 { 2930 2932 int item; 2931 2932 object_type *o_ptr;2933 2934 2933 cptr q, s; 2935 2934 … … 2942 2941 s = "You have nothing to examine."; 2943 2942 2944 while (TRUE) 2945 { 2946 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP))) return; 2947 2948 /* Get the item */ 2949 o_ptr = &inventory[item]; 2950 2951 /* Fully known */ 2952 o_ptr->ident |= (IDENT_KNOWN); 2943 while (get_item(&item, q, s, (USE_INVEN | USE_EQUIP))) 2944 { 2945 object_type *o_ptr = &inventory[item]; 2946 2947 /* "Know" */ 2948 o_ptr->ident |= IDENT_KNOWN; 2953 2949 2954 2950 /* Describe */ 2955 object_info_screen(o_ptr); 2951 text_out_hook = text_out_to_screen; 2952 screen_save(); 2953 Term_gotoxy(0, 0); 2954 2955 object_info_header(o_ptr); 2956 if (!object_info_known(o_ptr)) 2957 text_out("This item does not possess any special abilities."); 2958 2959 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 2960 (void)anykey(); 2961 2962 screen_load(); 2956 2963 } 2957 2964 } trunk/src/obj-info.c
r555 r556 684 684 * Output object information 685 685 */ 686 bool object_info_out(const object_type *o_ptr) 686 bool object_info_out(const object_type *o_ptr, 687 void (*flags)(const object_type *, u32b *, u32b *, u32b *)) 687 688 { 688 689 u32b f1, f2, f3; … … 690 691 691 692 /* Grab the object flags */ 692 object_info_out_flags(o_ptr, &f1, &f2, &f3);693 flags(o_ptr, &f1, &f2, &f3); 693 694 694 695 … … 729 730 * Return TRUE if an object description was displayed. 730 731 */ 731 static bool screen_out_head(const object_type *o_ptr)732 void object_info_header(const object_type *o_ptr) 732 733 { 733 734 char *o_name; … … 750 751 object_known_p(o_ptr) && a_info[o_ptr->name1].text) 751 752 { 752 p_text_out(a_text + a_info[o_ptr->name1].text); 753 text_out("\n\n"); 754 text_out(a_text + a_info[o_ptr->name1].text); 753 755 } 754 756 … … 760 762 if (k_info[o_ptr->k_idx].text) 761 763 { 762 p_text_out(k_text + k_info[o_ptr->k_idx].text); 764 text_out("\n\n"); 765 text_out(k_text + k_info[o_ptr->k_idx].text); 763 766 did_desc = TRUE; 764 767 } … … 767 770 if (o_ptr->name2 && object_known_p(o_ptr) && e_info[o_ptr->name2].text) 768 771 { 769 if (did_desc) p_text_out(" "); 770 p_text_out(e_text + e_info[o_ptr->name2].text); 772 if (did_desc) text_out(" "); 773 else text_out("\n\n"); 774 775 text_out(e_text + e_info[o_ptr->name2].text); 771 776 } 772 777 } 773 778 774 else 775 { 776 return FALSE; 777 } 778 779 return TRUE; 780 } 781 782 783 /* 784 * Place an item description on the screen. 785 */ 786 void object_info_screen(const object_type *o_ptr) 787 { 788 bool has_description, has_info; 789 790 /* Redirect output to the screen */ 791 text_out_hook = text_out_to_screen; 792 793 /* Save the screen */ 794 screen_save(); 779 return; 780 } 781 782 783 bool object_info_known(const object_type *o_ptr) 784 { 785 bool has_info = FALSE; 786 787 has_info = object_info_out(o_ptr, object_flags_known); 795 788 796 789 new_paragraph = TRUE; 797 has_description = screen_out_head(o_ptr); 798 object_info_out_flags = object_flags_known; 799 800 /* Dump the info */ 801 has_info = object_info_out(o_ptr); 802 803 /* Dump origin info */ 804 new_paragraph = TRUE; 805 describe_origin(o_ptr); 790 if (describe_origin(o_ptr)) has_info = TRUE; 806 791 807 792 new_paragraph = TRUE; 808 793 if (!object_known_p(o_ptr)) 794 { 809 795 p_text_out("You do not know the full extent of this item's powers."); 810 else if (!has_description && !has_info) 811 p_text_out("This item does not seem to possess any special abilities."); 812 813 new_paragraph = TRUE; 814 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 815 816 /* Wait for input */ 817 (void)anykey(); 818 819 /* Load the screen */ 820 screen_load(); 821 822 /* Hack -- Browse book, then prompt for a command */ 823 if (o_ptr->tval == cp_ptr->spell_book) 824 { 825 /* Call the aux function */ 826 do_cmd_browse_aux(o_ptr); 827 } 828 } 796 has_info = TRUE; 797 } 798 799 return has_info; 800 } 801 802 bool object_info_full(const object_type *o_ptr) 803 { 804 return object_info_out(o_ptr, object_flags); 805 } trunk/src/object1.c
r532 r556 1637 1637 1638 1638 /* 1639 * Describe an item's random attributes for "character dumps"1640 */1641 void identify_random_gen(const object_type *o_ptr)1642 {1643 /* Set hooks for character dump */1644 object_info_out_flags = object_flags_known;1645 1646 /* Set the indent/wrap */1647 text_out_indent = 3;1648 text_out_wrap = 72;1649 1650 /* Dump the info */1651 if (object_info_out(o_ptr))1652 text_out("\n");1653 1654 /* Reset indent/wrap */1655 text_out_indent = 0;1656 text_out_wrap = 0;1657 }1658 1659 1660 /*1661 1639 * Convert an inventory index into a one character label. 1662 1640 * trunk/src/store.c
r542 r556 2304 2304 object_type *o_ptr; 2305 2305 2306 if (item < 0) return;2306 if (item < 0) return; 2307 2307 2308 2308 /* Get the actual object */ … … 2312 2312 Term_erase(0, 0, 255); 2313 2313 Term_gotoxy(0, 0); 2314 object_info_screen(o_ptr); 2314 object_info_full(o_ptr); 2315 2316 /* Hack -- Browse book, then prompt for a command */ 2317 if (o_ptr->tval == cp_ptr->spell_book) 2318 { 2319 /* Call the aux function */ 2320 do_cmd_browse_aux(o_ptr); 2321 } 2315 2322 } 2316 2323 trunk/src/variable.c
r529 r556 737 737 738 738 739 void (*object_info_out_flags)(const object_type *o_ptr, u32b *f1, u32b *f2, u32b *f3);740 741 739 742 740 /* trunk/src/wizard1.c
r531 r556 453 453 text_out_file = fh; 454 454 455 /* Set object_info_out() hook */456 object_info_out_flags = object_flags;457 458 455 /* Dump the header */ 459 456 spoiler_underline(format("Artifact Spoilers for %s %s", … … 496 493 497 494 /* Write out the artifact description to the spoiler file */ 498 object_info_ out(i_ptr);495 object_info_full(i_ptr); 499 496 500 497 /*
