1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * option) any later version. |
11 | * option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the Affero GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * and the GNU General Public License along with this program. If not, see |
19 | * and the GNU General Public License along with this program. If not, see |
20 | * <http://www.gnu.org/licenses/>. |
20 | * <http://www.gnu.org/licenses/>. |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | /* the contents of this file were create solely by peterm@soda.berkeley.edu |
25 | /* the contents of this file were create solely by peterm@soda.berkeley.edu |
26 | all of the above disclaimers apply. */ |
26 | all of the above disclaimers apply. */ |
… | |
… | |
29 | #include <sproto.h> |
29 | #include <sproto.h> |
30 | #include <spells.h> |
30 | #include <spells.h> |
31 | #include <errno.h> |
31 | #include <errno.h> |
32 | |
32 | |
33 | /* name of the person to resurrect and which spell was used |
33 | /* name of the person to resurrect and which spell was used |
34 | * to resurrect |
34 | * to resurrect |
35 | */ |
35 | */ |
36 | static int |
36 | static int |
37 | resurrect_player (object *op, char *playername, object *spell) |
37 | resurrect_player (object *op, char *playername, object *spell) |
38 | { |
38 | { |
39 | FILE *deadplayer, *liveplayer; |
39 | FILE *deadplayer, *liveplayer; |
… | |
… | |
161 | } |
161 | } |
162 | |
162 | |
163 | |
163 | |
164 | /* raise_dead by peterm and mehlhaff@soda.berkeley.edu |
164 | /* raise_dead by peterm and mehlhaff@soda.berkeley.edu |
165 | * op -- who is doing the resurrecting |
165 | * op -- who is doing the resurrecting |
166 | * spell - spell object |
166 | * spell - spell object |
167 | * dir -- direction the spell is cast |
167 | * dir -- direction the spell is cast |
168 | * corpseobj - corpse to raise - can be null, in which case this function will find it |
168 | * corpseobj - corpse to raise - can be null, in which case this function will find it |
169 | */ |
169 | */ |
170 | int |
170 | int |
171 | cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg) |
171 | cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg) |
… | |
… | |
188 | strcpy (name_to_resurrect, arg); |
188 | strcpy (name_to_resurrect, arg); |
189 | temp = NULL; |
189 | temp = NULL; |
190 | } |
190 | } |
191 | else |
191 | else |
192 | { |
192 | { |
193 | sx = op->x + freearr_x[dir]; |
193 | sx = op->x + DIRX (dir); |
194 | sy = op->y + freearr_y[dir]; |
194 | sy = op->y + DIRY (dir); |
195 | m = op->map; |
195 | m = op->map; |
196 | mflags = get_map_flags (m, &m, sx, sy, &sx, &sy); |
196 | mflags = get_map_flags (m, &m, sx, sy, &sx, &sy); |
197 | if (mflags & P_OUT_OF_MAP) |
197 | if (mflags & P_OUT_OF_MAP) |
198 | temp = NULL; |
198 | temp = NULL; |
199 | else |
199 | else |