fix issue #510, pull request #519 - vomit effects

Add some vomiting effects:

Trigger divine wrath if hero vomits at an altar's location.  (What
about adding throne and maybe sink special effects too?)

If poly'd into a yellow dragon, breathe (acid) on self.  (I'm not
sure why.)

If on ice and poly'd into an acidic form, melt the ice.  Also,
change melt_ice() to give its message when melting happens at the
hero's location even if hero can't see.

Fixes #519
Fixes #510
This commit is contained in:
PatR
2021-07-15 16:10:34 -07:00
parent 475648bd02
commit e9c813b6ba
3 changed files with 30 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.595 $ $NHDT-Date: 1626315675 2021/07/15 02:21:15 $
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.596 $ $NHDT-Date: 1626390626 2021/07/15 23:10:26 $
General Fixes and Modified Features
-----------------------------------
@@ -1080,6 +1080,7 @@ menu for what-is command supports /^ and /" to view a list of nearby or whole
spiders will occasionally spin webs when moving around
drinking a burning potion of oil will cure being turned into slime
new bigroom variant, a boulder maze
vomiting on an altar provokes the deities wrath
Platform- and/or Interface-Specific New Features

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 eat.c $NHDT-Date: 1620548002 2021/05/09 08:13:22 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.243 $ */
/* NetHack 3.7 eat.c $NHDT-Date: 1626390626 2021/07/15 23:10:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.247 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3361,6 +3361,8 @@ floorfood(const char *verb,
void
vomit(void) /* A good idea from David Neves */
{
boolean spewed = FALSE;
if (cantvomit(g.youmonst.data)) {
/* doesn't cure food poisoning; message assumes that we aren't
dealing with some esoteric body_part() */
@@ -3373,6 +3375,8 @@ vomit(void) /* A good idea from David Neves */
reaches 0, but only if u.uhs < FAINTING (and !cantvomit()) */
if (u.uhs >= FAINTING)
Your("%s heaves convulsively!", body_part(STOMACH));
else
spewed = TRUE;
}
/* nomul()/You_can_move_again used to be unconditional, which was
@@ -3383,6 +3387,27 @@ vomit(void) /* A good idea from David Neves */
g.multi_reason = "vomiting";
g.nomovemsg = You_can_move_again;
}
if (spewed) {
struct attack
*mattk = attacktype_fordmg(g.youmonst.data, AT_BREA, AD_ACID);
/* currently, only yellow dragons can breathe acid */
if (mattk) {
You("breathe acid on yourself..."); /* [why?] */
ubreatheu(mattk);
}
/* vomiting on an altar is, all things considered, rather impolite */
if (IS_ALTAR(levl[u.ux][u.uy].typ))
altar_wrath(u.ux, u.uy);
/* if poly'd into acidic form, stomach acid is stronger than normal */
if (acidic(g.youmonst.data)) {
/* TODO: if there's a web here, destroy that too (before ice) */
if (is_ice(u.ux, u.uy))
melt_ice(u.ux, u.uy,
"Your stomach acid melts straight through the ice!");
}
}
}
int

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 zap.c $NHDT-Date: 1620413928 2021/05/07 18:58:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.360 $ */
/* NetHack 3.7 zap.c $NHDT-Date: 1626390628 2021/07/15 23:10:28 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.369 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -4457,7 +4457,7 @@ melt_ice(xchar x, xchar y, const char *msg)
if (Underwater)
vision_recalc(1);
newsym(x, y);
if (cansee(x, y))
if (cansee(x, y) || (x == u.ux && y == u.uy))
Norep("%s", msg);
if ((otmp = sobj_at(BOULDER, x, y)) != 0) {
if (cansee(x, y))