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

Function wiz_flip_level

src/wizcmds.c:408–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408RESTORE_WARNING_FORMAT_NONLITERAL
409
410/* #wizfliplevel - transpose the current level */
411int
412wiz_flip_level(void)
413{
414 static const char choices[] = "0123",
415 prmpt[] = "Flip 0=randomly, 1=vertically, 2=horizontally, 3=both:";
416
417 /*
418 * Does not handle
419 * levregions,
420 * monster mtrack,
421 * migrating monsters aimed at returning to specific coordinates
422 * on this level
423 * as flipping is normally done only during level creation.
424 */
425 if (wizard) {
426 char c = yn_function(prmpt, choices, '\0', TRUE);
427
428 if (c && strchr(choices, c)) {
429 c -= '0';
430
431 if (!c)
432 flip_level_rnd(3, TRUE);
433 else
434 flip_level((int) c, TRUE);
435
436 docrt();
437 } else {
438 pline("%s", Never_mind);
439 }
440 }
441 return ECMD_OK;
442}
443
444/* #levelchange command - adjust hero's experience level */
445int

Callers

nothing calls this directly

Calls 5

yn_functionFunction · 0.85
flip_level_rndFunction · 0.85
flip_levelFunction · 0.85
docrtFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected