OSDN Git Service

[Refactor] #38862 Moved angband.h, h-*.h and system-variables.c/h
[hengband/hengband.git] / src / cmd / cmd-gameoption.c
1 #include "system/angband.h"
2
3 #include "autopick/autopick.h"
4 #include "io/write-diary.h"
5 #include "cmd/cmd-gameoption.h"
6 #include "cmd/cmd-autopick.h"
7 #include "gameterm.h"
8 #include "view/display-main-window.h"
9 #include "cmd/cmd-dump.h"
10 #include "core/show-file.h"
11 #include "files.h"
12
13 #include "world/world.h"
14
15 /*
16  * Software options (set via the '=' command).
17  */
18
19 /*** Input Options ***/
20
21 bool rogue_like_commands;       /* Rogue-like commands */
22 bool always_pickup;     /* Pick things up by default */
23 bool carry_query_flag;  /* Prompt before picking things up */
24 bool quick_messages;    /* Activate quick messages */
25 bool auto_more; /* Automatically clear '-more-' prompts */
26 bool command_menu;      /* Enable command selection menu */
27 bool other_query_flag;  /* Prompt for floor item selection */
28 bool use_old_target;    /* Use old target by default */
29 bool always_repeat;     /* Repeat obvious commands */
30 bool confirm_destroy;   /* Prompt for destruction of known worthless items */
31 bool confirm_wear;      /* Confirm to wear/wield known cursed items */
32 bool confirm_quest;     /* Prompt before exiting a quest level */
33 bool target_pet;        /* Allow targeting pets */
34 bool easy_open; /* Automatically open doors */
35 bool easy_disarm;       /* Automatically disarm traps */
36 bool easy_floor;        /* Display floor stacks in a list */
37 bool use_command;       /* Allow unified use command */
38 bool over_exert;        /* Allow casting spells when short of mana */
39 bool numpad_as_cursorkey;       /* Use numpad keys as cursor key in editor mode */
40
41                                                         /*** Map Screen Options ***/
42
43 bool center_player;     /* Center map while walking (*slow*) */
44 bool center_running;    /* Centering even while running */
45 bool view_yellow_lite;  /* Use special colors for torch-lit grids */
46 bool view_bright_lite;  /* Use special colors for 'viewable' grids */
47 bool view_granite_lite; /* Use special colors for wall grids (slow) */
48 bool view_special_lite; /* Use special colors for floor grids (slow) */
49 bool view_perma_grids;  /* Map remembers all perma-lit grids */
50 bool view_torch_grids;  /* Map remembers all torch-lit grids */
51 bool view_unsafe_grids; /* Map marked by detect traps */
52 bool view_reduce_view;  /* Reduce view-radius in town */
53 bool fresh_before;      /* Flush output while in repeated command */
54 bool fresh_after;       /* Flush output after monster's move */
55 bool fresh_message;     /* Flush output after every message */
56 bool hilite_player;     /* Hilite the player with the cursor */
57 bool display_path;      /* Display actual path before shooting */
58
59
60                                         /*** Text Display Options ***/
61
62 bool plain_descriptions;        /* Plain object descriptions */
63 bool plain_pickup;      /* Plain pickup messages(japanese only) */
64 bool always_show_list;  /* Always show list when choosing items */
65 bool depth_in_feet;     /* Show dungeon level in feet */
66 bool show_labels;       /* Show labels in object listings */
67 bool show_weights;      /* Show weights in object listings */
68 bool show_item_graph;   /* Show items graphics */
69 bool equippy_chars;     /* Display 'equippy' chars */
70 bool display_mutations; /* Display mutations in 'C'haracter Display */
71 bool compress_savefile; /* Compress messages in savefiles */
72 bool abbrev_extra;      /* Describe obj's extra resistances by abbreviation */
73 bool abbrev_all;        /* Describe obj's all resistances by abbreviation */
74 bool exp_need;  /* Show the experience needed for next level */
75 bool ignore_unview;     /* Ignore whenever any monster does */
76
77
78                                         /*** Game-Play Options ***/
79
80 bool stack_force_notes; /* Merge inscriptions when stacking */
81 bool stack_force_costs; /* Merge discounts when stacking */
82 bool expand_list;       /* Expand the power of the list commands */
83 bool small_levels;      /* Allow unusually small dungeon levels */
84 bool always_small_levels;       /* Always create unusually small dungeon levels */
85 bool empty_levels;      /* Allow empty 'arena' levels */
86 bool bound_walls_perm;  /* Boundary walls become 'permanent wall' */
87 bool last_words;        /* Leave last words when your character dies */
88
89 #ifdef WORLD_SCORE
90 bool send_score;        /* Send score dump to the world score server */
91 #endif
92
93 bool allow_debug_opts;  /* Allow use of debug/cheat options */
94
95
96                                                 /*** Disturbance Options ***/
97
98 bool find_ignore_stairs;        /* Run past stairs */
99 bool find_ignore_doors; /* Run through open doors */
100 bool find_cut;  /* Run past known corners */
101 bool check_abort;       /* Check for user abort while in repeated command */
102 bool flush_failure;     /* Flush input on various failures */
103 bool flush_disturb;     /* Flush input whenever disturbed */
104 bool disturb_move;      /* Disturb whenever any monster moves */
105 bool disturb_high;      /* Disturb whenever high-level monster moves */
106 bool disturb_near;      /* Disturb whenever viewable monster moves */
107 bool disturb_pets;      /* Disturb when visible pets move */
108 bool disturb_panel;     /* Disturb whenever map panel changes */
109 bool disturb_state;     /* Disturb whenever player state changes */
110 bool disturb_minor;     /* Disturb whenever boring things happen */
111 bool ring_bell; /* Audible bell (on errors, etc) */
112 bool disturb_trap_detect;       /* Disturb when leaving trap detected area */
113 bool alert_trap_detect; /* Alert when leaving trap detected area */
114
115
116                                                 /*** Birth Options ***/
117
118 bool manual_haggle;     /* Manually haggle in stores */
119 bool easy_band; /* Easy Mode (*) */
120 bool smart_learn;       /* Monsters learn from their mistakes (*) */
121 bool smart_cheat;       /* Monsters exploit players weaknesses (*) */
122 bool vanilla_town;      /* Use 'vanilla' town without quests and wilderness */
123 bool lite_town; /* Use 'lite' town without a wilderness */
124 bool ironman_shops;     /* Stores are permanently closed (*) */
125 bool ironman_small_levels;      /* Always create unusually small dungeon levels (*) */
126 bool ironman_downward;  /* Disable recall and use of up stairs (*) */
127 bool ironman_empty_levels;      /* Always create empty 'arena' levels (*) */
128 bool ironman_rooms;     /* Always generate very unusual rooms (*) */
129 bool ironman_nightmare; /* Nightmare mode(it isn't even remotely fair!)(*) */
130 bool left_hander;       /* Left-Hander */
131 bool preserve_mode;     /* Preserve artifacts (*) */
132 bool autoroller;        /* Allow use of autoroller for stats (*) */
133 bool autochara; /* Autoroll for weight, height and social status */
134 bool powerup_home;      /* Increase capacity of your home (*) */
135 bool show_ammo_detail;  /* Show Description of ammo damage */
136 bool show_ammo_no_crit; /* Show No-crit damage of ammo */
137 bool show_ammo_crit_ratio;      /* Show critical ratio of ammo */
138 bool show_actual_value; /* Show actual value of skill */
139
140
141
142
143                                                 /*** Easy Object Auto-Destroyer ***/
144
145 bool destroy_items;     /* Use easy auto-destroyer */
146 bool destroy_feeling;   /* Apply auto-destroy as sense feeling */
147 bool destroy_identify;  /* Apply auto-destroy as identify an item */
148 bool leave_worth;       /* Auto-destroyer leaves known worthy items */
149 bool leave_equip;       /* Auto-destroyer leaves weapons and armour */
150 bool leave_chest;       /* Auto-destroyer leaves closed chests */
151 bool leave_wanted;      /* Auto-destroyer leaves wanted corpses */
152 bool leave_corpse;      /* Auto-destroyer leaves corpses and skeletons */
153 bool leave_junk;        /* Auto-destroyer leaves junk */
154 bool leave_special;     /* Auto-destroyer leaves items your race/class needs */
155
156
157                                         /*** Play-record Options ***/
158
159 bool record_fix_art;    /* Record fixed artifacts */
160 bool record_rand_art;   /* Record random artifacts */
161 bool record_destroy_uniq;       /* Record when destroy unique monster */
162 bool record_fix_quest;  /* Record fixed quests */
163 bool record_rand_quest; /* Record random quests */
164 bool record_maxdepth;   /* Record movements to deepest level */
165 bool record_stair;      /* Record recall and stair movements */
166 bool record_buy;        /* Record purchased items */
167 bool record_sell;       /* Record sold items */
168 bool record_danger;     /* Record hitpoint warning */
169 bool record_arena;      /* Record arena victories */
170 bool record_ident;      /* Record first identified items */
171 bool record_named_pet;  /* Record information about named pets */
172 char record_o_name[MAX_NLEN];
173 GAME_TURN record_turn;
174
175
176 /* Cheating options */
177
178 bool cheat_peek;        /* Peek into object creation */
179 bool cheat_hear;        /* Peek into monster creation */
180 bool cheat_room;        /* Peek into dungeon creation */
181 bool cheat_xtra;        /* Peek into something else */
182 bool cheat_know;        /* Know complete monster info */
183 bool cheat_live;        /* Allow player to avoid death */
184 bool cheat_save;        /* Ask for saving death */
185 bool cheat_diary_output; /* Detailed info to diary */
186 bool cheat_turn;        /* Peek turn */
187 bool cheat_sight;
188
189
190 /* Special options */
191
192 byte hitpoint_warn;     /* Hitpoint warning (0 to 9) */
193 byte mana_warn; /* Mana color (0 to 9) */
194
195 byte delay_factor;      /* Delay factor (0 to 9) */
196
197 bool autosave_l;        /* Autosave before entering new levels */
198 bool autosave_t;        /* Timed autosave */
199 s16b autosave_freq;     /* Autosave frequency */
200
201 bool use_sound;                 /* The "sound" mode is enabled */
202 bool use_music;                 /* The "music" mode is enabled */
203 bool use_graphics;              /* The "graphics" mode is enabled */
204 bool use_bigtile = FALSE;
205
206 /*
207  * Run-time arguments
208  */
209 bool arg_fiddle;                        /* Command arg -- Request fiddle mode */
210 bool arg_wizard;                        /* Command arg -- Request wizard mode */
211 bool arg_sound;                         /* Command arg -- Request special sounds */
212 bool arg_music;                         /* Command arg -- Request special musics */
213 byte arg_graphics;                      /* Command arg -- Request graphics mode */
214 bool arg_monochrome;            /* Command arg -- Request monochrome mode */
215 bool arg_force_original;        /* Command arg -- Request original keyset */
216 bool arg_force_roguelike;       /* Command arg -- Request roguelike keyset */
217 bool arg_bigtile = FALSE;       /* Command arg -- Request big tile mode */
218
219 BIT_FLAGS option_flag[8]; //!< The array of normal options
220 BIT_FLAGS option_mask[8]; //!< The array of normal options
221 BIT_FLAGS window_flag[8]; //!< The array of window options
222 BIT_FLAGS window_mask[8]; //!< The array of window options
223
224 /*!
225  * @brief オプションテーブル /
226  * Available Options
227  */
228 const option_type option_info[] =
229 {
230         /*** Input Options ***/
231
232         { &rogue_like_commands,         FALSE, OPT_PAGE_INPUT, 0, 0,
233         "rogue_like_commands",          _("ローグ風キー配置を使用する", "Rogue-like commands") },
234
235         { &always_pickup,               FALSE, OPT_PAGE_INPUT, 0, 5,
236         "always_pickup",                _("常にアイテムを拾う" , "Pick things up by default") },
237
238         { &carry_query_flag,            FALSE, OPT_PAGE_INPUT, 0, 3,
239         "carry_query_flag",             _("アイテムを拾う前に確認する", "Prompt before picking things up") },
240
241         { &quick_messages,              TRUE,  OPT_PAGE_INPUT, 0, 1,
242         "quick_messages",               _("クイック・メッセージを使用する", "Activate quick messages") },
243
244         { &auto_more,                   FALSE, OPT_PAGE_INPUT, 2, 6,
245         "auto_more",                    _("キー待ちしないで連続でメッセージを表示する", "Automatically clear '-more-' prompts") },
246
247         { &command_menu,                TRUE,  OPT_PAGE_INPUT, 2, 7,
248         "command_menu",                 _("メニューによりコマンド選択を有効にする", "Enable command selection menu") },
249
250         { &other_query_flag,            FALSE, OPT_PAGE_INPUT, 0, 2,
251         "other_query_flag",             _("床上のアイテムを使用するときに確認する", "Prompt for floor item selection") },
252
253         { &use_old_target,              FALSE, OPT_PAGE_INPUT, 0, 4,
254         "use_old_target",               _("常に以前のターゲットを指定する", "Use old target by default") },
255
256         { &always_repeat,               TRUE,  OPT_PAGE_INPUT, 0, 6,
257         "always_repeat",                _("コマンド自動繰り返し", "Repeat obvious commands") },
258
259         { &confirm_destroy,             FALSE, OPT_PAGE_INPUT, 5, 3,
260         "confirm_destroy",              _("「無価値」なアイテムを破壊する時確認する", "Prompt for destruction of known worthless items") },
261
262         { &confirm_wear,                TRUE,  OPT_PAGE_INPUT, 5, 4,
263         "confirm_wear",                 _("呪われた物を装備する時確認する", "Confirm to wear/wield known cursed items") },
264
265         { &confirm_quest,               TRUE,  OPT_PAGE_INPUT, 1, 9,
266         "confirm_quest",                _("クエストを諦めて階段で逃げる前に確認する", "Prompt before exiting a quest level") },
267
268         { &target_pet,                  FALSE, OPT_PAGE_INPUT, 2, 5,
269         "target_pet",                   _("ペットをターゲットにする", "Allow targeting pets") },
270
271         { &easy_open,                   TRUE,  OPT_PAGE_INPUT, 5, 7,
272         "easy_open",                    _("自動的にドアを開ける", "Automatically open doors") },
273
274         { &easy_disarm,                 TRUE,  OPT_PAGE_INPUT, 5, 8,
275         "easy_disarm",                  _("自動的に罠を解除する", "Automatically disarm traps") },
276
277         { &easy_floor,                  FALSE, OPT_PAGE_INPUT, 5, 9,
278         "easy_floor",                   _("床上で重なったアイテムをリストする", "Display floor stacks in a list") },
279
280         { &use_command,                 FALSE, OPT_PAGE_INPUT, 5, 10,
281         "use_command",                  _("「使う(a)」コマンドでアイテムを何でも使える", "Allow unified use command") },
282
283         { &over_exert,                  FALSE, OPT_PAGE_INPUT, 0, 29,
284         "over_exert",                   _("MPが足りなくても魔法に挑戦する", "Allow casting spells when short of mana") },
285
286         { &numpad_as_cursorkey,         TRUE, OPT_PAGE_INPUT, 2, 31,
287         "numpad_as_cursorkey",          _("エディタ内でテンキーをカーソルキーとして使う", "Use numpad keys as cursor keys in editor mode") },
288
289 /*** Map Screen Options ***/
290
291         { &center_player,               FALSE, OPT_PAGE_MAPSCREEN, 5, 11,
292         "center_player",                _("常にプレイヤーを中心に置く(*遅い*)", "Center map while walking (*slow*)") },
293
294         { &center_running,              TRUE,  OPT_PAGE_MAPSCREEN, 5, 12,
295         "center_running",               _("走っている時でも中心に置く", "Centering even while running") },
296
297         { &view_yellow_lite,            TRUE,  OPT_PAGE_MAPSCREEN, 1, 28,
298         "view_yellow_lite",             _("明かりの範囲を特別な色で表示する", "Use special colors for torch-lit grids") },
299
300         { &view_bright_lite,            TRUE,  OPT_PAGE_MAPSCREEN, 1, 29,
301         "view_bright_lite",             _("視界の範囲を特別な色で表示する", "Use special colors for 'viewable' grids") },
302
303         { &view_granite_lite,           TRUE,  OPT_PAGE_MAPSCREEN, 1, 30,
304         "view_granite_lite",            _("壁を特別な色で表示する(重い)", "Use special colors for wall grids (slow)") },
305
306         { &view_special_lite,           TRUE,  OPT_PAGE_MAPSCREEN, 1, 31,
307         "view_special_lite",            _("床を特別な色で表示する(重い)", "Use special colors for floor grids (slow)") },
308
309         { &view_perma_grids,            TRUE,  OPT_PAGE_MAPSCREEN, 1, 6,
310         "view_perma_grids",             _("明るい場所はそのままにする", "Map remembers all perma-lit grids") },
311
312         { &view_torch_grids,            FALSE, OPT_PAGE_MAPSCREEN, 1, 7,
313         "view_torch_grids",             _("明かりで照らした場所はそのままにする", "Map remembers all torch-lit grids") },
314
315         { &view_unsafe_grids,           FALSE, OPT_PAGE_MAPSCREEN, 1, 8,
316         "view_unsafe_grids",            _("トラップ感知済みでない場所を表示する", "Map marked by detect traps") },
317
318         { &view_reduce_view,            FALSE, OPT_PAGE_MAPSCREEN, 1, 17,
319         "view_reduce_view",             _("街では視野を狭くする", "Reduce view-radius in town") },
320
321         { &fresh_before,                TRUE,  OPT_PAGE_MAPSCREEN, 1, 23,
322         "fresh_before",                 _("連続コマンド中に画面を再描画し続ける", "Flush output while in repeated command") },
323
324         { &fresh_after,                 FALSE, OPT_PAGE_MAPSCREEN, 1, 24,
325         "fresh_after",                  _("コマンド後に画面を常に再描画し続ける", "Flush output after monster's move") },
326
327         { &fresh_message,               FALSE, OPT_PAGE_MAPSCREEN, 1, 25,
328         "fresh_message",                _("メッセージの後に画面を再描画する", "Flush output after every message") },
329
330         { &hilite_player,               FALSE, OPT_PAGE_MAPSCREEN, 1, 27,
331         "hilite_player",                _("プレイヤーにカーソルを合わせる", "Hilite the player with the cursor") },
332
333         { &display_path,                FALSE, OPT_PAGE_MAPSCREEN, 2, 8,
334         "display_path",                 _("魔法や矢の軌跡を表示する", "Display actual path before shooting") },
335
336 /*** Text Display Options ***/
337
338         { &plain_descriptions,          TRUE,  OPT_PAGE_TEXT, 5, 1,
339         "plain_descriptions",           _("アイテムの記述を簡略にする", "Plain object descriptions") },
340
341         { &plain_pickup,                FALSE, OPT_PAGE_TEXT, 6, 6,
342         "plain_pickup",                 _("「拾った」メッセージを簡略化する", "Plain pickup messages(japanese only)") },
343
344         { &always_show_list,            TRUE,  OPT_PAGE_TEXT, 4, 0,
345         "always_show_list",             _("選択時には常に一覧を表示する", "Always show list when choosing items") },
346
347         { &depth_in_feet,               FALSE, OPT_PAGE_TEXT, 0, 7,
348         "depth_in_feet",                _("ダンジョンの深さをフィートで表示する", "Show dungeon level in feet") },
349
350         { &show_labels,                 TRUE,  OPT_PAGE_TEXT, 0, 10,
351         "show_labels",                  _("装備一覧で装備場所を表示する", "Show labels in object listings") },
352
353         { &show_weights,                TRUE,  OPT_PAGE_TEXT, 0, 11,
354         "show_weights",                 _("アイテム一覧で重量を表示する", "Show weights in object listings") },
355
356         { &show_item_graph,             TRUE,  OPT_PAGE_TEXT, 2, 0,
357         "show_item_graph",              _("アイテムのシンボルを表示する", "Show items graphics") },
358
359         { &equippy_chars,               TRUE,  OPT_PAGE_TEXT, 1, 12,
360         "equippy_chars",                _("ステータスに文字で装備を表示する", "Display 'equippy' chars") },
361
362         { &display_mutations,           FALSE, OPT_PAGE_TEXT, 5, 0,
363         "display_mutations",            _("'C'コマンドで突然変異を表示する", "Display mutations in 'C'haracter Display") },
364
365         { &compress_savefile,           FALSE, OPT_PAGE_TEXT, 1, 26,
366         "compress_savefile",            _("セーブ・ファイル中のメッセージを圧縮する", "Compress messages in savefiles") },
367
368         { &abbrev_extra,                FALSE, OPT_PAGE_TEXT, 2, 10,
369         "abbrev_extra",                 _("アイテムに追加耐性/能力の略称を刻む", "Describe obj's extra resistances by abbreviation") },
370
371         { &abbrev_all,                  FALSE, OPT_PAGE_TEXT, 2, 11,
372         "abbrev_all",                   _("アイテムに全ての耐性/能力の略称を刻む", "Describe obj's all resistances by abbreviation") },
373
374         { &exp_need,                    FALSE, OPT_PAGE_TEXT, 2, 12,
375         "exp_need",                     _("次のレベルに必要な経験値を表示する", "Show the experience needed for next level") },
376
377         { &ignore_unview,               FALSE, OPT_PAGE_TEXT, 2, 13,
378         "ignore_unview",                _("視界外のモンスターの行動を表示しない", "Ignore out-of-sight monster behavior") },
379
380         { &show_ammo_detail,            TRUE, OPT_PAGE_TEXT, 2, 14,
381         "show_ammo_detail",             _("矢弾のダメージの説明を表示する", "Show description of ammo damage") },
382
383         { &show_ammo_no_crit,           FALSE, OPT_PAGE_TEXT, 2, 15,
384         "show_ammo_no_crit",            _("会心を考慮しない場合の矢弾のダメージを表示する", "Show ammo damage with no critical") },
385
386         { &show_ammo_crit_ratio,        FALSE, OPT_PAGE_TEXT, 2, 16,
387         "show_ammo_crit_ratio",         _("矢弾の会心発生率を表示する", "Show critical ratio of ammo") },
388
389         { &show_actual_value,           FALSE, OPT_PAGE_TEXT, 2, 17,
390         "show_actual_vaule",            _("各技能値に実値を表示する", "Show actual value of skill") },
391
392
393 /*** Game-Play ***/
394
395         { &stack_force_notes,           TRUE,  OPT_PAGE_GAMEPLAY, 0, 8,
396         "stack_force_notes",            _("異なる銘のアイテムをまとめる", "Merge inscriptions when stacking") },
397
398         { &stack_force_costs,           FALSE, OPT_PAGE_GAMEPLAY, 0, 9,
399         "stack_force_costs",            _("異なる割引表示のアイテムをまとめる", "Merge discounts when stacking") },
400
401         { &expand_list,                 TRUE,  OPT_PAGE_GAMEPLAY, 1, 5,
402         "expand_list",                  _("「一覧」コマンドを拡張する", "Expand the power of the list commands") },
403
404         { &small_levels,                TRUE,  OPT_PAGE_GAMEPLAY, 0, 30,
405         "small_levels",                 _("非常に小さいフロアの生成を可能にする", "Allow unusually small dungeon levels") },
406
407         { &always_small_levels,         FALSE, OPT_PAGE_GAMEPLAY, 2, 3,
408         "always_small_levels",          _("常に非常に小さいフロアを生成する", "Always create unusually small dungeon levels") },
409
410         { &empty_levels,                TRUE,  OPT_PAGE_GAMEPLAY, 0, 31,
411         "empty_levels",                 _("空っぽの「アリーナ」レベルの生成を可能にする", "Allow empty 'arena' levels") },
412
413         { &bound_walls_perm,            FALSE, OPT_PAGE_GAMEPLAY, 2, 1,
414         "bound_walls_perm",             _("ダンジョンの外壁を永久岩にする", "Boundary walls become 'permanent wall'") },
415
416         { &last_words,                  TRUE,  OPT_PAGE_GAMEPLAY, 0, 28,
417         "last_words",                   _("キャラクターが死んだ時遺言をのこす", "Leave last words when your character dies") },
418
419 #ifdef WORLD_SCORE
420         { &send_score,                  TRUE,  OPT_PAGE_GAMEPLAY, 4, 6,
421         "send_score",                   _("スコアサーバにスコアを送る", "Send score dump to the world score server") },
422 #endif
423
424         { &allow_debug_opts,            FALSE, OPT_PAGE_GAMEPLAY, 6, 11,
425         "allow_debug_opts",             _("デバッグ/詐欺オプションを許可する", "Allow use of debug/cheat options") },
426
427 /*** Disturbance ***/
428
429         { &find_ignore_stairs,          FALSE, OPT_PAGE_DISTURBANCE, 0, 16,
430         "find_ignore_stairs",           _("階段は通過する", "Run past stairs") },
431
432         { &find_ignore_doors,           TRUE,  OPT_PAGE_DISTURBANCE, 0, 17,
433         "find_ignore_doors",            _("ドアは通過する", "Run through open doors") },
434
435         { &find_cut,                    FALSE, OPT_PAGE_DISTURBANCE, 0, 18,
436         "find_cut",                     _("曲り角を斜めに最短距離で通過する", "Run past known corners") },
437
438         { &check_abort,                 TRUE,  OPT_PAGE_DISTURBANCE, 1, 18,
439         "check_abort",                  _("連続コマンドはキー入力で中断する", "Check for user abort while in repeated command") },
440
441         { &flush_failure,               TRUE,  OPT_PAGE_DISTURBANCE, 1, 20,
442         "flush_failure",                _("様々なミス発生時に入力をクリアする", "Flush input on various failures") },
443
444         { &flush_disturb,               FALSE, OPT_PAGE_DISTURBANCE, 1, 21,
445         "flush_disturb",                _("障害発生時に入力をクリアする", "Flush input whenever disturbed") },
446
447         { &disturb_move,                FALSE, OPT_PAGE_DISTURBANCE, 0, 20,
448         "disturb_move",                 _("どこのモンスターが動いても行動を中止する", "Disturb whenever any monster moves") },
449
450         { &disturb_high,                FALSE, OPT_PAGE_DISTURBANCE, 1, 3,
451         "disturb_high",                 _("レベルの高いモンスターが動いたら行動を中止する", "Disturb whenever high-level monster moves") },
452
453         { &disturb_near,                TRUE,  OPT_PAGE_DISTURBANCE, 0, 21,
454         "disturb_near",                 _("視界内のモンスターが動いたら行動を中止する", "Disturb whenever viewable monster moves") },
455
456         { &disturb_pets,                FALSE, OPT_PAGE_DISTURBANCE, 5, 6,
457         "disturb_pets",                 _("視界内のペットが動いたら行動を中止する", "Disturb when visible pets move") },
458
459         { &disturb_panel,               TRUE,  OPT_PAGE_DISTURBANCE, 0, 22,
460         "disturb_panel",                _("画面スクロール時に行動を中止する", "Disturb whenever map panel changes") },
461
462         { &disturb_state,               TRUE,  OPT_PAGE_DISTURBANCE, 0, 23,
463         "disturb_state",                _("自分のステータス変化時に行動を中止する", "Disturb whenever player state changes") },
464
465         { &disturb_minor,               TRUE,  OPT_PAGE_DISTURBANCE, 0, 24,
466         "disturb_minor",                _("些細なことが起きても行動を中止する", "Disturb whenever boring things happen") },
467
468         { &ring_bell,                   FALSE, OPT_PAGE_DISTURBANCE, 0, 14,
469         "ring_bell",                    _("エラー時にビープ音を鳴らす", "Audible bell (on errors, etc)") },
470
471         { &disturb_trap_detect,         TRUE,  OPT_PAGE_DISTURBANCE, 0, 27,
472         "disturb_trap_detect",          _("トラップ感知範囲外に出る直前に行動を中止する", "Disturb when leaving trap detected area") },
473
474         { &alert_trap_detect,           FALSE, OPT_PAGE_DISTURBANCE, 0, 25,
475         "alert_trap_detect",            _("トラップ感知範囲外に出る直前に警告する", "Alert when leaving trap detected area") },
476
477 /*** Birth Options ***/
478         { &manual_haggle,               FALSE, OPT_PAGE_BIRTH, 1, 0,
479         "manual_haggle",                _("店で値切り交渉をする", "Manually haggle in stores") },
480
481         { &easy_band,                   FALSE, OPT_PAGE_BIRTH, 6, 31,
482         "easy_band",                    _("初心者用簡単モード(*)", "Easy Mode (*)") },
483
484         { &smart_learn,                 TRUE,  OPT_PAGE_BIRTH, 1, 14,
485         "smart_learn",                  _("モンスターは失敗を学習する(*)", "Monsters learn from their mistakes (*)") },
486
487         { &smart_cheat,                 FALSE, OPT_PAGE_BIRTH, 1, 15,
488         "smart_cheat",                  _("モンスターはプレイヤーの弱みを突く(*)", "Monsters exploit players weaknesses (*)") },
489
490         { &vanilla_town,                FALSE, OPT_PAGE_BIRTH, 6, 0,
491         "vanilla_town",                 _("元祖の街/クエストと荒野なし", "Use 'vanilla' town without quests and wilderness") },
492
493         { &lite_town,                   FALSE, OPT_PAGE_BIRTH, 6, 1,
494         "lite_town",                    _("小規模な街/荒野なし", "Use 'lite' town without a wilderness") },
495
496         { &ironman_shops,               FALSE, OPT_PAGE_BIRTH, 6, 2,
497         "ironman_shops",                _("(鉄人用)店を使用しない(*)", "Stores are permanently closed (*)") },
498
499         { &ironman_small_levels,        FALSE, OPT_PAGE_BIRTH, 6, 3,
500         "ironman_small_levels",         _("(鉄人用)常に非常に小さいフロアを生成(*)", "Always create unusually small dungeon levels (*)") },
501
502         { &ironman_downward,            FALSE, OPT_PAGE_BIRTH, 6, 4,
503         "ironman_downward",             _("(鉄人用)帰還と上り階段なし(*)", "Disable recall and use of up stairs (*)") },
504
505         { &ironman_empty_levels,        FALSE, OPT_PAGE_BIRTH, 6, 8,
506         "ironman_empty_levels",         _("(鉄人用)常に空っぽのアリーナレベルを生成(*)", "Always create empty 'arena' levels (*)") },
507
508         { &ironman_rooms,               FALSE, OPT_PAGE_BIRTH, 6, 12,
509         "ironman_rooms",                _("(鉄人用)常に普通でない部屋を生成する(*)", "Always generate very unusual rooms (*)") },
510
511         { &ironman_nightmare,           FALSE, OPT_PAGE_BIRTH, 6, 18,
512         "ironman_nightmare",            _("(鉄人用)悪夢モード(これは全く不条理です!)(*)", "Nightmare mode(it isn't even remotely fair!)(*)") },
513
514         { &left_hander,                 FALSE, OPT_PAGE_BIRTH, 6, 13,
515         "left_hander",                  _("左利きである", "Left-Hander") },
516
517         { &preserve_mode,               TRUE,  OPT_PAGE_BIRTH, 6, 14,
518         "preserve_mode",                _("伝説のアイテムを取り逃しても再生成される(*)", "Preserve artifacts (*)") },
519
520         { &autoroller,                  TRUE,  OPT_PAGE_BIRTH, 6, 15,
521         "autoroller",                   _("能力値にオートローラー使用(*)", "Allow use of autoroller for stats (*)") },
522
523         { &autochara,                   FALSE, OPT_PAGE_BIRTH, 6, 16,
524         "autochara",                   _("体格/地位にオートローラー使用", "Autoroll for weight, height and social status") },
525
526         { &powerup_home,                TRUE,  OPT_PAGE_BIRTH, 4, 3,
527         "powerup_home",                 _("我が家を拡張する(*)", "Increase capacity of your home (*)") },
528
529 /*** Easy Object Auto-Destroyer ***/
530
531         { &destroy_items,               FALSE, OPT_PAGE_AUTODESTROY, 7, 0,
532         "destroy_items",                _("アイテムの簡易自動破壊を使用する", "Use easy auto-destroyer") },
533
534         { &destroy_feeling,             FALSE, OPT_PAGE_AUTODESTROY, 7, 8,
535         "destroy_feeling",              _("簡易鑑定したとき自動破壊を適用する", "Apply auto-destroy as sense feeling") },
536
537         { &destroy_identify,            FALSE, OPT_PAGE_AUTODESTROY, 7, 9,
538         "destroy_identify",             _("鑑定したとき自動破壊を適用する", "Apply auto-destroy as identify an item") },
539
540         { &leave_worth,                 TRUE,  OPT_PAGE_AUTODESTROY, 7, 2,
541         "leave_worth",                  _("価値があるアイテムは壊さない", "Auto-destroyer leaves known worthy items") },
542
543         { &leave_equip,                 FALSE, OPT_PAGE_AUTODESTROY, 7, 3,
544         "leave_equip",                  _("武器/防具は壊さない", "Auto-destroyer leaves weapons and armour") },
545
546         { &leave_chest,                 TRUE,  OPT_PAGE_AUTODESTROY, 7, 7,
547         "leave_chest",                  _("開封されていない箱は壊さない", "Auto-destroyer leaves closed chests") },
548
549         { &leave_wanted,                TRUE,  OPT_PAGE_AUTODESTROY, 7, 4,
550         "leave_wanted",                 _("賞金首の死体/骨は壊さない", "Auto-destroyer leaves wanted corpses") },
551
552         { &leave_corpse,                FALSE, OPT_PAGE_AUTODESTROY, 7, 5,
553         "leave_corpse",                 _("死体/骨は壊さない", "Auto-destroyer leaves corpses and skeletons") },
554
555         { &leave_junk,                  FALSE, OPT_PAGE_AUTODESTROY, 7, 6,
556         "leave_junk",                   _("がらくたは壊さない", "Auto-destroyer leaves junk") },
557
558         { &leave_special,               TRUE,  OPT_PAGE_AUTODESTROY, 7, 1,
559         "leave_special",                _("種族/職業で特別に必要なアイテムは壊さない", "Auto-destroyer leaves items your race/class needs") },
560
561 /*** Play-record Options ***/
562
563         { &record_fix_art,              TRUE,  OPT_PAGE_PLAYRECORD, 4, 11,
564         "record_fix_art",               _("固定アーティファクトの入手を記録する", "Record fixed artifacts") },
565
566         { &record_rand_art,             TRUE,  OPT_PAGE_PLAYRECORD, 4, 12,
567         "record_rand_art",              _("ランダムアーティファクトの入手を記録する", "Record random artifacts") },
568
569         { &record_destroy_uniq,         TRUE,  OPT_PAGE_PLAYRECORD, 4, 13,
570         "record_destroy_uniq",          _("ユニークモンスターを倒したときを記録する", "Record when destroy unique monster") },
571
572         { &record_fix_quest,            TRUE,  OPT_PAGE_PLAYRECORD, 4, 14,
573         "record_fix_quest",             _("固定クエストの達成を記録する", "Record fixed quests") },
574
575         { &record_rand_quest,           TRUE,  OPT_PAGE_PLAYRECORD, 4, 15,
576         "record_rand_quest",            _("ランダムクエストの達成を記録する", "Record random quests") },
577
578         { &record_maxdepth,             TRUE,  OPT_PAGE_PLAYRECORD, 4, 16,
579         "record_maxdepth",              _("最深階を更新したときに記録する", "Record movements to deepest level") },
580
581         { &record_stair,                TRUE,  OPT_PAGE_PLAYRECORD, 4, 17,
582         "record_stair",                 _("階の移動を記録する", "Record recall and stair movements") },
583
584         { &record_buy,                  TRUE,  OPT_PAGE_PLAYRECORD, 4, 18,
585         "record_buy",                   _("アイテムの購入を記録する", "Record purchased items") },
586
587         { &record_sell,                 FALSE, OPT_PAGE_PLAYRECORD, 4, 19,
588         "record_sell",                  _("アイテムの売却を記録する", "Record sold items") },
589
590         { &record_danger,               TRUE,  OPT_PAGE_PLAYRECORD, 4, 20,
591         "record_danger",                _("ピンチになったときを記録する", "Record hitpoint warning") },
592
593         { &record_arena,                TRUE,  OPT_PAGE_PLAYRECORD, 4, 21,
594         "record_arena",                 _("アリーナでの勝利を記録する", "Record arena victories") },
595
596         { &record_ident,                TRUE,  OPT_PAGE_PLAYRECORD, 4, 22,
597         "record_ident",                 _("未判明のアイテムの識別を記録する", "Record first identified items") },
598
599         { &record_named_pet,            FALSE, OPT_PAGE_PLAYRECORD, 4, 23,
600         "record_named_pet",             _("名前つきペットの情報を記録する", "Record information about named pets") },
601
602 /*** End of Table ***/
603
604         { NULL,                         0, 0, 0, 0,
605         NULL,                           NULL }
606 };
607
608 /*!
609  * チートオプションの定義テーブル / Cheating options
610  */
611 const option_type cheat_info[CHEAT_MAX] =
612 {
613         { &cheat_peek,          FALSE,  255,    0x01, 0x00,
614         "cheat_peek",           _("アイテムの生成をのぞき見る", "Peek into object creation")
615         },
616
617         { &cheat_hear,          FALSE,  255,    0x02, 0x00,
618         "cheat_hear",           _("モンスターの生成をのぞき見る", "Peek into monster creation")
619         },
620
621         { &cheat_room,          FALSE,  255,    0x04, 0x00,
622         "cheat_room",           _("ダンジョンの生成をのぞき見る", "Peek into dungeon creation")
623         },
624
625         { &cheat_xtra,          FALSE,  255,    0x08, 0x00,
626         "cheat_xtra",           _("その他の事をのぞき見る", "Peek into something else")
627         },
628
629         { &cheat_know,          FALSE,  255,    0x10, 0x00,
630         "cheat_know",           _("完全なモンスターの思い出を知る", "Know complete monster info")
631         },
632
633         { &cheat_live,          FALSE,  255,    0x20, 0x00,
634         "cheat_live",           _("死を回避することを可能にする", "Allow player to avoid death")
635         },
636
637         { &cheat_save,          FALSE,  255,    0x40, 0x00,
638         "cheat_save",           _("死んだ時セーブするか確認する", "Ask for saving death")
639         },
640
641         { &cheat_diary_output,  FALSE,  255,    0x80, 0x00,
642         "cheat_diary_output",   _("ウィザードログを日記に出力する", "Output wizard log to diary.")
643         },
644
645         { &cheat_turn,  FALSE,  255,    0x81, 0x00,
646         "cheat_turn",   _("ゲームメッセージにターン表示を行う", "Put turn in game messages.")
647         },
648
649         { &cheat_sight, FALSE,  255,    0x82, 0x00,
650         "cheat_sight",  _("「見る」コマンドを拡張する。", "Expand \"L\"ook command.")
651         }
652 };
653
654
655 /*!
656 * 自動セーブオプションテーブル
657 */
658 const option_type autosave_info[2] =
659 {
660         { &autosave_l,      FALSE, 255, 0x01, 0x00,
661         "autosave_l",    _("新しい階に入る度に自動セーブする", "Autosave when entering new levels") },
662
663         { &autosave_t,      FALSE, 255, 0x02, 0x00,
664         "autosave_t",   _("一定ターン毎に自動セーブする", "Timed autosave") },
665 };
666
667
668 #define OPT_NUM 15
669
670 typedef struct
671 {
672         char key;
673         concptr name;
674         int row;
675 } opts;
676
677 opts option_fields[OPT_NUM] =
678 {
679         { '1', _("    キー入力     オプション", "Input Options"), 3 },
680         { '2', _("   マップ画面    オプション", "Map Screen Options"), 4 },
681         { '3', _("  テキスト表示   オプション", "Text Display Options"), 5 },
682         { '4', _("  ゲームプレイ   オプション", "Game-Play Options"), 6 },
683         { '5', _("  行動中止関係   オプション", "Disturbance Options"), 7 },
684         { '6', _("  簡易自動破壊   オプション", "Easy Auto-Destroyer Options"), 8 },
685         { 'r', _("   プレイ記録    オプション", "Play record Options"), 9 },
686
687         { 'p', _("自動拾いエディタ", "Auto-picker/destroyer editor"), 11 },
688         { 'd', _(" 基本ウェイト量 ", "Base Delay Factor"), 12 },
689         { 'h', _("低ヒットポイント", "Hitpoint Warning"), 13 },
690         { 'm', _("  低魔力色閾値  ", "Mana Color Threshold"), 14 },
691         { 'a', _("   自動セーブ    オプション", "Autosave Options"), 15 },
692         { 'w', _("ウインドウフラグ", "Window Flags"), 16 },
693
694         { 'b', _("      初期       オプション (参照のみ)", "Birth Options (Browse Only)"), 18 },
695         { 'c', _("      詐欺       オプション", "Cheat Options"), 19 },
696 };
697
698 /*!
699  * @brief セーブ頻度ターンの次の値を返す
700  * @param current 現在のセーブ頻度ターン値
701  * @return 次のセーブ頻度ターン値
702  */
703 static s16b toggle_frequency(s16b current)
704 {
705         switch (current)
706         {
707         case 0: return 50;
708         case 50: return 100;
709         case 100: return 250;
710         case 250: return 500;
711         case 500: return 1000;
712         case 1000: return 2500;
713         case 2500: return 5000;
714         case 5000: return 10000;
715         case 10000: return 25000;
716         default: return 0;
717         }
718 }
719
720 /*!
721  * @brief 自動セーブオプションを変更するコマンドのメインルーチン
722  * @param info 表示メッセージ
723  * @return なし
724  */
725 static void do_cmd_options_autosave(concptr info)
726 {
727         char ch;
728         int i, k = 0, n = 2;
729         char buf[80];
730
731         Term_clear();
732
733         /* Interact with the player */
734         while (TRUE)
735         {
736                 /* Prompt */
737                 sprintf(buf, _("%s ( リターンで次へ, y/n でセット, F で頻度を入力, ESC で決定 ) ",
738                         "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) "), info);
739
740                 prt(buf, 0, 0);
741
742                 /* Display the options */
743                 for (i = 0; i < n; i++)
744                 {
745                         byte a = TERM_WHITE;
746
747                         /* Color current option */
748                         if (i == k) a = TERM_L_BLUE;
749
750                         /* Display the option text */
751                         sprintf(buf, "%-48s: %s (%s)",
752                                 autosave_info[i].o_desc,
753                                 (*autosave_info[i].o_var ? _("はい  ", "yes") : _("いいえ", "no ")),
754                                 autosave_info[i].o_text);
755                         c_prt(a, buf, i + 2, 0);
756                 }
757                 prt(format(_("自動セーブの頻度: %d ターン毎", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0);
758
759                 /* Hilite current option */
760                 move_cursor(k + 2, 50);
761
762                 /* Get a key */
763                 ch = inkey();
764
765                 /* Analyze */
766                 switch (ch)
767                 {
768                 case ESCAPE:
769                 {
770                         return;
771                 }
772
773                 case '-':
774                 case '8':
775                 {
776                         k = (n + k - 1) % n;
777                         break;
778                 }
779
780                 case ' ':
781                 case '\n':
782                 case '\r':
783                 case '2':
784                 {
785                         k = (k + 1) % n;
786                         break;
787                 }
788
789                 case 'y':
790                 case 'Y':
791                 case '6':
792                 {
793
794                         (*autosave_info[k].o_var) = TRUE;
795                         k = (k + 1) % n;
796                         break;
797                 }
798
799                 case 'n':
800                 case 'N':
801                 case '4':
802                 {
803                         (*autosave_info[k].o_var) = FALSE;
804                         k = (k + 1) % n;
805                         break;
806                 }
807
808                 case 'f':
809                 case 'F':
810                 {
811                         autosave_freq = toggle_frequency(autosave_freq);
812                         prt(format(_("自動セーブの頻度: %d ターン毎", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0);
813                         break;
814                 }
815
816                 case '?':
817                 {
818                         (void)show_file(p_ptr, TRUE, _("joption.txt#Autosave", "option.txt#Autosave"), NULL, 0, 0);
819                         Term_clear();
820                         break;
821                 }
822
823                 default:
824                 {
825                         bell();
826                         break;
827                 }
828                 }
829         }
830 }
831
832
833 /*!
834  * @brief ウィンドウオプションを変更するコマンドのメインルーチン /
835  * Modify the "window" options
836  * @return なし
837  */
838 static void do_cmd_options_win(void)
839 {
840         int i, j, d;
841         TERM_LEN y = 0;
842         TERM_LEN x = 0;
843         char ch;
844         bool go = TRUE;
845         u32b old_flag[8];
846
847
848         /* Memorize old flags */
849         for (j = 0; j < 8; j++)
850         {
851                 /* Acquire current flags */
852                 old_flag[j] = window_flag[j];
853         }
854
855         Term_clear();
856
857         /* Interact */
858         while (go)
859         {
860                 /* Prompt */
861                 prt(_("ウィンドウ・フラグ (<方向>で移動, tでチェンジ, y/n でセット, ESC)", "Window Flags (<dir>, t, y, n, ESC) "), 0, 0);
862
863                 /* Display the windows */
864                 for (j = 0; j < 8; j++)
865                 {
866                         byte a = TERM_WHITE;
867
868                         concptr s = angband_term_name[j];
869
870                         /* Use color */
871                         if (j == x) a = TERM_L_BLUE;
872
873                         /* Window name, staggered, centered */
874                         Term_putstr(35 + j * 5 - strlen(s) / 2, 2 + j % 2, -1, a, s);
875                 }
876
877                 /* Display the options */
878                 for (i = 0; i < 16; i++)
879                 {
880                         byte a = TERM_WHITE;
881
882                         concptr str = window_flag_desc[i];
883
884                         /* Use color */
885                         if (i == y) a = TERM_L_BLUE;
886
887                         /* Unused option */
888                         if (!str) str = _("(未使用)", "(Unused option)");
889
890                         /* Flag name */
891                         Term_putstr(0, i + 5, -1, a, str);
892
893                         /* Display the windows */
894                         for (j = 0; j < 8; j++)
895                         {
896                                 char c = '.';
897                                 a = TERM_WHITE;
898
899                                 /* Use color */
900                                 if ((i == y) && (j == x)) a = TERM_L_BLUE;
901
902                                 /* Active flag */
903                                 if (window_flag[j] & (1L << i)) c = 'X';
904
905                                 /* Flag value */
906                                 Term_putch(35 + j * 5, i + 5, a, c);
907                         }
908                 }
909
910                 /* Place Cursor */
911                 Term_gotoxy(35 + x * 5, y + 5);
912
913                 /* Get key */
914                 ch = inkey();
915
916                 /* Analyze */
917                 switch (ch)
918                 {
919                 case ESCAPE:
920                 {
921                         go = FALSE;
922                         break;
923                 }
924
925                 case 'T':
926                 case 't':
927                 {
928                         /* Clear windows */
929                         for (j = 0; j < 8; j++)
930                         {
931                                 window_flag[j] &= ~(1L << y);
932                         }
933
934                         /* Clear flags */
935                         for (i = 0; i < 16; i++)
936                         {
937                                 window_flag[x] &= ~(1L << i);
938                         }
939                 }
940                         /* Fall through */
941
942                 case 'y':
943                 case 'Y':
944                 {
945                         /* Ignore screen */
946                         if (x == 0) break;
947
948                         /* Set flag */
949                         window_flag[x] |= (1L << y);
950                         break;
951                 }
952
953                 case 'n':
954                 case 'N':
955                 {
956                         /* Clear flag */
957                         window_flag[x] &= ~(1L << y);
958                         break;
959                 }
960
961                 case '?':
962                 {
963                         (void)show_file(p_ptr, TRUE, _("joption.txt#Window", "option.txt#Window"), NULL, 0, 0);
964
965                         Term_clear();
966                         break;
967                 }
968
969                 default:
970                 {
971                         d = get_keymap_dir(ch);
972
973                         x = (x + ddx[d] + 8) % 8;
974                         y = (y + ddy[d] + 16) % 16;
975
976                         if (!d) bell();
977                 }
978                 }
979         }
980
981         /* Notice changes */
982         for (j = 0; j < 8; j++)
983         {
984                 term *old = Term;
985
986                 /* Dead window */
987                 if (!angband_term[j]) continue;
988
989                 /* Ignore non-changes */
990                 if (window_flag[j] == old_flag[j]) continue;
991
992                 /* Activate */
993                 Term_activate(angband_term[j]);
994                 Term_clear();
995                 Term_fresh();
996                 Term_activate(old);
997         }
998 }
999
1000
1001 /*!
1002  * @brief チートオプションを変更するコマンドのメインルーチン
1003  * Interact with some options for cheating
1004  * @param info 表示メッセージ
1005  * @return なし
1006  */
1007 static void do_cmd_options_cheat(concptr info)
1008 {
1009         char    ch;
1010         int             i, k = 0, n = CHEAT_MAX;
1011         char    buf[80];
1012         Term_clear();
1013
1014         /* Interact with the player */
1015         while (TRUE)
1016         {
1017                 DIRECTION dir;
1018
1019                 /* Prompt */
1020                 sprintf(buf, _("%s ( リターンで次へ, y/n でセット, ESC で決定 )", "%s (RET to advance, y/n to set, ESC to accept) "), info);
1021
1022                 prt(buf, 0, 0);
1023
1024 #ifdef JP
1025                 /* 詐欺オプションをうっかりいじってしまう人がいるようなので注意 */
1026                 prt("                                 <<  注意  >>", 11, 0);
1027                 prt("      詐欺オプションを一度でも設定すると、スコア記録が残らなくなります!", 12, 0);
1028                 prt("      後に解除してもダメですので、勝利者を目指す方はここのオプションはい", 13, 0);
1029                 prt("      じらないようにして下さい。", 14, 0);
1030 #endif
1031                 /* Display the options */
1032                 for (i = 0; i < n; i++)
1033                 {
1034                         byte a = TERM_WHITE;
1035
1036                         /* Color current option */
1037                         if (i == k) a = TERM_L_BLUE;
1038
1039                         /* Display the option text */
1040                         sprintf(buf, "%-48s: %s (%s)",
1041                                 cheat_info[i].o_desc,
1042                                 (*cheat_info[i].o_var ? _("はい  ", "yes") : _("いいえ", "no ")),
1043                                 cheat_info[i].o_text);
1044                         c_prt(a, buf, i + 2, 0);
1045                 }
1046
1047                 /* Hilite current option */
1048                 move_cursor(k + 2, 50);
1049
1050                 /* Get a key */
1051                 ch = inkey();
1052
1053                 /*
1054                  * HACK - Try to translate the key into a direction
1055                  * to allow using the roguelike keys for navigation.
1056                  */
1057                 dir = get_keymap_dir(ch);
1058                 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1059                         ch = I2D(dir);
1060
1061                 /* Analyze */
1062                 switch (ch)
1063                 {
1064                 case ESCAPE:
1065                 {
1066                         return;
1067                 }
1068
1069                 case '-':
1070                 case '8':
1071                 {
1072                         k = (n + k - 1) % n;
1073                         break;
1074                 }
1075
1076                 case ' ':
1077                 case '\n':
1078                 case '\r':
1079                 case '2':
1080                 {
1081                         k = (k + 1) % n;
1082                         break;
1083                 }
1084
1085                 case 'y':
1086                 case 'Y':
1087                 case '6':
1088                 {
1089                         if (!current_world_ptr->noscore)
1090                                 exe_write_diary(p_ptr, DIARY_DESCRIPTION, 0,
1091                                         _("詐欺オプションをONにして、スコアを残せなくなった。", "gave up sending score to use cheating options."));
1092                         current_world_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit);
1093                         (*cheat_info[k].o_var) = TRUE;
1094                         k = (k + 1) % n;
1095                         break;
1096                 }
1097
1098                 case 'n':
1099                 case 'N':
1100                 case '4':
1101                 {
1102                         (*cheat_info[k].o_var) = FALSE;
1103                         k = (k + 1) % n;
1104                         break;
1105                 }
1106
1107                 case '?':
1108                 {
1109                         strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), cheat_info[k].o_text);
1110                         /* Peruse the help file */
1111                         (void)show_file(p_ptr, TRUE, buf, NULL, 0, 0);
1112
1113                         Term_clear();
1114                         break;
1115                 }
1116
1117                 default:
1118                 {
1119                         bell();
1120                         break;
1121                 }
1122                 }
1123         }
1124 }
1125
1126
1127 /*!
1128  * @brief ビットセットからゲームオプションを展開する / Extract option variables from bit sets
1129  * @return なし
1130  */
1131 void extract_option_vars(void)
1132 {
1133         int i;
1134
1135         for (i = 0; option_info[i].o_desc; i++)
1136         {
1137                 int os = option_info[i].o_set;
1138                 int ob = option_info[i].o_bit;
1139
1140                 /* Set the "default" options */
1141                 if (option_info[i].o_var)
1142                 {
1143                         /* Set */
1144                         if (option_flag[os] & (1L << ob))
1145                         {
1146                                 /* Set */
1147                                 (*option_info[i].o_var) = TRUE;
1148                         }
1149                         else
1150                         {
1151                                 (*option_info[i].o_var) = FALSE;
1152                         }
1153                 }
1154         }
1155 }
1156
1157
1158 /*!
1159  * @brief 標準オプションを変更するコマンドのメインルーチン /
1160  * Set or unset various options.
1161  * @return なし
1162  * @details
1163  * <pre>
1164  * The user must use the "Ctrl-R" command to "adapt" to changes
1165  * in any options which control "visual" aspects of the game.
1166  * </pre>
1167  */
1168 void do_cmd_options(void)
1169 {
1170         char k;
1171         int d, skey;
1172         TERM_LEN i, y = 0;
1173         screen_save();
1174
1175         /* Interact */
1176         while (TRUE)
1177         {
1178                 int n = OPT_NUM;
1179
1180                 /* Does not list cheat option when cheat option is off */
1181                 if (!current_world_ptr->noscore && !allow_debug_opts) n--;
1182                 Term_clear();
1183
1184                 /* Why are we here */
1185                 prt(_("[ オプションの設定 ]", "Game options"), 1, 0);
1186
1187                 while (TRUE)
1188                 {
1189                         /* Give some choices */
1190                         for (i = 0; i < n; i++)
1191                         {
1192                                 byte a = TERM_WHITE;
1193                                 if (i == y) a = TERM_L_BLUE;
1194                                 Term_putstr(5, option_fields[i].row, -1, a,
1195                                         format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name));
1196                         }
1197
1198                         prt(_("<方向>で移動, Enterで決定, ESCでキャンセル, ?でヘルプ: ", "Move to <dir>, Select to Enter, Cancel to ESC, ? to help: "), 21, 0);
1199
1200                         /* Get command */
1201                         skey = inkey_special(TRUE);
1202                         if (!(skey & SKEY_MASK)) k = (char)skey;
1203                         else k = 0;
1204
1205                         if (k == ESCAPE) break;
1206
1207                         if (my_strchr("\n\r ", k))
1208                         {
1209                                 k = option_fields[y].key;
1210                                 break;
1211                         }
1212
1213                         for (i = 0; i < n; i++)
1214                         {
1215                                 if (tolower(k) == option_fields[i].key) break;
1216                         }
1217
1218                         /* Command is found */
1219                         if (i < n) break;
1220
1221                         /* Hack -- browse help */
1222                         if (k == '?') break;
1223
1224                         /* Move cursor */
1225                         d = 0;
1226                         if (skey == SKEY_UP) d = 8;
1227                         if (skey == SKEY_DOWN) d = 2;
1228                         y = (y + ddy[d] + n) % n;
1229                         if (!d) bell();
1230                 }
1231
1232                 if (k == ESCAPE) break;
1233
1234                 /* Analyze */
1235                 switch (k)
1236                 {
1237                 case '1':
1238                 {
1239                         /* Process the general options */
1240                         do_cmd_options_aux(OPT_PAGE_INPUT, _("キー入力オプション", "Input Options"));
1241                         break;
1242                 }
1243
1244                 case '2':
1245                 {
1246                         /* Process the general options */
1247                         do_cmd_options_aux(OPT_PAGE_MAPSCREEN, _("マップ画面オプション", "Map Screen Options"));
1248                         break;
1249                 }
1250
1251                 case '3':
1252                 {
1253                         /* Spawn */
1254                         do_cmd_options_aux(OPT_PAGE_TEXT, _("テキスト表示オプション", "Text Display Options"));
1255                         break;
1256                 }
1257
1258                 case '4':
1259                 {
1260                         /* Spawn */
1261                         do_cmd_options_aux(OPT_PAGE_GAMEPLAY, _("ゲームプレイ・オプション", "Game-Play Options"));
1262                         break;
1263                 }
1264
1265                 case '5':
1266                 {
1267                         /* Spawn */
1268                         do_cmd_options_aux(OPT_PAGE_DISTURBANCE, _("行動中止関係のオプション", "Disturbance Options"));
1269                         break;
1270                 }
1271
1272                 case '6':
1273                 {
1274                         /* Spawn */
1275                         do_cmd_options_aux(OPT_PAGE_AUTODESTROY, _("簡易自動破壊オプション", "Easy Auto-Destroyer Options"));
1276                         break;
1277                 }
1278
1279                 /* Play-record Options */
1280                 case 'R':
1281                 case 'r':
1282                 {
1283                         /* Spawn */
1284                         do_cmd_options_aux(OPT_PAGE_PLAYRECORD, _("プレイ記録オプション", "Play-record Options"));
1285                         break;
1286                 }
1287
1288                 /* Birth Options */
1289                 case 'B':
1290                 case 'b':
1291                 {
1292                         /* Spawn */
1293                         do_cmd_options_aux(OPT_PAGE_BIRTH, (!current_world_ptr->wizard || !allow_debug_opts) ?
1294                                 _("初期オプション(参照のみ)", "Birth Options(browse only)") :
1295                                 _("初期オプション((*)はスコアに影響)", "Birth Options((*)s effect score)"));
1296                         break;
1297                 }
1298
1299                 /* Cheating Options */
1300                 case 'C':
1301                 {
1302                         if (!current_world_ptr->noscore && !allow_debug_opts)
1303                         {
1304                                 /* Cheat options are not permitted */
1305                                 bell();
1306                                 break;
1307                         }
1308
1309                         /* Spawn */
1310                         do_cmd_options_cheat(_("詐欺師は決して勝利できない!", "Cheaters never win"));
1311                         break;
1312                 }
1313
1314                 case 'a':
1315                 case 'A':
1316                 {
1317                         do_cmd_options_autosave(_("自動セーブ", "Autosave"));
1318                         break;
1319                 }
1320
1321                 /* Window flags */
1322                 case 'W':
1323                 case 'w':
1324                 {
1325                         /* Spawn */
1326                         do_cmd_options_win();
1327                         p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL |
1328                                 PW_PLAYER | PW_MESSAGE | PW_OVERHEAD |
1329                                 PW_MONSTER | PW_OBJECT | PW_SNAPSHOT |
1330                                 PW_DUNGEON | PW_MONSTER_LIST);
1331                         break;
1332                 }
1333
1334                 /* Auto-picker/destroyer editor */
1335                 case 'P':
1336                 case 'p':
1337                 {
1338                         do_cmd_edit_autopick(p_ptr);
1339                         break;
1340                 }
1341
1342                 /* Hack -- Delay Speed */
1343                 case 'D':
1344                 case 'd':
1345                 {
1346                         /* Prompt */
1347                         clear_from(18);
1348                         prt(_("コマンド: 基本ウェイト量", "Command: Base Delay Factor"), 19, 0);
1349
1350                         /* Get a new value */
1351                         while (TRUE)
1352                         {
1353                                 int msec = delay_factor * delay_factor * delay_factor;
1354                                 prt(format(_("現在のウェイト: %d (%dミリ秒)", "Current base delay factor: %d (%d msec)"), delay_factor, msec), 22, 0);
1355                                 prt(_("ウェイト (0-9) ESCで決定: ", "Delay Factor (0-9 or ESC to accept): "), 20, 0);
1356                                 k = inkey();
1357                                 if (k == ESCAPE) break;
1358                                 else if (k == '?')
1359                                 {
1360                                         (void)show_file(p_ptr, TRUE, _("joption.txt#BaseDelay", "option.txt#BaseDelay"), NULL, 0, 0);
1361                                         Term_clear();
1362                                 }
1363                                 else if (isdigit(k)) delay_factor = D2I(k);
1364                                 else bell();
1365                         }
1366
1367                         break;
1368                 }
1369
1370                 /* Hack -- hitpoint warning factor */
1371                 case 'H':
1372                 case 'h':
1373                 {
1374                         /* Prompt */
1375                         clear_from(18);
1376                         prt(_("コマンド: 低ヒットポイント警告", "Command: Hitpoint Warning"), 19, 0);
1377
1378                         /* Get a new value */
1379                         while (TRUE)
1380                         {
1381                                 prt(format(_("現在の低ヒットポイント警告: %d0%%", "Current hitpoint warning: %d0%%"), hitpoint_warn), 22, 0);
1382                                 prt(_("低ヒットポイント警告 (0-9) ESCで決定: ", "Hitpoint Warning (0-9 or ESC to accept): "), 20, 0);
1383                                 k = inkey();
1384                                 if (k == ESCAPE) break;
1385                                 else if (k == '?')
1386                                 {
1387                                         (void)show_file(p_ptr, TRUE, _("joption.txt#Hitpoint", "option.txt#Hitpoint"), NULL, 0, 0);
1388                                         Term_clear();
1389                                 }
1390                                 else if (isdigit(k)) hitpoint_warn = D2I(k);
1391                                 else bell();
1392                         }
1393
1394                         break;
1395                 }
1396
1397                 /* Hack -- mana color factor */
1398                 case 'M':
1399                 case 'm':
1400                 {
1401                         /* Prompt */
1402                         clear_from(18);
1403                         prt(_("コマンド: 低魔力色閾値", "Command: Mana Color Threshold"), 19, 0);
1404
1405                         /* Get a new value */
1406                         while (TRUE)
1407                         {
1408                                 prt(format(_("現在の低魔力色閾値: %d0%%", "Current mana color threshold: %d0%%"), mana_warn), 22, 0);
1409                                 prt(_("低魔力閾値 (0-9) ESCで決定: ", "Mana color Threshold (0-9 or ESC to accept): "), 20, 0);
1410                                 k = inkey();
1411                                 if (k == ESCAPE) break;
1412                                 else if (k == '?')
1413                                 {
1414                                         (void)show_file(p_ptr, TRUE, _("joption.txt#Manapoint", "option.txt#Manapoint"), NULL, 0, 0);
1415                                         Term_clear();
1416                                 }
1417                                 else if (isdigit(k)) mana_warn = D2I(k);
1418                                 else bell();
1419                         }
1420
1421                         break;
1422                 }
1423
1424                 case '?':
1425                         (void)show_file(p_ptr, TRUE, _("joption.txt", "option.txt"), NULL, 0, 0);
1426                         Term_clear();
1427                         break;
1428
1429                         /* Unknown option */
1430                 default:
1431                 {
1432                         bell();
1433                         break;
1434                 }
1435                 }
1436
1437                 msg_erase();
1438         }
1439
1440         screen_load();
1441
1442         /* Hack - Redraw equippy chars */
1443         p_ptr->redraw |= (PR_EQUIPPY);
1444 }
1445
1446
1447 /*!
1448  * @brief 標準オプションを変更するコマンドのサブルーチン /
1449  * Interact with some options
1450  * @param page オプションページ番号
1451  * @param info 表示メッセージ
1452  * @return なし
1453  */
1454 void do_cmd_options_aux(int page, concptr info)
1455 {
1456         char    ch;
1457         int     i, k = 0, n = 0, l;
1458         int     opt[24];
1459         char    buf[80];
1460         bool    browse_only = (page == OPT_PAGE_BIRTH) && current_world_ptr->character_generated &&
1461                 (!current_world_ptr->wizard || !allow_debug_opts);
1462
1463
1464         /* Lookup the options */
1465         for (i = 0; i < 24; i++) opt[i] = 0;
1466
1467         /* Scan the options */
1468         for (i = 0; option_info[i].o_desc; i++)
1469         {
1470                 /* Notice options on this "page" */
1471                 if (option_info[i].o_page == page) opt[n++] = i;
1472         }
1473         Term_clear();
1474
1475         /* Interact with the player */
1476         while (TRUE)
1477         {
1478                 DIRECTION dir;
1479
1480                 /* Prompt */
1481                 sprintf(buf, _("%s (リターン:次, %sESC:終了, ?:ヘルプ) ", "%s (RET:next, %s, ?:help) "),
1482                         info, browse_only ? _("", "ESC:exit") : _("y/n:変更, ", "y/n:change, ESC:accept"));
1483                 prt(buf, 0, 0);
1484
1485                 /* HACK -- description for easy-auto-destroy options */
1486                 if (page == OPT_PAGE_AUTODESTROY)
1487                         c_prt(TERM_YELLOW, _("以下のオプションは、簡易自動破壊を使用するときのみ有効",
1488                                 "Following options will protect items from easy auto-destroyer."), 6, _(6, 3));
1489
1490                 /* Display the options */
1491                 for (i = 0; i < n; i++)
1492                 {
1493                         byte a = TERM_WHITE;
1494
1495                         /* Color current option */
1496                         if (i == k) a = TERM_L_BLUE;
1497
1498                         /* Display the option text */
1499                         sprintf(buf, "%-48s: %s (%.19s)",
1500                                 option_info[opt[i]].o_desc,
1501                                 (*option_info[opt[i]].o_var ? _("はい  ", "yes") : _("いいえ", "no ")),
1502                                 option_info[opt[i]].o_text);
1503                         if ((page == OPT_PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0);
1504                         else c_prt(a, buf, i + 2, 0);
1505                 }
1506
1507                 if ((page == OPT_PAGE_AUTODESTROY) && (k > 2)) l = 3;
1508                 else l = 0;
1509
1510                 /* Hilite current option */
1511                 move_cursor(k + 2 + l, 50);
1512
1513                 /* Get a key */
1514                 ch = inkey();
1515
1516                 /*
1517                  * HACK - Try to translate the key into a direction
1518                  * to allow using the roguelike keys for navigation.
1519                  */
1520                 dir = get_keymap_dir(ch);
1521                 if ((dir == 2) || (dir == 4) || (dir == 6) || (dir == 8))
1522                         ch = I2D(dir);
1523
1524                 /* Analyze */
1525                 switch (ch)
1526                 {
1527                 case ESCAPE:
1528                 {
1529                         return;
1530                 }
1531
1532                 case '-':
1533                 case '8':
1534                 {
1535                         k = (n + k - 1) % n;
1536                         break;
1537                 }
1538
1539                 case ' ':
1540                 case '\n':
1541                 case '\r':
1542                 case '2':
1543                 {
1544                         k = (k + 1) % n;
1545                         break;
1546                 }
1547
1548                 case 'y':
1549                 case 'Y':
1550                 case '6':
1551                 {
1552                         if (browse_only) break;
1553                         (*option_info[opt[k]].o_var) = TRUE;
1554                         k = (k + 1) % n;
1555                         break;
1556                 }
1557
1558                 case 'n':
1559                 case 'N':
1560                 case '4':
1561                 {
1562                         if (browse_only) break;
1563                         (*option_info[opt[k]].o_var) = FALSE;
1564                         k = (k + 1) % n;
1565                         break;
1566                 }
1567
1568                 case 't':
1569                 case 'T':
1570                 {
1571                         if (!browse_only) (*option_info[opt[k]].o_var) = !(*option_info[opt[k]].o_var);
1572                         break;
1573                 }
1574
1575                 case '?':
1576                 {
1577                         strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), option_info[opt[k]].o_text);
1578                         /* Peruse the help file */
1579                         (void)show_file(p_ptr, TRUE, buf, NULL, 0, 0);
1580
1581                         Term_clear();
1582                         break;
1583                 }
1584
1585                 default:
1586                 {
1587                         bell();
1588                         break;
1589                 }
1590                 }
1591         }
1592 }