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

Function livelog_newform

src/polyself.c:306–333  ·  view source on GitHub ↗

log a message if non-poly'd hero's gender has changed */

Source from the content-addressed store, hash-verified

304
305/* log a message if non-poly'd hero's gender has changed */
306void
307livelog_newform(boolean viapoly, int oldgend, int newgend)
308{
309 char buf[BUFSZ];
310 const char *oldrole, *oldrank, *newrole, *newrank;
311
312 /*
313 * TODO?
314 * Give other logging feedback here instead of in newman().
315 */
316
317 if (!Upolyd) {
318 if (newgend != oldgend) {
319 oldrole = (oldgend && gu.urole.name.f) ? gu.urole.name.f
320 : gu.urole.name.m;
321 newrole = (newgend && gu.urole.name.f) ? gu.urole.name.f
322 : gu.urole.name.m;
323 oldrank = rank_of(u.ulevel, Role_switch, oldgend);
324 newrank = rank_of(u.ulevel, Role_switch, newgend);
325 Sprintf(buf, "%.10s %.30s", genders[flags.female].adj, newrank);
326 livelog_printf(LL_MINORAC, "%s into %s",
327 viapoly ? "polymorphed" : "transformed",
328 an(strcmp(newrole, oldrole) ? newrole
329 : strcmp(newrank, oldrank) ? newrank
330 : buf));
331 }
332 }
333}
334
335staticfn void
336newman(void)

Callers 2

Amulet_onFunction · 0.85
newmanFunction · 0.85

Calls 3

rank_ofFunction · 0.85
livelog_printfFunction · 0.85
anFunction · 0.85

Tested by

no test coverage detected