14 struct param *par = param_by_letter('A');
16 if (par->distance != dist_no_obj_specified)
17 printf("I don't know how to %s.\n", par->tag);
22 exec_look_around(void)
24 printf("You are in %s.\n", player->location->description);
25 list_objs_at_loc(player->location);
32 struct param *par = param_by_letter('A');
33 struct object *obj = par->object;
34 enum distance dist = par->distance;
36 if (dist >= dist_unknown_obj)
37 printf("I don't understand what you want to see.\n");
38 else if (dist == dist_not_here)
39 printf("You don't see any %s here.\n", par->tag);
40 else if (dist == dist_overthere)
41 printf("You squeeze your eyes, but %s is too far away.\n", par->tag);
42 else if (dist == dist_here_contained)
43 printf("Hard to see, try to get it first.\n");
45 printf("%s\n", obj->details);
46 list_objs_at_loc(obj);
55 struct param *par = param_by_letter('A');
56 struct object *obj = par->object;
57 enum distance dist = par->distance;
59 if (dist >= dist_unknown_obj)
60 printf("I don't understand where you want to go.\n");
61 else if (dist == dist_location)
62 printf("You are already there.\n");
63 else if (dist == dist_overthere)
64 move_player(get_passage_to(obj));
65 else if (dist == dist_here)
67 else if (dist < dist_not_here)
68 printf("You can't get any closer than this.\n");
70 printf("You don't see any %s here.\n", "XXX");
78 return move_object(param_by_letter('A'), param_by_letter('B')->object, player);
84 return move_object(param_by_letter('A'), player->location, player);
90 return move_object(param_by_letter('A'), player, player->location);
96 return move_object(param_by_letter('A'), player, person_here());
102 return move_object(param_by_letter('A'), person_here(), player);
108 return move_object(param_by_letter('A'), player, param_by_letter('B')->object);
114 if (list_objs_at_loc(player) == 0)
115 printf("You are empty-handed.\n");
122 struct param *par = param_by_letter('A');
123 if (object_within_reach("open", par))
124 printf("%s\n", (par->object->open)(par->object));
131 struct param *par = param_by_letter('A');
132 if (object_within_reach("close", par))
133 printf("%s\n", (par->object->close)(par->object));
140 struct param *par = param_by_letter('A');
141 if (object_within_reach("lock", par))
142 printf("%s\n", (par->object->lock)(par->object));
149 struct param *par = param_by_letter('A');
150 if (object_within_reach("unlock", par))
151 printf("%s\n", (par->object->unlock)(par->object));
156 parseexec(const char *input)
158 static const struct command commands[] = {
159 {&exec_quit, "quit"},
160 {&exec_look_around, "look"},
161 {&exec_look_around, "look around"},
162 {&exec_look, "look at A?"},
163 {&exec_look, "look A?"},
164 {&exec_go, "go to the A?"},
165 {&exec_go, "go to A?"},
167 {&exec_get_from, "get A from B?"},
168 {&exec_get, "get the A?"},
169 {&exec_get, "get A?"},
170 {&exec_get, "pick up the A?"},
171 {&exec_get, "pick up a A?"},
172 {&exec_get, "pick up A?"},
173 {&exec_get, "pick the A?"},
174 {&exec_get, "pick a A?"},
175 {&exec_get, "pick A?"},
176 {&exec_put_in, "put A in B?"},
177 {&exec_put_in, "drop A in B?"},
178 {&exec_drop, "drop A?"},
179 {&exec_give, "give A?"},
180 {&exec_ask, "ask A?"},
181 {&exec_inventory, "inventory"},
182 {&exec_open, "open A?"},
183 {&exec_close, "close A?"},
184 {&exec_lock, "lock A?"},
185 {&exec_unlock, "unlock A?"},
186 {&exec_no_match, "A?"},
189 const struct command *cmd;
190 for (cmd = commands; !match_command(input, cmd->pattern); ++cmd)