ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/spell_util.C
(Generate patch)

Comparing deliantra/server/server/spell_util.C (file contents):
Revision 1.97 by root, Sat Jun 27 03:51:05 2009 UTC vs.
Revision 1.101 by root, Fri Nov 6 13:03:34 2009 UTC

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>
637 638
638/* put_a_monster: puts a monster named monstername near by 639/* put_a_monster: puts a monster named monstername near by
639 * op. This creates the treasures for the monsters, and 640 * op. This creates the treasures for the monsters, and
640 * also deals with multipart monsters properly. 641 * also deals with multipart monsters properly.
641 */ 642 */
642void 643static void
643put_a_monster (object *op, const char *monstername) 644put_a_monster (object *op, const char *monstername)
644{ 645{
645 object *tmp, *head = NULL, *prev = NULL; 646 object *tmp, *head = NULL, *prev = NULL;
646 archetype *at; 647 archetype *at;
647 int dir; 648 int dir;
783 * at casting a prayer. 784 * at casting a prayer.
784 * op is the player. 785 * op is the player.
785 * failure is basically how much grace they had. 786 * failure is basically how much grace they had.
786 * power is how much grace the spell would normally take to cast. 787 * power is how much grace the spell would normally take to cast.
787 */ 788 */
788void 789static void
789prayer_failure (object *op, int failure, int power) 790prayer_failure (object *op, int failure, int power)
790{ 791{
791 const char *godname; 792 const char *godname;
792 object *tmp; 793 object *tmp;
793 794
886 tmp->insert_at (op); 887 tmp->insert_at (op);
887 } 888 }
888 } 889 }
889} 890}
890 891
891int 892static int
892cast_party_spell (object *op, object *caster, int dir, object *spell_ob, char *spellparam) 893cast_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}
1449} 1449}
1450 1450
1451/* this checks to see if something special should happen if 1451/* this checks to see if something special should happen if
1452 * something runs into the object. 1452 * something runs into the object.
1453 */ 1453 */
1454void 1454static void
1455check_spell_effect (object *op) 1455check_spell_effect (object *op)
1456{ 1456{
1457 switch (op->subtype) 1457 switch (op->subtype)
1458 { 1458 {
1459 case SP_BOLT: 1459 case SP_BOLT:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines