Angband
Macros | Enumerations | Functions
obj-tval.h File Reference

Wrapper functions for tvals. More...

#include "object.h"
#include "list-tvals.h"

Go to the source code of this file.

Macros

#define TV(a, b)   TV_##a,
#define SV_UNKNOWN   0
 Special "sval" value – unknown "sval".

Enumerations

enum  { TV_MAX }
 The values for the "tval" field of various objects. More...

Functions

bool tval_can_have_charges (const struct object *o_ptr)
bool tval_can_have_failure (const struct object *o_ptr)
bool tval_can_have_flavor_k (const struct object_kind *kind)
bool tval_can_have_nourishment (const struct object *o_ptr)
bool tval_can_have_timeout (const struct object *o_ptr)
int tval_find_idx (const char *name)
 Returns the numeric equivalent tval of the textual tval name.
const char * tval_find_name (int tval)
 Returns the textual equivalent tval of the numeric tval name.
bool tval_is_ammo (const struct object *o_ptr)
bool tval_is_armor (const struct object *o_ptr)
bool tval_is_body_armor (const struct object *o_ptr)
bool tval_is_book_k (const struct object_kind *kind)
bool tval_is_chest (const struct object *o_ptr)
bool tval_is_food (const struct object *o_ptr)
bool tval_is_food_k (const struct object_kind *k_ptr)
bool tval_is_mushroom (const struct object *o_ptr)
bool tval_is_mushroom_k (const struct object_kind *k_ptr)
bool tval_is_fuel (const struct object *o_ptr)
bool tval_is_head_armor (const struct object *o_ptr)
bool tval_is_jewelry (const struct object *o_ptr)
bool tval_is_launcher (const struct object *o_ptr)
bool tval_is_light (const struct object *o_ptr)
bool tval_is_light_k (const struct object_kind *k_ptr)
bool tval_is_melee_weapon (const struct object *o_ptr)
bool tval_is_money (const struct object *o_ptr)
bool tval_is_money_k (const struct object_kind *kind)
bool tval_is_pointy (const struct object *o_ptr)
bool tval_is_potion (const struct object *o_ptr)
bool tval_is_ring (const struct object *o_ptr)
bool tval_is_rod (const struct object *o_ptr)
bool tval_is_scroll (const struct object *o_ptr)
bool tval_is_staff (const struct object *o_ptr)
bool tval_is_useable (const struct object *o_ptr)
bool tval_is_wand (const struct object *o_ptr)
bool tval_is_weapon (const struct object *o_ptr)
bool tval_has_variable_power (const struct object *o_ptr)
bool tval_is_wearable (const struct object *o_ptr)
bool tval_is_edible (const struct object *o_ptr)
bool tval_is_zapper (const struct object *o_ptr)
int tval_sval_count (const char *name)
 Counts the svals (from object.txt) of a given non-null tval.
int tval_sval_list (const char *name, int *list, int max_size)
 Lists up to max_size svals (from object.txt) of a given non-null tval Assumes list has allocated space for at least max_size elements.

Detailed Description

Wrapper functions for tvals.

Copyright (c) 2014 Ben Semmler

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.

Macro Definition Documentation

#define SV_UNKNOWN   0

Special "sval" value – unknown "sval".

Referenced by flavor_assign_fixed(), flavor_assign_random(), flavor_reset_fixed(), and parse_flavor_flavor().

#define TV (   a,
 
)    TV_##a,

Enumeration Type Documentation

anonymous enum

The values for the "tval" field of various objects.

This value is the primary means by which items are sorted in the player inventory, followed by "sval" and "cost".

Enumerator:
TV_MAX 

Function Documentation

bool tval_can_have_charges ( const struct object o_ptr)
bool tval_can_have_failure ( const struct object o_ptr)

References FALSE, TRUE, and object::tval.

Referenced by obj_can_fail().

bool tval_can_have_flavor_k ( const struct object_kind kind)

References FALSE, TRUE, and object_kind::tval.

Referenced by obj_desc_get_modstr().

bool tval_can_have_nourishment ( const struct object o_ptr)

References object::tval.

Referenced by obj_known_food().

bool tval_can_have_timeout ( const struct object o_ptr)
int tval_find_idx ( const char *  name)
const char* tval_find_name ( int  tval)

Returns the textual equivalent tval of the numeric tval name.

References i, N_ELEMENTS, and grouper::name.

Referenced by dump_autoinscriptions(), dump_objects(), lookup_kind(), and lookup_symbol().

bool tval_has_variable_power ( const struct object o_ptr)

References FALSE, TRUE, and object::tval.

Referenced by object_value(), and object_value_real().

bool tval_is_ammo ( const struct object o_ptr)
bool tval_is_armor ( const struct object o_ptr)
bool tval_is_body_armor ( const struct object o_ptr)
bool tval_is_book_k ( const struct object_kind kind)

References FALSE, TRUE, and object_kind::tval.

Referenced by obj_desc_get_modstr().

bool tval_is_chest ( const struct object o_ptr)
bool tval_is_edible ( const struct object o_ptr)

References FALSE, TRUE, and object::tval.

Referenced by describe_effect(), and do_cmd_eat_food().

bool tval_is_food ( const struct object o_ptr)
bool tval_is_food_k ( const struct object_kind k_ptr)

References object_kind::tval.

Referenced by player_outfit().

bool tval_is_fuel ( const struct object o_ptr)
bool tval_is_head_armor ( const struct object o_ptr)

References object::tval.

Referenced by wield_slot().

bool tval_is_jewelry ( const struct object o_ptr)
bool tval_is_launcher ( const struct object o_ptr)

References object::tval.

Referenced by object_prep().

bool tval_is_light ( const struct object o_ptr)
bool tval_is_light_k ( const struct object_kind k_ptr)

References object_kind::tval.

Referenced by player_outfit().

bool tval_is_melee_weapon ( const struct object o_ptr)
bool tval_is_money ( const struct object o_ptr)
bool tval_is_money_k ( const struct object_kind kind)
bool tval_is_mushroom ( const struct object o_ptr)

References object::tval.

Referenced by inven_carry().

bool tval_is_mushroom_k ( const struct object_kind k_ptr)

References object_kind::tval.

bool tval_is_pointy ( const struct object o_ptr)

References object::tval.

Referenced by calc_bonuses().

bool tval_is_potion ( const struct object o_ptr)
bool tval_is_ring ( const struct object o_ptr)

References object::tval.

Referenced by apply_magic(), do_cmd_wield(), and wield_slot().

bool tval_is_rod ( const struct object o_ptr)
bool tval_is_scroll ( const struct object o_ptr)
bool tval_is_staff ( const struct object o_ptr)
bool tval_is_useable ( const struct object o_ptr)

References FALSE, TRUE, and object::tval.

Referenced by obj_is_useable().

bool tval_is_wand ( const struct object o_ptr)
bool tval_is_weapon ( const struct object o_ptr)
bool tval_is_wearable ( const struct object o_ptr)

References FALSE, TRUE, and object::tval.

Referenced by obj_known_digging().

bool tval_is_zapper ( const struct object o_ptr)

References object::tval.

Referenced by inven_carry().

int tval_sval_count ( const char *  name)

Counts the svals (from object.txt) of a given non-null tval.

References i, k_info, angband_constants::k_max, num, object_kind::tval, tval_find_idx(), and z_info.

Referenced by init_obj_make().

int tval_sval_list ( const char *  name,
int list,
int  max_size 
)

Lists up to max_size svals (from object.txt) of a given non-null tval Assumes list has allocated space for at least max_size elements.

References i, k_info, angband_constants::k_max, num, object_kind::sval, object_kind::tval, tval_find_idx(), and z_info.

Referenced by init_obj_make().