Crossfire Client, Branch
R11627
|
#include <ctype.h>
#include <client.h>
#include <item.h>
#include <newclient.h>
#include <external.h>
#include <script.h>
#include <item-types.h>
Go to the source code of this file.
Defines | |
#define | NROF_ITEMS 50 /* how many items are reserved initially */ |
Functions | |
static void | add_item (item *env, item *op) |
static item * | alloc_items (int nrof) |
void | animate_objects (void) |
int | can_write_spell_on (item *it) |
item * | create_new_item (item *env, sint32 tag) |
void | free_all_items (item *op) |
static void | get_flags (item *op, uint16 flags) |
const char * | get_number (uint32 i) |
uint8 | get_type_from_name (const char *name) |
void | inscribe_magical_scroll (item *scroll, Spell *spell) |
static void | insert_item_before_item (item *newitem, item *before) |
item * | locate_item (sint32 tag) |
static item * | locate_item_from_item (item *op, sint32 tag) |
item * | map_item (void) |
static item * | new_item (void) |
int | num_free_items (void) |
item * | player_item (void) |
void | print_inventory (item *op) |
void | remove_item (item *op) |
void | remove_item_inventory (item *op) |
void | send_mark_obj (item *op) |
static void | set_flag_string (item *op) |
void | set_item_values (item *op, char *name, sint32 weight, uint16 face, uint16 flags, uint16 anim, uint16 animspeed, uint32 nrof, uint16 type) |
void | toggle_locked (item *op) |
void | update_item (int tag, int loc, char *name, int weight, int face, int flags, int anim, int animspeed, uint32 nrof, int type) |
void | update_item_sort (item *it) |
Variables | |
static const char *const | apply_string [] |
static item * | free_items |
static item * | map |
static item * | player |
const char *const | rcsid_common_item_c = "$Id: item.c 9201 2008-06-01 17:32:45Z anmaster $" |
#define NROF_ITEMS 50 /* how many items are reserved initially */ |
Definition at line 37 of file item.c.
Referenced by create_new_item().
Definition at line 398 of file item.c.
References item_struct::env, item_struct::inv, item_struct::next, and item_struct::prev.
Referenced by create_new_item().
static item* alloc_items | ( | int | nrof | ) | [static] |
Definition at line 241 of file item.c.
References list, new_item(), item_struct::next, and item_struct::prev.
Referenced by create_new_item().
void animate_objects | ( | void | ) |
Definition at line 687 of file item.c.
References item_struct::anim_speed, item_struct::anim_state, item_struct::animation_id, animations, Player_Struct::below, Player_Struct::container, cpl, item_struct::face, Animations::faces, item_struct::inv, item_struct::inv_updated, item_struct::last_anim, item_struct::next, and Animations::num_animations.
Referenced by event_loop().
int can_write_spell_on | ( | item * | it | ) |
Definition at line 752 of file item.c.
References item_struct::type.
Referenced by item_event_item_changed(), item_event_item_deleting(), and spellinventory_redraw().
item* create_new_item | ( | item * | env, |
sint32 | tag | ||
) |
Definition at line 422 of file item.c.
References add_item(), alloc_items(), free_items, item_struct::locked, item_struct::next, NROF_ITEMS, item_struct::prev, and item_struct::tag.
Referenced by update_item().
void free_all_items | ( | item * | op | ) |
Definition at line 258 of file item.c.
References free_all_items(), item_struct::inv, and item_struct::next.
Referenced by free_all_items().
Definition at line 492 of file item.c.
References item_struct::applied, item_struct::apply_type, item_struct::cursed, item_struct::damned, F_APPLIED, F_CURSED, F_DAMNED, F_LOCKED, F_MAGIC, F_OPEN, F_UNPAID, item_struct::flagsval, item_struct::locked, item_struct::magical, item_struct::open, set_flag_string(), item_struct::unpaid, and item_struct::was_open.
Referenced by set_item_values(), and update_item().
const char* get_number | ( | uint32 | i | ) |
Definition at line 182 of file item.c.
References MAX_BUF.
Referenced by set_item_values().
uint8 get_type_from_name | ( | const char * | name | ) |
Definition at line 49 of file item.c.
References item_types, LOG(), LOG_WARNING, and NUM_ITEM_TYPES.
Referenced by set_item_values().
void inscribe_magical_scroll | ( | item * | scroll, |
Spell * | spell | ||
) |
Definition at line 756 of file item.c.
References command_inscribe, csocket, ClientSocket::fd, LOG(), LOG_WARNING, MAX_BUF, script_monitor_str(), SockList_AddChar(), SockList_AddInt(), SockList_AddString(), SockList_Init(), SockList_Send(), item_struct::tag, and Spell_struct::tag.
Referenced by click_inscribe_spell().
static void insert_item_before_item | ( | item * | newitem, |
item * | before | ||
) | [static] |
Definition at line 78 of file item.c.
References item_struct::env, item_struct::inv, item_struct::inv_updated, item_struct::next, and item_struct::prev.
Referenced by update_item_sort().
item* locate_item | ( | sint32 | tag | ) |
Definition at line 292 of file item.c.
References Player_Struct::container, cpl, item_struct::inv, locate_item_from_item(), map, and item_struct::tag.
Referenced by common_item_command(), DeleteInventory(), DeleteItem(), main(), update_item(), and UpdateItemCmd().
static item* locate_item_from_item | ( | item * | op, |
sint32 | tag | ||
) | [static] |
Definition at line 274 of file item.c.
References item_struct::inv, item_struct::next, and item_struct::tag.
Referenced by locate_item().
Definition at line 611 of file item.c.
References map, new_item(), and item_struct::weight.
Referenced by init_client_vars().
Definition at line 209 of file item.c.
References item_struct::anim_state, item_struct::animation_id, item_struct::applied, copy_name, item_struct::cursed, item_struct::d_name, item_struct::damned, item_struct::env, item_struct::face, item_struct::flagsval, item_struct::inv, item_struct::inv_updated, item_struct::last_anim, item_struct::locked, item_struct::magical, item_struct::next, NO_ITEM_TYPE, item_struct::nrof, item_struct::open, item_struct::p_name, item_struct::prev, item_struct::s_name, item_struct::tag, item_struct::type, item_struct::unpaid, and item_struct::weight.
Referenced by alloc_items(), map_item(), and player_item().
int num_free_items | ( | void | ) |
Definition at line 444 of file item.c.
References item_struct::next.
Referenced by do_num_free_items().
item* player_item | ( | void | ) |
Definition at line 606 of file item.c.
References new_item(), and player.
Referenced by init_client_vars().
void print_inventory | ( | item * | op | ) |
Definition at line 654 of file item.c.
References item_struct::d_name, draw_info(), item_struct::flags, get_info_width(), item_struct::inv, MAX_BUF, NDI_BLACK, item_struct::next, item_struct::nrof, print_inventory(), item_struct::tag, and item_struct::weight.
Referenced by do_inv(), and print_inventory().
void remove_item | ( | item * | op | ) |
Definition at line 321 of file item.c.
References item_struct::anim_state, item_struct::animation_id, item_struct::applied, Player_Struct::container, copy_name, cpl, item_struct::cursed, item_struct::d_name, item_struct::damned, item_struct::env, item_struct::face, item_struct::flagsval, free_items, item_struct::inv, item_struct::inv_updated, item_event_item_deleting(), item_struct::last_anim, item_struct::locked, item_struct::magical, item_struct::next, NO_ITEM_TYPE, item_struct::nrof, item_struct::open, item_struct::p_name, item_struct::prev, remove_item_inventory(), item_struct::s_name, item_struct::tag, item_struct::type, item_struct::unpaid, and item_struct::weight.
Referenced by DeleteItem(), remove_item_inventory(), and update_item().
void remove_item_inventory | ( | item * | op | ) |
Definition at line 382 of file item.c.
References item_struct::inv, item_struct::inv_updated, item_event_container_clearing(), and remove_item().
Referenced by DeleteInventory(), main(), and remove_item().
void send_mark_obj | ( | item * | op | ) |
Definition at line 590 of file item.c.
References csocket, item_struct::env, ClientSocket::fd, MAX_BUF, script_monitor_str(), SockList_AddInt(), SockList_AddString(), SockList_Init(), SockList_Send(), and item_struct::tag.
Referenced by buttonpress_in_list(), list_button_event(), and list_item_action().
static void set_flag_string | ( | item * | op | ) | [static] |
Definition at line 462 of file item.c.
References apply_string, item_struct::apply_type, item_struct::cursed, item_struct::damned, item_struct::flags, item_struct::locked, item_struct::magical, item_struct::open, and item_struct::unpaid.
Referenced by get_flags().
void set_item_values | ( | item * | op, |
char * | name, | ||
sint32 | weight, | ||
uint16 | face, | ||
uint16 | flags, | ||
uint16 | anim, | ||
uint16 | animspeed, | ||
uint32 | nrof, | ||
uint16 | type | ||
) |
Definition at line 506 of file item.c.
References item_struct::anim_speed, item_struct::animation_id, copy_name, csocket, item_struct::d_name, item_struct::env, item_struct::face, get_flags(), get_number(), get_type_from_name(), item_struct::inv_updated, item_event_item_changed(), NO_ITEM_TYPE, item_struct::nrof, item_struct::p_name, item_struct::s_name, ClientSocket::sc_version, item_struct::type, update_item_sort(), and item_struct::weight.
Referenced by update_item().
void toggle_locked | ( | item * | op | ) |
Definition at line 573 of file item.c.
References csocket, item_struct::env, ClientSocket::fd, item_struct::locked, MAX_BUF, script_monitor_str(), SockList_AddChar(), SockList_AddInt(), SockList_AddString(), SockList_Init(), SockList_Send(), and item_struct::tag.
Referenced by buttonpress_in_list(), list_button_event(), and list_item_action().
void update_item | ( | int | tag, |
int | loc, | ||
char * | name, | ||
int | weight, | ||
int | face, | ||
int | flags, | ||
int | anim, | ||
int | animspeed, | ||
uint32 | nrof, | ||
int | type | ||
) |
Definition at line 618 of file item.c.
References item_struct::anim_speed, item_struct::animation_id, copy_name, create_new_item(), item_struct::d_name, item_struct::env, item_struct::face, get_flags(), item_struct::inv, item_struct::inv_updated, locate_item(), item_struct::nrof, remove_item(), set_item_values(), item_struct::tag, and item_struct::weight.
Referenced by common_item_command(), and UpdateItemCmd().
void update_item_sort | ( | item * | it | ) |
Definition at line 96 of file item.c.
References item_struct::applied, item_struct::env, insert_item_before_item(), item_struct::inv, item_struct::locked, item_struct::next, item_struct::prev, item_struct::s_name, and item_struct::type.
Referenced by set_item_values().
const char* const apply_string[] [static] |
{ "", " (readied)", " (wielded)", " (worn)", " (active)", " (applied)", }
Definition at line 458 of file item.c.
Referenced by set_flag_string().
item* free_items [static] |
Definition at line 33 of file item.c.
Referenced by create_new_item(), and remove_item().
Definition at line 34 of file item.c.
Referenced by locate_item(), and map_item().
Definition at line 34 of file item.c.
Referenced by player_item().
const char* const rcsid_common_item_c = "$Id: item.c 9201 2008-06-01 17:32:45Z anmaster $" |