Crossfire Server, Branches 1.12  R18729
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 ob_methods *context, const object *op, const object *observer, 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(context, op, observer, 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 }
#define FOOD
Definition: define.h:118
#define RING
Definition: define.h:232
#define BOOTS
Definition: define.h:281
#define CLOAK
Definition: define.h:268
#define GIRDLE
Definition: define.h:295
#define ARMOUR
Definition: define.h:128
#define AMULET
Definition: define.h:153
void common_ob_describe(const ob_methods *context, const object *op, const object *observer, char *buf, size_t size)
Definition: describe.c:39
#define FLESH
Definition: define.h:234
#define WEAPON
Definition: define.h:127
#define GLOVES
Definition: define.h:282
#define BRACERS
Definition: define.h:286
#define LAMP
Definition: define.h:263
#define SHIELD
Definition: define.h:145
#define SKILL
Definition: define.h:157
void legacy_ob_describe(const ob_methods *context, const object *op, const object *observer, char *buf, size_t size)
#define BOW
Definition: define.h:126
#define DRINK
Definition: define.h:187
#define HELMET
Definition: define.h:146
#define ARROW
Definition: define.h:125
#define SKILL_TOOL
Definition: define.h:236
void query_name(const object *op, char *buf, size_t size)
Definition: item.c:628
uint8 type
Definition: object.h:189