/* Returns a direction it wants you to explore in. Take the direction and call automap_unexplore, which'll take you back to the @read. If it returns NULL, we're finished; get player input */ const char *automap_explore(void) { if(automap_explored) { n_show_error(E_SAVE, "tried to explore when we just did so", automap_explored); return NULL; } if(!loc_exp) return NULL; if(automap_dir == NUM_EXITS) { fast_saveundo(); automap_location = evaluate_expression(loc_exp, stack_get_depth()).v; automap_dir = 0; } else { automap_dir++; if(automap_dir == NUM_EXITS) { loc_node *r = room_find(automap_location, TRUE); r->found = TRUE; automap_calc_exits(r, 0); allow_saveundo = TRUE; allow_output = TRUE; return NULL; } } allow_saveundo = FALSE; allow_output = FALSE; automap_explored = TRUE; return dirways[automap_dir].name; }
int room_enter(ROOM_INDEX_DATA *rb[],int key,ROOM_INDEX_DATA *rm) { ROOM_INDEX_DATA *temp; temp = room_find(rb,key); if(temp) return(0); rb[key] = rm; return(1); }
int room_enter(struct room_data *rb[], int key, struct room_data *rm) { struct room_data *temp; temp = room_find(rb, key); if (temp) return(0); rb[key] = rm; return(1); }
void room_iterate(ROOM_INDEX_DATA *rb[],void *cdata) { register int i; for(i=0;i<WORLD_SIZE;i++) { ROOM_INDEX_DATA *temp; temp = room_find(rb,i); } }
int room_remove(ROOM_INDEX_DATA *rb[],int key) { ROOM_INDEX_DATA *tmp; tmp = room_find(rb,key); if(tmp) { rb[key] = 0; free(tmp); } return(0); }
ROOM_INDEX_DATA *room_find_or_create(ROOM_INDEX_DATA *rb[],int key) { ROOM_INDEX_DATA *rv; rv = room_find(rb,key); if(rv) return rv; rv = (ROOM_INDEX_DATA *)malloc(sizeof(ROOM_INDEX_DATA)); rb[key] = rv; return rv; }
void room_iterate(struct room_data *rb[], void (*func)(), void *cdata) { register int i; for (i=0; i<WORLD_SIZE; i++) { struct room_data *temp; temp = room_find(rb, i); if (temp) { (*func)(i, temp, cdata); } } }
int room_remove(struct room_data *rb[], int key) { struct room_data *tmp; tmp = room_find(rb, key); if (tmp) { rb[key] = 0; free(tmp); } return(0); }
struct room_data *room_find_or_create(struct room_data *rb[], int key) { struct room_data *rv; rv = room_find(rb, key); if (rv) return rv; rv = (struct room_data *)malloc(sizeof(struct room_data)); rb[key] = rv; return rv; }
void automap_set_locations(int center) { loc_node *r; r = room_find(center, TRUE); n_hash_enumerate(&rooms, make_untouched); automap_edges_mindist(); automap_calc_cycles(r); n_hash_enumerate(&rooms, make_untouched); automap_forget_interference(); mymap_reinit(); automap_edges_untouch(); automap_calc_location(r, NULL, 0, 0); automap_resolve_interference(r, 2); }