Crossfire Server, Branches 1.12  R18729
process.c
Go to the documentation of this file.
1 /*
2  CrossFire, A Multiplayer game for X-windows
3 
4  Copyright (C) 2006 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 <sproto.h>
27 
31 method_ret legacy_ob_process(ob_methods *context, object *op) {
32  switch (op->type) {
33  case ROD:
34  case HORN:
35  regenerate_rod(op);
36  return METHOD_OK;
37 
38  case FORCE:
39  case POTION_EFFECT:
41  return METHOD_OK;
42 
43  case DISEASE:
44  move_disease(op);
45  return METHOD_OK;
46 
47  case SYMPTOM:
48  move_symptom(op);
49  return METHOD_OK;
50 
51  case DOOR:
52  remove_door(op);
53  return METHOD_OK;
54 
55  case LOCKED_DOOR:
57  return METHOD_OK;
58 
59  case GOLEM:
60  move_golem(op);
61  return METHOD_OK;
62 
63  case EARTHWALL:
64  hit_player(op, 2, op, AT_PHYSICAL, 1);
65  return METHOD_OK;
66 
67  case FIREWALL:
68  move_firewall(op);
69  if (op->stats.maxsp)
70  animate_turning(op);
71  return METHOD_OK;
72 
73  case TRIGGER_BUTTON:
74  case TRIGGER_PEDESTAL:
75  case TRIGGER_ALTAR:
77  return METHOD_OK;
78 
79  case DIRECTOR:
80  if (op->stats.maxsp)
81  animate_turning(op);
82  return METHOD_OK;
83 
84  case HOLE:
85  legacy_move_hole(op);
86  return METHOD_OK;
87 
88  case PLAYERMOVER:
90  return METHOD_OK;
91  }
92  return METHOD_UNHANDLED;
93 }
void regenerate_rod(object *rod)
Definition: spell_util.c:728
#define DISEASE
Definition: define.h:331
void legacy_remove_force(object *op)
Definition: time.c:768
void remove_door(object *op)
Definition: time.c:51
#define EARTHWALL
Definition: define.h:167
method_ret legacy_ob_process(ob_methods *context, object *op)
Definition: process.c:31
#define DOOR
Definition: define.h:135
int move_disease(object *disease)
Definition: disease.c:192
void move_player_mover(object *op)
Definition: time.c:639
void move_symptom(object *symptom)
Definition: disease.c:615
void legacy_move_hole(object *op)
Definition: time.c:776
#define GOLEM
Definition: define.h:168
#define POTION_EFFECT
Definition: define.h:297
sint16 maxsp
Definition: living.h:84
char method_ret
Definition: ob_methods.h:41
#define SYMPTOM
Definition: define.h:332
#define METHOD_OK
Definition: ob_methods.h:42
#define HORN
Definition: define.h:147
void legacy_animate_trigger(object *op)
Definition: time.c:772
void move_golem(object *op)
Definition: pets.c:541
void remove_locked_door(object *op)
Definition: time.c:80
#define LOCKED_DOOR
Definition: define.h:132
#define TRIGGER_PEDESTAL
Definition: define.h:144
#define AT_PHYSICAL
Definition: attack.h:104
#define TRIGGER_BUTTON
Definition: define.h:142
#define METHOD_UNHANDLED
Definition: ob_methods.h:43
void move_firewall(object *op)
Definition: standalone.c:188
#define TRIGGER_ALTAR
Definition: define.h:143
#define FORCE
Definition: define.h:296
#define FIREWALL
Definition: define.h:204
living stats
Definition: object.h:219
#define PLAYERMOVER
Definition: define.h:154
void animate_turning(object *op)
Definition: button.c:284
#define DIRECTOR
Definition: define.h:294
#define ROD
Definition: define.h:115
#define HOLE
Definition: define.h:276
int hit_player(object *op, int dam, object *hitter, uint32 type, int full_hit)
Definition: attack.c:1868
uint8 type
Definition: object.h:189