version 1.25 | | version 1.26 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.25 2001/06/13 12:51:58 michtoen Exp $"; | | * "$Id: time.c,v 1.26 2001/07/14 04:11:18 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
if(head!=NULL) | | if(head!=NULL) |
op->head=head,prev->more=op; | | op->head=head,prev->more=op; |
if (RANDOM()%10) generate_artifact(op, gen->map->difficulty); | | if (RANDOM()%10) generate_artifact(op, gen->map->difficulty); |
insert_ob_in_map(op,gen->map,gen); | | insert_ob_in_map(op,gen->map,gen,0); |
if (QUERY_FLAG(op, FLAG_FREED)) return; | | if (QUERY_FLAG(op, FLAG_FREED)) return; |
if(op->randomitems!=NULL) | | if(op->randomitems!=NULL) |
create_treasure(op->randomitems,op,GT_APPLY, | | create_treasure(op->randomitems,op,GT_APPLY, |
| | |
if((int)op->stats.wc < (NUM_ANIMATIONS(op)/2+1)) { | | if((int)op->stats.wc < (NUM_ANIMATIONS(op)/2+1)) { |
CLEAR_FLAG(op, FLAG_NO_PASS); | | CLEAR_FLAG(op, FLAG_NO_PASS); |
CLEAR_FLAG(op, FLAG_BLOCKSVIEW); | | CLEAR_FLAG(op, FLAG_BLOCKSVIEW); |
update_all_los(op->map); | | update_all_los(op->map, op->x, op->y); |
} | | } |
SET_ANIMATION(op, op->stats.wc); | | SET_ANIMATION(op, op->stats.wc); |
update_object(op); | | update_object(op,UP_OBJ_CHANGE); |
return; | | return; |
} | | } |
| | |
| | |
if (i!=-1) { | | if (i!=-1) { |
remove_ob(tmp); | | remove_ob(tmp); |
tmp->x+=freearr_x[i],tmp->y+=freearr_y[i]; | | tmp->x+=freearr_x[i],tmp->y+=freearr_y[i]; |
insert_ob_in_map(tmp,op->map,op); | | insert_ob_in_map(tmp,op->map,op,0); |
} | | } |
} | | } |
} | | } |
| | |
SET_FLAG(op, FLAG_NO_PASS); /* The coast is clear, block the way */ | | SET_FLAG(op, FLAG_NO_PASS); /* The coast is clear, block the way */ |
if(!op->arch->clone.stats.ac) | | if(!op->arch->clone.stats.ac) |
SET_FLAG(op, FLAG_BLOCKSVIEW); | | SET_FLAG(op, FLAG_BLOCKSVIEW); |
update_all_los(op->map); | | update_all_los(op->map, op->x, op->y); |
} | | } |
} /* gate is halfway up */ | | } /* gate is halfway up */ |
| | |
SET_ANIMATION(op, op->stats.wc); | | SET_ANIMATION(op, op->stats.wc); |
update_object(op); | | update_object(op,UP_OBJ_CHANGE); |
} /* gate is going up */ | | } /* gate is going up */ |
} | | } |
| | |
| | |
check_trigger(op,NULL); | | check_trigger(op,NULL); |
} else { | | } else { |
SET_ANIMATION(op, op->stats.wc); | | SET_ANIMATION(op, op->stats.wc); |
update_object(op); | | update_object(op,UP_OBJ_FACE); |
} | | } |
} | | } |
| | |
| | |
} | | } |
} | | } |
SET_ANIMATION(op, op->stats.wc); | | SET_ANIMATION(op, op->stats.wc); |
update_object(op); | | update_object(op,UP_OBJ_FACE); |
return; | | return; |
} | | } |
/* We're closing */ | | /* We're closing */ |
| | |
if((int)op->stats.wc >= NUM_ANIMATIONS(op)) | | if((int)op->stats.wc >= NUM_ANIMATIONS(op)) |
op->stats.wc=NUM_ANIMATIONS(op)-1; | | op->stats.wc=NUM_ANIMATIONS(op)-1; |
SET_ANIMATION(op, op->stats.wc); | | SET_ANIMATION(op, op->stats.wc); |
update_object(op); | | update_object(op,UP_OBJ_FACE); |
if((unsigned char) op->stats.wc==(NUM_ANIMATIONS(op)-1)) { | | if((unsigned char) op->stats.wc==(NUM_ANIMATIONS(op)-1)) { |
op->speed = 0; | | op->speed = 0; |
update_ob_speed(op); /* closed, let's stop */ | | update_ob_speed(op); /* closed, let's stop */ |
| | |
if (map == NULL) | | if (map == NULL) |
return; | | return; |
if (QUERY_FLAG (op, FLAG_REMOVED)) | | if (QUERY_FLAG (op, FLAG_REMOVED)) |
insert_ob_in_map (op, map, originator); | | insert_ob_in_map (op, map, originator,0); |
else if (op->type == ARROW) | | else if (op->type == ARROW) |
merge_ob (op, NULL); /* only some arrows actually need this */ | | merge_ob (op, NULL); /* only some arrows actually need this */ |
} | | } |
| | |
op->stats.hp = 0; | | op->stats.hp = 0; |
op->face=op->arch->clone.face; | | op->face=op->arch->clone.face; |
op->owner=NULL; /* So that stopped arrows will be saved */ | | op->owner=NULL; /* So that stopped arrows will be saved */ |
update_object (op); | | update_object (op,UP_OBJ_FACE); |
return op; | | return op; |
} | | } |
| | |
| | |
object *payload = op->inv; | | object *payload = op->inv; |
remove_ob (payload); | | remove_ob (payload); |
clear_owner(payload); | | clear_owner(payload); |
insert_ob_in_map (payload, op->map, payload); | | insert_ob_in_map (payload, op->map, payload,0); |
remove_ob (op); | | remove_ob (op); |
free_object (op); | | free_object (op); |
} else { | | } else { |
| | |
remove_ob (op); | | remove_ob (op); |
op->x = new_x; | | op->x = new_x; |
op->y = new_y; | | op->y = new_y; |
insert_ob_in_map (op, op->map, op); | | insert_ob_in_map (op, op->map, op,0); |
} | | } |
| | |
/* This routine doesnt seem to work for "inanimate" objects that | | /* This routine doesnt seem to work for "inanimate" objects that |
| | |
free_object(tmp); | | free_object(tmp); |
else { | | else { |
tmp->x=op->x+freearr_x[j],tmp->y=op->y+freearr_y[j]; | | tmp->x=op->x+freearr_x[j],tmp->y=op->y+freearr_y[j]; |
insert_ob_in_map(tmp,op->map,op); | | insert_ob_in_map(tmp,op->map,op,0); |
} | | } |
} | | } |
} | | } |
| | |
tmp->title = add_string(op->slaying); | | tmp->title = add_string(op->slaying); |
} | | } |
tmp->x=op->x;tmp->y=op->y;tmp->map=op->map;tmp->level=op->level; | | tmp->x=op->x;tmp->y=op->y;tmp->map=op->map;tmp->level=op->level; |
insert_ob_in_map(tmp,op->map,op); | | insert_ob_in_map(tmp,op->map,op,0); |
} | | } |
| | |
/* move_marker --peterm@soda.csua.berkeley.edu | | /* move_marker --peterm@soda.csua.berkeley.edu |