Crossfire Server, Trunk  R20513
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 }
See Ring.
Definition: object.h:185
Typedefs for ob_methods.
Definition: ob_methods.h:45
See Bracers.
Definition: object.h:217
See Cloak.
Definition: object.h:204
See Food.
Definition: object.h:112
See Projectile.
Definition: object.h:117
See Weapon.
Definition: object.h:119
See Helmet.
Definition: object.h:136
See Drink.
Definition: object.h:157
See Girdle.
Definition: object.h:223
See Amulet.
Definition: object.h:139
animal &#39;body parts&#39; -b.t.
Definition: object.h:187
Global type definitions and header inclusions.
See Boots.
Definition: object.h:212
Allows the use of a skill.
Definition: object.h:189
See Shooting Weapon.
Definition: object.h:118
void common_ob_describe(const ob_methods *context, const object *op, const object *observer, char *buf, size_t size)
Describes an object, seen by a given observer.
Definition: describe.c:36
Lamp.
Definition: object.h:201
Object type variables.
See Shield.
Definition: object.h:135
Also see SKILL_TOOL (74) below.
Definition: object.h:143
uint8_t type
PLAYER, BULLET, etc.
Definition: object.h:338
void legacy_ob_describe(const ob_methods *context, const object *op, const object *observer, char *buf, size_t size)
Describes an object, seen by a given observer.
See Gloves.
Definition: object.h:213
void query_name(const object *op, char *buf, size_t size)
Describes an item.
Definition: item.c:625
See Breastplate Armor.
Definition: object.h:120
Object type functions and variables.