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

Function doseduce

src/mhitu.c:1984–2305  ·  view source on GitHub ↗

returns 1 if monster teleported (or hero leaves monster's vicinity) */

Source from the content-addressed store, hash-verified

1982
1983/* returns 1 if monster teleported (or hero leaves monster's vicinity) */
1984int
1985doseduce(struct monst *mon)
1986{
1987 struct obj *ring, *nring;
1988 boolean fem = (mon->data == &mons[PM_AMOROUS_DEMON]
1989 && Mgender(mon) == FEMALE); /* otherwise incubus */
1990 boolean seewho, naked; /* True iff no armor */
1991 int attr_tot, tried_gloves = 0;
1992 char qbuf[QBUFSZ], Who[QBUFSZ];
1993
1994 if (mon->mcan || mon->mspec_used) {
1995 pline_mon(mon, "%s acts as though %s has got a %sheadache.",
1996 Monnam(mon), mhe(mon), mon->mcan ? "severe " : "");
1997 return 0;
1998 }
1999 if (unresponsive()) {
2000 pline_mon(mon, "%s seems dismayed at your lack of response.",
2001 Monnam(mon));
2002 return 0;
2003 }
2004 seewho = canseemon(mon);
2005 if (!seewho)
2006 pline("Someone caresses you...");
2007 else
2008 You_feel("very attracted to %s.", mon_nam(mon));
2009 /* cache the seducer's name in a local buffer */
2010 Strcpy(Who, (!seewho ? (fem ? "She" : "He") : Monnam(mon)));
2011
2012 /* if in the process of putting armor on or taking armor off,
2013 interrupt that activity now */
2014 (void) stop_donning((struct obj *) 0);
2015 /* don't try to take off gloves if cursed weapon blocks them */
2016 if (welded(uwep))
2017 tried_gloves = 1;
2018
2019 for (ring = gi.invent; ring; ring = nring) {
2020 nring = ring->nobj;
2021 if (ring->otyp != RIN_ADORNMENT)
2022 continue;
2023 if (fem) {
2024 if (ring->owornmask && uarmg) {
2025 /* don't take off worn ring if gloves are in the way */
2026 if (!tried_gloves++)
2027 mayberem(mon, Who, uarmg, "gloves");
2028 if (uarmg)
2029 continue; /* next ring might not be worn */
2030 }
2031 /* confirmation prompt when charisma is high bypassed if deaf */
2032 if (!Deaf && rn2(20) < ACURR(A_CHA)) {
2033 (void) safe_qbuf(qbuf, "\"That ",
2034 " looks pretty. May I have it?\"", ring,
2035 xname, simpleonames, "ring");
2036 makeknown(RIN_ADORNMENT);
2037 SetVoice(mon, 0, 80, 0);
2038 if (y_n(qbuf) == 'n')
2039 continue;
2040 } else
2041 pline("%s decides she'd like %s, and takes it.",

Callers 2

mhitm_ad_ssexFunction · 0.85
domonnoiseFunction · 0.85

Calls 15

MgenderFunction · 0.85
pline_monFunction · 0.85
MonnamFunction · 0.85
unresponsiveFunction · 0.85
canseemonFunction · 0.85
You_feelFunction · 0.85
mon_namFunction · 0.85
stop_donningFunction · 0.85
weldedFunction · 0.85
mayberemFunction · 0.85
rn2Function · 0.85
safe_qbufFunction · 0.85

Tested by

no test coverage detected