MCPcopy Index your code
hub / github.com/NetHack/NetHack / beg

Function beg

src/sounds.c:518–542  ·  view source on GitHub ↗

pet makes "I'm hungry" noises */

Source from the content-addressed store, hash-verified

516
517/* pet makes "I'm hungry" noises */
518void
519beg(struct monst *mtmp)
520{
521 if (helpless(mtmp)
522 || !(carnivorous(mtmp->data) || herbivorous(mtmp->data)))
523 return;
524
525 /* presumably nearness and soundok checks have already been made */
526 if (!is_silent(mtmp->data) && mtmp->data->msound <= MS_ANIMAL) {
527 (void) domonnoise(mtmp);
528 } else if (mtmp->data->msound >= MS_HUMANOID) {
529 if (!canspotmon(mtmp))
530 map_invisible(mtmp->mx, mtmp->my);
531 SetVoice(mtmp, 0, 80, 0);
532 verbalize("I'm hungry.");
533 } else {
534 /* this is pretty lame but is better than leaving out the block
535 of speech types between animal and humanoid; this covers
536 MS_SILENT too (if caller lets that get this far) since it's
537 excluded by the first two cases */
538 if (canspotmon(mtmp))
539 pline("%s seems famished.", Monnam(mtmp));
540 /* looking famished will be a good trick for a tame skeleton... */
541 }
542}
543
544/* hero has attacked a peaceful monster within 'mon's view */
545const char *

Callers 1

dog_hungerFunction · 0.85

Calls 5

domonnoiseFunction · 0.85
map_invisibleFunction · 0.85
verbalizeFunction · 0.85
MonnamFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected