version 1.14 | | version 1.15 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.14 2000/05/17 03:51:15 cvs Exp $"; | | * "$Id: spell_effect.c,v 1.15 2000/05/26 09:50:49 jec Exp $"; |
*/ | | */ |
| | |
| | |
| | |
else tmp->stats.dam=power; /* nasty recoils! */ | | else tmp->stats.dam=power; /* nasty recoils! */ |
| | |
tmp->stats.maxhp=tmp->count; /*??*/ | | tmp->stats.maxhp=tmp->count; /*??*/ |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,NULL); |
} | | } |
} | | } |
} | | } |
| | |
tmp->stats.hp+=lvl/5; /* increase the area of destruction */ | | tmp->stats.hp+=lvl/5; /* increase the area of destruction */ |
tmp->stats.dam=lvl; /* nasty recoils! */ | | tmp->stats.dam=lvl; /* nasty recoils! */ |
tmp->stats.maxhp=tmp->count; /*??*/ | | tmp->stats.maxhp=tmp->count; /*??*/ |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
| | |
} | | } |
| | |
| | |
int i,j; | | int i,j; |
object *tmp; | | object *tmp; |
| | |
spell_effect(SP_AGGRAVATION, op->x, op->y, op->map); | | spell_effect(SP_AGGRAVATION, op->x, op->y, op->map, op); |
| | |
for (i = 0; i < op->map->mapx; i++) | | for (i = 0; i < op->map->mapx; i++) |
for (j = 0; j < op->map->mapy; j++) { | | for (j = 0; j < op->map->mapy; j++) { |
| | |
new_draw_info_format(NDI_UNIQUE, 0, op, | | new_draw_info_format(NDI_UNIQUE, 0, op, |
"The %s vibrates violently, then explodes!",query_name(wand)); | | "The %s vibrates violently, then explodes!",query_name(wand)); |
play_sound_map(op->map, op->x, op->y, SOUND_OB_EXPLODE); | | play_sound_map(op->map, op->x, op->y, SOUND_OB_EXPLODE); |
spell_effect(SP_DESTRUCTION, op->x, op->y, op->map); | | spell_effect(SP_DESTRUCTION, op->x, op->y, op->map, op); |
remove_ob(wand); | | remove_ob(wand); |
free_object(wand); | | free_object(wand); |
return 1; | | return 1; |
| | |
for(tmp = op->inv; tmp != NULL; tmp = next) { | | for(tmp = op->inv; tmp != NULL; tmp = next) { |
next = tmp->below; | | next = tmp->below; |
if(QUERY_FLAG(tmp, FLAG_APPLIED)) | | if(QUERY_FLAG(tmp, FLAG_APPLIED)) |
apply(op,tmp,0); | | manual_apply(op,tmp,0); |
if(tmp->type == ABILITY) { | | if(tmp->type == ABILITY) { |
remove_ob(tmp); | | remove_ob(tmp); |
free_object(tmp); | | free_object(tmp); |
| | |
| | |
/* Put the new creature on the map */ | | /* Put the new creature on the map */ |
op->x = x; op->y = y; | | op->x = x; op->y = y; |
insert_ob_in_map(op,map); | | insert_ob_in_map(op,map,owner); |
| | |
/* It is possible that there is something on the map that kills | | /* It is possible that there is something on the map that kills |
* the object when inserted. Unlikely, but worth checking. */ | | * the object when inserted. Unlikely, but worth checking. */ |
| | |
*/ | | */ |
image->stats.food += range; | | image->stats.food += range; |
image->speed_left = 0.1; | | image->speed_left = 0.1; |
insert_ob_in_map(image,op->map); | | insert_ob_in_map(image,op->map,op); |
} | | } |
return 1; | | return 1; |
} | | } |
| | |
spb->speed_left= -0.1; | | spb->speed_left= -0.1; |
if(type==SP_LARGE_SPEEDBALL) | | if(type==SP_LARGE_SPEEDBALL) |
spb->stats.dam=30; | | spb->stats.dam=30; |
insert_ob_in_map(spb,op->map); | | insert_ob_in_map(spb,op->map,op); |
return 1; | | return 1; |
} | | } |
| | |
| | |
return 0; | | return 0; |
} | | } |
tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir]; | | tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir]; |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
| | |
if (QUERY_FLAG(tmp, FLAG_REMOVED)) { | | if (QUERY_FLAG(tmp, FLAG_REMOVED)) { |
new_draw_info(NDI_UNIQUE, 0,op,"Something destroys your wall"); | | new_draw_info(NDI_UNIQUE, 0,op,"Something destroys your wall"); |
| | |
tmp2 = get_object(); | | tmp2 = get_object(); |
copy_object(tmp,tmp2); | | copy_object(tmp,tmp2); |
tmp2->x = x; tmp2->y = y; | | tmp2->x = x; tmp2->y = y; |
insert_ob_in_map(tmp2,op->map); | | insert_ob_in_map(tmp2,op->map,op); |
} else posblocked=1; | | } else posblocked=1; |
x = tmp->x-i*freearr_x[dir2]; y = tmp->y-i*freearr_y[dir2]; | | x = tmp->x-i*freearr_x[dir2]; y = tmp->y-i*freearr_y[dir2]; |
if(!blocked(op->map,x,y)&&!negblocked) { | | if(!blocked(op->map,x,y)&&!negblocked) { |
tmp2 = get_object(); | | tmp2 = get_object(); |
copy_object(tmp,tmp2); | | copy_object(tmp,tmp2); |
tmp2->x = x; tmp2->y = y; | | tmp2->x = x; tmp2->y = y; |
insert_ob_in_map(tmp2,op->map); | | insert_ob_in_map(tmp2,op->map,op); |
} else negblocked=1; | | } else negblocked=1; |
} | | } |
} | | } |
| | |
tmp->glow_radius=dam; | | tmp->glow_radius=dam; |
tmp->x=x,tmp->y=y; | | tmp->x=x,tmp->y=y; |
if(tmp->speed<=0) tmp->speed = 0.000001; /* safety */ | | if(tmp->speed<=0) tmp->speed = 0.000001; /* safety */ |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
| | |
if(op->type==PLAYER) draw(op); | | if(op->type==PLAYER) draw(op); |
return 1; | | return 1; |
| | |
| | |
remove_ob(op); | | remove_ob(op); |
op->x=x,op->y=y; | | op->x=x,op->y=y; |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
draw(op); | | draw(op); |
return 1; | | return 1; |
} | | } |
| | |
/* Actually move the player now */ | | /* Actually move the player now */ |
remove_ob(op); | | remove_ob(op); |
op->x+=freearr_x[dir]*dist,op->y+=freearr_y[dir]*dist; | | op->x+=freearr_x[dir]*dist,op->y+=freearr_y[dir]*dist; |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
draw(op); | | draw(op); |
op->speed_left= -FABS(op->speed)*5; /* Freeze them for a short while */ | | op->speed_left= -FABS(op->speed)*5; /* Freeze them for a short while */ |
return 1; | | return 1; |
| | |
prev = tmp; | | prev = tmp; |
} | | } |
head->direction = dir; | | head->direction = dir; |
insert_ob_in_map(head, op->map); | | insert_ob_in_map(head, op->map, op); |
if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) { | | if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) { |
object *tmp; | | object *tmp; |
create_treasure(head->randomitems,head,GT_INVENTORY,6,0); | | create_treasure(head->randomitems,head,GT_INVENTORY,6,0); |
| | |
| | |
set_owner(tmp,op); | | set_owner(tmp,op); |
tmp->x=dx,tmp->y=dy; | | tmp->x=dx,tmp->y=dy; |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
return 1; | | return 1; |
} | | } |
| | |
| | |
if (op->type==PLAYER) drop(env,op); | | if (op->type==PLAYER) drop(env,op); |
else { | | else { |
remove_ob(op); | | remove_ob(op); |
insert_ob_in_map(op, env->map); | | insert_ob_in_map(op, env->map, op); |
} | | } |
} | | } |
if (env->map == NULL) | | if (env->map == NULL) |
| | |
if(op->type==PLAYER) | | if(op->type==PLAYER) |
set_owner(tmp,op); | | set_owner(tmp,op); |
| | |
insert_ob_in_map(tmp,op->map); | | if ((tmp = insert_ob_in_map(tmp,op->map,op)) != NULL) |
| | |
/* It is possible that the object got destroyed by the insert above */ | | |
if (!QUERY_FLAG(tmp, FLAG_FREED)) | | |
move_cancellation(tmp); | | move_cancellation(tmp); |
return 1; | | return 1; |
} | | } |
| | |
if(reflwall(op->map,op->x,op->y)) { | | if(reflwall(op->map,op->x,op->y)) { |
| | |
op->direction=absdir(op->direction+4); | | op->direction=absdir(op->direction+4); |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
return; | | return; |
} | | } |
hit_map(op, 0, op->attacktype); | | hit_map(op, 0, op->attacktype); |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
} | | } |
| | |
void cancellation(object *op) | | void cancellation(object *op) |
| | |
tmp-> nrof = small_nuggets; | | tmp-> nrof = small_nuggets; |
tmp->x = x; | | tmp->x = x; |
tmp->y = y; | | tmp->y = y; |
insert_ob_in_map(tmp, op->map); | | insert_ob_in_map(tmp, op->map, op); |
} | | } |
if (large_nuggets) { | | if (large_nuggets) { |
tmp = get_object(); | | tmp = get_object(); |
| | |
tmp-> nrof = large_nuggets; | | tmp-> nrof = large_nuggets; |
tmp->x = x; | | tmp->x = x; |
tmp->y = y; | | tmp->y = y; |
insert_ob_in_map(tmp, op->map); | | insert_ob_in_map(tmp, op->map, op); |
} | | } |
} | | } |
| | |
| | |
if (!success) | | if (!success) |
new_draw_info(NDI_UNIQUE, 0,op, "You can't reach anything unidentified."); | | new_draw_info(NDI_UNIQUE, 0,op, "You can't reach anything unidentified."); |
else { | | else { |
spell_effect(SP_IDENTIFY, op->x, op->y, op->map); | | spell_effect(SP_IDENTIFY, op->x, op->y, op->map, op); |
} | | } |
return success; | | return success; |
} | | } |
| | |
object *detect_ob = arch_to_object(detect_arch); | | object *detect_ob = arch_to_object(detect_arch); |
detect_ob->x = x; | | detect_ob->x = x; |
detect_ob->y = y; | | detect_ob->y = y; |
insert_ob_in_map(detect_ob, op->map); | | insert_ob_in_map(detect_ob, op->map, op); |
} | | } |
} | | } |
if ((type == SP_DETECT_MAGIC || type == SP_DETECT_CURSE) && | | if ((type == SP_DETECT_MAGIC || type == SP_DETECT_CURSE) && |
| | |
if((effect=get_archetype("detect_magic"))){ | | if((effect=get_archetype("detect_magic"))){ |
effect->x = tmp->x; | | effect->x = tmp->x; |
effect->y = tmp->y; | | effect->y = tmp->y; |
insert_ob_in_map(effect,tmp->map); | | insert_ob_in_map(effect,tmp->map,op); |
} | | } |
SET_FLAG(tmp,FLAG_UNAGGRESSIVE); | | SET_FLAG(tmp,FLAG_UNAGGRESSIVE); |
} | | } |
| | |
/* that players will garner much exp with */ | | /* that players will garner much exp with */ |
/* this spell */ | | /* this spell */ |
#endif | | #endif |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
} | | } |
| | |
return 1; | | return 1; |
| | |
free_object(tmp); | | free_object(tmp); |
return 0; | | return 0; |
} | | } |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
if(QUERY_FLAG(tmp, FLAG_BLOCKSVIEW)) | | if(QUERY_FLAG(tmp, FLAG_BLOCKSVIEW)) |
update_all_los(op->map); | | update_all_los(op->map); |
if(op->type==PLAYER) | | if(op->type==PLAYER) |
| | |
if((effect=get_archetype("detect_magic"))){ | | if((effect=get_archetype("detect_magic"))){ |
effect->x = tmp->x; | | effect->x = tmp->x; |
effect->y = tmp->y; | | effect->y = tmp->y; |
insert_ob_in_map(effect,tmp->map); | | insert_ob_in_map(effect,tmp->map,op); |
} | | } |
set_owner(tmp,op); | | set_owner(tmp,op); |
SET_FLAG(tmp,FLAG_MONSTER); | | SET_FLAG(tmp,FLAG_MONSTER); |
| | |
if((effect=get_archetype("detect_magic"))){ | | if((effect=get_archetype("detect_magic"))){ |
effect->x = tmp->x; | | effect->x = tmp->x; |
effect->y = tmp->y; | | effect->y = tmp->y; |
insert_ob_in_map(effect,tmp->map); | | insert_ob_in_map(effect,tmp->map,op); |
} | | } |
set_owner(tmp,op); | | set_owner(tmp,op); |
SET_FLAG(tmp,FLAG_MONSTER); | | SET_FLAG(tmp,FLAG_MONSTER); |
| | |
} | | } |
} /* if monster level is much less than character level */ | | } /* if monster level is much less than character level */ |
| | |
insert_ob_in_map(head, op->map); | | insert_ob_in_map(head, op->map, op); |
if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) { | | if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) { |
object *tmp; | | object *tmp; |
create_treasure(head->randomitems,head,GT_INVENTORY,6,0); | | create_treasure(head->randomitems,head,GT_INVENTORY,6,0); |
| | |
tmp->speed_left= -1; | | tmp->speed_left= -1; |
tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir]; | | tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir]; |
tmp->direction=dir; | | tmp->direction=dir; |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
return 1; | | return 1; |
} | | } |
| | |
| | |
} | | } |
} | | } |
| | |
insert_ob_in_map(hitter,op->map); | | insert_ob_in_map(hitter,op->map,op); |
| | |
return success; | | return success; |
} | | } |
| | |
tmp->speed_left= -1; | | tmp->speed_left= -1; |
tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir]; | | tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir]; |
tmp->direction=dir; | | tmp->direction=dir; |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,op); |
return 1; | | return 1; |
} | | } |
| | |
| | |
if(effect){ | | if(effect){ |
effect->x = tmp->x; | | effect->x = tmp->x; |
effect->y = tmp->y; | | effect->y = tmp->y; |
insert_ob_in_map(effect,op->map); | | insert_ob_in_map(effect,op->map,op); |
} | | } |
} | | } |
#endif | | #endif |
| | |
flash->x = x; | | flash->x = x; |
flash->y = y; | | flash->y = y; |
flash->map = walk->map; | | flash->map = walk->map; |
insert_ob_in_map(flash,walk->map); | | insert_ob_in_map(flash,walk->map,op); |
return 1; | | return 1; |
} | | } |
free_object(disease); | | free_object(disease); |