… | |
… | |
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 (©) 2001,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2001,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 | #include <global.h> |
25 | #include <global.h> |
… | |
… | |
889 | } |
890 | } |
890 | |
891 | |
891 | int |
892 | int |
892 | cast_party_spell (object *op, object *caster, int dir, object *spell_ob, char *spellparam) |
893 | cast_party_spell (object *op, object *caster, int dir, object *spell_ob, char *spellparam) |
893 | { |
894 | { |
894 | int success; |
|
|
895 | object *spell; |
|
|
896 | |
|
|
897 | if (!spell_ob->other_arch) |
895 | if (!spell_ob->other_arch) |
898 | { |
896 | { |
899 | LOG (llevError, "cast_party_spell: empty other arch\n"); |
897 | LOG (llevError, "cast_party_spell: empty other arch\n"); |
900 | return 0; |
898 | return 0; |
901 | } |
899 | } |
902 | |
900 | |
903 | spell = arch_to_object (spell_ob->other_arch); |
901 | object *spell = arch_to_object (spell_ob->other_arch); |
904 | |
902 | |
905 | /* Always cast spell on caster */ |
903 | /* Always cast spell on caster */ |
906 | success = cast_spell (op, caster, dir, spell, spellparam); |
904 | int success = cast_spell (op, caster, dir, spell, spellparam); |
907 | |
905 | |
908 | if (!op->contr || !op->contr->party) |
906 | if (!op->contr || !op->contr->party) |
909 | { |
907 | { |
910 | spell->remove (); |
908 | spell->remove (); |
911 | return success; |
909 | return success; |
912 | } |
910 | } |
913 | |
911 | |
914 | for_all_players (pl) |
912 | for_all_players (pl) |
915 | if ((pl->ob->contr->party == op->contr->party) && (on_same_map (pl->ob, caster))) |
913 | if ((pl->ob->contr->party == op->contr->party) |
|
|
914 | && on_same_map (pl->ob, op) |
|
|
915 | && pl->ob != op) |
916 | cast_spell (pl->ob, caster, pl->ob->facing, spell, spellparam); |
916 | cast_spell (pl->ob, caster, pl->ob->facing, spell, spellparam); |
917 | |
917 | |
918 | spell->remove (); |
918 | spell->remove (); |
919 | return success; |
919 | return success; |
920 | } |
920 | } |