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

Function not_fully_identified

src/objnam.c:1786–1819  ·  view source on GitHub ↗

used from invent.c */

Source from the content-addressed store, hash-verified

1784
1785/* used from invent.c */
1786boolean
1787not_fully_identified(struct obj *otmp)
1788{
1789 /* gold doesn't have any interesting attributes [yet?] */
1790 if (otmp->oclass == COIN_CLASS)
1791 return FALSE; /* always fully ID'd */
1792 /* check fundamental ID hallmarks first */
1793 if (!otmp->known || !otmp->dknown
1794#ifdef MAIL_STRUCTURES
1795 || (!otmp->bknown && otmp->otyp != SCR_MAIL)
1796#else
1797 || !otmp->bknown
1798#endif
1799 || !objects[otmp->otyp].oc_name_known)
1800 return TRUE;
1801 if ((!otmp->cknown && (Is_container(otmp) || otmp->otyp == STATUE))
1802 || (!otmp->lknown && Is_box(otmp)))
1803 return TRUE;
1804 if (otmp->oartifact && undiscovered_artifact(otmp->oartifact))
1805 return TRUE;
1806 /* otmp->rknown is the only item of interest if we reach here */
1807 /*
1808 * Note: if a revision ever allows scrolls to become fireproof or
1809 * rings to become shockproof, this checking will need to be revised.
1810 * `rknown' ID only matters if xname() will provide the info about it.
1811 */
1812 if (otmp->rknown
1813 || (otmp->oclass != ARMOR_CLASS && otmp->oclass != WEAPON_CLASS
1814 && !is_weptool(otmp) /* (redundant) */
1815 && otmp->oclass != BALL_CLASS)) /* (useless) */
1816 return FALSE;
1817 else /* lack of `rknown' only matters for vulnerable objects */
1818 return (boolean) is_damageable(otmp);
1819}
1820
1821/* format a corpse name (xname() omits monster type; doname() calls us);
1822 eatcorpse() also uses us for death reason when eating tainted glob */

Callers 5

obj_is_pnameFunction · 0.85
askchainFunction · 0.85
count_unidentifiedFunction · 0.85
identify_packFunction · 0.85
invent.cFile · 0.85

Calls 1

undiscovered_artifactFunction · 0.85

Tested by

no test coverage detected