Crossfire Server, Trunk
legacy_describe.c
Go to the documentation of this file.
1 /*
2  CrossFire, A Multiplayer game for X-windows
3 
4  Copyright (C) 2007 Mark Wedel & Crossfire Development Team
5  Copyright (C) 1992 Frank Tore Johansen
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21  The authors can be reached via e-mail at crossfire-devel@real-time.com
22 */
23 #include <global.h>
24 #include <ob_methods.h>
25 #include <ob_types.h>
38 void legacy_ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size) {
39  buf[0] = '\0';
40  if (op == NULL)
41  return;
42 
43  switch (op->type) {
44  case RING:
45  case SKILL:
46  case WEAPON:
47  case ARMOUR:
48  case BRACERS:
49  case HELMET:
50  case SHIELD:
51  case BOOTS:
52  case GLOVES:
53  case AMULET:
54  case GIRDLE:
55  case BOW:
56  case ARROW:
57  case CLOAK:
58  case FOOD:
59  case DRINK:
60  case FLESH:
61  case SKILL_TOOL:
62  case LAMP:
63  common_ob_describe(op, observer, use_media_tags, buf, size);
64  return;
65 
66  default:
67  if (buf[0] == '\0') {
68  query_name(op, buf, size-1);
69  buf[size-1] = 0;
70  }
71  return;
72  }
73 }
global.h
BOW
@ BOW
Definition: object.h:118
BRACERS
@ BRACERS
Definition: object.h:217
FLESH
@ FLESH
Definition: object.h:187
GLOVES
@ GLOVES
Definition: object.h:213
GIRDLE
@ GIRDLE
Definition: object.h:223
ARMOUR
@ ARMOUR
Definition: object.h:120
WEAPON
@ WEAPON
Definition: object.h:119
AMULET
@ AMULET
Definition: object.h:139
SKILL
@ SKILL
Definition: object.h:143
common_ob_describe
void common_ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Definition: describe.c:36
CLOAK
@ CLOAK
Definition: object.h:204
HELMET
@ HELMET
Definition: object.h:136
query_name
void query_name(const object *op, char *buf, size_t size)
Definition: item.c:585
LAMP
@ LAMP
Definition: object.h:201
ARROW
@ ARROW
Definition: object.h:117
RING
@ RING
Definition: object.h:185
ob_types.h
legacy_ob_describe
void legacy_ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Definition: legacy_describe.c:38
give.op
op
Definition: give.py:33
SKILL_TOOL
@ SKILL_TOOL
Definition: object.h:189
buf
StringBuffer * buf
Definition: readable.c:1610
FOOD
@ FOOD
Definition: object.h:112
DRINK
@ DRINK
Definition: object.h:157
ob_methods.h
BOOTS
@ BOOTS
Definition: object.h:212
SHIELD
@ SHIELD
Definition: object.h:135