Changeset 567
- Timestamp:
- 09/17/07 07:48:37 (1 year ago)
- Files:
-
- trunk/lib/edit/object.txt (modified) (26 diffs)
- trunk/src/attack.c (modified) (1 diff)
- trunk/src/cmd-obj.c (modified) (1 diff)
- trunk/src/cmd4.c (modified) (2 diffs)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/obj-info.c (modified) (12 diffs)
- trunk/src/store.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/edit/object.txt
r555 r567 1755 1755 G:?:w 1756 1756 I:70:11:0 1757 W:5:0:5:1 501757 W:5:0:5:125 1758 1758 A:100:5 to 100 1759 1759 F:EASY_KNOW … … 1776 1776 W:0:0:4:2 1777 1777 A:50:1 to 10 1778 M:55:2d3 1778 1779 F:EASY_KNOW 1779 1780 E:DRINK_GOOD … … 1905 1906 G:!:d 1906 1907 I:75:35:100 1907 W:3:0:4:4 51908 W:3:0:4:40 1908 1909 A:100:5 to 25 1909 1910 M:85:2d3 … … 1916 1917 W:5:0:4:130 1917 1918 A:100:10 to 35 1918 M:7 0:2d31919 M:75:2d3 1919 1920 F:EASY_KNOW 1920 1921 E:CURE_CRITICAL … … 1949 1950 W:0:0:4:0 1950 1951 A:50:0 to 10 1952 M:70:2d3 1953 P:0:3d4:0:0:0 1951 1954 F:EASY_KNOW 1952 1955 E:PARALYZE … … 1956 1959 I:75:7:0 1957 1960 W:0:0:4:0 1961 M:70:2d3 1958 1962 A:50:0 to 10 1959 P:0: 1d1:0:0:01963 P:0:3d4:0:0:0 1960 1964 F:EASY_KNOW 1961 1965 E:BLIND … … 1965 1969 I:75:9:50 1966 1970 W:0:0:4:0 1971 M:70:2d3 1967 1972 A:50:0 to 10 1968 P:0: 1d1:0:0:01973 P:0:3d4:0:0:0 1969 1974 F:EASY_KNOW 1970 1975 E:CONFUSE … … 1974 1979 I:75:6:0 1975 1980 W:3:0:4:0 1981 M:70:2d3 1976 1982 A:50:0 to 10 1977 P:0: 1d1:0:0:01983 P:0:3d4:0:0:0 1978 1984 F:EASY_KNOW 1979 1985 E:POISON … … 1985 1991 W:1:0:4:75 1986 1992 A:100:1 to 100 1987 P:0:1d1:0:0:01988 1993 F:EASY_KNOW 1989 1994 E:HASTE … … 1993 1998 I:75:4:50 1994 1999 W:1:0:4:0 2000 M:70:2d3 1995 2001 A:50:0 to 10 1996 P:0: 1d1:0:0:02002 P:0:3d4:0:0:0 1997 2003 F:EASY_KNOW 1998 2004 E:SLOW … … 2003 2009 W:30:0:4:8000 2004 2010 A:80:30 to 90 2005 P:0:1d1:0:0:02006 2011 F:EASY_KNOW 2007 2012 E:GAIN_DEX … … 2012 2017 W:25:0:4:300 2013 2018 A:75:20 to 60 2014 P:0:1d1:0:0:02015 2019 F:EASY_KNOW 2016 2020 E:RESTORE_DEX … … 2021 2025 W:25:0:4:300 2022 2026 A:75:21 to 60 2023 P:0:1d1:0:0:02024 2027 F:EASY_KNOW 2025 2028 E:RESTORE_CON … … 2030 2033 W:10:0:4:0 2031 2034 A:50:10 to 15 2032 P:0:1d1:0:0:02033 2035 F:EASY_KNOW 2034 2036 E:LOSE_EXP … … 2038 2040 I:75:5:0 2039 2041 W:0:0:4:0 2042 M:100:1d2 2040 2043 A:20:3 to 15 2041 P:0:1d1:0:0:02042 2044 F:EASY_KNOW 2043 2045 E:DRINK_SALT … … 2048 2050 W:25:0:4:800 2049 2051 A:100:25 to 100 2050 P:0:1d1:0:0:02051 2052 F:EASY_KNOW 2052 2053 E:ENLIGHTENMENT … … 2057 2058 W:1:0:4:35 2058 2059 A:100:1 to 100 2059 P:0:1d1:0:0:02060 2060 F:EASY_KNOW 2061 2061 E:HERO … … 2066 2066 W:3:0:4:100 2067 2067 A:100:3 to 100 2068 P:0:1d1:0:0:02069 2068 F:EASY_KNOW 2070 2069 E:SHERO … … 2075 2074 W:1:0:4:10 2076 2075 A:100:1 to 100 2077 P:0:1d1:0:0:02078 2076 F:EASY_KNOW 2079 2077 E:CURE_PARANOIA … … 2084 2082 W:40:0:4:400 2085 2083 A:100:40 to 100 2086 P:0:1d1:0:0:02087 2084 F:EASY_KNOW 2088 2085 E:RESTORE_EXP … … 2093 2090 W:1:0:4:30 2094 2091 A:100:1 to 100 2095 P:0:1d1:0:0:02096 2092 F:EASY_KNOW 2097 2093 E:RESIST_FIRE … … 2102 2098 W:1:0:4:30 2103 2099 A:100:1 to 100 2104 P:0:1d1:0:0:02105 2100 F:EASY_KNOW 2106 2101 E:RESIST_COLD … … 2111 2106 W:3:0:4:50 2112 2107 A:100:3 to 25 2113 P:0:1d1:0:0:02114 2108 F:EASY_KNOW 2115 2109 E:TMD_SINVIS … … 2122 2116 W:5:0:4:75 2123 2117 A:100:1 to 35 2124 P:0:1d1:0:0:02125 2118 F:EASY_KNOW 2126 2119 E:CURE_POISON … … 2131 2124 W:25:0:4:350 2132 2125 A:100:25 to 100 2133 P:0:1d1:0:0:02134 2126 F:EASY_KNOW 2135 2127 E:RESTORE_MANA … … 2140 2132 W:3:0:4:20 2141 2133 A:100:3 to 25 2142 P:0:1d1:0:0:02143 2134 F:EASY_KNOW 2144 2135 E:TMD_INFRA trunk/src/attack.c
r522 r567 984 984 985 985 /* Hack -- Base damage from thrown object */ 986 tdam = damroll(i_ptr->dd, i_ptr->ds) + i_ptr->to_d; 986 tdam = damroll(i_ptr->dd, i_ptr->ds); 987 if (!tdam) tdam = 1; 988 tdam += i_ptr->to_d; 987 989 988 990 /* Chance of hitting */ trunk/src/cmd-obj.c
r556 r567 72 72 object_info_header(o_ptr); 73 73 if (!object_info_known(o_ptr)) 74 text_out(" This item does not seem to possess any special abilities.");74 text_out("\n\nThis item does not seem to possess any special abilities."); 75 75 76 76 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); trunk/src/cmd4.c
r556 r567 1237 1237 object_info_header(o_ptr); 1238 1238 if (!object_info_known(o_ptr)) 1239 text_out(" This item does not seem to possess any special abilities.");1239 text_out("\n\nThis item does not seem to possess any special abilities."); 1240 1240 1241 1241 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); … … 1602 1602 object_info_header(o_ptr); 1603 1603 if (!object_info_known(o_ptr)) 1604 text_out(" This item does not seem to possess any special abilities.");1604 text_out("\n\nThis item does not seem to possess any special abilities."); 1605 1605 1606 1606 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); trunk/src/externs.h
r556 r567 396 396 extern bool object_info_known(const object_type *o_ptr); 397 397 extern bool object_info_full(const object_type *o_ptr); 398 extern bool object_info_store(const object_type *o_ptr); 398 399 399 400 /* object1.c */ trunk/src/obj-info.c
r556 r567 68 68 static void output_desc_list(cptr intro, cptr list[], int n) 69 69 { 70 if (n != 0) 71 { 72 /* Output intro */ 73 p_text_out(intro); 74 75 /* Output list */ 76 output_list(list, n); 77 78 /* Output end */ 79 text_out(". "); 80 } 70 if (!n) return; 71 72 p_text_out(intro); 73 output_list(list, n); 74 text_out(". "); 81 75 } 82 76 … … 185 179 * Describe combat advantages. 186 180 */ 187 static bool describe_combat(const object_type *o_ptr, u32b f1)181 static bool describe_combat(const object_type *o_ptr, bool full) 188 182 { 189 183 cptr desc[15]; … … 193 187 object_type *j_ptr = &inventory[INVEN_BOW]; 194 188 189 u32b f1, f2, f3; 190 195 191 bool weapon = (wield_slot(o_ptr) == INVEN_WIELD); 196 192 bool ammo = (p_ptr->ammo_tval == o_ptr->tval) && … … 198 194 199 195 /* Abort if we've nothing to say */ 200 if (!weapon && !ammo) return FALSE; 201 196 if (!weapon && !ammo) 197 { 198 /* Potions can have special text */ 199 if (o_ptr->tval != TV_POTION) return FALSE; 200 if (!o_ptr->dd || !o_ptr->ds) return FALSE; 201 if (!object_known_p(o_ptr)) return FALSE; 202 203 p_text_out("It can be thrown at monsters with damaging effect. "); 204 return TRUE; 205 } 206 207 if (full) 208 object_flags(o_ptr, &f1, &f2, &f3); 209 else 210 object_flags_known(o_ptr, &f1, &f2, &f3); 202 211 203 212 … … 520 529 * Describe an object's activation, if any. 521 530 */ 522 static bool describe_activation(const object_type *o_ptr, u32b f3 )531 static bool describe_activation(const object_type *o_ptr, u32b f3, bool full) 523 532 { 524 533 const object_kind *k_ptr = &k_info[o_ptr->k_idx]; … … 530 539 { 531 540 const artifact_type *a_ptr = &a_info[o_ptr->name1]; 532 if (!object_known_p(o_ptr) ) return FALSE;541 if (!object_known_p(o_ptr) && !full) return FALSE; 533 542 534 543 effect = a_ptr->effect; … … 539 548 else 540 549 { 541 if (!object_aware_p(o_ptr)) return FALSE;550 if (!object_aware_p(o_ptr) && !full) return FALSE; 542 551 543 552 effect = k_ptr->effect; … … 601 610 } 602 611 603 /* No activation */ 604 return (FALSE); 612 return TRUE; 605 613 } 606 614 … … 684 692 * Output object information 685 693 */ 686 bool object_info_out(const object_type *o_ptr, 687 void (*flags)(const object_type *, u32b *, u32b *, u32b *)) 694 static bool object_info_out(const object_type *o_ptr, bool full) 688 695 { 689 696 u32b f1, f2, f3; … … 691 698 692 699 /* Grab the object flags */ 693 flags(o_ptr, &f1, &f2, &f3); 694 695 696 /* New para */ 697 new_paragraph = TRUE; 698 699 /* Describe boring bits */ 700 if ((o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) && 701 o_ptr->pval) 702 { 703 p_text_out("It provides nourishment for about "); 704 text_out_c(TERM_L_GREEN, "%d", o_ptr->pval / 2); 705 text_out(" turns under normal conditions. "); 706 } 707 708 709 /* Describe combat bits */ 710 new_paragraph = TRUE; 711 if (describe_combat(o_ptr, f1)) something = TRUE; 700 if (full) 701 object_flags(o_ptr, &f1, &f2, &f3); 702 else 703 object_flags_known(o_ptr, &f1, &f2, &f3); 712 704 713 705 /* Describe other bits */ … … 717 709 if (describe_sustains(o_ptr, f2)) something = TRUE; 718 710 if (describe_misc_magic(o_ptr, f3)) something = TRUE; 719 if (describe_activation(o_ptr, f3 )) something = TRUE;711 if (describe_activation(o_ptr, f3, full)) something = TRUE; 720 712 if (describe_ignores(o_ptr, f3)) something = TRUE; 721 713 … … 785 777 bool has_info = FALSE; 786 778 787 has_info = object_info_out(o_ptr, object_flags_known); 779 has_info = object_info_out(o_ptr, FALSE); 780 781 /* Describe boring bits */ 782 if ((o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) && 783 o_ptr->pval) 784 { 785 p_text_out("It provides nourishment for about "); 786 text_out_c(TERM_L_GREEN, "%d", o_ptr->pval / 2); 787 text_out(" turns under normal conditions. "); 788 has_info = TRUE; 789 } 790 791 new_paragraph = TRUE; 792 if (!object_known_p(o_ptr)) 793 { 794 p_text_out("You do not know the full extent of this item's powers."); 795 has_info = TRUE; 796 } 797 798 /* Describe combat bits */ 799 new_paragraph = TRUE; 800 if (describe_combat(o_ptr, FALSE)) has_info = TRUE; 788 801 789 802 new_paragraph = TRUE; 790 803 if (describe_origin(o_ptr)) has_info = TRUE; 791 804 805 return has_info; 806 } 807 808 bool object_info_full(const object_type *o_ptr) 809 { 810 return object_info_out(o_ptr, TRUE); 811 } 812 813 bool object_info_store(const object_type *o_ptr) 814 { 815 bool has_info = FALSE; 816 817 has_info = object_info_out(o_ptr, TRUE); 818 819 /* Describe boring bits */ 820 if ((o_ptr->tval == TV_FOOD || o_ptr->tval == TV_POTION) && 821 o_ptr->pval) 822 { 823 p_text_out("It provides nourishment for about "); 824 text_out_c(TERM_L_GREEN, "%d", o_ptr->pval / 2); 825 text_out(" turns under normal conditions. "); 826 has_info = TRUE; 827 } 828 792 829 new_paragraph = TRUE; 793 if (!object_known_p(o_ptr)) 794 { 795 p_text_out("You do not know the full extent of this item's powers."); 796 has_info = TRUE; 797 } 830 if (describe_combat(o_ptr, TRUE)) has_info = TRUE; 798 831 799 832 return has_info; 800 833 } 801 802 bool object_info_full(const object_type *o_ptr)803 {804 return object_info_out(o_ptr, object_flags);805 }trunk/src/store.c
r559 r567 2316 2316 Term_erase(0, 0, 255); 2317 2317 Term_gotoxy(0, 0); 2318 object_info_full(o_ptr); 2318 2319 text_out_hook = text_out_to_screen; 2320 screen_save(); 2321 2322 object_info_header(o_ptr); 2323 if (!object_info_store(o_ptr)) 2324 text_out("\n\nThis item does not seem to possess any special abilities."); 2325 2326 text_out_c(TERM_L_BLUE, "\n\n[Press any key to continue]\n"); 2327 (void)anykey(); 2328 2329 screen_load(); 2319 2330 2320 2331 /* Hack -- Browse book, then prompt for a command */
