… | |
… | |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002-2003,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002-2003,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * it under the terms of the GNU General Public License as published by |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * the Free Software Foundation, either version 3 of the License, or |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * (at your 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 GNU General Public License |
18 | * You should have received a copy of the Affero GNU General Public License |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | * and the GNU General Public License along with this program. If not, see |
|
|
20 | * <http://www.gnu.org/licenses/>. |
20 | * |
21 | * |
21 | * 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> |
22 | */ |
23 | */ |
23 | |
24 | |
24 | /* This file contains all the spell attack code. Grouping this code |
25 | /* This file contains all the spell attack code. Grouping this code |
… | |
… | |
36 | /* this function checks to see if a spell pushes objects as well |
37 | /* this function checks to see if a spell pushes objects as well |
37 | * as flies over and damages them (only used for cones for now) |
38 | * as flies over and damages them (only used for cones for now) |
38 | * but moved here so it could be applied to bolts too |
39 | * but moved here so it could be applied to bolts too |
39 | * op is the spell object. |
40 | * op is the spell object. |
40 | */ |
41 | */ |
41 | void |
42 | static void |
42 | check_spell_knockback (object *op) |
43 | check_spell_knockback (object *op) |
43 | { |
44 | { |
44 | int weight_move; |
45 | int weight_move; |
45 | int frictionmod = 2; /*poor man's physics - multipy targets weight by this amount */ |
46 | int frictionmod = 2; /*poor man's physics - multipy targets weight by this amount */ |
46 | |
47 | |
… | |
… | |
107 | ***************************************************************************/ |
108 | ***************************************************************************/ |
108 | |
109 | |
109 | /* Causes op to fork. op is the original bolt, tmp |
110 | /* Causes op to fork. op is the original bolt, tmp |
110 | * is the first piece of the fork. |
111 | * is the first piece of the fork. |
111 | */ |
112 | */ |
112 | void |
113 | static void |
113 | forklightning (object *op, object *tmp) |
114 | forklightning (object *op, object *tmp) |
114 | { |
115 | { |
115 | int new_dir = 1; /* direction or -1 for left, +1 for right 0 if no new bolt */ |
116 | int new_dir = 1; /* direction or -1 for left, +1 for right 0 if no new bolt */ |
116 | int t_dir; /* stores temporary dir calculation */ |
117 | int t_dir; /* stores temporary dir calculation */ |
117 | maptile *m; |
118 | maptile *m; |
… | |
… | |
388 | |
389 | |
389 | /* Causes an object to explode, eg, a firebullet, |
390 | /* Causes an object to explode, eg, a firebullet, |
390 | * poison cloud ball, etc. op is the object to |
391 | * poison cloud ball, etc. op is the object to |
391 | * explode. |
392 | * explode. |
392 | */ |
393 | */ |
393 | void |
394 | static void |
394 | explode_bullet (object *op) |
395 | explode_bullet (object *op) |
395 | { |
396 | { |
396 | object *tmp, *owner; |
397 | object *tmp, *owner; |
397 | |
398 | |
398 | if (!op->other_arch) |
399 | if (!op->other_arch) |
… | |
… | |
686 | * CONE RELATED FUNCTIONS |
687 | * CONE RELATED FUNCTIONS |
687 | * |
688 | * |
688 | *****************************************************************************/ |
689 | *****************************************************************************/ |
689 | |
690 | |
690 | /* drops an object based on what is in the cone's "other_arch" */ |
691 | /* drops an object based on what is in the cone's "other_arch" */ |
691 | void |
692 | static void |
692 | cone_drop (object *op) |
693 | cone_drop (object *op) |
693 | { |
694 | { |
694 | object *new_ob = arch_to_object (op->other_arch); |
695 | object *new_ob = arch_to_object (op->other_arch); |
695 | |
696 | |
696 | new_ob->level = op->level; |
697 | new_ob->level = op->level; |
… | |
… | |
1046 | * dir is the direction to look in. |
1047 | * dir is the direction to look in. |
1047 | * range is how far out to look. |
1048 | * range is how far out to look. |
1048 | * type is the type of spell - either SPELL_MANA or SPELL_GRACE. |
1049 | * type is the type of spell - either SPELL_MANA or SPELL_GRACE. |
1049 | * this info is used for blocked magic/unholy spaces. |
1050 | * this info is used for blocked magic/unholy spaces. |
1050 | */ |
1051 | */ |
1051 | object * |
1052 | static object * |
1052 | get_pointed_target (object *op, int dir, int range, int type) |
1053 | get_pointed_target (object *op, int dir, int range, int type) |
1053 | { |
1054 | { |
1054 | object *target; |
1055 | object *target; |
1055 | sint16 x, y; |
1056 | sint16 x, y; |
1056 | int dist, mflags; |
1057 | int dist, mflags; |
… | |
… | |
1243 | * we do this by creating a force and inserting it in the |
1244 | * we do this by creating a force and inserting it in the |
1244 | * object. if time is 0, the object glows permanently. To truely |
1245 | * object. if time is 0, the object glows permanently. To truely |
1245 | * make this work for non-living objects, we would have to |
1246 | * make this work for non-living objects, we would have to |
1246 | * give them the capability to have an inventory. b.t. |
1247 | * give them the capability to have an inventory. b.t. |
1247 | */ |
1248 | */ |
1248 | int |
1249 | static int |
1249 | make_object_glow (object *op, int radius, int time) |
1250 | make_object_glow (object *op, int radius, int time) |
1250 | { |
1251 | { |
1251 | /* some things are unaffected... */ |
1252 | /* some things are unaffected... */ |
1252 | if (op->path_denied & PATH_LIGHT) |
1253 | if (op->path_denied & PATH_LIGHT) |
1253 | return 0; |
1254 | return 0; |