Crossfire Client, Trunk
Functions | Variables
item.c File Reference
#include "client.h"
#include <ctype.h>
#include "external.h"
#include "item.h"
#include "script.h"
#include "item-types.h"
Include dependency graph for item.c:

Go to the source code of this file.

Functions

static void add_item (item *env, item *op)
 
void animate_objects (void)
 
int can_write_spell_on (item *it)
 
static itemcreate_new_item (item *env, gint32 tag)
 
void free_all_items (item *op)
 
static void get_flags (item *op, guint16 flags)
 
const char * get_number (guint32 i)
 
guint8 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)
 
itemlocate_item (gint32 tag)
 
static itemlocate_item_from_item (item *op, gint32 tag)
 
itemmap_item (void)
 
static itemnew_item (void)
 
itemplayer_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, gint32 weight, guint16 face, guint16 flags, guint16 anim, guint16 animspeed, guint32 nrof, guint16 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, guint32 nrof, int type)
 
void update_item_sort (item *it)
 

Variables

static const char *const apply_string []
 
static itemmap
 
static itemplayer
 

Detailed Description

Provides functions that process items in various ways.

Definition in file item.c.

Function Documentation

◆ add_item()

static void add_item ( item env,
item op 
)
static

Definition at line 361 of file item.c.

References item_struct::env, item_struct::inv, item_struct::next, and item_struct::prev.

Referenced by create_new_item().

Here is the caller graph for this function:

◆ animate_objects()

void animate_objects ( void  )

◆ can_write_spell_on()

int can_write_spell_on ( item it)

Definition at line 720 of file item.c.

References item_struct::type.

◆ create_new_item()

static item* create_new_item ( item env,
gint32  tag 
)
static

Definition at line 386 of file item.c.

References add_item(), item_struct::locked, new_item(), and item_struct::tag.

Referenced by update_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_all_items()

void free_all_items ( item op)

Definition at line 242 of file item.c.

References free_all_items(), item_struct::inv, and item_struct::next.

Referenced by free_all_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_flags()

static void get_flags ( item op,
guint16  flags 
)
static

◆ get_number()

const char* get_number ( guint32  i)

Definition at line 186 of file item.c.

References MAX_BUF.

Referenced by set_item_values().

Here is the caller graph for this function:

◆ get_type_from_name()

guint8 get_type_from_name ( const char *  name)

Definition at line 38 of file item.c.

References item_types, LOG(), LOG_WARNING, and NUM_ITEM_TYPES.

Referenced by set_item_values().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inscribe_magical_scroll()

void inscribe_magical_scroll ( item scroll,
Spell spell 
)

◆ insert_item_before_item()

static void insert_item_before_item ( item newitem,
item before 
)
static

Definition at line 68 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().

Here is the caller graph for this function:

◆ locate_item()

item* locate_item ( gint32  tag)

Definition at line 278 of file item.c.

References Player_Struct::container, cpl, item_struct::inv, locate_item_from_item(), map, player, and item_struct::tag.

Referenced by DeleteInventory(), DeleteItem(), hide_main_client(), Item2Cmd(), update_item(), and UpdateItemCmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ locate_item_from_item()

static item* locate_item_from_item ( item op,
gint32  tag 
)
static

Definition at line 259 of file item.c.

References item_struct::inv, item_struct::next, and item_struct::tag.

Referenced by locate_item().

Here is the caller graph for this function:

◆ map_item()

item* map_item ( void  )

Definition at line 571 of file item.c.

References map, new_item(), and item_struct::weight.

Referenced by client_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ new_item()

static item* new_item ( void  )
static

◆ player_item()

item* player_item ( void  )

Definition at line 565 of file item.c.

References new_item(), and player.

Referenced by client_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_inventory()

void print_inventory ( item op)

Definition at line 620 of file item.c.

References item_struct::d_name, draw_ext_info(), item_struct::flags, get_info_width(), item_struct::inv, MAX_BUF, MSG_TYPE_CLIENT, MSG_TYPE_CLIENT_DEBUG, NDI_BLACK, item_struct::next, item_struct::nrof, print_inventory(), item_struct::tag, and item_struct::weight.

Referenced by do_inv(), and print_inventory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_item()

void remove_item ( item op)

Definition at line 309 of file item.c.

References Player_Struct::container, cpl, item_struct::env, item_struct::inv, item_struct::inv_updated, item_event_item_deleting(), map, item_struct::next, player, item_struct::prev, and remove_item_inventory().

Referenced by DeleteItem(), remove_item_inventory(), and update_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove_item_inventory()

void remove_item_inventory ( item op)

Definition at line 344 of file item.c.

References item_struct::inv, item_struct::inv_updated, item_event_container_clearing(), and remove_item().

Referenced by DeleteInventory(), hide_main_client(), and remove_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_mark_obj()

void send_mark_obj ( item op)

Definition at line 548 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 list_item_action(), and ma_mark().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_flag_string()

static void set_flag_string ( item op)
static

◆ set_item_values()

void set_item_values ( item op,
char *  name,
gint32  weight,
guint16  face,
guint16  flags,
guint16  anim,
guint16  animspeed,
guint32  nrof,
guint16  type 
)

◆ toggle_locked()

void toggle_locked ( item op)

Definition at line 530 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 list_item_action(), and ma_lock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_item()

void update_item ( int  tag,
int  loc,
char *  name,
int  weight,
int  face,
int  flags,
int  anim,
int  animspeed,
guint32  nrof,
int  type 
)

◆ update_item_sort()

void update_item_sort ( item it)

Definition at line 87 of file item.c.

References item_struct::applied, item_struct::env, insert_item_before_item(), item_struct::inv, item_struct::locked, map, item_struct::next, item_struct::prev, item_struct::s_name, and item_struct::type.

Referenced by set_item_values().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ apply_string

const char* const apply_string[]
static
Initial value:
= {
"", " (readied)", " (wielded)", " (worn)", " (active)", " (applied)",
}

Definition at line 403 of file item.c.

Referenced by set_flag_string().

◆ map

item * map
static

◆ player

item* player
static

Definition at line 27 of file item.c.

Referenced by animate_objects(), locate_item(), player_item(), remove_item(), and update_item().