version 1.34 | | version 1.35 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_util_c = | | * static char *rcsid_spell_util_c = |
* "$Id: spell_util.c,v 1.34 2000/11/24 00:48:56 peterm Exp $"; | | * "$Id: spell_util.c,v 1.35 2000/12/04 00:40:05 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
case SP_CONFLICT: | | case SP_CONFLICT: |
success = cast_cause_conflict(op,caster,spellarch[type],type); | | success = cast_cause_conflict(op,caster,spellarch[type],type); |
break; | | break; |
| | |
| | case SP_POISON_FOG: |
| | case SP_VITRIOL_SPLASH: |
| | /* These two don't do anything yet, but putting the above in |
| | * prevents compiler warnings. |
| | */ |
| | break; |
} | | } |
| | |
play_sound_map(op->map, op->x, op->y, SOUND_CAST_SPELL_0 + type); | | play_sound_map(op->map, op->x, op->y, SOUND_CAST_SPELL_0 + type); |
| | |
/* Perhaps we should also put checks in for no magic and unholy | | /* Perhaps we should also put checks in for no magic and unholy |
* ground to prevent it from moving along? | | * ground to prevent it from moving along? |
*/ | | */ |
#if 0 | | |
/* Remove code that determines if it stops because it hits | | |
* a type of monster. I don't think that should affect it. | | |
*/ | | |
head=tmp->head==NULL?tmp:tmp->head; | | |
if((QUERY_FLAG(head, FLAG_ALIVE) && head->immune & immune_stop)) | | |
return 0; | | |
#endif | | |
} | | } |
/* If it passes the above tests, it must be OK */ | | /* If it passes the above tests, it must be OK */ |
return 1; | | return 1; |
| | |
op->value=1; | | op->value=1; |
if(!op->direction) | | if(!op->direction) |
return; | | return; |
/* | | |
* The bolt stops if it hits someone who is immune to it. | | |
*/ | | |
tmp=get_map_ob(op->map,op->x,op->y); | | |
while(tmp!=NULL&&(!QUERY_FLAG(tmp, FLAG_ALIVE)||!(tmp->immune&op->attacktype))) | | |
tmp=tmp->above; | | |
if(tmp!=NULL) { | | |
remove_ob(op); | | |
free_object(op); | | |
return; | | |
} | | |
if(blocks_view(op->map,op->x+DIRX(op),op->y+DIRY(op))) | | if(blocks_view(op->map,op->x+DIRX(op),op->y+DIRY(op))) |
return; | | return; |
w=wall(op->map,op->x+DIRX(op),op->y+DIRY(op)); | | w=wall(op->map,op->x+DIRX(op),op->y+DIRY(op)); |
| | |
{ | | { |
tag_t op_tag = op->count; | | tag_t op_tag = op->count; |
object *tmp; | | object *tmp; |
mapstruct *map; | | |
| | |
if (op->other_arch == NULL) { | | if (op->other_arch == NULL) { |
LOG (llevError, "BUG: explode_object(): op without other_arch\n"); | | LOG (llevError, "BUG: explode_object(): op without other_arch\n"); |
| | |
case CONE: | | case CONE: |
{ | | { |
int type = tmp->stats.sp; | | int type = tmp->stats.sp; |
int level = op->level; | | |
if(!type) type = op->stats.sp; | | if(!type) type = op->stats.sp; |
copy_owner(tmp,op); | | copy_owner(tmp,op); |
cast_cone(op,op,0,SP_PARAMETERS[type].bdur,type,op->other_arch,op->attacktype&AT_MAGIC); | | cast_cone(op,op,0,SP_PARAMETERS[type].bdur,type,op->other_arch,op->attacktype&AT_MAGIC); |
| | |
/* ball lightning automatically seeks out a victim, if | | /* ball lightning automatically seeks out a victim, if |
it sees any monsters close enough. */ | | it sees any monsters close enough. */ |
void move_ball_lightning(object *op) { | | void move_ball_lightning(object *op) { |
int i,nx,ny,tx,ty,j,dam_save,dir; | | int i,nx,ny,j,dam_save,dir; |
object *owner; | | object *owner; |
| | |
owner = get_owner(op); | | owner = get_owner(op); |
| | |
| | |
if(!(RANDOM() %4)) | | if(!(RANDOM() %4)) |
j = RANDOM() %2; | | j = RANDOM() %2; |
| | else j=0; /* ? j wasn't being assigned to anything before */ |
for(i = 1; i < 9; i++) { | | for(i = 1; i < 9; i++) { |
/* i bit 0: alters sign of offset | | /* i bit 0: alters sign of offset |
* otther bits (i / 2): absolute value of offset | | * otther bits (i / 2): absolute value of offset |
| | |
| | |
if(i>=0) { /* we have a preferred direction! */ | | if(i>=0) { /* we have a preferred direction! */ |
/* pick another direction if the preferred dir is blocked. */ | | /* pick another direction if the preferred dir is blocked. */ |
if(wall(op->map,tx + freearr_x[i], ty + freearr_y[i])) { | | if(wall(op->map,nx + freearr_x[i], ny + freearr_y[i])) { |
i+= RANDOM()%3-1; /* -1, 0, +1 */ | | i+= RANDOM()%3-1; /* -1, 0, +1 */ |
if(i==0) i=8; | | if(i==0) i=8; |
if(i==9) i=1; | | if(i==9) i=1; |