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

Function tt_oname

src/topten.c:1421–1441  ·  view source on GitHub ↗

* Attach random player name and class from high score list * to an object (for statues or morgue corpses). */

Source from the content-addressed store, hash-verified

1419 * to an object (for statues or morgue corpses).
1420 */
1421struct obj *
1422tt_oname(struct obj *otmp)
1423{
1424 struct toptenentry *tt;
1425 if (!otmp)
1426 return (struct obj *) 0;
1427
1428 tt = get_rnd_toptenentry();
1429
1430 if (!tt)
1431 return (struct obj *) 0;
1432
1433 set_corpsenm(otmp, classmon(tt->plrole));
1434 if (tt->plgend[0] == 'F')
1435 otmp->spe = CORPSTAT_FEMALE;
1436 else if (tt->plgend[0] == 'M')
1437 otmp->spe = CORPSTAT_MALE;
1438 otmp = oname(otmp, tt->name, ONAME_NO_FLAGS);
1439
1440 return otmp;
1441}
1442
1443/* Randomly select a topten entry to mimic */
1444int

Callers 1

mk_tt_objectFunction · 0.85

Calls 4

get_rnd_toptenentryFunction · 0.85
set_corpsenmFunction · 0.85
classmonFunction · 0.85
onameFunction · 0.85

Tested by

no test coverage detected