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

Function redist_attr

src/attrib.c:739–760  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739void
740redist_attr(void)
741{
742 int i, tmp;
743
744 for (i = 0; i < A_MAX; i++) {
745 if (i == A_INT || i == A_WIS)
746 continue;
747 /* Polymorphing doesn't change your mind */
748 tmp = AMAX(i);
749 AMAX(i) += (rn2(5) - 2);
750 if (AMAX(i) > ATTRMAX(i))
751 AMAX(i) = ATTRMAX(i);
752 if (AMAX(i) < ATTRMIN(i))
753 AMAX(i) = ATTRMIN(i);
754 ABASE(i) = ABASE(i) * AMAX(i) / tmp;
755 /* ABASE(i) > ATTRMAX(i) is impossible */
756 if (ABASE(i) < ATTRMIN(i))
757 ABASE(i) = ATTRMIN(i);
758 }
759 /* encumber_msg(); -- caller needs to do this */
760}
761
762/* apply minor variation to attributes */
763void

Callers 1

newmanFunction · 0.85

Calls 1

rn2Function · 0.85

Tested by

no test coverage detected