ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_move.C
Revision: 1.10
Committed: Mon May 28 21:28:35 2007 UTC (17 years ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.9: +17 -17 lines
Log Message:
update copyrights in server/*.C

File Contents

# Content
1 /*
2 * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 *
8 * Crossfire TRT is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 * The authors can be reached via e-mail to <crossfire@schmorp.de>
23 */
24
25 #include <global.h>
26 #include <sproto.h>
27 #include <skills.h>
28
29 static int
30 move_internal (object *op, char *params, int dir)
31 {
32 if (params)
33 {
34 if (params[0] == 'f')
35 {
36 if (!op->contr->fire_on)
37 {
38 op->contr->fire_on = 1;
39 move_player (op, dir);
40 op->contr->fire_on = 0;
41 return 0;
42 }
43 }
44 else if (params[0] == 'r' && !op->contr->run_on)
45 op->contr->run_on = 1;
46 }
47
48 move_player (op, dir);
49 return 0;
50 }
51
52 int
53 command_east (object *op, char *params)
54 {
55 return move_internal (op, params, 3);
56 }
57
58 int
59 command_north (object *op, char *params)
60 {
61 return move_internal (op, params, 1);
62 }
63
64 int
65 command_northeast (object *op, char *params)
66 {
67 return move_internal (op, params, 2);
68 }
69
70 int
71 command_northwest (object *op, char *params)
72 {
73 return move_internal (op, params, 8);
74 }
75
76 int
77 command_south (object *op, char *params)
78 {
79 return move_internal (op, params, 5);
80 }
81
82 int
83 command_southeast (object *op, char *params)
84 {
85 return move_internal (op, params, 4);
86 }
87
88 int
89 command_southwest (object *op, char *params)
90 {
91 return move_internal (op, params, 6);
92 }
93
94 int
95 command_west (object *op, char *params)
96 {
97 return move_internal (op, params, 7);
98 }
99
100 // XXX: What does this do?
101 int
102 command_stay (object *op, char *params)
103 {
104 if (!op->contr->fire_on && (!params || params[0] != 'f'))
105 return 0;
106 fire (op, 0);
107 return 0;
108 }