version 1.4 | | version 1.5 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.4 2000/04/17 14:18:13 jec Exp $"; | | * "$Id: time.c,v 1.5 2000/05/26 09:50:49 jec 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); | | insert_ob_in_map(op,gen->map,gen); |
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_INVENTORY, | | create_treasure(op->randomitems,op,GT_INVENTORY, |
| | |
"You are crushed by the %s!",op->name); | | "You are crushed by the %s!",op->name); |
} else | | } else |
/* If the object is not alive, and the object either can | | /* If the object is not alive, and the object either can |
* not be picked up or the object rolls, move the object | | * be picked up or the object rolls, move the object |
* off the gate. | | * off the gate. |
*/ | | */ |
if(!QUERY_FLAG(tmp, FLAG_ALIVE) | | if(!QUERY_FLAG(tmp, FLAG_ALIVE) |
| | |
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); | | insert_ob_in_map(tmp,op->map,op); |
} | | } |
} | | } |
} | | } |
| | |
{ | | { |
if((unsigned char)++op->stats.wc >= NUM_ANIMATIONS(op)) { | | if((unsigned char)++op->stats.wc >= NUM_ANIMATIONS(op)) { |
op->stats.wc = 0; | | op->stats.wc = 0; |
check_trigger(op); | | check_trigger(op,NULL); |
} | | } else { |
SET_ANIMATION(op, op->stats.wc); | | SET_ANIMATION(op, op->stats.wc); |
update_object(op); | | update_object(op); |
} | | } |
| | } |
| | |
void move_hole(object *op) { /* 1 = opening, 0 = closing */ | | void move_hole(object *op) { /* 1 = opening, 0 = closing */ |
object *next,*tmp; | | object *next,*tmp; |
| | |
SET_FLAG(op, FLAG_WALK_ON); | | SET_FLAG(op, FLAG_WALK_ON); |
for (tmp=op->above; tmp!=NULL; tmp=next) { | | for (tmp=op->above; tmp!=NULL; tmp=next) { |
next=tmp->above; | | next=tmp->above; |
apply(tmp,op,0); | | move_apply(op,tmp,tmp); |
} | | } |
} | | } |
SET_ANIMATION(op, op->stats.wc); | | SET_ANIMATION(op, op->stats.wc); |
| | |
if (tmp->type== PLAYER) | | if (tmp->type== PLAYER) |
esrv_send_item (tmp, op); | | esrv_send_item (tmp, op); |
} else | | } else |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
op->owner=NULL; /* So that stopped arrows will be saved */ | | op->owner=NULL; /* So that stopped arrows will be saved */ |
} | | } |
| | |
| | |
| | |
/* Nothing alive? Insert arrow and return */ | | /* Nothing alive? Insert arrow and return */ |
if(tmp==NULL) { | | if(tmp==NULL) { |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
return; | | return; |
} | | } |
| | |
| | |
number-=8; | | number-=8; |
op->face = &new_faces[number]; | | op->face = &new_faces[number]; |
} | | } |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
return; | | return; |
} | | } |
| | |
| | |
* stop the arrow. | | * stop the arrow. |
*/ | | */ |
if(op->direction) | | if(op->direction) |
insert_ob_in_map(op,op->map); | | insert_ob_in_map(op,op->map,op); |
else | | else |
stop_arrow(op,NULL); | | stop_arrow(op,NULL); |
} | | } |
| | |
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); | | insert_ob_in_map(tmp,op->map,op); |
} | | } |
} | | } |
} | | } |
| | |
free_object(op); | | free_object(op); |
return; | | return; |
} | | } |
transfer_ob(op->above,EXIT_X(op),EXIT_Y(op)); | | transfer_ob(op->above,EXIT_X(op),EXIT_Y(op),0,op); |
} else | | } else |
teleport(op,TELEPORTER); | | teleport(op,TELEPORTER,op); |
} | | } |
} | | } |
| | |
| | |
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); | | insert_ob_in_map(tmp,op->map,op); |
} | | } |
| | |
/* move_marker --peterm@soda.csua.berkeley.edu | | /* move_marker --peterm@soda.csua.berkeley.edu |
| | |
move_hole(op); | | move_hole(op); |
return 0; | | return 0; |
case DEEP_SWAMP: | | case DEEP_SWAMP: |
deep_swamp(op, 0); | | move_deep_swamp(op); |
return 0; | | return 0; |
case CANCELLATION: | | case CANCELLATION: |
move_cancellation(op); | | move_cancellation(op); |