]> granicus.if.org Git - nethack/commitdiff
eating corpses while hallucinating (trunk only)
authornethack.rankin <nethack.rankin>
Fri, 2 Jul 2010 01:49:51 +0000 (01:49 +0000)
committernethack.rankin <nethack.rankin>
Fri, 2 Jul 2010 01:49:51 +0000 (01:49 +0000)
     Contributed by <email deleted>, give an
alternate message when eating a corpse while hallucinating, including one
that gives homage to Tony the Tiger from old Frosted Flakes commercials
if you happen to be polymorphed into a tiger.  Even players who try to
keep their characters hallucinating all the time are unlikely to ever run
into "tastes gr-r-reat!".

     I rewrote the conditional expression to only test Hallucination once.
And I added the comment about omnivores, who'll never get "is delicious"
result with the current carnivore vs herbivore logic.  (That behavior has
been around for quite a while, but seems somewhat suspect.)

src/eat.c

index 3b07630f86ba4cf51d534c8172dc9ed2be3d8ccf..2e2b90cd6f1203fde7d3dd04fbed80f30fd56ebf 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1,5 +1,4 @@
 /* NetHack 3.5 eat.c   $Date$  $Revision$ */
-/*     SCCS Id: @(#)eat.c      3.5     2008/07/20      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1640,14 +1639,21 @@ eatcorpse(otmp)         /* called when a corpse is selected as food */
                (Stone_resistance || Hallucination)) {
            pline("This tastes just like chicken!");
        } else {
+           /* [is this right?  omnivores end up always disliking the taste] */
+           boolean yummy = (vegan(&mons[mnum]) ?
+                               (!carnivorous(youmonst.data) &&
+                                       herbivorous(youmonst.data)) :
+                               (carnivorous(youmonst.data) &&
+                                       !herbivorous(youmonst.data)));
+
            pline("%s%s %s!",
                  type_is_pname(&mons[mnum]) ? "" :
                    the_unique_pm(&mons[mnum]) ? "The " : "This ",
                  food_xname(otmp, FALSE),
-                 (vegan(&mons[mnum]) ?
-                  (!carnivorous(youmonst.data) && herbivorous(youmonst.data)) :
-                  (carnivorous(youmonst.data) && !herbivorous(youmonst.data)))
-                 ? "is delicious" : "tastes terrible");
+                 Hallucination ?
+                  (yummy ? ((u.umonnum == PM_TIGER) ? "is gr-r-reat" :
+                            "is gnarly") : "is grody") :
+                  (yummy ? "is delicious" : "tastes terrible"));
        }
 
        return(retcode);