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

Function dobreathe

src/polyself.c:1420–1447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1418}
1419
1420int
1421dobreathe(void)
1422{
1423 struct attack *mattk;
1424
1425 if (Strangled) {
1426 You_cant("breathe. Sorry.");
1427 return ECMD_OK;
1428 }
1429 if (u.uen < 15) {
1430 You("don't have enough energy to breathe!");
1431 return ECMD_OK;
1432 }
1433 u.uen -= 15;
1434 disp.botl = TRUE;
1435
1436 if (!getdir((char *) 0))
1437 return ECMD_CANCEL;
1438
1439 mattk = attacktype_fordmg(gy.youmonst.data, AT_BREA, AD_ANY);
1440 if (!mattk)
1441 impossible("bad breath attack?"); /* mouthwash needed... */
1442 else if (!u.dx && !u.dy && !u.dz)
1443 ubreatheu(mattk);
1444 else
1445 ubuzz(BZ_U_BREATH(BZ_OFS_AD(mattk->adtyp)), (int) mattk->damn);
1446 return ECMD_TIME;
1447}
1448
1449int
1450dospit(void)

Callers 1

domonabilityFunction · 0.85

Calls 7

You_cantFunction · 0.85
YouFunction · 0.85
getdirFunction · 0.85
attacktype_fordmgFunction · 0.85
ubreatheuFunction · 0.85
ubuzzFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected