From 3cdc140c7253e91e13befae09dd280f962c67674 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 14 Dec 2010 01:14:37 +0000 Subject: [PATCH] talking gecko (trunk only) Suggested by , chatting to a gecko will give a reference to GEICO's car insurance ads. I limited it to when the hero is hallucinating. Chatting to a gecko monster, or to anything capable of speaking--except for a couple of previously handled special cases, like quest leader--which happens to look like a gecko at the time, or (50:50 chance) to a shopkeeper regardless of appearance, you'll get "15 minutes can save you 15 zorkmids", parodying "15 minutes can save you 15% or more on car insurance". (One of my comments says there's a chance to interfere with shopping, but that's not accurate since using #chat to get shop price quotes doesn't use the monster-response routine. I left that comment in anyway; the "15 minutes" response might interfere afterall if someone mistakenly thinks they can save gold by waiting that long before paying their shopping bill.) I don't think we ever found a good place to add some reference to GEICO's other--and more relevant to nethack--slogan, "so easy a caveman can do it". --- doc/fixes35.0 | 1 + src/sounds.c | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 7b27631f5..6f21a3923 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -463,6 +463,7 @@ Sunsword's light radius depends on its curse/bless state Add M-C and M-R meta-key shortcuts for #conduct and #ride, respectively can now use ESC to cancel out of prompts for playing musical instruments being crowned gives an additional benefit: one extra skill slot/credit +chatting to a gecko or shopkeeper while hallucinating gives alternate message Platform- and/or Interface-Specific New Features diff --git a/src/sounds.c b/src/sounds.c index 9dfba7fc0..9e793f530 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1,5 +1,4 @@ /* NetHack 3.5 sounds.c $Date$ $Revision$ */ -/* SCCS Id: @(#)sounds.c 3.5 2007/05/05 */ /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ @@ -12,6 +11,7 @@ # endif #endif +STATIC_DCL boolean FDECL(mon_is_gecko, (struct monst *)); STATIC_DCL int FDECL(domonnoise,(struct monst *)); STATIC_DCL int NDECL(dochat); STATIC_DCL int FDECL(mon_in_room, (struct monst *,int)); @@ -464,6 +464,24 @@ register struct monst *mtmp; } } +/* return True if mon is a gecko or seems to look like one (hallucination) */ +STATIC_OVL boolean +mon_is_gecko(mon) +struct monst *mon; +{ + int glyph; + + /* return True if it is actually a gecko */ + if (mon->data == &mons[PM_GECKO]) return TRUE; + /* return False if it is a long worm; we might be chatting to its tail + (not strictly needed; long worms are MS_SILENT so won't get here) */ + if (mon->data == &mons[PM_LONG_WORM]) return FALSE; + /* result depends upon whether map spot shows a gecko, which will + be due to hallucination or to mimickery since mon isn't one */ + glyph = glyph_at(mon->mx, mon->my); + return (boolean)(glyph_to_mon(glyph) == PM_GECKO); +} + STATIC_OVL int domonnoise(mtmp) register struct monst *mtmp; @@ -490,6 +508,9 @@ register struct monst *mtmp; (same_race(ptr, youmonst.data) || /* current form, */ same_race(ptr, &mons[Race_switch]))) /* unpoly'd form */ msound = MS_HUMANOID; + /* silliness, with slight chance to interfere with shopping */ + else if (Hallucination && mon_is_gecko(mtmp)) + msound = MS_SELL; /* be sure to do this before talking; the monster might teleport away, in * which case we want to check its pre-teleport position @@ -509,7 +530,15 @@ register struct monst *mtmp; quest_chat(mtmp); break; case MS_SELL: /* pitch, pay, total */ - shk_chat(mtmp); + if (!Hallucination || (mtmp->isshk && !rn2(2))) { + shk_chat(mtmp); + } else { + /* approximation of GEICO's advertising slogan (it actually + concludes with "save you 15% or more on car insurance.") */ + Sprintf(verbuf, "15 minutes could save you 15 %s.", + currency(15L)); /* "zorkmids" */ + verbl_msg = verbuf; + } break; case MS_VAMPIRE: {