Go to the documentation of this file.
52 else if (strstr(name,
item_types[type][pos]) != NULL) {
54 fprintf(stderr,
"Returning type %d for %s\n", type, name);
61 LOG(
LOG_WARNING,
"common::get_type_from_name",
"Could not find match for %s", name);
73 newitem->
env->
inv = newitem;
78 before->
prev = newitem;
79 newitem->
next = before;
89 item *itmp, *last = NULL;
127 for (itmp = it->
env->
inv; itmp != NULL; itmp = itmp->
next) {
134 }
else if (itmp->
type == it->
type) {
188 static const char *numbers[] = {
189 "no",
"a",
"two",
"three",
"four",
190 "five",
"six",
"seven",
"eight",
"nine",
191 "ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
192 "fifteen",
"sixteen",
"seventeen",
"eighteen",
"nineteen",
200 snprintf(buf,
sizeof(buf),
"%u", i);
263 for (; op; op = op->
next) {
264 if (op->
tag == tag) {
365 for (tmp = env->
inv; tmp && tmp->
next; tmp = tmp->
next)
404 "",
" (readied)",
" (wielded)",
" (worn)",
" (active)",
" (applied)",
412 strcat(op->
flags,
" *");
418 strcat(op->
flags,
" (undefined)");
422 strcat(op->
flags,
" (open)");
425 strcat(op->
flags,
" (damned)");
428 strcat(op->
flags,
" (cursed)");
431 strcat(op->
flags,
" (blessed)");
434 strcat(op->
flags,
" (magic)");
437 strcat(op->
flags,
" (unpaid)");
440 strcat(op->
flags,
" (read)");
462 guint16 flags, guint16 anim, guint16 animspeed,
463 guint32 nrof, guint16 type)
468 printf(
"Error in set_item_values(): item pointer is NULL.\n");
496 if (op->
nrof != nrof) {
509 op->
weight = (float)weight/1000;
539 snprintf((
char*)buf,
sizeof(buf),
"lock %d %d", !op->
locked, op->
tag);
557 snprintf((
char*)buf,
sizeof(buf),
"mark %d", op->
tag);
579 void update_item(
int tag,
int loc,
char *name,
int weight,
int face,
int flags,
580 int anim,
int animspeed, guint32 nrof,
int type)
602 if (ip && ip->
env != env) {
612 anim, animspeed, nrof, type);
636 snprintf(buf,
sizeof(buf),
"%s's inventory (%d):", op->
d_name, op->
tag);
637 snprintf(buf2,
sizeof(buf2),
"%-*s%6.1f kg", info_width-10, buf, op->
weight);
642 for (tmp = op->
inv; tmp; tmp = tmp->
next) {
643 snprintf(buf,
sizeof(buf),
"%*s- %d %s%s (%d)", l-2,
"", tmp->
nrof, tmp->
d_name, tmp->
flags, tmp->
tag);
644 snprintf(buf2,
sizeof(buf2),
"%-*s%6.1f kg", info_width-8-l, buf, tmp->
nrof*tmp->
weight);
722 return (it->
type == 661);
730 snprintf((
char*)buf,
sizeof(buf),
"inscribe 0 %d %d", scroll->
tag, spell->
tag);
void item_event_container_clearing(item *container)
void set_item_values(item *op, char *name, gint32 weight, guint16 face, guint16 flags, guint16 anim, guint16 animspeed, guint32 nrof, guint16 type)
@ LOG_WARNING
Warning that something might not work.
void SockList_Init(SockList *sl, guint8 *buf)
void inscribe_magical_scroll(item *scroll, Spell *spell)
int SockList_Send(SockList *sl, GSocketConnection *c)
void remove_item_inventory(item *op)
void SockList_AddChar(SockList *sl, char c)
void send_mark_obj(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)
static const char *const apply_string[]
void SockList_AddInt(SockList *sl, guint32 data)
void script_monitor_str(const char *command)
struct item_struct * prev
static const char *const item_types[256][64]
static void get_flags(item *op, guint16 flags)
int can_write_spell_on(item *it)
void SockList_AddString(SockList *sl, const char *str)
void free_all_items(item *op)
void LOG(LogLevel level, const char *origin, const char *format,...)
void draw_ext_info(int orig_color, int type, int subtype, const char *message)
void update_item_sort(item *it)
static item * new_item(void)
#define MSG_TYPE_CLIENT_DEBUG
static item * create_new_item(item *env, gint32 tag)
struct item_struct * next
static item * locate_item_from_item(item *op, gint32 tag)
const char * get_number(guint32 i)
void remove_item(item *op)
static void set_flag_string(item *op)
item * locate_item(gint32 tag)
guint8 get_type_from_name(const char *name)
static void add_item(item *env, item *op)
Animations animations[MAXANIM]
void item_event_item_deleting(item *it)
void animate_objects(void)
void toggle_locked(item *op)
void item_event_item_changed(item *it)
static void insert_item_before_item(item *newitem, item *before)
void print_inventory(item *op)