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

Function use_cream_pie

src/apply.c:3567–3603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3565#undef glyph_is_poleable
3566
3567staticfn int
3568use_cream_pie(struct obj *obj)
3569{
3570 boolean wasblind = Blind;
3571 boolean wascreamed = u.ucreamed;
3572 boolean several = FALSE;
3573
3574 if (obj->quan > 1L) {
3575 several = TRUE;
3576 obj = splitobj(obj, 1L);
3577 }
3578 if (Hallucination)
3579 You("give yourself a facial.");
3580 else
3581 You("immerse your %s in %s%s.", body_part(FACE),
3582 several ? "one of " : "",
3583 several ? makeplural(the(xname(obj))) : the(xname(obj)));
3584 if (can_blnd((struct monst *) 0, &gy.youmonst, AT_WEAP, obj)) {
3585 int blindinc = rnd(25);
3586
3587 u.ucreamed += blindinc;
3588 make_blinded(BlindedTimeout + (long) blindinc, FALSE);
3589 if (!Blind || (Blind && wasblind))
3590 pline("There's %ssticky goop all over your %s.",
3591 wascreamed ? "more " : "", body_part(FACE));
3592 else /* Blind && !wasblind */
3593 You_cant("see through all the sticky goop on your %s.",
3594 body_part(FACE));
3595 }
3596
3597 setnotworn(obj);
3598 /* useup() is appropriate, but we want costly_alteration()'s message */
3599 costly_alteration(obj, COST_SPLAT);
3600 obj_extract_self(obj);
3601 delobj(obj);
3602 return ECMD_OK;
3603}
3604
3605/* getobj callback for object to rub royal jelly on */
3606staticfn int

Callers 1

doapplyFunction · 0.85

Calls 15

splitobjFunction · 0.85
YouFunction · 0.85
body_partFunction · 0.85
makepluralFunction · 0.85
theFunction · 0.85
xnameFunction · 0.85
can_blndFunction · 0.85
rndFunction · 0.85
make_blindedFunction · 0.85
You_cantFunction · 0.85
setnotwornFunction · 0.85
costly_alterationFunction · 0.85

Tested by

no test coverage detected