Example #1
0
/*
 * Ask for and parse a "debug command"
 * The "command_arg" may have been set.
 */
void do_cmd_debug(void)
{
	int py = p_ptr->py;
	int px = p_ptr->px;

	int     x, y;
	char    cmd;


	/* Get a "debug command" */
	(void)get_com("Debug Command: ", &cmd);

	/* Analyze the command */
	switch (cmd)
	{
		/* Nothing */
		case ESCAPE:
		case ' ':
		case '\n':
		case '\r':
		break;


#ifdef ALLOW_SPOILERS

		/* Hack -- Generate Spoilers */
		case '"':
			do_cmd_spoilers();
		break;

#endif /* ALLOW_SPOILERS */

#ifdef MATLAB
		case '=':
			output_monster_matlab();
		break;
#endif /* MATLAB */

		/* Hack -- Help */
		case '?':
			screen_save();
			(void)show_file("wizard.txt", NULL, 0 , 0);
			screen_load();
		break;


		/* Cure all maladies */
		case 'a':
			do_cmd_wiz_cure_all();
		break;

		/* Know alignment */
		case 'A':
			msg_format("Your alignment is %d.", p_ptr->align);
		break;

		/* Teleport to target */
		case 'b':
			do_cmd_wiz_bamf();
		break;

		/* Create any object */
		case 'c':
			wiz_create_item();
		break;

		/* Create a named artifact */
		case 'C':
/*			wiz_create_named_art(p_ptr->command_arg);*/
		break;

		/* Detect everything */
		case 'd':
			(void)detect_all();
		break;

		/* Edit character */
		case 'e':
			do_cmd_wiz_change();
		break;

		/* View item info */
		case 'f':
			(void)identify_fully();
		break;

		/* Create feature */
		case 'F':
			if (p_ptr->command_arg > 0) do_cmd_wiz_feature(p_ptr->command_arg);
		break;

		/* Good Objects */
		case 'g':
			if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1;
			acquirement(py, px, p_ptr->command_arg, FALSE, TRUE);
		break;

		/* Hitpoint rerating */
		case 'h':
			do_cmd_rerate();
		break;

#ifdef MONSTER_HORDES
		case 'H':
			do_cmd_summon_horde();
		break;
#endif /* MONSTER_HORDES */

		/* Identify */
		case 'i':
			(void)ident_spell();
		break;

		/* Fields Integrity */
		case 'I':
			(void)test_field_data_integrity();
		break;

		/* Go up or down in the dungeon */
		case 'j':
			do_cmd_wiz_jump();
		break;

		/* Test compression code */
		case 'J':
			/* test_compress_module(); */
		break;

		/* Self-Knowledge */
		case 'k':
			self_knowledge();
		break;

		/* Learn about objects */
		case 'l':
			do_cmd_wiz_learn();
		break;

		/* Lose Mutation */
		case 'L':
			(void)lose_mutation(p_ptr->command_arg);
		break;

		/* Magic Mapping */
		case 'm':
			map_area();
		break;

		/* Gain Mutation */
		case 'M':
			(void)gain_mutation(p_ptr->command_arg);
		break;

		/* Specific reward */
		case 'r':
			(void)gain_level_reward(p_ptr->command_arg);
		break;

		/* Summon _friendly_ named monster */
		case 'N':
			do_cmd_wiz_named_friendly(p_ptr->command_arg, TRUE);
		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;

#if 0
		/* Complete a Quest -KMW- */
		case 'q':
		{
			for (i = 0; i < max_quests; i++)
			{
				if (p_ptr->quest[i].status == QUEST_STATUS_TAKEN)
				{
					p_ptr->quest[i].status++;
					msg_print("Completed Quest");
					msg_print(NULL);
					break;
				}
			}
			if (i == max_quests)
			{
				msg_print("No current quest");
				msg_print(NULL);
			}
			break;
		}
#endif

		/* Make every dungeon square "known" to test streamers -KMW- */
		case 'u':
		{
			for (y = min_hgt; y < max_hgt; y++)
			{
				for (x = min_wid; x < max_wid; x++)
				{
					area(y, x)->info |= (CAVE_GLOW | CAVE_MARK);
				}
			}

			wiz_lite();
			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;

		/* Very Good Objects */
		case 'v':
			if (p_ptr->command_arg <= 0) p_ptr->command_arg = 1;
			acquirement(py, px, p_ptr->command_arg, TRUE, TRUE);
		break;

		/* Wizard Light the Level */
		case 'w':
			if (p_ptr->depth)
			{
				wiz_lite();
			}
			else
			{
				learn_map();
			}
		break;

		case 'W':
			test_decision_tree();
		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':
			do_cmd_wiz_zap();
		break;

		case 'Z':
			do_cmd_wiz_zap_all();
		break;

		/* Hack -- whatever I desire */
		case '_':
			do_cmd_wiz_hack_ben();
		break;

#ifdef USE_SCRIPT
		/* Hack -- activate a script */
		case '@':
			do_cmd_wiz_script();
		break;
#endif /* USE_SCRIPT */

		/* Not a Wizard Command */
		default:
			msg_print("That is not a valid debug command.");
		break;
	}
}
Example #2
0
/*!
 * @brief デバッグコマンドを選択する処理のメインルーチン /
 * Ask for and parse a "debug command"
 * The "command_arg" may have been set.
 * @return なし
 */
void do_cmd_debug(void)
{
	int     x, y, i;
	char    cmd;


	/* Get a "debug command" */
	get_com("Debug Command: ", &cmd, FALSE);

	/* Analyze the command */
	switch (cmd)
	{
	/* Nothing */
	case ESCAPE:
	case ' ':
	case '\n':
	case '\r':
		break;

#ifdef ALLOW_SPOILERS

	/* Hack -- Generate Spoilers */
	case '"':
		do_cmd_spoilers();
		break;

#endif /* ALLOW_SPOILERS */

	/* Hack -- Help */
	case '?':
		do_cmd_help();
		break;

	/* Cure all maladies */
	case 'a':
		do_cmd_wiz_cure_all();
		break;

	/* Know alignment */
	case 'A':
		msg_format("Your alignment is %d.", p_ptr->align);
		break;

	/* Teleport to target */
	case 'b':
		do_cmd_wiz_bamf();
		break;

	case 'B':
		battle_monsters();
		break;

	/* Create any object */
	case 'c':
		wiz_create_item();
		break;

	/* Create a named artifact */
	case 'C':
		wiz_create_named_art();
		break;

	/* Detect everything */
	case 'd':
		detect_all(DETECT_RAD_ALL * 3);
		break;

	/* Dimension_door */
	case 'D':
		wiz_dimension_door();
		break;

	/* Edit character */
	case 'e':
		do_cmd_wiz_change();
		break;

	/* Blue Mage Only */
	case 'E':
		if (p_ptr->pclass == CLASS_BLUE_MAGE)
		{
			do_cmd_wiz_blue_mage();
		}
		break;

	/* View item info */
	case 'f':
		identify_fully(FALSE);
		break;

	/* Create desired feature */
	case 'F':
		do_cmd_wiz_create_feature();
		break;

	/* Good Objects */
	case 'g':
		if (command_arg <= 0) command_arg = 1;
		acquirement(p_ptr->y, p_ptr->x, command_arg, FALSE, FALSE, TRUE);
		break;

	/* Hitpoint rerating */
	case 'h':
		do_cmd_rerate(TRUE);
		break;

#ifdef MONSTER_HORDES
	case 'H':
		do_cmd_summon_horde();
		break;
#endif /* MONSTER_HORDES */

	/* Identify */
	case 'i':
		(void)ident_spell(FALSE);
		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(DETECT_RAD_ALL * 3);
		break;

	/* Mutation */
	case 'M':
		(void)gain_random_mutation(command_arg);
		break;

	/* Reset Class */
	case 'R':
		(void)do_cmd_wiz_reset_class();
		break;

	/* Specific reward */
	case 'r':
		(void)gain_level_reward(command_arg);
		break;

	/* Summon _friendly_ named monster */
	case 'N':
		do_cmd_wiz_named_friendly(command_arg);
		break;

	/* Summon Named Monster */
	case 'n':
		do_cmd_wiz_named(command_arg);
		break;

	/* Dump option bits usage */
	case 'O':
		do_cmd_dump_options();
		break;

	/* Object playing routines */
	case 'o':
		do_cmd_wiz_play();
		break;

	/* Phase Door */
	case 'p':
		teleport_player(10, 0L);
		break;

	/* Complete a Quest -KMW- */
	case 'q':
		if(p_ptr->inside_quest)
		{
			if (quest[p_ptr->inside_quest].status == QUEST_STATUS_TAKEN)
			{
				complete_quest(p_ptr->inside_quest);
				break;
			}
		}
		else
		{
			msg_print("No current quest");
			msg_print(NULL);
		}
		break;

	/* Make every dungeon square "known" to test streamers -KMW- */
	case 'u':
		for (y = 0; y < cur_hgt; y++)
		{
			for (x = 0; x < cur_wid; x++)
			{
				cave[y][x].info |= (CAVE_GLOW | CAVE_MARK);
			}
		}
		wiz_lite(FALSE);
		break;

	/* Summon Random Monster(s) */
	case 's':
		if (command_arg <= 0) command_arg = 1;
		do_cmd_wiz_summon(command_arg);
		break;

	/* Special(Random Artifact) Objects */
	case 'S':
		if (command_arg <= 0) command_arg = 1;
		acquirement(p_ptr->y, p_ptr->x, command_arg, TRUE, TRUE, TRUE);
		break;

	/* Teleport */
	case 't':
		teleport_player(100, 0L);
		break;

	/* Very Good Objects */
	case 'v':
		if (command_arg <= 0) command_arg = 1;
		acquirement(p_ptr->y, p_ptr->x, command_arg, TRUE, FALSE, TRUE);
		break;

	/* Wizard Light the Level */
	case 'w':
		wiz_lite((bool)(p_ptr->pclass == CLASS_NINJA));
		break;

	/* Increase Experience */
	case 'x':
		gain_exp(command_arg ? command_arg : (p_ptr->exp + 1));
		break;

	/* Zap Monsters (Genocide) */
	case 'z':
		do_cmd_wiz_zap();
		break;

	/* Zap Monsters (Omnicide) */
	case 'Z':
		do_cmd_wiz_zap_all();
		break;

	/* Hack -- whatever I desire */
	case '_':
		do_cmd_wiz_hack_ben();
		break;

	/* Not a Wizard Command */
	default:
		msg_print("That is not a valid debug command.");
		break;
	}
}