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

Function hack_artifacts

src/artifact.c:86–107  ·  view source on GitHub ↗

handle some special cases; must be called after u_init() */

Source from the content-addressed store, hash-verified

84
85/* handle some special cases; must be called after u_init() */
86staticfn void
87hack_artifacts(void)
88{
89 struct artifact *art;
90 int alignmnt = aligns[flags.initalign].value;
91
92 /* Fix up the alignments of "gift" artifacts */
93 for (art = artilist + 1; art->otyp; art++)
94 if (art->role == Role_switch && art->alignment != A_NONE)
95 art->alignment = alignmnt;
96
97 /* Excalibur can be used by any lawful character, not just knights */
98 if (!Role_if(PM_KNIGHT))
99 artilist[ART_EXCALIBUR].role = NON_PM;
100
101 /* Fix up the quest artifact */
102 if (gu.urole.questarti) {
103 artilist[gu.urole.questarti].alignment = alignmnt;
104 artilist[gu.urole.questarti].role = Role_switch;
105 }
106 return;
107}
108
109/* zero out the artifact existence list */
110void

Callers 2

init_artifactsFunction · 0.85
restore_artifactsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected