7 list_objs_at_loc(struct object *location)
13 if (obj != player && obj->location == location) {
15 printf("%s:\n", location->contents);
16 printf("%s\n", obj->description);
29 if (distance_to(obj) == dist_here && obj->health > 0)
37 get_passage_to(struct object *target)
42 if (obj->location == player->location &&
43 obj->prospect == target)
51 distance_to(struct object *obj)
54 !valid_obj(obj) ? dist_unknown_obj :
55 obj == player ? dist_player :
56 obj == player->location ? dist_location :
57 obj->location == player ? dist_held :
58 obj->location == player->location ? dist_here :
59 get_passage_to(obj) != NULL ? dist_overthere :
60 !valid_obj(obj->location) ? dist_not_here :
61 obj->location->location == player ? dist_held_contained :
62 obj->location->location == player->location ? dist_here_contained :
67 move_player(struct object *passage)
69 printf("%s\n", passage->text_go);
70 if (passage->destination != NULL) {
71 player->location = passage->destination;
78 weight_of_contents(struct object *container)
84 if (obj->location == container)
91 object_within_reach(const char *verb, struct param *par)
95 enum distance dist = par->distance;
97 if (dist > dist_not_here)
98 printf("I don't understand what you want to %s.\n", verb);
99 else if (dist == dist_not_here)
100 printf("You don't see any %s here.\n", par->tag);
101 else if (dist >= dist_here_contained)
102 printf("That is out of reach.\n");
103 else if (par->count > 1)
104 printf("Multiple choices to %s; be more specific.\n", verb);