diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-03-07 16:55:42 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-03-07 16:55:42 +0100 |
commit | 99a0478c7a943290ab4350d64688682dbb615f24 (patch) | |
tree | a565a0f4bba73f9019f57db5ff2c5d7e38d33316 /src/object2.cc | |
parent | 1dff4ac4fe5325ab8a2ac630d5211a5474e6a77b (diff) |
Convert object-related macros from defines.h into functions
Diffstat (limited to 'src/object2.cc')
-rw-r--r-- | src/object2.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/object2.cc b/src/object2.cc index 895b0a9b..c5f4fa44 100644 --- a/src/object2.cc +++ b/src/object2.cc @@ -823,6 +823,17 @@ void object_known(object_type *o_ptr) +/* + * Determine if a given inventory item is "known" + * Test One -- Check for special "known" tag + * Test Two -- Check for "Easy Know" + "Aware" + */ +extern bool object_known_p(object_type const *o_ptr) +{ + return ((o_ptr->ident & (IDENT_KNOWN)) || + (k_info[o_ptr->k_idx].easy_know && k_info[o_ptr->k_idx].aware)); +} + /* @@ -834,6 +845,13 @@ void object_aware(object_type *o_ptr) k_info[o_ptr->k_idx].aware = TRUE; } +/** + * Is the player aware of the effects of the given object? + */ +bool object_aware_p(object_type const *o_ptr) +{ + return k_info[o_ptr->k_idx].aware; +} /* @@ -846,6 +864,14 @@ void object_tried(object_type *o_ptr) } +/** + * Has the given object been "tried"? + */ +bool object_tried_p(object_type const *o_ptr) +{ + return k_info[o_ptr->k_idx].tried; +} + /* * Return the "value" of an "unknown" item |