version 1.84 | | version 1.85 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.84 2006/01/07 14:30:07 akirschbaum Exp $"; | | * "$Id: time.c,v 1.85 2006/02/05 03:56:58 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
object *tmp,*tmp2; | | object *tmp,*tmp2; |
| | |
for(tmp=get_map_ob(op->map,op->x,op->y);tmp!=NULL;tmp=tmp->above) { | | for(tmp=get_map_ob(op->map,op->x,op->y);tmp!=NULL;tmp=tmp->above) { |
| | |
| | |
if(tmp->type == PLAYER) { /* we've got someone to MARK */ | | if(tmp->type == PLAYER) { /* we've got someone to MARK */ |
| | |
if ( quest_on_activate(op, tmp->contr) ) | | if ( quest_on_activate(op, tmp->contr) ) |
| | |
for(tmp2=tmp->inv;tmp2 !=NULL; tmp2=tmp2->below) { | | for(tmp2=tmp->inv;tmp2 !=NULL; tmp2=tmp2->below) { |
if(tmp2->type == FORCE && tmp2->slaying && !strcmp(tmp2->slaying,op->name)) break; | | if(tmp2->type == FORCE && tmp2->slaying && !strcmp(tmp2->slaying,op->name)) break; |
} | | } |
| | |
if(tmp2) { | | if(tmp2) { |
remove_ob(tmp2); | | remove_ob(tmp2); |
free_object(tmp2); | | free_object(tmp2); |
} | | } |
| | |
/* cycle through his inventory to look for the MARK we want to place */ | | /* cycle through his inventory to look for the MARK we want to |
| | * place |
| | */ |
for(tmp2=tmp->inv;tmp2 !=NULL; tmp2=tmp2->below) { | | for(tmp2=tmp->inv;tmp2 !=NULL; tmp2=tmp2->below) { |
if(tmp2->type == FORCE && tmp2->slaying && !strcmp(tmp2->slaying,op->slaying)) break; | | if(tmp2->type == FORCE && tmp2->slaying && !strcmp(tmp2->slaying,op->slaying)) break; |
} | | } |
| | |
/* if we didn't find our own MARK */ | | /* if we didn't find our own MARK */ |
if(tmp2==NULL) { | | if(tmp2==NULL) { |
| | |
object *force = get_archetype(FORCE_NAME); | | object *force = get_archetype(FORCE_NAME); |
| | |
force->speed = 0; | | force->speed = 0; |
if(op->stats.food) { | | if(op->stats.food) { |
force->speed = 0.01; | | force->speed = 0.01; |
| | |
update_ob_speed (force); | | update_ob_speed (force); |
/* put in the lock code */ | | /* put in the lock code */ |
force->slaying = add_string(op->slaying); | | force->slaying = add_string(op->slaying); |
| | |
if ( op->lore ) | | if ( op->lore ) |
force->lore = add_string( op->lore ); | | force->lore = add_string( op->lore ); |
| | |
insert_ob_in_ob(force,tmp); | | insert_ob_in_ob(force,tmp); |
if(op->msg) | | if(op->msg) |
new_draw_info(NDI_UNIQUE|NDI_NAVY,0,tmp,op->msg); | | new_draw_info(NDI_UNIQUE|NDI_NAVY,0,tmp,op->msg); |
| | |
if(op->stats.hp > 0) { | | if(op->stats.hp > 0) { |
op->stats.hp--; | | op->stats.hp--; |
if(op->stats.hp==0) { | | if(op->stats.hp==0) { |
| | |
return; | | return; |
} | | } |
} | | } |
} | | } /* if tmp2 == NULL */ |
| | } /* if tmp->type == PLAYER */ |
} | | } /* For all objects on this space */ |
| | |
} | | |
} | | } |
| | |
int process_object(object *op) { | | int process_object(object *op) { |