Crossfire Server, Trunk
legacy_describe.cpp
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>
26 
39 void legacy_ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size) {
40  buf[0] = '\0';
41  if (op == NULL)
42  return;
43 
44  switch (op->type) {
45  case RING:
46  case SKILL:
47  case WEAPON:
48  case ARMOUR:
49  case BRACERS:
50  case HELMET:
51  case SHIELD:
52  case BOOTS:
53  case GLOVES:
54  case AMULET:
55  case GIRDLE:
56  case BOW:
57  case ARROW:
58  case CLOAK:
59  case FOOD:
60  case DRINK:
61  case FLESH:
62  case SKILL_TOOL:
63  case LAMP:
64  common_ob_describe(op, observer, use_media_tags, buf, size);
65  return;
66 
67  default:
68  if (buf[0] == '\0') {
69  query_name(op, buf, size-1);
70  buf[size-1] = 0;
71  }
72  return;
73  }
74 }
global.h
BOW
@ BOW
Definition: object.h:123
BRACERS
@ BRACERS
Definition: object.h:222
FLESH
@ FLESH
Definition: object.h:192
GLOVES
@ GLOVES
Definition: object.h:218
GIRDLE
@ GIRDLE
Definition: object.h:228
ARMOUR
@ ARMOUR
Definition: object.h:125
WEAPON
@ WEAPON
Definition: object.h:124
AMULET
@ AMULET
Definition: object.h:144
SKILL
@ SKILL
Definition: object.h:148
common_ob_describe
void common_ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Definition: describe.cpp:36
buf
StringBuffer * buf
Definition: readable.cpp:1565
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.cpp:39
CLOAK
@ CLOAK
Definition: object.h:209
HELMET
@ HELMET
Definition: object.h:141
query_name
void query_name(const object *op, char *buf, size_t size)
Definition: item.cpp:588
LAMP
@ LAMP
Definition: object.h:206
ARROW
@ ARROW
Definition: object.h:122
RING
@ RING
Definition: object.h:190
ob_types.h
give.op
op
Definition: give.py:33
SKILL_TOOL
@ SKILL_TOOL
Definition: object.h:194
FOOD
@ FOOD
Definition: object.h:117
DRINK
@ DRINK
Definition: object.h:162
ob_methods.h
BOOTS
@ BOOTS
Definition: object.h:217
SHIELD
@ SHIELD
Definition: object.h:140