OSDN Git Service

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