MCPcopy Create free account
hub / github.com/NetHack/NetHack / vomit

Function vomit

src/eat.c:3735–3785  ·  view source on GitHub ↗

Side effects of vomiting */ added nomul (MRS) - it makes sense, you're too busy being sick! */

Source from the content-addressed store, hash-verified

3733/* Side effects of vomiting */
3734/* added nomul (MRS) - it makes sense, you're too busy being sick! */
3735void
3736vomit(void) /* A good idea from David Neves */
3737{
3738 boolean spewed = FALSE;
3739
3740 if (cantvomit(gy.youmonst.data)) {
3741 /* doesn't cure food poisoning; message assumes that we aren't
3742 dealing with some esoteric body_part() */
3743 Your("jaw gapes convulsively.");
3744 } else {
3745 if (Sick && (u.usick_type & SICK_VOMITABLE) != 0)
3746 make_sick(0L, (char *) 0, TRUE, SICK_VOMITABLE);
3747 /* if not enough in stomach to actually vomit then dry heave;
3748 vomiting_dialog() gives a vomit message when its countdown
3749 reaches 0, but only if u.uhs < FAINTING (and !cantvomit()) */
3750 if (u.uhs >= FAINTING)
3751 Your("%s heaves convulsively!", body_part(STOMACH));
3752 else
3753 spewed = TRUE;
3754 }
3755
3756 /* nomul()/You_can_move_again used to be unconditional, which was
3757 viable while eating but not for Vomiting countdown where hero might
3758 be immobilized for some other reason at the time vomit() is called */
3759 if (gm.multi >= -2) {
3760 nomul(-2);
3761 gm.multi_reason = "vomiting";
3762 gn.nomovemsg = You_can_move_again;
3763 }
3764
3765 if (spewed) {
3766 struct attack
3767 *mattk = attacktype_fordmg(gy.youmonst.data, AT_BREA, AD_ACID);
3768
3769 /* currently, only yellow dragons can breathe acid */
3770 if (mattk) {
3771 You("breathe acid on yourself..."); /* [why?] */
3772 ubreatheu(mattk);
3773 }
3774 /* vomiting on an altar is, all things considered, rather impolite */
3775 if (IS_ALTAR(levl[u.ux][u.uy].typ))
3776 altar_wrath(u.ux, u.uy);
3777 /* if poly'd into acidic form, stomach acid is stronger than normal */
3778 if (acidic(gy.youmonst.data)) {
3779 /* TODO: if there's a web here, destroy that too (before ice) */
3780 if (is_ice(u.ux, u.uy))
3781 melt_ice(u.ux, u.uy,
3782 "Your stomach acid melts straight through the ice!");
3783 }
3784 }
3785}
3786
3787int
3788eaten_stat(int base, struct obj *obj)

Callers 5

vomiting_dialogueFunction · 0.85
chokeFunction · 0.85
use_unicorn_hornFunction · 0.85
drinkfountainFunction · 0.85
drinksinkFunction · 0.85

Calls 11

cantvomitFunction · 0.85
YourFunction · 0.85
make_sickFunction · 0.85
body_partFunction · 0.85
nomulFunction · 0.85
attacktype_fordmgFunction · 0.85
YouFunction · 0.85
ubreatheuFunction · 0.85
altar_wrathFunction · 0.85
is_iceFunction · 0.85
melt_iceFunction · 0.85

Tested by

no test coverage detected