Angband
Enumerations | Functions | Variables
obj-identify.h File Reference

Object identification and knowledge routines. More...

Go to the source code of this file.

Enumerations

enum  obj_pseudo_t {
  INSCRIP_NULL = 0, INSCRIP_STRANGE = 1, INSCRIP_AVERAGE = 2, INSCRIP_MAGICAL = 3,
  INSCRIP_SPLENDID = 4, INSCRIP_EXCELLENT = 5, INSCRIP_SPECIAL = 6, INSCRIP_UNKNOWN = 7,
  INSCRIP_MAX
}
 Pseudo-ID markers. More...

Functions

bool easy_know (const struct object *obj)
 
Object knowledge predicates

These answer questions about an object's ID status


bool object_all_but_flavor_is_known (const struct object *obj)
 Is the player aware of all of an object's miscellaneous proerties?
bool object_is_known (const struct object *obj)
bool object_is_known_artifact (const struct object *obj)
bool object_is_known_not_artifact (const struct object *obj)
bool object_was_worn (const struct object *obj)
bool object_flavor_is_aware (const struct object *obj)
bool object_flavor_was_tried (const struct object *obj)
bool object_effect_is_known (const struct object *obj)
bool object_name_is_visible (const struct object *obj)
bool object_ego_is_visible (const struct object *obj)
bool object_attack_plusses_are_visible (const struct object *obj)
bool object_defence_plusses_are_visible (const struct object *obj)
bool object_flag_is_known (const struct object *obj, int flag)
bool object_element_is_known (const struct object *obj, int element)
bool object_this_mod_is_visible (const struct object *obj, int mod)
bool object_check_for_ident (struct object *obj)
 Checks for additional knowledge implied by what the player already knows.
void object_flavor_aware (struct object *obj)
 Mark an object's flavour as as one the player is aware of.
void object_flavor_tried (struct object *obj)
 Mark an object's flavour as tried.
void object_know_all_but_flavor (struct object *obj)
 Make the player aware of all of an object' properties except flavor.
void object_notice_everything (struct object *obj)
 Mark as object as fully known, a.k.a identified.
void object_notice_ego (struct object *obj)
 Notice the ego on an ego item.
void object_notice_effect (struct object *obj)
 Notice the "effect" from activating an object.
void object_notice_attack_plusses (struct object *obj)
bool object_notice_element (struct object *obj, int element)
 Notice elemental resistance properties for an element on an object.
bool object_notice_flag (struct object *obj, int flag)
 Notice a single flag - returns TRUE if anything new was learned.
bool object_notice_flags (struct object *obj, bitflag flags[OF_SIZE])
 Notice a set of flags - returns TRUE if anything new was learned.
bool object_notice_curses (struct object *obj)
 Notice curses on an object.
void object_notice_on_firing (struct object *obj)
void object_notice_on_wield (struct object *obj)
 Notice object properties that become obvious on wielding or wearing.
void equip_notice_on_defend (struct player *p)
 
Equipment knowledge improvers

These add to the player's knowledge of objects in their equipment


void equip_notice_flag (struct player *p, int flag)
 Notice a given special flag on wielded items.
void equip_notice_element (struct player *p, int element)
 Notice the elemental resistance properties on wielded items.
void equip_notice_to_hit_on_attack (struct player *p)
 Notice to-hit bonus on attacking.
void equip_notice_on_attack (struct player *p)
 Notice things which happen on attacking.
bool object_high_resist_is_possible (const struct object *obj)
 
Other functions that either need a rethink, or will change in the move

to "rune-based" ID


bool object_was_sensed (const struct object *obj)
void object_notice_sensing (struct object *obj)
 Mark an object as sensed (kind of).
void object_sense_artifact (struct object *obj)
 Sense artifacts.
obj_pseudo_t object_pseudo (const struct object *obj)
 Given an object, return a short identifier which gives some idea of what the item is.
void do_ident_item (struct object *obj)
 Identify an item.
void sense_inventory (void)
 Sense the inventory.

Variables

s32b object_last_wield
 Time last item was wielded.

Detailed Description

Object identification and knowledge routines.

Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke Copyright (c) 2009 Brian Bull

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Enumeration Type Documentation

Pseudo-ID markers.

Enumerator:
INSCRIP_NULL 

No pseudo-ID status

INSCRIP_STRANGE 

Item that has mixed combat bonuses

INSCRIP_AVERAGE 

Item with no interesting features

INSCRIP_MAGICAL 

Item with combat bonuses

INSCRIP_SPLENDID 

Obviously good item

INSCRIP_EXCELLENT 

Ego-item

INSCRIP_SPECIAL 

Artifact

INSCRIP_UNKNOWN 
INSCRIP_MAX 

Maximum number of pseudo-ID markers

Function Documentation

void do_ident_item ( struct object obj)
bool easy_know ( const struct object obj)


Object knowledge predicates

These answer questions about an object's ID status

Returns
whether an object counts as "known" due to EASY_KNOW status

References object_kind::aware, FALSE, kf_has, object::kind, object_kind::kind_flags, and TRUE.

Referenced by object_effect_is_known(), object_element_is_known(), object_flag_is_known(), object_flags_known(), and object_notice_on_wield().

void equip_notice_element ( struct player p,
int  element 
)
void equip_notice_flag ( struct player p,
int  flag 
)
void equip_notice_on_attack ( struct player p)

Notice things which happen on attacking.

Does not apply to weapon or bow which should be done separately

References player::body, player_body::count, i, object_notice_attack_plusses(), slot_by_name(), and slot_object().

Referenced by py_attack_real().

void equip_notice_on_defend ( struct player p)


Equipment knowledge improvers

These add to the player's knowledge of objects in their equipment

Notice things which happen on defending.

References player::body, player_body::count, EVENT_EQUIPMENT, EVENT_INVENTORY, event_signal(), i, object_notice_defence_plusses(), and slot_object().

Referenced by check_hit().

void equip_notice_to_hit_on_attack ( struct player p)

Notice to-hit bonus on attacking.

Used e.g. for ranged attacks where the item's to_d is not involved. Does not apply to weapon or bow which should be done separately

References player::body, player_body::count, i, object_notice_attack_plusses(), slot_by_name(), slot_object(), and object::to_h.

Referenced by ranged_helper().

bool object_all_but_flavor_is_known ( const struct object obj)

Is the player aware of all of an object's miscellaneous proerties?

Parameters
objis the object

References FALSE, object_all_brands_and_slays_are_known(), object_all_elements_are_known(), object_all_flags_are_known(), object_all_miscellaneous_are_known(), and TRUE.

Referenced by object_info_out(), object_is_known(), and object_value_base().

bool object_attack_plusses_are_visible ( const struct object obj)
bool object_check_for_ident ( struct object obj)
bool object_defence_plusses_are_visible ( const struct object obj)
Returns
whether the object's defence bonuses are known

References FALSE, object::id_flags, id_has, and TRUE.

Referenced by calc_bonuses(), ignore_level_of(), obj_desc_combat(), object_check_for_ident(), object_notice_defence_plusses(), and object_value().

bool object_effect_is_known ( const struct object obj)
Returns
whether the player is aware of the object's effect when used

References easy_know(), FALSE, object::id_flags, id_has, object::kind, and TRUE.

Referenced by effects_power(), equip_notice_after_time(), obj_known_effect(), object_check_for_ident(), and show_obj_list().

bool object_ego_is_visible ( const struct object obj)
Returns
whether both the object is both an ego and the player knows it is

References object::ego, FALSE, object::id_flags, id_has, and TRUE.

Referenced by describe_flavor_text(), obj_desc_name(), object_is_ignored(), and textui_cmd_ignore_menu().

bool object_element_is_known ( const struct object obj,
int  element 
)
Returns
whether the player knows the given element properties of an object

References easy_know(), object::el_info, EL_INFO_KNOWN, ELEM_MAX, FALSE, element_info::flags, and TRUE.

Referenced by calc_bonuses(), and display_resistance_panel().

bool object_flag_is_known ( const struct object obj,
int  flag 
)
Returns
whether the player knows whether an object has a given flag

References easy_know(), FALSE, object::known_flags, of_has, and TRUE.

Referenced by display_player_sust_info(), display_resistance_panel(), and store_will_buy().

void object_flavor_aware ( struct object obj)
bool object_flavor_is_aware ( const struct object obj)
void object_flavor_tried ( struct object obj)

Mark an object's flavour as tried.

Parameters
objis the object whose flavour should be marked

References object::kind, object_kind::tried, and TRUE.

Referenced by object_notice_on_wield(), and use_aux().

bool object_flavor_was_tried ( const struct object obj)
Returns
whether the player has tried to use other objects of the same kind

References object::kind, and object_kind::tried.

Referenced by obj_desc_inscrip().

bool object_high_resist_is_possible ( const struct object obj)


Other functions that either need a rethink, or will change in the move

to "rune-based" ID

Returns
whether it is possible an object has a high resist given the player's current knowledge

References object::el_info, EL_INFO_KNOWN, ELEM_HIGH_MAX, ELEM_HIGH_MIN, FALSE, element_info::flags, i, element_info::res_level, and TRUE.

Referenced by ignore_level_of().

bool object_is_known ( const struct object obj)
bool object_is_known_artifact ( const struct object obj)
Returns
whether the object is known to be an artifact

References object::artifact, object::id_flags, and id_has.

Referenced by artifact_is_known(), and compare_items().

bool object_is_known_not_artifact ( const struct object obj)
Returns
whether the object is known to not be an artifact

References object::artifact, object::id_flags, and id_has.

Referenced by ignore_level_of(), object_is_ignored(), and textui_cmd_ignore_menu().

void object_know_all_but_flavor ( struct object obj)

Make the player aware of all of an object' properties except flavor.

Parameters
objis the object to mark

References object_know_all_elements(), object_know_all_flags(), object_know_all_miscellaneous(), and object_know_brands_and_slays().

Referenced by desc_art_fake(), desc_obj_fake(), object_info_ego(), object_notice_everything(), spoil_artifact(), store_create_item(), and store_create_random().

bool object_name_is_visible ( const struct object obj)
Returns
whether any ego or artifact name is available to the player

References object::artifact, object::ego, FALSE, object::id_flags, id_has, and TRUE.

Referenced by gear_object_for_use(), obj_desc_name(), obj_desc_name_prefix(), and object_list_format_name().

void object_notice_attack_plusses ( struct object obj)
bool object_notice_curses ( struct object obj)
void object_notice_effect ( struct object obj)

Notice the "effect" from activating an object.

Parameters
objis the object to become aware of

References object_add_id_flag(), object_check_for_ident(), object_flavor_aware(), and object_flavor_is_aware().

Referenced by use_aux().

void object_notice_ego ( struct object obj)
bool object_notice_element ( struct object obj,
int  element 
)

Notice elemental resistance properties for an element on an object.

References object::el_info, EL_INFO_KNOWN, ELEM_MAX, EVENT_EQUIPMENT, EVENT_INVENTORY, event_signal(), FALSE, element_info::flags, object_check_for_ident(), and TRUE.

Referenced by equip_notice_element().

void object_notice_everything ( struct object obj)
bool object_notice_flag ( struct object obj,
int  flag 
)

Notice a single flag - returns TRUE if anything new was learned.

References EVENT_EQUIPMENT, EVENT_INVENTORY, event_signal(), FALSE, object::known_flags, object_check_for_ident(), of_has, of_on, and TRUE.

Referenced by equip_notice_after_time(), and equip_notice_flag().

bool object_notice_flags ( struct object obj,
bitflag  flags[OF_SIZE] 
)

Notice a set of flags - returns TRUE if anything new was learned.

References EVENT_EQUIPMENT, EVENT_INVENTORY, event_signal(), FALSE, flags, object::known_flags, object_check_for_ident(), of_is_subset, of_union, and TRUE.

Referenced by object_notice_curses().

void object_notice_on_firing ( struct object obj)
void object_notice_on_wield ( struct object obj)
void object_notice_sensing ( struct object obj)
obj_pseudo_t object_pseudo ( const struct object obj)
void object_sense_artifact ( struct object obj)
bool object_this_mod_is_visible ( const struct object obj,
int  mod 
)
bool object_was_sensed ( const struct object obj)
bool object_was_worn ( const struct object obj)
Returns
whether the object has been worn/wielded

References FALSE, object::id_flags, id_has, and TRUE.

Referenced by ignore_level_of(), obj_desc_inscrip(), object_pseudo(), and textui_cmd_ignore_menu().

void sense_inventory ( void  )

Variable Documentation

s32b object_last_wield

Time last item was wielded.

Referenced by object_notice_on_wield(), and sense_inventory().