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

Function helm_simple_name

src/objnam.c:5512–5528  ·  view source on GitHub ↗

helm vs hat for messages */

Source from the content-addressed store, hash-verified

5510
5511/* helm vs hat for messages */
5512const char *
5513helm_simple_name(struct obj *helmet)
5514{
5515 /*
5516 * There is some wiggle room here; the result has been chosen
5517 * for consistency with the "protected by hard helmet" messages
5518 * given for various bonks on the head: headgear that provides
5519 * such protection is a "helm", that which doesn't is a "hat".
5520 *
5521 * elven leather helm / leather hat -> hat
5522 * dwarvish iron helm / hard hat -> helm
5523 * The rest are completely straightforward:
5524 * fedora, cornuthaum, dunce cap -> hat
5525 * all other types of helmets -> helm
5526 */
5527 return !hard_helmet(helmet) ? "hat" : "helm";
5528}
5529
5530/* gloves vs gauntlets; depends upon discovery state */
5531const char *

Callers 15

armoroffFunction · 0.85
canwearobjFunction · 0.85
disintegrate_armFunction · 0.85
mhitm_ad_drinFunction · 0.85
tiphatFunction · 0.85
armor_simple_nameFunction · 0.85
spoteffectsFunction · 0.85
toss_upFunction · 0.85
throw_goldFunction · 0.85
break_armorFunction · 0.85
burnarmorFunction · 0.85
trapeffect_rocktrapFunction · 0.85

Calls 1

hard_helmetFunction · 0.85

Tested by

no test coverage detected