have the player use movement keystrokes to position the cursor at a particular map location, then use one of [.,:;] to pick the spot */
| 768 | /* have the player use movement keystrokes to position the cursor at a |
| 769 | particular map location, then use one of [.,:;] to pick the spot */ |
| 770 | int |
| 771 | getpos(coord *ccp, boolean force, const char *goal) |
| 772 | { |
| 773 | static struct { |
| 774 | int nhkf, ret; |
| 775 | } const pick_chars_def[] = { |
| 776 | { NHKF_GETPOS_PICK, LOOK_TRADITIONAL }, |
| 777 | { NHKF_GETPOS_PICK_Q, LOOK_QUICK }, |
| 778 | { NHKF_GETPOS_PICK_O, LOOK_ONCE }, |
| 779 | { NHKF_GETPOS_PICK_V, LOOK_VERBOSE } |
| 780 | }; |
| 781 | static const int mMoOdDxX_def[] = { |
| 782 | NHKF_GETPOS_MON_NEXT, |
| 783 | NHKF_GETPOS_MON_PREV, |
| 784 | NHKF_GETPOS_OBJ_NEXT, |
| 785 | NHKF_GETPOS_OBJ_PREV, |
| 786 | NHKF_GETPOS_DOOR_NEXT, |
| 787 | NHKF_GETPOS_DOOR_PREV, |
| 788 | NHKF_GETPOS_UNEX_NEXT, |
| 789 | NHKF_GETPOS_UNEX_PREV, |
| 790 | NHKF_GETPOS_INTERESTING_NEXT, |
| 791 | NHKF_GETPOS_INTERESTING_PREV, |
| 792 | NHKF_GETPOS_VALID_NEXT, |
| 793 | NHKF_GETPOS_VALID_PREV |
| 794 | }; |
| 795 | struct _cmd_queue cq, *cmdq; |
| 796 | const char *cp; |
| 797 | char pick_chars[6]; |
| 798 | char mMoOdDxX[13]; |
| 799 | int result = 0; |
| 800 | int i, c; |
| 801 | int sidx; |
| 802 | coordxy cx, cy; |
| 803 | coordxy tx = u.ux, ty = u.uy; |
| 804 | boolean msg_given = TRUE; /* clear message window by default */ |
| 805 | boolean show_goal_msg = FALSE; |
| 806 | coord *garr[NUM_GLOCS] = DUMMY; |
| 807 | int gcount[NUM_GLOCS] = DUMMY; |
| 808 | int gidx[NUM_GLOCS] = DUMMY; |
| 809 | schar udx = u.dx, udy = u.dy, udz = u.dz; |
| 810 | int dx, dy; |
| 811 | boolean rushrun = FALSE; |
| 812 | |
| 813 | /* temporary? if we have a queued direction, return the adjacent spot |
| 814 | in that direction */ |
| 815 | if (!gi.in_doagain) { |
| 816 | if ((cmdq = cmdq_pop()) != 0) { |
| 817 | cq = *cmdq; |
| 818 | free((genericptr_t) cmdq); |
| 819 | if (cq.typ == CMDQ_DIR && !cq.dirz) { |
| 820 | ccp->x = u.ux + cq.dirx; |
| 821 | ccp->y = u.uy + cq.diry; |
| 822 | } else { |
| 823 | cmdq_clear(CQ_CANNED); |
| 824 | result = -1; |
| 825 | } |
| 826 | return result; |
| 827 | } |
no test coverage detected