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

Comparing deliantra/server/server/spell_effect.C (file contents):
Revision 1.83 by root, Tue May 6 16:55:26 2008 UTC vs.
Revision 1.84 by root, Tue Jul 8 08:33:27 2008 UTC

61{ 61{
62 object *wand, *tmp; 62 object *wand, *tmp;
63 int ncharges; 63 int ncharges;
64 64
65 wand = find_marked_object (op); 65 wand = find_marked_object (op);
66 if (wand == NULL || wand->type != WAND) 66 if (!wand || wand->type != WAND)
67 { 67 {
68 new_draw_info (NDI_UNIQUE, 0, op, "You need to mark the wand you want to recharge."); 68 new_draw_info (NDI_UNIQUE, 0, op, "You need to mark the wand you want to recharge.");
69 return 0; 69 return 0;
70 } 70 }
71 if (!(random_roll (0, 3, op, PREFER_HIGH))) 71 if (!(random_roll (0, 3, op, PREFER_HIGH)))
301 if (!QUERY_FLAG (op, FLAG_WIZCAST) && (mflags & P_NO_MAGIC)) 301 if (!QUERY_FLAG (op, FLAG_WIZCAST) && (mflags & P_NO_MAGIC))
302 { 302 {
303 new_draw_info (NDI_UNIQUE, 0, op, "Something blocks your magic."); 303 new_draw_info (NDI_UNIQUE, 0, op, "Something blocks your magic.");
304 return 0; 304 return 0;
305 } 305 }
306
306 if (mflags & P_IS_ALIVE) 307 if (mflags & P_IS_ALIVE)
307 { 308 {
308 for (tmp = GET_MAP_OB (m, x, y); tmp != NULL; tmp = tmp->above) 309 for (tmp = GET_MAP_OB (m, x, y); tmp; tmp = tmp->above)
309 if (QUERY_FLAG (tmp, FLAG_ALIVE) && (tmp->type == PLAYER || QUERY_FLAG (tmp, FLAG_MONSTER))) 310 if (QUERY_FLAG (tmp, FLAG_ALIVE) && (tmp->type == PLAYER || QUERY_FLAG (tmp, FLAG_MONSTER)))
310 { 311 {
311 new_draw_info (NDI_UNIQUE, 0, op, "You detect something."); 312 new_draw_info (NDI_UNIQUE, 0, op, "You detect something.");
312 if (tmp->head != NULL) 313 if (tmp->head != NULL)
313 tmp = tmp->head; 314 tmp = tmp->head;
491 new_draw_info (NDI_UNIQUE, 0, op, "You feel a force starting to build up inside you."); 492 new_draw_info (NDI_UNIQUE, 0, op, "You feel a force starting to build up inside you.");
492 return 1; 493 return 1;
493 } 494 }
494 495
495 dummy = get_archetype (FORCE_NAME); 496 dummy = get_archetype (FORCE_NAME);
496 if (dummy == NULL) 497
498 if (!dummy)
497 { 499 {
498 new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); 500 new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!");
499 LOG (llevError, "cast_word_of_recall: get_archetype(force) failed!\n"); 501 LOG (llevError, "cast_word_of_recall: get_archetype(force) failed!\n");
500 return 0; 502 return 0;
501 } 503 }
1982 return 0; 1984 return 0;
1983 } 1985 }
1984 1986
1985 /* if no direction specified, pick one */ 1987 /* if no direction specified, pick one */
1986 if (!dir) 1988 if (!dir)
1987 dir = find_free_spot (NULL, op->map, op->x, op->y, 1, 9); 1989 dir = find_free_spot (spell->other_arch, op->map, op->x, op->y, 1, 9);
1988 1990
1989 m = op->map; 1991 m = op->map;
1990 x = op->x + freearr_x[dir]; 1992 x = op->x + freearr_x[dir];
1991 y = op->y + freearr_y[dir]; 1993 y = op->y + freearr_y[dir];
1992 1994
1993 /* if there's no place to put the golem, abort */ 1995 /* if there's no place to put the golem, abort */
1994 if ((dir == -1) || (get_map_flags (m, &m, x, y, &x, &y) & P_OUT_OF_MAP) || 1996 if (dir < 0 || (get_map_flags (m, &m, x, y, &x, &y) & P_OUT_OF_MAP)
1995 ((spell->other_arch->move_type & GET_MAP_MOVE_BLOCK (m, x, y)) == spell->other_arch->move_type)) 1997 || ((spell->other_arch->move_type & GET_MAP_MOVE_BLOCK (m, x, y)) == spell->other_arch->move_type))
1996 { 1998 {
1997 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way."); 1999 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way.");
1998 return 0; 2000 return 0;
1999 } 2001 }
2000 2002

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines