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

Function dospit

src/polyself.c:1449–1478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1447}
1448
1449int
1450dospit(void)
1451{
1452 struct obj *otmp;
1453 struct attack *mattk;
1454
1455 if (!getdir((char *) 0))
1456 return ECMD_CANCEL;
1457 mattk = attacktype_fordmg(gy.youmonst.data, AT_SPIT, AD_ANY);
1458 if (!mattk) {
1459 impossible("bad spit attack?");
1460 } else {
1461 switch (mattk->adtyp) {
1462 case AD_BLND:
1463 case AD_DRST:
1464 otmp = mksobj(BLINDING_VENOM, TRUE, FALSE);
1465 break;
1466 default:
1467 impossible("bad attack type in dospit");
1468 FALLTHROUGH;
1469 /*FALLTHRU*/
1470 case AD_ACID:
1471 otmp = mksobj(ACID_VENOM, TRUE, FALSE);
1472 break;
1473 }
1474 otmp->spe = 1; /* to indicate it's yours */
1475 throwit(otmp, 0L, FALSE, (struct obj *) 0);
1476 }
1477 return ECMD_TIME;
1478}
1479
1480int
1481doremove(void)

Callers 1

domonabilityFunction · 0.85

Calls 5

getdirFunction · 0.85
attacktype_fordmgFunction · 0.85
mksobjFunction · 0.85
throwitFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected