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

Create object name descriptions. More...

Go to the source code of this file.

Enumerations

enum  {
  ODESC_BASE = 0x00, ODESC_COMBAT = 0x01, ODESC_EXTRA = 0x02, ODESC_FULL = ODESC_COMBAT | ODESC_EXTRA,
  ODESC_STORE = 0x04, ODESC_PLURAL = 0x08, ODESC_SINGULAR = 0x10, ODESC_SPOIL = 0x20,
  ODESC_PREFIX = 0x40, ODESC_CAPITAL = 0x80, ODESC_TERSE = 0x100, ODESC_NOEGO = 0x200
}
 Modes for object_desc(). More...
 

Functions

void object_base_name (char *buf, size_t max, int tval, bool plural)
 Puts the object base kind's name into buf. More...
 
void object_kind_name (char *buf, size_t max, const struct object_kind *kind, bool easy_know)
 Puts a very stripped-down version of an object's name into buf. More...
 
size_t obj_desc_name_format (char *buf, size_t max, size_t end, const char *fmt, const char *modstr, bool pluralise)
 Formats 'fmt' into 'buf', with the following formatting characters: More...
 
size_t object_desc (char *buf, size_t max, const struct object *obj, int mode)
 Describes item obj into buffer buf of size max. More...
 

Variables

const char * inscrip_text []
 

Detailed Description

Create object name descriptions.

Copyright (c) 1997 - 2007 Angband contributors

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

anonymous enum

Modes for object_desc().

Enumerator
ODESC_BASE 

Only describe the base name

ODESC_COMBAT 

Also show combat bonuses

ODESC_EXTRA 

Show charges/inscriptions/pvals

ODESC_FULL 

Show entire description

ODESC_STORE 

This is an in-store description

ODESC_PLURAL 

Always pluralise

ODESC_SINGULAR 

Always singular

ODESC_SPOIL 

Display regardless of player knowledge

ODESC_PREFIX 
ODESC_CAPITAL 

Capitalise object name

ODESC_TERSE 

Make terse names

ODESC_NOEGO 

Don't show ego names

Function Documentation

size_t obj_desc_name_format ( char *  buf,
size_t  max,
size_t  end,
const char *  fmt,
const char *  modstr,
bool  pluralise 
)

Formats 'fmt' into 'buf', with the following formatting characters:

'~' at the end of a word (e.g. "fridge~") will pluralise

'|x|y|' will be output as 'x' if singular or 'y' if plural (e.g. "kni|fe|ves|")

'#' will be replaced with 'modstr' (which may contain the pluralising formats given above).

References NULL, obj_desc_name_format(), prev, and strnfcat().

Referenced by lookup_sval(), obj_desc_name(), obj_desc_name_format(), object_base_name(), object_kind_name(), wr_ignore(), and wr_item().

void object_base_name ( char *  buf,
size_t  max,
int  tval,
bool  plural 
)
size_t object_desc ( char *  buf,
size_t  max,
const struct object obj,
int  mode 
)

Describes item obj into buffer buf of size max.

ODESC_PREFIX prepends a 'the', 'a' or number ODESC_BASE results in a base description. ODESC_COMBAT will add to-hit, to-dam and AC info. ODESC_EXTRA will add pval/charge/inscription/ignore info. ODESC_PLURAL will pluralise regardless of the number in the stack. ODESC_STORE turns off ignore markers, for in-store display. ODESC_SPOIL treats the object as fully identified.

Setting 'prefix' to true prepends a 'the', 'a' or the number in the stack, respectively.

Returns
The number of bytes used of the buffer.

Construct the name

References object::ego, object_kind::everseen, ego_item::everseen, ignore_item_ok(), object::kind, object::known, object_kind::name, obj_desc_aware(), obj_desc_charges(), obj_desc_chest(), obj_desc_combat(), obj_desc_inscrip(), obj_desc_light(), obj_desc_mods(), obj_desc_name(), object_flavor_is_aware(), ODESC_COMBAT, ODESC_EXTRA, ODESC_PREFIX, ODESC_SPOIL, ODESC_STORE, ODESC_TERSE, prefix(), object::pval, strnfmt(), tval_is_chest(), tval_is_light(), and tval_is_money().

Referenced by activation_message(), apply_autoinscription(), artifact_power(), become_aware(), brand_object(), context_menu_cave(), context_menu_object(), context_menu_store_item(), death_examine(), death_info(), desc_art_fake(), desc_obj_fake(), display_object_recall(), display_object_recall_interactive(), do_cmd_buy(), do_cmd_inscribe(), do_cmd_sell(), do_cmd_stash(), do_cmd_wield(), drop_near(), effect_handler_CURSE_ARMOR(), effect_handler_CURSE_WEAPON(), effect_handler_DAMAGE(), effect_handler_DISENCHANT(), enchant_spell(), equip_learn_after_time(), equip_learn_element(), equip_learn_flag(), floor_carry_fail(), floor_object_for_use(), gear_object_for_use(), get_art_name(), get_artifact_display_name(), get_artifact_name(), inven_carry(), inven_damage(), inven_drop(), inven_takeoff(), inven_wield(), kind_info(), melee_effect_handler_EAT_FOOD(), melee_effect_handler_EAT_ITEM(), minus_ac(), monster_turn_grab_objects(), object_curses_find_element(), object_curses_find_flags(), object_learn_on_wield(), object_list_format_name(), pack_overflow(), player_know_object(), project_o(), project_p(), ranged_helper(), recharged_notice(), see_floor_items(), set_obj_names(), spoil_artifact(), store_display_entry(), store_examine(), store_purchase(), store_sell(), target_recall_loop_object(), target_set_interactive_aux(), textui_cmd_ignore_menu(), textui_obj_examine(), uncurse_object(), verify_object(), wiz_display_item(), and write_character_dump().

void object_kind_name ( char *  buf,
size_t  max,
const struct object_kind kind,
bool  easy_know 
)

Puts a very stripped-down version of an object's name into buf.

If easy_know is true, then the IDed names are used, otherwise flavours, scroll names, etc will be used.

Just truncates if the buffer isn't big enough.

References object_kind::aware, object_kind::flavor, my_strcpy(), object_kind::name, NULL, obj_desc_name_format(), and flavor::text.

Referenced by activation_message(), cmp_ignore(), display_object(), ignore_sval_menu_display(), and wiz_create_item_subdisplay().

Variable Documentation

const char* inscrip_text[]