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

Function lesshungry

src/eat.c:3288–3333  ·  view source on GitHub ↗

called after eating (and after drinking fruit juice) */

Source from the content-addressed store, hash-verified

3286
3287/* called after eating (and after drinking fruit juice) */
3288void
3289lesshungry(int num)
3290{
3291 /* See comments in newuhs() for discussion on force_save_hs */
3292 boolean iseating = (go.occupation == eatfood) || gf.force_save_hs;
3293
3294 debugpline1("lesshungry(%d)", num);
3295 u.uhunger += num;
3296 if (u.uhunger >= 2000) {
3297 if (!iseating || svc.context.victual.canchoke) {
3298 if (iseating) {
3299 choke(svc.context.victual.piece);
3300 reset_eat();
3301 } else {
3302 choke((go.occupation == opentin) ? svc.context.tin.tin : 0);
3303 /* no reset_eat() */
3304 }
3305 }
3306 } else {
3307 /* Have lesshungry() report when you're nearly full so all eating
3308 * warns when you're about to choke.
3309 */
3310 if (u.uhunger >= 1500 && !Hunger
3311 && (!svc.context.victual.eating
3312 || (svc.context.victual.eating
3313 && !svc.context.victual.fullwarn))) {
3314 pline("You're having a hard time getting all of it down.");
3315 gn.nomovemsg = "You're finally finished.";
3316 if (!svc.context.victual.eating) {
3317 gm.multi = -2;
3318 } else {
3319 svc.context.victual.fullwarn = 1;
3320 if (svc.context.victual.canchoke
3321 && (svc.context.victual.reqtime
3322 - svc.context.victual.usedtime) > 1) {
3323 /* food with one bite left will not survive a stop */
3324 if (!paranoid_query(ParanoidEating, "Continue eating?")) {
3325 reset_eat();
3326 gn.nomovemsg = (char *) 0;
3327 }
3328 }
3329 }
3330 }
3331 }
3332 newuhs(FALSE);
3333}
3334
3335staticfn int
3336unfaint(void)

Callers 4

cpostfxFunction · 0.85
consume_tinFunction · 0.85
eatspecialFunction · 0.85
biteFunction · 0.85

Calls 5

chokeFunction · 0.85
reset_eatFunction · 0.85
paranoid_queryFunction · 0.85
newuhsFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected