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

Function init_attr

src/attrib.c:722–737  ·  view source on GitHub ↗

allocate hero's initial characteristics */

Source from the content-addressed store, hash-verified

720
721/* allocate hero's initial characteristics */
722void
723init_attr(int np)
724{
725 int i;
726
727 for (i = 0; i < A_MAX; i++) {
728 ABASE(i) = AMAX(i) = gu.urole.attrbase[i];
729 ATEMP(i) = ATIME(i) = 0;
730 np -= gu.urole.attrbase[i];
731 }
732
733 /* distribute leftover points */
734 np = init_attr_role_redist(np, TRUE);
735 /* if we went over, remove points */
736 np = init_attr_role_redist(np, FALSE);
737}
738
739void
740redist_attr(void)

Callers 1

u_init_inventory_attrsFunction · 0.85

Calls 1

init_attr_role_redistFunction · 0.85

Tested by

no test coverage detected