ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_move.C
Revision: 1.14
Committed: Tue May 6 19:37:01 2008 UTC (16 years, 1 month ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: rel-2_80, rel-2_6, rel-2_7, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, rel-2_78, rel-2_61
Changes since 1.13: +1 -0 lines
Log Message:
exactly

File Contents

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