15 return exec_look_around();
31 struct param *par = param_by_letter('A');
33 if (par->distance != dist_no_obj_specified)
34 printf("I don't know how to %s.\n", par->tag);
39 exec_look_around(void)
41 printf("You are in %s.\n", player->location->description);
42 list_objs_at_loc(player->location);
49 struct param *par = param_by_letter('A');
50 struct object *obj = par->object;
51 enum distance dist = par->distance;
53 if (dist >= dist_unknown_obj)
54 printf("I don't understand what you want to see.\n");
55 else if (dist == dist_not_here)
56 printf("You don't see any %s here.\n", par->tag);
57 else if (dist == dist_overthere)
58 printf("You squeeze your eyes, but %s is too far away.\n",
60 else if (dist == dist_here_contained)
61 printf("Hard to see, try to get it first.\n");
63 printf("%s\n", obj->details);
64 list_objs_at_loc(obj);
73 struct param *par = param_by_letter('A');
74 struct object *obj = par->object;
75 enum distance dist = par->distance;
77 if (dist >= dist_unknown_obj)
78 printf("I don't understand where you want to go.\n");
79 else if (dist == dist_location)
80 printf("You are already there.\n");
81 else if (dist == dist_overthere)
82 move_player(get_passage_to(obj));
83 else if (dist == dist_here)
85 else if (dist < dist_not_here)
86 printf("You can't get any closer than this.\n");
88 printf("You don't see any %s here.\n", "XXX");
97 param_by_letter('A'), param_by_letter('B')->object, player);
103 return move_object(param_by_letter('A'), player->location, player);
109 return move_object(param_by_letter('A'), player, player->location);
115 return move_object(param_by_letter('A'), player, person_here());
121 return move_object(param_by_letter('A'), person_here(), player);
128 param_by_letter('A'), player, param_by_letter('B')->object);
134 if (list_objs_at_loc(player) == 0)
135 printf("You are empty-handed.\n");
142 struct param *par = param_by_letter('A');
143 if (object_within_reach("open", par))
144 printf("%s\n", (par->object->open)(par->object));
151 struct param *par = param_by_letter('A');
152 if (object_within_reach("close", par))
153 printf("%s\n", (par->object->close)(par->object));
160 struct param *par = param_by_letter('A');
161 if (object_within_reach("lock", par))
162 printf("%s\n", (par->object->lock)(par->object));
169 struct param *par = param_by_letter('A');
170 if (object_within_reach("unlock", par))
171 printf("%s\n", (par->object->unlock)(par->object));
176 parseexec(const char *input)
178 static const struct command commands[] = {
179 { &exec_quit, "quit" },
180 { &exec_quit, "bye" },
181 { &exec_load, "load" },
182 { &exec_save, "save" },
183 { &exec_look_around, "look" },
184 { &exec_look_around, "look around" },
185 { &exec_look, "look at A?" },
186 { &exec_look, "look A?" },
187 { &exec_go, "go to the A?" },
188 { &exec_go, "go to A?" },
189 { &exec_go, "go A?" },
190 { &exec_get_from, "get A from B?" },
191 { &exec_get, "get the A?" },
192 { &exec_get, "get A?" },
193 { &exec_get, "pick up the A?" },
194 { &exec_get, "pick up a A?" },
195 { &exec_get, "pick up A?" },
196 { &exec_get, "pick the A?" },
197 { &exec_get, "pick a A?" },
198 { &exec_get, "pick A?" },
199 { &exec_put_in, "put A in B?" },
200 { &exec_put_in, "drop A in B?" },
201 { &exec_drop, "drop A?" },
202 { &exec_give, "give the A?" },
203 { &exec_give, "give A?" },
204 { &exec_ask, "ask A?" },
205 { &exec_inventory, "inventory" },
206 { &exec_open, "open A?" },
207 { &exec_close, "close A?" },
208 { &exec_lock, "lock A?" },
209 { &exec_unlock, "unlock A?" },
210 { &exec_no_match, "A?" },
213 const struct command *cmd;
214 for (cmd = commands; !match_command(input, cmd->pattern); ++cmd)