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

Function noarmor

src/invent.c:4577–4597  ·  view source on GitHub ↗

caller is responsible for checking !wearing_armor() */

Source from the content-addressed store, hash-verified

4575
4576/* caller is responsible for checking !wearing_armor() */
4577staticfn void
4578noarmor(boolean report_uskin)
4579{
4580 if (!uskin || !report_uskin) {
4581 You("are not wearing any armor.");
4582 } else {
4583 char *p, *uskinname, buf[BUFSZ];
4584
4585 uskinname = strcpy(buf, simpleonames(uskin));
4586 /* shorten "set of <color> dragon scales" to "<color> scales"
4587 and "<color> dragon scale mail" to "<color> scale mail" */
4588 if (!strncmpi(uskinname, "set of ", 7))
4589 uskinname += 7;
4590 if ((p = strstri(uskinname, " dragon ")) != 0)
4591 while ((p[1] = p[8]) != '\0')
4592 ++p;
4593
4594 You("are not wearing armor but have %s embedded in your skin.",
4595 uskinname);
4596 }
4597}
4598
4599/* the #seearmor command */
4600int

Callers 2

ggetobjFunction · 0.85
doprarmFunction · 0.85

Calls 4

YouFunction · 0.85
simpleonamesFunction · 0.85
strstriFunction · 0.85
strncmpiFunction · 0.70

Tested by

no test coverage detected