Changeset 676
- Timestamp:
- 02/01/08 04:41:56 (8 months ago)
- Files:
-
- trunk/src/angband.h (modified) (1 diff)
- trunk/src/defines.h (modified) (1 diff)
- trunk/src/dungeon.c (modified) (2 diffs)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/obj-desc.c (modified) (2 diffs)
- trunk/src/obj-make.c (modified) (4 diffs)
- trunk/src/object.h (modified) (3 diffs)
- trunk/src/squelch.c (modified) (1 diff)
- trunk/src/tables.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/angband.h
r610 r676 38 38 #include "ui.h" 39 39 #include "z-type.h" 40 #include "object.h" 40 41 #include "externs.h" 41 #include "object.h"42 42 43 43 trunk/src/defines.h
r655 r676 1708 1708 1709 1709 /* 1710 * The special inscriptions.1711 */1712 #define INSCRIP_NULL 01713 #define INSCRIP_TERRIBLE 11714 #define INSCRIP_WORTHLESS 21715 #define INSCRIP_CURSED 31716 #define INSCRIP_BROKEN 41717 #define INSCRIP_AVERAGE 51718 #define INSCRIP_GOOD 61719 #define INSCRIP_EXCELLENT 71720 #define INSCRIP_SPECIAL 81721 #define INSCRIP_UNCURSED 91722 #define INSCRIP_INDESTRUCTIBLE 101723 1724 /*1725 * Number of special inscriptions, plus one.1726 */1727 #define MAX_INSCRIP 111728 1729 1730 /*1731 1710 * Some bit-flags for the "smart" field of "monster_type". 1732 1711 * trunk/src/dungeon.c
r669 r676 21 21 22 22 23 /*24 * Return a "feeling" (or NULL) about an item. Method 1 (Heavy).25 */26 int value_check_aux1(const object_type *o_ptr)27 {28 /* Artifacts */29 if (artifact_p(o_ptr))30 {31 /* Cursed/Broken */32 if (cursed_p(o_ptr) || broken_p(o_ptr)) return (INSCRIP_TERRIBLE);33 34 /* Normal */35 return (INSCRIP_SPECIAL);36 }37 38 /* Ego-Items */39 if (ego_item_p(o_ptr))40 {41 /* Cursed/Broken */42 if (cursed_p(o_ptr) || broken_p(o_ptr)) return (INSCRIP_WORTHLESS);43 44 /* Normal */45 return (INSCRIP_EXCELLENT);46 }47 48 /* Cursed items */49 if (cursed_p(o_ptr)) return (INSCRIP_CURSED);50 51 /* Broken items */52 if (broken_p(o_ptr)) return (INSCRIP_BROKEN);53 54 /* Good "armor" bonus */55 if (o_ptr->to_a > 0) return (INSCRIP_GOOD);56 57 /* Good "weapon" bonus */58 if (o_ptr->to_h + o_ptr->to_d > 0) return (INSCRIP_GOOD);59 60 /* Default to "average" */61 return (INSCRIP_AVERAGE);62 }63 64 65 /*66 * Return a "feeling" (or NULL) about an item. Method 2 (Light).67 */68 static int value_check_aux2(const object_type *o_ptr)69 {70 /* Cursed items (all of them) */71 if (cursed_p(o_ptr)) return (INSCRIP_CURSED);72 73 /* Broken items (all of them) */74 if (broken_p(o_ptr)) return (INSCRIP_BROKEN);75 76 /* Artifacts -- except cursed/broken ones */77 if (artifact_p(o_ptr)) return (INSCRIP_GOOD);78 79 /* Ego-Items -- except cursed/broken ones */80 if (ego_item_p(o_ptr)) return (INSCRIP_GOOD);81 82 /* Good armor bonus */83 if (o_ptr->to_a > 0) return (INSCRIP_GOOD);84 85 /* Good weapon bonuses */86 if (o_ptr->to_h + o_ptr->to_d > 0) return (INSCRIP_GOOD);87 88 /* No feeling */89 return (0);90 }91 92 93 23 94 24 /* … … 192 122 193 123 /* Check for a feeling */ 194 feel = (heavy ? value_check_aux1(o_ptr) : value_check_aux2(o_ptr));124 feel = (heavy ? object_pseudo_heavy(o_ptr) : object_pseudo_light(o_ptr)); 195 125 196 126 /* Skip non-feelings */ trunk/src/externs.h
r671 r676 75 75 extern cptr stat_names_full[A_MAX]; 76 76 extern const char *window_flag_desc[32]; 77 extern c ptr inscrip_text[MAX_INSCRIP];77 extern const char *inscrip_text[]; 78 78 extern const grouper object_text_order[]; 79 79 extern const byte store_choices[MAX_STORES-2][STORE_CHOICES][2]; trunk/src/obj-desc.c
r668 r676 713 713 * OD_FULL -- Rings of Death [1,+3] (+2 to Stealth) {nifty} (squelch) 714 714 */ 715 size_t object_desc(char *buf, size_t max, const object_type *o_ptr, bool prefix, int mode)715 size_t object_desc(char *buf, size_t max, const object_type *o_ptr, bool prefix, odesc_detail_t mode) 716 716 { 717 717 object_kind *k_ptr = &k_info[o_ptr->k_idx]; … … 801 801 * player isn't meant to know. 802 802 */ 803 void object_desc_spoil(char *buf, size_t max, const object_type *o_ptr, int pref, int mode)803 void object_desc_spoil(char *buf, size_t max, const object_type *o_ptr, int pref, odesc_detail_t mode) 804 804 { 805 805 object_type object_type_body; trunk/src/obj-make.c
r653 r676 94 94 /* Occasional level boost */ 95 95 if ((level > 0) && one_in_(GREAT_OBJ)) 96 { 97 /* What a bizarre calculation */ 98 level = 1 + (level * MAX_O_DEPTH / randint(MAX_O_DEPTH)); 96 { 97 /* What a bizarre calculation */ 98 level = 1 + (level * MAX_O_DEPTH / randint(MAX_O_DEPTH)); 99 99 } 100 100 … … 534 534 535 535 /* Cursed (if "bad") */ 536 if (o_ptr->to_h +o_ptr->to_d < 0)537 o_ptr->flags3 |= TR3_LIGHT_CURSE;536 if (o_ptr->to_h < 0 || o_ptr->to_d < 0) 537 o_ptr->flags3 |= TR3_LIGHT_CURSE; 538 538 } 539 539 … … 1688 1688 1689 1689 k_idx = lookup_kind(TV_GOLD, sval); 1690 1690 1691 1691 /* Prepare a gold object */ 1692 1692 object_prep(j_ptr, k_idx); … … 1702 1702 } 1703 1703 1704 1704 /* 1705 * Return a "feeling" (or NULL) about an item. Method 1 (Heavy). 1706 */ 1707 int object_pseudo_heavy(const object_type *o_ptr) 1708 { 1709 if (artifact_p(o_ptr)) 1710 { 1711 if (cursed_p(o_ptr) || broken_p(o_ptr)) 1712 return INSCRIP_TERRIBLE; 1713 else 1714 return INSCRIP_SPECIAL; 1715 } 1716 1717 if (ego_item_p(o_ptr)) 1718 { 1719 if (cursed_p(o_ptr) || broken_p(o_ptr)) 1720 return INSCRIP_WORTHLESS; 1721 else 1722 return INSCRIP_EXCELLENT; 1723 } 1724 1725 if (cursed_p(o_ptr)) 1726 return INSCRIP_CURSED; 1727 else if (broken_p(o_ptr)) 1728 return INSCRIP_BROKEN; 1729 else if (o_ptr->to_a > 0 || (o_ptr->to_h + o_ptr->to_d > 0)) 1730 return INSCRIP_GOOD; 1731 1732 /* Default to "average" */ 1733 return (INSCRIP_AVERAGE); 1734 } 1735 1736 1737 1738 /* 1739 * Return a "feeling" (or NULL) about an item. Method 2 (Light). 1740 */ 1741 int object_pseudo_light(const object_type *o_ptr) 1742 { 1743 /* Cursed items (all of them) */ 1744 if (cursed_p(o_ptr)) return (INSCRIP_CURSED); 1745 1746 /* Broken items (all of them) */ 1747 if (broken_p(o_ptr)) return (INSCRIP_BROKEN); 1748 1749 /* Artifacts -- except cursed/broken ones */ 1750 if (artifact_p(o_ptr)) return (INSCRIP_GOOD); 1751 1752 /* Ego-Items -- except cursed/broken ones */ 1753 if (ego_item_p(o_ptr)) return (INSCRIP_GOOD); 1754 1755 /* Good armor bonus */ 1756 if (o_ptr->to_a > 0) return (INSCRIP_GOOD); 1757 1758 /* Good weapon bonuses */ 1759 if (o_ptr->to_h + o_ptr->to_d > 0) return (INSCRIP_GOOD); 1760 1761 /* No feeling */ 1762 return (0); 1763 } 1764 trunk/src/object.h
r668 r676 16 16 * Modes for object_desc(). 17 17 */ 18 enum18 typedef enum 19 19 { 20 ODESC_BASE = 0, /** Only describe the base name */ 21 ODESC_COMBAT = 1, /** Also show combat bonuses */ 22 ODESC_FULL = 3, /** Show entire description */ 23 ODESC_STORE = 4 /** Also show {squelch} marker */ 24 }; 20 ODESC_BASE = 0, /*!< Only describe the base name */ 21 ODESC_COMBAT = 1, /*!< Also show combat bonuses */ 22 ODESC_FULL = 3, /*!< Show entire description */ 23 ODESC_STORE = 4 /*!< Also show {squelch} marker */ 24 } odesc_detail_t; 25 26 27 /** 28 * Pseudo-ID markers. 29 */ 30 typedef enum 31 { 32 INSCRIP_NULL = 0, /*!< No pseudo-ID status */ 33 INSCRIP_TERRIBLE = 1, /*!< Cursed artifact */ 34 INSCRIP_WORTHLESS = 2, /*!< Worthless item */ 35 INSCRIP_CURSED = 3, /*!< Cursed normal item */ 36 INSCRIP_BROKEN = 4, /*!< Cursed ego-item */ 37 INSCRIP_AVERAGE = 5, /*!< Item with no interesting features */ 38 INSCRIP_GOOD = 6, /*!< Item with some combat bonuses */ 39 INSCRIP_EXCELLENT = 7, /*!< Ego-item */ 40 INSCRIP_SPECIAL = 8, /*!< Artifact */ 41 INSCRIP_UNCURSED = 9, /*!< Item previous cursed, now uncursed */ 42 INSCRIP_INDESTRUCTIBLE = 10, /*!< Artifact that was tried to be destroyed */ 43 44 INSCRIP_MAX /*!< Maximum number of pseudo-ID markers */ 45 } obj_pseudo_t; 46 47 25 48 26 49 … … 29 52 /* obj-desc.c */ 30 53 void object_kind_name(char *buf, size_t max, int k_idx, bool easy_know); 31 size_t object_desc(char *buf, size_t max, const object_type *o_ptr, bool prefix, int mode);32 void object_desc_spoil(char *buf, size_t max, const object_type *o_ptr, int pref, int mode);54 size_t object_desc(char *buf, size_t max, const object_type *o_ptr, bool prefix, odesc_detail_t mode); 55 void object_desc_spoil(char *buf, size_t max, const object_type *o_ptr, int pref, odesc_detail_t mode); 33 56 34 57 /* obj-info.c */ … … 45 68 bool make_object(object_type *j_ptr, int lev, bool good, bool great); 46 69 bool make_gold(object_type *j_ptr, int lev); 70 int object_pseudo_heavy(const object_type *o_ptr); 71 int object_pseudo_light(const object_type *o_ptr); 47 72 48 73 /* obj-ui.c */ trunk/src/squelch.c
r653 r676 341 341 bool fullid = object_known_p(o_ptr); 342 342 bool sensed = (o_ptr->ident & IDENT_SENSE) || fullid; 343 byte feel = fullid ? value_check_aux1(o_ptr) : o_ptr->pseudo;343 byte feel = fullid ? object_pseudo_heavy(o_ptr) : o_ptr->pseudo; 344 344 345 345 trunk/src/tables.c
r543 r676 1399 1399 1400 1400 1401 c ptr inscrip_text[MAX_INSCRIP] =1401 const char *inscrip_text[] = 1402 1402 { 1403 1403 NULL,
