the #engrave command */
| 953 | |
| 954 | /* the #engrave command */ |
| 955 | int |
| 956 | doengrave(void) |
| 957 | { |
| 958 | char *sp; /* Place holder for space count of engr text */ |
| 959 | struct _doengrave_ctx *de; |
| 960 | int retval; |
| 961 | boolean initial_msg_given = FALSE; |
| 962 | |
| 963 | /* Can the adventurer engrave at all? */ |
| 964 | if (!u_can_engrave()) |
| 965 | return ECMD_FAIL; |
| 966 | |
| 967 | de = (struct _doengrave_ctx *) alloc(sizeof (struct _doengrave_ctx)); |
| 968 | doengrave_ctx_init(de); |
| 969 | |
| 970 | gm.multi = 0; /* moves consumed */ |
| 971 | gn.nomovemsg = (char *) 0; /* occupation end message */ |
| 972 | |
| 973 | /* One may write with finger, or weapon, or wand, or..., or... |
| 974 | * Edited by GAN 10/20/86 so as not to change weapon wielded. |
| 975 | */ |
| 976 | |
| 977 | de->otmp = getobj("write with", stylus_ok, GETOBJ_PROMPT); |
| 978 | if (!de->otmp) {/* otmp == &hands_obj if fingers */ |
| 979 | de->ret = ECMD_CANCEL; |
| 980 | goto doengr_exit; |
| 981 | } |
| 982 | |
| 983 | if (de->otmp == &hands_obj) { |
| 984 | Strcat(strcpy(de->fbuf, "your "), body_part(FINGERTIP)); |
| 985 | de->writer = de->fbuf; |
| 986 | } else { |
| 987 | de->writer = yname(de->otmp); |
| 988 | } |
| 989 | |
| 990 | /* There's no reason you should be able to write with a wand |
| 991 | * while both your hands are tied up. |
| 992 | */ |
| 993 | if (!freehand() && de->otmp != uwep && !de->otmp->owornmask) { |
| 994 | You("have no free %s to write with!", body_part(HAND)); |
| 995 | goto doengr_exit; |
| 996 | } |
| 997 | |
| 998 | if (de->jello) { |
| 999 | You("tickle %s with %s.", mon_nam(u.ustuck), de->writer); |
| 1000 | Your("message dissolves..."); |
| 1001 | goto doengr_exit; |
| 1002 | } |
| 1003 | if (!can_reach_floor(TRUE)) { |
| 1004 | if (de->otmp->oclass != WAND_CLASS) { |
| 1005 | cant_reach_floor(u.ux, u.uy, FALSE, TRUE, FALSE); |
| 1006 | goto doengr_exit; |
| 1007 | } else { |
| 1008 | You("gesture, with your wand, towards the %s below you.", |
| 1009 | surface(u.ux, u.uy)); |
| 1010 | initial_msg_given = TRUE; |
| 1011 | } |
| 1012 | } |
nothing calls this directly
no test coverage detected