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

Function u_init_inventory_attrs

src/u_init.c:1372–1393  ·  view source on GitHub ↗

initialise starting inventory and attributes this function can be run multiple times and will overwrite the effects of previous runs */

Source from the content-addressed store, hash-verified

1370 this function can be run multiple times and will overwrite the effects of
1371 previous runs */
1372void
1373u_init_inventory_attrs(void)
1374{
1375 gl.lastinvnr = 51;
1376 while (gi.invent)
1377 useupall(gi.invent);
1378
1379 u.umoney0 = 0;
1380 u_init_role();
1381 u_init_race();
1382
1383 if (discover)
1384 ini_inv(Wishing);
1385
1386 if (u.umoney0)
1387 ini_inv(Money);
1388 u.umoney0 += hidden_gold(TRUE); /* in case sack has gold in it */
1389
1390 init_attr(75); /* init attribute values */
1391 vary_init_attr(); /* minor variation to attrs */
1392 u_init_carry_attr_boost();
1393}
1394
1395/* side effects of starting inventory (e.g. discovering it) and skills (both
1396 those based on role and those based on starting inventory) */

Callers 1

newgameFunction · 0.85

Calls 8

useupallFunction · 0.85
u_init_roleFunction · 0.85
u_init_raceFunction · 0.85
ini_invFunction · 0.85
hidden_goldFunction · 0.85
init_attrFunction · 0.85
vary_init_attrFunction · 0.85
u_init_carry_attr_boostFunction · 0.85

Tested by

no test coverage detected