/* * Ask for and parse a "debug command" * * The "p_ptr->command_arg" may have been set. */ void do_cmd_debug(void) { int py = p_ptr->py; int px = p_ptr->px; char cmd; /* Get a "debug command" */ if (!get_com("Debug Command: ", &cmd)) return; /* Analyze the command */ switch (cmd) { /* Ignore */ case ESCAPE: case ' ': case '\n': case '\r': { break; } #ifdef ALLOW_SPOILERS /* Hack -- Generate Spoilers */ case '"': { do_cmd_spoilers(); break; } #endif /* Hack -- Help */ case '?': { do_cmd_wiz_help(); break; } /* Cure all maladies */ case 'a': { do_cmd_wiz_cure_all(); break; } /* Teleport to target */ case 'b': { do_cmd_wiz_bamf(); break; } /* Create any object */ case 'c': { wiz_create_item(); break; } /* Create an artifact */ case 'C': { if (p_ptr->command_arg > 0) { wiz_create_artifact(p_ptr->command_arg); } else { char name[80] = ""; int a_idx = -1; /* Avoid the prompt getting in the way */ screen_save(); /* Prompt */ prt("Create which artifact? ", 0, 0); /* Get the name */ if (askfor_aux(name, sizeof(name), NULL)) { /* See if an a_idx was entered */ a_idx = get_idx_from_name(name); /* If not, find the artifact with that name */ if (a_idx < 1) a_idx = lookup_artifact_name(name); /* Did we find a valid artifact? */ if (a_idx != -1) wiz_create_artifact(a_idx); } /* Reload the screen */ screen_load(); } break; } /* Detect everything */ case 'd': { detect_all(TRUE); break; } /* Edit character */ case 'e': { do_cmd_wiz_change(); break; } case 'f': { stats_collect(); break; } /* Good Objects */ case 'g': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; acquirement(py, px, p_ptr->depth, p_ptr->command_arg, FALSE); break; } /* Hitpoint rerating */ case 'h': { do_cmd_rerate(); break; } /* Identify */ case 'i': { (void)ident_spell(); break; } /* Go up or down in the dungeon */ case 'j': { do_cmd_wiz_jump(); break; } /* Learn about objects */ case 'l': { do_cmd_wiz_learn(); break; } /* Magic Mapping */ case 'm': { map_area(); break; } /* Summon Named Monster */ case 'n': { if (p_ptr->command_arg > 0) { do_cmd_wiz_named(p_ptr->command_arg, TRUE); } else { char name[80] = ""; s16b r_idx; /* Avoid the prompt getting in the way */ screen_save(); /* Prompt */ prt("Summon which monster? ", 0, 0); /* Get the name */ if (askfor_aux(name, sizeof(name), NULL)) { /* See if a r_idx was entered */ r_idx = get_idx_from_name(name); /* If not, find the monster with that name */ if (r_idx < 1) r_idx = lookup_monster(name); /* Did we find a valid monster? */ if (r_idx != -1) do_cmd_wiz_named(r_idx, TRUE); } p_ptr->redraw |= (PR_MAP | PR_MONLIST); /* Reload the screen */ screen_load(); } break; } /* Object playing routines */ case 'o': { do_cmd_wiz_play(); break; } /* Phase Door */ case 'p': { teleport_player(10); break; } /* Query the dungeon */ case 'q': { do_cmd_wiz_query(); break; } /* Summon Random Monster(s) */ case 's': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; do_cmd_wiz_summon(p_ptr->command_arg); break; } /* Teleport */ case 't': { teleport_player(100); break; } /* Create a trap */ case 'T': { cave_set_feat(p_ptr->py, p_ptr->px, FEAT_INVIS); break; } /* Un-hide all monsters */ case 'u': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 255; do_cmd_wiz_unhide(p_ptr->command_arg); break; } /* Very Good Objects */ case 'v': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; acquirement(py, px, p_ptr->depth, p_ptr->command_arg, TRUE); break; } case 'V': { wiz_test_kind(p_ptr->command_arg); break; } /* Wizard Light the Level */ case 'w': { wiz_light(); break; } /* Increase Experience */ case 'x': { if (p_ptr->command_arg) { gain_exp(p_ptr->command_arg); } else { gain_exp(p_ptr->exp + 1); } break; } /* Zap Monsters (Banishment) */ case 'z': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = MAX_SIGHT; do_cmd_wiz_zap(p_ptr->command_arg); break; } /* Hack */ case '_': { do_cmd_wiz_hack_ben(); break; } /* Oops */ default: { msg_print("That is not a valid debug command."); break; } } }
/* * Ask for and parse a "debug command" * * The "p_ptr->command_arg" may have been set. */ void do_cmd_debug(void) { int py = p_ptr->py; int px = p_ptr->px; char cmd; /* Get a "debug command" */ if (!get_com("Debug Command: ", &cmd)) return; /* Analyze the command */ switch (cmd) { /* Ignore */ case ESCAPE: case ' ': case '\n': case '\r': { break; } #ifdef ALLOW_SPOILERS /* Hack -- Generate Spoilers */ case '"': { do_cmd_spoilers(); break; } #endif /* Hack -- Help */ case '?': { do_cmd_help(); break; } /* Cure all maladies */ case 'a': { do_cmd_wiz_cure_all(); break; } /* Teleport to target */ case 'b': { do_cmd_wiz_bamf(); break; } /* Create any object */ case 'c': { wiz_create_item(); break; } /* Create an artifact */ case 'C': { wiz_create_artifact(p_ptr->command_arg); break; } /* Detect everything */ case 'd': { detect_all(); break; } /* Edit character */ case 'e': { do_cmd_wiz_change(); break; } /* View item info */ case 'f': { (void)identify_fully(); break; } /* Good Objects */ case 'g': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; acquirement(py, px, p_ptr->command_arg, FALSE); break; } /* Hitpoint rerating */ case 'h': { do_cmd_rerate(); break; } /* Identify */ case 'i': { (void)ident_spell(); break; } /* Go up or down in the dungeon */ case 'j': { do_cmd_wiz_jump(); break; } /* Self-Knowledge */ case 'k': { self_knowledge(); break; } /* Learn about objects */ case 'l': { do_cmd_wiz_learn(); break; } /* Magic Mapping */ case 'm': { map_area(); break; } /* Summon Named Monster */ case 'n': { do_cmd_wiz_named(p_ptr->command_arg, TRUE); break; } /* Object playing routines */ case 'o': { do_cmd_wiz_play(); break; } /* Phase Door */ case 'p': { teleport_player(10); break; } /* Query the dungeon */ case 'q': { do_cmd_wiz_query(); break; } /* Summon Random Monster(s) */ case 's': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; do_cmd_wiz_summon(p_ptr->command_arg); break; } /* Teleport */ case 't': { teleport_player(100); break; } /* Un-hide all monsters */ case 'u': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 255; do_cmd_wiz_unhide(p_ptr->command_arg); break; } /* Very Good Objects */ case 'v': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; acquirement(py, px, p_ptr->command_arg, TRUE); break; } /* Wizard Light the Level */ case 'w': { wiz_lite(); break; } /* Increase Experience */ case 'x': { if (p_ptr->command_arg) { gain_exp(p_ptr->command_arg); } else { gain_exp(p_ptr->exp + 1); } break; } /* Zap Monsters (Genocide) */ case 'z': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = MAX_SIGHT; do_cmd_wiz_zap(p_ptr->command_arg); break; } /* Oops */ default: { msg_print("That is not a valid debug command."); break; } } }
/* * Ask for and parse a "debug command" * * The "p_ptr->command_arg" may have been set. */ void do_cmd_debug(void) { int py = p_ptr->py; int px = p_ptr->px; char cmd; /* Get a "debug command" */ if (!get_com("Debug Command: ", &cmd)) return; /* Analyze the command */ switch (cmd) { /* Ignore */ case ESCAPE: case ' ': case '\n': case '\r': { break; } #ifdef ALLOW_SPOILERS /* Hack -- Generate Spoilers */ case '"': { do_cmd_spoilers(); break; } #endif /* Hack -- Help */ case '?': { do_cmd_help(); break; } /* Cure all maladies */ case 'a': { do_cmd_wiz_cure_all(); break; } /* Teleport to target */ case 'b': { do_cmd_wiz_bamf(); break; } /* Create any object */ case 'c': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; wiz_create_item(p_ptr->command_arg); break; } /* Create an artefact */ case 'C': { char prompt[80]; char buf[80]; sprintf(prompt, "%s", "Index: "); sprintf(buf, "%d", 0); if(term_get_string(prompt, buf, 0)) wiz_create_artefact( atoi(buf) ); break; } /* Detect everything */ case 'd': { detect_all_doors_traps(); detect_all(); break; } /* Edit character */ case 'e': { do_cmd_wiz_change(); break; } /* Forget items and map and monster memory */ case 'f': { do_cmd_wiz_forget(); break; } /* Good Objects */ case 'g': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; acquirement(py, px, p_ptr->command_arg, FALSE); break; } /* Identify */ case 'i': { (void)ident_spell(); break; } /* Go up or down in the dungeon */ case 'j': { do_cmd_wiz_jump(); break; } /* Self-Knowledge */ case 'k': { self_knowledge(); break; } /* Wizard Look */ case 'l': { do_cmd_wiz_look(); break; } /* Magic Mapping */ case 'm': { map_area(); break; } /* Summon Named Monster */ case 'n': { char prompt[80]; char buf[80]; sprintf(prompt, "%s", "Index: "); sprintf(buf, "%d", 0); if(term_get_string(prompt, buf, 0)) do_cmd_wiz_named(atoi(buf), TRUE); break; } /* Object playing routines */ case 'o': { do_cmd_wiz_play(); break; } /* Debug Options */ case 'O': { screen_save(); do_cmd_options_aux(6, "Debug Options"); screen_load(); break; } /* Phase Door */ case 'p': { teleport_player(10); break; } /* Query the dungeon */ case 'q': { do_cmd_wiz_query(); break; } /* Summon Random Monster(s) */ case 's': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; do_cmd_wiz_summon(p_ptr->command_arg); break; } /* Teleport */ case 't': { teleport_player(100); break; } /* Un-hide all monsters */ case 'u': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 255; do_cmd_wiz_unhide(p_ptr->command_arg); break; } /* Very Good Objects */ case 'v': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1; acquirement(py, px, p_ptr->command_arg, TRUE); break; } /* Wizard Light the Level */ case 'w': { wiz_light(); break; } /* Increase Experience */ case 'x': { if (p_ptr->command_arg) { gain_exp(p_ptr->command_arg); } else { gain_exp(p_ptr->exp); } break; } /* Zap Monsters (Banishment) */ case 'z': { if (p_ptr->command_arg <= 0) p_ptr->command_arg = MAX_SIGHT; do_cmd_wiz_zap(p_ptr->command_arg); break; } /* Oops */ default: { msg_print("That is not a valid debug command."); break; } } }