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

Function whimper

src/sounds.c:478–515  ·  view source on GitHub ↗

the sounds of distressed pets */

Source from the content-addressed store, hash-verified

476
477/* the sounds of distressed pets */
478void
479whimper(struct monst *mtmp)
480{
481 const char *whimper_verb = 0;
482 enum sound_effect_entries se = se_canine_whine;
483 if (helpless(mtmp) || !mtmp->data->msound)
484 return;
485
486 /* presumably nearness and soundok checks have already been made */
487 if (Hallucination)
488 whimper_verb = ROLL_FROM(h_sounds);
489 else
490 switch (mtmp->data->msound) {
491 case MS_MEW:
492 case MS_GROWL:
493 whimper_verb = "whimper";
494 break;
495 case MS_BARK:
496 whimper_verb = "whine";
497 break;
498 case MS_SQEEK:
499 se = se_squeal;
500 whimper_verb = "squeal";
501 break;
502 }
503 if (whimper_verb) {
504 if (!Hallucination) {
505 Soundeffect(se, 50);
506 }
507 pline("%s %s.", Monnam(mtmp), vtense((char *) 0, whimper_verb));
508 if (svc.context.run)
509 nomul(0);
510 wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 6);
511 }
512#ifndef SND_LIB_INTEGRATED
513 nhUse(se);
514#endif
515}
516
517/* pet makes "I'm hungry" noises */
518void

Callers 2

dog_moveFunction · 0.85
check_leashFunction · 0.85

Calls 5

MonnamFunction · 0.85
vtenseFunction · 0.85
nomulFunction · 0.85
wake_neartoFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected