Angband
Macros | Functions | Variables
obj-tval.c File Reference

Wrapper functions for tvals. More...

#include "init.h"
#include "obj-tval.h"
#include "z-type.h"
#include "z-util.h"
#include "list-tvals.h"

Macros

#define TV(a, b)   { TV_##a, b },

Functions

bool tval_is_staff (const struct object *o_ptr)
bool tval_is_wand (const struct object *o_ptr)
bool tval_is_rod (const struct object *o_ptr)
bool tval_is_potion (const struct object *o_ptr)
bool tval_is_scroll (const struct object *o_ptr)
bool tval_is_food (const struct object *o_ptr)
bool tval_is_food_k (const struct object_kind *kind)
bool tval_is_mushroom (const struct object *o_ptr)
bool tval_is_mushroom_k (const struct object_kind *kind)
bool tval_is_light (const struct object *o_ptr)
bool tval_is_light_k (const struct object_kind *kind)
bool tval_is_ring (const struct object *o_ptr)
bool tval_is_chest (const struct object *o_ptr)
bool tval_is_fuel (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_can_have_nourishment (const struct object *o_ptr)
bool tval_can_have_charges (const struct object *o_ptr)
bool tval_can_have_timeout (const struct object *o_ptr)
bool tval_is_body_armor (const struct object *o_ptr)
bool tval_is_head_armor (const struct object *o_ptr)
bool tval_is_ammo (const struct object *o_ptr)
bool tval_is_launcher (const struct object *o_ptr)
bool tval_is_useable (const struct object *o_ptr)
bool tval_can_have_failure (const struct object *o_ptr)
bool tval_is_jewelry (const struct object *o_ptr)
bool tval_is_weapon (const struct object *o_ptr)
bool tval_is_armor (const struct object *o_ptr)
bool tval_is_melee_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_can_have_flavor_k (const struct object_kind *kind)
bool tval_is_book_k (const struct object_kind *kind)
bool tval_is_zapper (const struct object *o_ptr)
char * de_armour (const char *name)
 Small hack to allow both spellings of armer.
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.
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.

Variables

static const grouper tval_names []
 List of { tval, name } pairs.

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 TV (   a,
 
)    { TV_##a, b },

Function Documentation

char* de_armour ( const char *  name)

Small hack to allow both spellings of armer.

References my_strcpy(), and string_make().

Referenced by tval_find_idx().

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 kind)

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 kind)

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 kind)

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().

Variable Documentation

const grouper tval_names[]
static

List of { tval, name } pairs.