+/*!
+ * @brief 指定された地点の地形IDを変更する /
+ * Create desired feature
+ * @return なし
+ */
+static void do_cmd_wiz_create_feature(void)
+{
+ static int prev_feat = 0;
+ static int prev_mimic = 0;
+ cave_type *c_ptr;
+ feature_type *f_ptr;
+ char tmp_val[160];
+ IDX tmp_feat, tmp_mimic;
+ POSITION y, x;
+
+ if (!tgt_pt(&x, &y)) return;
+
+ c_ptr = &cave[y][x];
+
+ /* Default */
+ sprintf(tmp_val, "%d", prev_feat);
+
+ /* Query */
+ if (!get_string(_("地形: ", "Feature: "), tmp_val, 3)) return;
+
+ /* Extract */
+ tmp_feat = (IDX)atoi(tmp_val);
+ if (tmp_feat < 0) tmp_feat = 0;
+ else if (tmp_feat >= max_f_idx) tmp_feat = max_f_idx - 1;
+
+ /* Default */
+ sprintf(tmp_val, "%d", prev_mimic);
+
+ /* Query */
+ if (!get_string(_("地形 (mimic): ", "Feature (mimic): "), tmp_val, 3)) return;
+
+ /* Extract */
+ tmp_mimic = (IDX)atoi(tmp_val);
+ if (tmp_mimic < 0) tmp_mimic = 0;
+ else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
+
+ cave_set_feat(y, x, tmp_feat);
+ c_ptr->mimic = (s16b)tmp_mimic;
+
+ f_ptr = &f_info[get_feat_mimic(c_ptr)];
+
+ if (have_flag(f_ptr->flags, FF_GLYPH) ||
+ have_flag(f_ptr->flags, FF_MINOR_GLYPH))
+ c_ptr->info |= (CAVE_OBJECT);
+ else if (have_flag(f_ptr->flags, FF_MIRROR))
+ c_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
+
+ /* Notice */
+ note_spot(y, x);
+
+ /* Redraw */
+ lite_spot(y, x);
+
+ /* Update some things */
+ p_ptr->update |= (PU_FLOW);
+
+ prev_feat = tmp_feat;
+ prev_mimic = tmp_mimic;
+}
+
+
+#define NUM_O_SET 8
+#define NUM_O_BIT 32
+
+/*!
+ * @brief 現在のオプション設定をダンプ出力する /
+ * Hack -- Dump option bits usage
+ * @return なし
+ */
+static void do_cmd_dump_options(void)
+{
+ int i, j;
+ FILE *fff;
+ char buf[1024];
+ int **exist;
+
+ /* Build the filename */
+ path_build(buf, sizeof buf, ANGBAND_DIR_USER, "opt_info.txt");
+
+ /* File type is "TEXT" */
+ FILE_TYPE(FILE_TYPE_TEXT);
+
+ /* Open the file */
+ fff = my_fopen(buf, "a");
+
+ /* Oops */
+ if (!fff)
+ {
+ msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), buf);
+ msg_print(NULL);
+ return;
+ }
+
+ /* Allocate the "exist" array (2-dimension) */
+ C_MAKE(exist, NUM_O_SET, int *);
+ C_MAKE(*exist, NUM_O_BIT * NUM_O_SET, int);
+ for (i = 1; i < NUM_O_SET; i++) exist[i] = *exist + i * NUM_O_BIT;
+
+ /* Check for exist option bits */
+ for (i = 0; option_info[i].o_desc; i++)
+ {
+ const option_type *ot_ptr = &option_info[i];
+ if (ot_ptr->o_var) exist[ot_ptr->o_set][ot_ptr->o_bit] = i + 1;
+ }
+
+ fprintf(fff, "[Option bits usage on Hengband %d.%d.%d]\n\n",
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+
+ fputs("Set - Bit (Page) Option Name\n", fff);
+ fputs("------------------------------------------------\n", fff);
+ /* Dump option bits usage */
+ for (i = 0; i < NUM_O_SET; i++)
+ {
+ for (j = 0; j < NUM_O_BIT; j++)
+ {
+ if (exist[i][j])
+ {
+ const option_type *ot_ptr = &option_info[exist[i][j] - 1];
+ fprintf(fff, " %d - %02d (%4d) %s\n",
+ i, j, ot_ptr->o_page, ot_ptr->o_text);
+ }
+ else
+ {
+ fprintf(fff, " %d - %02d\n", i, j);
+ }
+ }
+ fputc('\n', fff);
+ }
+
+ /* Free the "exist" array (2-dimension) */
+ C_KILL(*exist, NUM_O_BIT * NUM_O_SET, int);
+ C_KILL(exist, NUM_O_SET, int *);
+
+ /* Close it */
+ my_fclose(fff);
+
+ msg_format(_("オプションbit使用状況をファイル %s に書き出しました。", "Option bits usage dump saved to file %s."), buf);
+}
+
+