MCPcopy Index your code
hub / github.com/NetHack/NetHack / is_pure

Function is_pure

src/quest.c:152–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152staticfn int
153is_pure(boolean talk)
154{
155 int purity;
156 aligntyp original_alignment = u.ualignbase[A_ORIGINAL];
157
158 if (wizard && talk) {
159 if (u.ualign.type != original_alignment) {
160 You("are currently %s instead of %s.", align_str(u.ualign.type),
161 align_str(original_alignment));
162 } else if (u.ualignbase[A_CURRENT] != original_alignment) {
163 You("have converted.");
164 } else if (u.ualign.record < MIN_QUEST_ALIGN) {
165 You("are currently %d and require %d.", u.ualign.record,
166 MIN_QUEST_ALIGN);
167 if (yn_function("adjust?", (char *) 0, 'y', TRUE) == 'y')
168 u.ualign.record = MIN_QUEST_ALIGN;
169 }
170 }
171 purity = (u.ualign.record >= MIN_QUEST_ALIGN
172 && u.ualign.type == original_alignment
173 && u.ualignbase[A_CURRENT] == original_alignment)
174 ? 1
175 : (u.ualignbase[A_CURRENT] != original_alignment) ? -1 : 0;
176 return purity;
177}
178
179/*
180 * Expel the player to the stairs on the parent of the quest dungeon.

Callers 2

ok_to_questFunction · 0.85
chat_with_leaderFunction · 0.85

Calls 3

YouFunction · 0.85
align_strFunction · 0.85
yn_functionFunction · 0.85

Tested by

no test coverage detected