the #eat command */
| 2814 | |
| 2815 | /* the #eat command */ |
| 2816 | int |
| 2817 | doeat(void) |
| 2818 | { |
| 2819 | struct obj *otmp; |
| 2820 | int basenutrit; /* nutrition of full item */ |
| 2821 | boolean dont_start = FALSE, |
| 2822 | already_partly_eaten; |
| 2823 | int ll_conduct = 0; |
| 2824 | |
| 2825 | if (Strangled) { |
| 2826 | pline("If you can't breathe air, how can you consume solids?"); |
| 2827 | return ECMD_OK; |
| 2828 | } |
| 2829 | if (!(otmp = floorfood("eat", 0))) |
| 2830 | return ECMD_OK; |
| 2831 | if (check_capacity((char *) 0)) |
| 2832 | return ECMD_OK; |
| 2833 | |
| 2834 | if (u.uedibility) { |
| 2835 | int res = edibility_prompts(otmp); |
| 2836 | |
| 2837 | if (res) { |
| 2838 | Your( |
| 2839 | "%s stops tingling and your sense of smell returns to normal.", |
| 2840 | body_part(NOSE)); |
| 2841 | u.uedibility = 0; |
| 2842 | if (res == 1) |
| 2843 | return ECMD_OK; |
| 2844 | } |
| 2845 | } |
| 2846 | |
| 2847 | /* from floorfood(), &hands_obj means iron bars at current spot */ |
| 2848 | if (otmp == &hands_obj) { |
| 2849 | /* hero in metallivore form is eating [diggable] iron bars |
| 2850 | at current location so skip the other assorted checks; |
| 2851 | operates as if digging rather than via the eat occupation */ |
| 2852 | if (still_chewing(u.ux, u.uy) && levl[u.ux][u.uy].typ == IRONBARS) { |
| 2853 | /* this is verbose, but player will see the hero rather than the |
| 2854 | bars so wouldn't know that more turns of eating are required */ |
| 2855 | You("pause to swallow."); |
| 2856 | } |
| 2857 | return ECMD_TIME; |
| 2858 | } |
| 2859 | /* We have to make non-foods take 1 move to eat, unless we want to |
| 2860 | * do ridiculous amounts of coding to deal with partly eaten plate |
| 2861 | * mails, players who polymorph back to human in the middle of their |
| 2862 | * metallic meal, etc.... |
| 2863 | */ |
| 2864 | if (!is_edible(otmp)) { |
| 2865 | You("cannot eat that!"); |
| 2866 | return ECMD_OK; |
| 2867 | } else if ((otmp->owornmask & (W_ARMOR | W_TOOL | W_AMUL | W_SADDLE)) |
| 2868 | != 0) { |
| 2869 | /* let them eat rings */ |
| 2870 | You_cant("eat %s you're wearing.", something); |
| 2871 | return ECMD_OK; |
| 2872 | } else if (!(carried(otmp) ? retouch_object(&otmp, FALSE) |
| 2873 | : touch_artifact(otmp, &gy.youmonst))) { |
nothing calls this directly
no test coverage detected