version 1.94 | | version 1.95 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.94 2003/01/30 00:07:09 garbled Exp $"; | | * "$Id: spell_effect.c,v 1.95 2003/02/03 07:23:48 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
} | | } |
| | |
int dimension_door(object *op,int dir) { | | int dimension_door(object *op,int dir) { |
int dist, maxdist; | | int dist, maxdist, mflags; |
| | |
if(op->type!=PLAYER) | | if(op->type!=PLAYER) |
return 0; | | return 0; |
| | |
return 0; | | return 0; |
} | | } |
| | |
for(dist=0;dist<op->contr->count; dist++) | | for(dist=0;dist<op->contr->count; dist++) { |
if (get_map_flags(op->map, NULL, | | mflags = get_map_flags(op->map, NULL, |
op->x+freearr_x[dir]*(dist+1), op->y+freearr_y[dir]*(dist+1), | | op->x+freearr_x[dir]*(dist+1), op->y+freearr_y[dir]*(dist+1), |
NULL, NULL) & (P_NO_MAGIC | P_OUT_OF_MAP)) break; | | NULL, NULL); |
| | |
| | if ((mflags & (P_NO_MAGIC | P_OUT_OF_MAP)) || |
| | ((mflags & P_NO_PASS) && (mflags & P_BLOCKSVIEW))) break; |
| | } |
| | |
if(dist<op->contr->count) { | | if(dist<op->contr->count) { |
new_draw_info(NDI_UNIQUE, 0,op,"Something blocks the magic of the spell.\n"); | | new_draw_info(NDI_UNIQUE, 0,op,"Something blocks the magic of the spell.\n"); |
| | |
* spaces that blocked the players view. | | * spaces that blocked the players view. |
*/ | | */ |
| | |
for(dist=1; dist < maxdist; dist++) | | for(dist=0; dist < maxdist; dist++) { |
if (get_map_flags(op->map, NULL, | | mflags = get_map_flags(op->map, NULL, |
op->x+freearr_x[dir] * dist, | | op->x+freearr_x[dir] * (dist+1), |
op->y+freearr_y[dir] * dist, | | op->y+freearr_y[dir] * (dist+1), |
NULL, NULL) & (P_NO_MAGIC | P_OUT_OF_MAP)) { | | NULL, NULL); |
dist--; | | if ((mflags & (P_NO_MAGIC | P_OUT_OF_MAP)) || |
| | ((mflags & P_NO_PASS) && (mflags & P_BLOCKSVIEW))) { |
break; | | break; |
} | | } |
| | } |
| | |
/* If the destinate is blocked, keep backing up until we | | /* If the destination is blocked, keep backing up until we |
* find a place for the player. | | * find a place for the player. |
*/ | | */ |
for(;dist>0; dist--) | | for(;dist>0; dist--) |
| | |
int animate_weapon(object *op,object *caster,int dir, archetype *at, int spellnum) { | | int animate_weapon(object *op,object *caster,int dir, archetype *at, int spellnum) { |
object *weapon, *tmp; | | object *weapon, *tmp; |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
int a, i, j; | | int a, i; |
sint16 x, y; | | sint16 x, y; |
int magic; | | int magic; |
mapstruct *m; | | mapstruct *m; |