Crossfire Server, Branches 1.12
R18729
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
apply.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 to crossfire-devel@real-time.com
22
*/
23
#include <
global.h
>
24
#include <
ob_methods.h
>
25
#include <
ob_types.h
>
26
#include <
sounds.h
>
27
#include <
sproto.h
>
28
49
method_ret
legacy_ob_apply
(
ob_methods
*context,
object
*op,
object
*applier,
int
aflags) {
50
switch
(op->
type
) {
51
/* Eneq(at)(csd.uu.se): Handle apply on containers. */
52
case
CLOSE_CON
:
53
if
(applier->
type
==
PLAYER
)
54
legacy_apply_container
(applier, op->
env
);
55
return
METHOD_OK
;
56
57
case
CONTAINER
:
58
if
(applier->
type
==
PLAYER
)
59
legacy_apply_container
(applier, op);
60
return
METHOD_OK
;
61
62
case
WEAPON
:
63
case
ARMOUR
:
64
case
BOOTS
:
65
case
GLOVES
:
66
case
AMULET
:
67
case
GIRDLE
:
68
case
BRACERS
:
69
case
SHIELD
:
70
case
HELMET
:
71
case
RING
:
72
case
CLOAK
:
73
case
WAND
:
74
case
ROD
:
75
case
HORN
:
76
case
SKILL
:
77
case
BOW
:
78
case
BUILDER
:
79
case
SKILL_TOOL
:
80
if
(op->
env
!= applier)
81
return
METHOD_ERROR
;
/* not in inventory */
82
(void)
apply_special
(applier, op, aflags);
83
return
METHOD_OK
;
84
85
default
:
86
return
METHOD_UNHANDLED
;
87
}
88
}
RING
#define RING
Definition:
define.h:232
sounds.h
legacy_apply_container
void legacy_apply_container(object *op, object *sack)
Definition:
apply.c:1872
ob_methods
Definition:
ob_methods.h:72
CLOSE_CON
#define CLOSE_CON
Definition:
define.h:303
WAND
#define WAND
Definition:
define.h:291
METHOD_ERROR
#define METHOD_ERROR
Definition:
ob_methods.h:44
legacy_ob_apply
method_ret legacy_ob_apply(ob_methods *context, object *op, object *applier, int aflags)
Definition:
apply.c:49
BOOTS
#define BOOTS
Definition:
define.h:281
CLOAK
#define CLOAK
Definition:
define.h:268
GIRDLE
#define GIRDLE
Definition:
define.h:295
global.h
ARMOUR
#define ARMOUR
Definition:
define.h:128
PLAYER
#define PLAYER
Definition:
define.h:113
method_ret
char method_ret
Definition:
ob_methods.h:41
AMULET
#define AMULET
Definition:
define.h:153
apply_special
int apply_special(object *who, object *op, int aflags)
Definition:
apply.c:1139
METHOD_OK
#define METHOD_OK
Definition:
ob_methods.h:42
HORN
#define HORN
Definition:
define.h:147
obj::env
struct obj * env
Definition:
object.h:151
sproto.h
WEAPON
#define WEAPON
Definition:
define.h:127
METHOD_UNHANDLED
#define METHOD_UNHANDLED
Definition:
ob_methods.h:43
GLOVES
#define GLOVES
Definition:
define.h:282
BUILDER
#define BUILDER
Definition:
define.h:334
BRACERS
#define BRACERS
Definition:
define.h:286
ob_types.h
SHIELD
#define SHIELD
Definition:
define.h:145
CONTAINER
#define CONTAINER
Definition:
define.h:306
SKILL
#define SKILL
Definition:
define.h:157
BOW
#define BOW
Definition:
define.h:126
HELMET
#define HELMET
Definition:
define.h:146
ROD
#define ROD
Definition:
define.h:115
SKILL_TOOL
#define SKILL_TOOL
Definition:
define.h:236
ob_methods.h
obj::type
uint8 type
Definition:
object.h:189
crossfire-code
server
branches
1.12
types
legacy
apply.c
Generated on Sun Nov 18 2018 02:40:29 for Crossfire Server, Branches 1.12 by
1.8.6