1 #pragma once
2 
3 #include <algorithm>
4 #include <unordered_set>
5 #include <vector>
6 
7 #include "ability-type.h"
8 #include "activity-interrupt-type.h"
9 #include "char-set-type.h"
10 #include "confirm-prompt-type.h"
11 #include "easy-confirm-type.h"
12 #include "feature.h"
13 #include "flang-t.h"
14 #include "flush-reason-type.h"
15 #include "lang-t.h"
16 #include "maybe-bool.h"
17 #include "mpr.h"
18 #include "newgame-def.h"
19 #include "pattern.h"
20 #include "screen-mode.h"
21 #include "skill-focus-mode.h"
22 #include "spell-type.h"
23 #include "tag-pref.h"
24 #include "travel-open-doors-type.h"
25 
26 using std::vector;
27 
28 enum autosac_type
29 {
30     AS_NO,
31     AS_YES,
32     AS_PROMPT,
33     AS_BEFORE_EXPLORE,
34     AS_PROMPT_IGNORE,
35 };
36 
37 struct message_filter
38 {
39     int             channel;        // Use -1 to match any channel.
40     text_pattern    pattern;        // Empty pattern matches any message
41 
message_filtermessage_filter42     message_filter(int ch, const string &s)
43         : channel(ch), pattern(s)
44     {
45     }
46 
message_filtermessage_filter47     message_filter(const string &s) : channel(-1), pattern(s, true) { }
48 
49     bool operator== (const message_filter &mf) const
50     {
51         return channel == mf.channel && pattern == mf.pattern;
52     }
53 
is_filteredmessage_filter54     bool is_filtered(int ch, const string &s) const
55     {
56         bool channel_match = ch == channel || channel == -1;
57         if (!channel_match || pattern.empty())
58             return channel_match;
59         return pattern.matches(s);
60     }
61 };
62 
63 struct sound_mapping
64 {
65     text_pattern pattern;
66     string       soundfile;
67     bool         interrupt_game;
68 
69     bool operator== (const sound_mapping &o) const
70     {
71         return pattern == o.pattern
72                 && soundfile == o.soundfile
73                 && interrupt_game == o.interrupt_game;
74     }
75 };
76 
77 struct colour_mapping
78 {
79     string tag;
80     text_pattern pattern;
81     colour_t colour;
82     bool operator== (const colour_mapping &o) const
83     {
84         return tag == o.tag && pattern == o.pattern && colour == o.colour;
85     }
86 };
87 
88 struct message_colour_mapping
89 {
90     message_filter message;
91     msg_colour_type colour;
92     bool operator== (const message_colour_mapping &o) const
93     {
94         return message == o.message && colour == o.colour;
95     }
96 };
97 
98 struct flang_entry
99 {
100     flang_t lang_id;
101     int value;
102 };
103 
104 enum use_animation_type
105 {
106     UA_NONE             = 0,
107     // projectile animations, from throwing weapons, fireball, etc
108     UA_BEAM             = (1 << 0),
109     // flashes the screen when trying to cast a spell beyond its range
110     UA_RANGE            = (1 << 1),
111     // flashes the screen on low hitpoint warning
112     UA_HP               = (1 << 2),
113     // flashes the screen on attempt to travel or rest with a monster in view
114     UA_MONSTER_IN_SIGHT = (1 << 3),
115     // various animations for picking up runes and the orb
116     UA_PICKUP           = (1 << 4),
117     // various monster spell/ability effects (slime creature merging, etc)
118     UA_MONSTER          = (1 << 5),
119     // various player spell/ability animation effects (shatter, etc)
120     UA_PLAYER           = (1 << 6),
121     // animation when entering certain branches (abyss, zot, etc)
122     UA_BRANCH_ENTRY     = (1 << 7),
123     // animations that can't be turned off (please don't use unless they can
124     // be turned off some other way)
125     UA_ALWAYS_ON        = (1 << 8),
126 };
127 DEF_BITFIELD(use_animations_type, use_animation_type);
128 
129 class LineInput;
130 class GameOption;
131 struct game_options
132 {
133 public:
134     game_options();
135     ~game_options();
136     void reset_options();
137 
138     void read_option_line(const string &s, bool runscripts = false);
139     void read_options(LineInput &, bool runscripts,
140                       bool clear_aliases = true);
141 
142     void include(const string &file, bool resolve, bool runscript);
143     void report_error(PRINTF(1, ));
144 
145     string resolve_include(const string &file, const char *type = "");
146 
147     bool was_included(const string &file) const;
148 
149     static string resolve_include(string including_file, string included_file,
150                             const vector<string> *rcdirs = nullptr);
151 
152 #ifdef USE_TILE_WEB
153     void write_webtiles_options(const string &name);
154 #endif
155 
156 public:
157     string      filename;     // The name of the file containing options.
158     string      basefilename; // Base (pathless) file name
159     int         line_num;     // Current line number being processed.
160 
161     // View options
162     map<dungeon_feature_type, feature_def> feature_colour_overrides;
163     map<dungeon_feature_type, FixedVector<char32_t, 2> > feature_symbol_overrides;
164     map<monster_type, cglyph_t> mon_glyph_overrides;
165     char32_t cset_override[NUM_DCHAR_TYPES];
166     typedef pair<string, cglyph_t> item_glyph_override_type;
167     vector<item_glyph_override_type > item_glyph_overrides;
168     map<string, cglyph_t> item_glyph_cache;
169 
170     string      save_dir;       // Directory where saves and bones go.
171     string      macro_dir;      // Directory containing macro.txt
172     string      morgue_dir;     // Directory where character dumps and morgue
173                                 // dumps are saved. Overrides crawl_dir.
174     string      shared_dir;     // Directory where the logfile, scores and bones
175                                 // are stored. On a multi-user system, this dir
176                                 // should be accessible by different people.
177     vector<string> additional_macro_files;
178 
179     uint64_t    seed;           // Non-random games.
180     uint64_t    seed_from_rc;
181     bool        pregen_dungeon; // Is the dungeon completely generated at the beginning?
182     bool        incremental_pregen; // Does the dungeon always generate in a specified order?
183 
184 #ifdef DGL_SIMPLE_MESSAGING
185     bool        messaging;      // Check for messages.
186 #endif
187 
188     bool        suppress_startup_errors;
189 
190     bool        mouse_input;
191 
192     int         view_max_width;
193     int         view_max_height;
194     int         mlist_min_height;
195     int         msg_min_height;
196     int         msg_max_height;
197     int         msg_webtiles_height;
198     bool        mlist_allow_alternate_layout;
199     bool        monster_item_view_coordinates;
200     vector<text_pattern> monster_item_view_features;
201     bool        messages_at_top;
202     bool        msg_condense_repeats;
203     bool        msg_condense_short;
204 
205     // The view lock variables force centering the viewport around the PC @
206     // at all times (the default). If view locking is not enabled, the viewport
207     // scrolls only when the PC hits the edge of it.
208     bool        view_lock_x;
209     bool        view_lock_y;
210 
211     // For an unlocked viewport, this will centre the viewport when scrolling.
212     bool        centre_on_scroll;
213 
214     // If symmetric_scroll is set, for diagonal moves, if the view
215     // scrolls at all, it'll scroll diagonally.
216     bool        symmetric_scroll;
217 
218     // How far from the viewport edge is scrolling forced.
219     int         scroll_margin_x;
220     int         scroll_margin_y;
221 
222     // Whether exclusions and exclusion radius are visible in the viewport.
223     bool        always_show_exclusions;
224 
225     int         autopickup_on;
226     bool        autopickup_starting_ammo;
227     bool        default_manual_training;
228     bool        default_show_all_skills;
229 
230     bool        show_newturn_mark;// Show underscore prefix in messages for new turn
231     bool        show_game_time; // Show game time instead of player turns.
232     bool        equip_bar; // Show equip bar instead of noise bar.
233     bool        animate_equip_bar; // Animate colours in equip bar.
234 
235     FixedBitVector<NUM_OBJECT_CLASSES> autopickups; // items to autopickup
236     bool        auto_switch;     // switch melee&ranged weapons according to enemy range
237     travel_open_doors_type travel_open_doors; // open doors while exploring
238     bool        easy_unequip;    // allow auto-removing of armour / jewellery
239     bool        equip_unequip;   // Make 'W' = 'T', and 'P' = 'R'.
240     bool        jewellery_prompt; // Always prompt for slot when changing jewellery.
241     bool        easy_door;       // 'O', 'C' don't prompt with just one door.
242     bool        warn_hatches;    // offer a y/n prompt when the player uses an escape hatch
243     bool        enable_recast_spell; // Allow recasting spells with 'z' Enter.
244     skill_focus_mode skill_focus; // is the focus skills available
245     bool        auto_hide_spells; // hide new spells
246 
247     bool        note_all_skill_levels;  // take note for all skill levels (1-27)
248     bool        note_skill_max;   // take note when skills reach new max
249     string      user_note_prefix; // Prefix for user notes
250     int         note_hp_percent;  // percentage hp for notetaking
251     bool        note_xom_effects; // take note of all Xom effects
252     bool        note_chat_messages; // log chat in Webtiles
253     bool        note_dgl_messages; // log chat in DGL
254     easy_confirm_type easy_confirm;    // make yesno() confirming easier
255     bool        easy_quit_item_prompts; // make item prompts quitable on space
256     confirm_prompt_type allow_self_target;      // yes, no, prompt
257     bool        simple_targeting; // disable smart spell targeting
258     bool        always_use_static_targeters; // whether to use static targeters even in `z`
259 
260     int         colour[16];      // macro fg colours to other colours
261     unsigned    background_colour; // select default background colour
262     unsigned    foreground_colour; // select default foreground colour
263     msg_colour_type channels[NUM_MESSAGE_CHANNELS];  // msg channel colouring
264     use_animations_type use_animations; // which animations to show
265     bool        darken_beyond_range; // whether to darken squares out of range
266 
267     int         hp_warning;      // percentage hp for danger warning
268     int         magic_point_warning;    // percentage mp for danger warning
269     bool        clear_messages;   // clear messages each turn
270     bool        show_more;        // Show message-full more prompts.
271     bool        small_more;       // Show one-char more prompts.
272     unsigned    friend_brand;     // Attribute for branding friendly monsters
273     unsigned    neutral_brand;    // Attribute for branding neutral monsters
274     bool        blink_brightens_background; // Assume blink will brighten bg.
275     bool        bold_brightens_foreground; // Assume bold will brighten fg.
276     bool        best_effort_brighten_background; // Allow bg brighten attempts.
277     bool        best_effort_brighten_foreground; // Allow fg brighten attempts.
278     bool        allow_extended_colours; // Use more than 8 terminal colours.
279     bool        macro_meta_entry; // Allow user to use numeric sequences when
280                                   // creating macros
281     int         autofight_warning;      // Amount of real time required between
282                                         // two autofight commands
283     bool        cloud_status;     // Whether to show a cloud status light
284     bool        always_show_zot;  // Whether to always show the Zot timer
285 
286     int         fire_items_start; // index of first item for fire command
287     vector<unsigned> fire_order;  // missile search order for 'f' command
288     unordered_set<spell_type, hash<int>> fire_order_spell;
289     unordered_set<ability_type, hash<int>> fire_order_ability;
290     bool        launcher_autoquiver; // whether to autoquiver launcher ammo on wield
291 
292     unordered_set<int> force_targeter; // spell types to always use a
293                                        // targeter for
294 
295     bool        flush_input[NUM_FLUSH_REASONS]; // when to flush input buff
296 
297     bool        sounds_on;              // Allow sound effects to play
298     bool        one_SDL_sound_channel;  // Limit to one SDL sound at once
299 
300     char_set_type  char_set;
301     FixedVector<char32_t, NUM_DCHAR_TYPES> char_table;
302 
303 #ifdef WIZARD
304     int            wiz_mode;      // no, never, start in wiz mode
305     int            explore_mode;  // no, never, start in explore mode
306 #endif
307     vector<string> terp_files; // Lua files to load for luaterp
308     bool           no_save;    // don't use persistent save files
309 
310     // internal use only:
311     int         sc_entries;      // # of score entries
312     int         sc_format;       // Format for score entries
313 
314     vector<pair<int, int> > hp_colour;
315     vector<pair<int, int> > mp_colour;
316     vector<pair<int, int> > stat_colour;
317     vector<int> enemy_hp_colour;
318 
319     string map_file_name;   // name of mapping file to use
320     vector<pair<text_pattern, bool> > force_autopickup;
321     vector<text_pattern> note_monsters;  // Interesting monsters
322     vector<text_pattern> note_messages;  // Interesting messages
323     vector<pair<text_pattern, string> > autoinscriptions;
324     vector<text_pattern> note_items;     // Objects to note
325     // Skill levels to note
326     FixedBitVector<MAX_SKILL_LEVEL + 1> note_skill_levels;
327     vector<pair<text_pattern, string>> auto_spell_letters;
328     vector<pair<text_pattern, string>> auto_item_letters;
329     vector<pair<text_pattern, string>> auto_ability_letters;
330 
331     bool        pickup_thrown;  // Pickup thrown missiles
332     int         travel_delay;   // How long to pause between travel moves
333     int         explore_delay;  // How long to pause between explore moves
334     int         rest_delay;     // How long to pause between rest moves
335 
336     bool        show_travel_trail;
337 
338     int         view_delay;
339 
340     bool        arena_dump_msgs;
341     bool        arena_dump_msgs_all;
342     bool        arena_list_eq;
343 
344     vector<message_filter> force_more_message;
345     vector<message_filter> flash_screen_message;
346     vector<text_pattern> confirm_action;
347 
348     unsigned    tc_reachable;   // Colour for squares that are reachable
349     unsigned    tc_excluded;    // Colour for excluded squares.
350     unsigned    tc_exclude_circle; // Colour for squares in the exclusion radius
351     // Colour for squares which are safely traversable but that travel
352     // considers forbidden, either because they are themselves forbidden by
353     // travel options or exclusions or because they are only accessible through
354     // such squares.
355     unsigned    tc_forbidden;
356     // Colour for squares that are not safely traversable (e.g. deep water,
357     // lava, or traps)
358     unsigned    tc_dangerous;
359     unsigned    tc_disconnected;// Areas that are completely disconnected.
360     vector<text_pattern> auto_exclude; // Automatically set an exclusion
361                                        // around certain monsters.
362 
363     unsigned    evil_colour; // Colour for things player's god disapproves
364 
365     unsigned    remembered_monster_colour;  // Colour of remembered monsters
366     unsigned    detected_monster_colour;    // Colour of detected monsters
367     unsigned    detected_item_colour;       // Colour of detected items
368     unsigned    status_caption_colour;      // Colour of captions in HUD.
369 
370     unsigned    heap_brand;         // Highlight heaps of items
371     unsigned    stab_brand;         // Highlight monsters that are stabbable
372     unsigned    may_stab_brand;     // Highlight potential stab candidates
373     unsigned    feature_item_brand; // Highlight features covered by items.
374     unsigned    trap_item_brand;    // Highlight traps covered by items.
375 
376     // What is the minimum number of items in a stack for which
377     // you show summary (one-line) information
378     int         item_stack_summary_minimum;
379 
380     int         explore_stop;      // Stop exploring if a previously unseen
381                                    // item comes into view
382 
383     // Don't stop greedy explore when picking up an item which matches
384     // any of these patterns.
385     vector<text_pattern> explore_stop_pickup_ignore;
386 
387     bool        explore_greedy;    // Explore goes after items as well.
388 
389     // How much more eager greedy-explore is for items than to explore.
390     int         explore_item_greed;
391 
392     // How much autoexplore favours visiting squares next to walls.
393     int         explore_wall_bias;
394 
395     // Wait for rest wait percent HP and MP before exploring.
396     bool        explore_auto_rest;
397 
398     bool        travel_key_stop;   // Travel stops on keypress.
399 
400     bool        travel_one_unsafe_move; // Allow one unsafe move of auto travel
401 
402     vector<sound_mapping> sound_mappings;
403     string sound_file_path;
404     vector<colour_mapping> menu_colour_mappings;
405     vector<message_colour_mapping> message_colour_mappings;
406 
407     vector<menu_sort_condition> sort_menus;
408 
409     bool        dump_on_save;       // Automatically dump character when saving.
410     int         dump_kill_places;   // How to dump place information for kills.
411     int         dump_message_count; // How many old messages to dump
412 
413     int         dump_item_origins;  // Show where items came from?
414     int         dump_item_origin_price;
415 
416     unordered_set<string> dump_fields;
417     // Order of sections in the character dump.
418     vector<string> dump_order;
419 
420     int         pickup_menu_limit;  // Over this number of items, menu for
421                                     // pickup
422     bool        ability_menu;       // 'a'bility starts with a full-screen menu
423     bool        easy_floor_use;     // , selects the floor item if there's 1
424     bool        bad_item_prompt;    // Confirm before using a bad consumable
425 
426     int         assign_item_slot;   // How free slots are assigned
427     maybe_bool  show_god_gift;      // Show {god gift} in item names
428 
429     maybe_bool  restart_after_game; // If true, Crawl will not close on game-end
430                                     // If maybe, Crawl will restart only if the
431                                     // CL options would bring up the startup
432                                     // menu.
433     bool        restart_after_save; // .. or on save
434     bool        newgame_after_quit; // override the restart_after_game behaviour
435                                     // to always start a new game on quit.
436 
437     bool        name_bypasses_menu; // should the menu be skipped if there is
438                                     // a name set on game start
439     bool        read_persist_options; // If true, Crawl will try to load
440                                       // options from c_persist.options
441 
442     vector<text_pattern> drop_filter;
443 
444     map<string, FixedBitVector<NUM_ACTIVITY_INTERRUPTS>> activity_interrupts;
445 #ifdef DEBUG_DIAGNOSTICS
446     FixedBitVector<NUM_DIAGNOSTICS> quiet_debug_messages;
447 #endif
448 
449     // Previous startup options
450     bool        remember_name;      // Remember and reprompt with last name
451 
452     bool        dos_use_background_intensity;
453 
454     bool        use_fake_cursor;    // Draw a fake cursor instead of relying
455                                     // on the term's own cursor.
456     bool        use_fake_player_cursor;
457 
458     bool        show_player_species;
459 
460     int         level_map_cursor_step;  // The cursor increment in the level
461                                         // map.
462 
463     bool        use_modifier_prefix_keys; // Treat '/' as SHIFT and '*' as CTRL
464 
465     // If the player prefers to merge kill records, this option can do that.
466     int         kill_map[KC_NCATEGORIES];
467 
468     bool        rest_wait_both; // Stop resting only when both HP and MP are
469                                 // fully restored.
470 
471     bool        rest_wait_ancestor;// Stop resting only if the ancestor's HP
472                                    // is fully restored.
473 
474     int         rest_wait_percent; // Stop resting after restoring this
475                                    // fraction of HP or MP
476 
477     bool        regex_search; // whether to default to regex search for ^F
478     bool        autopickup_search; // whether to annotate stash items with
479                                    // autopickup status
480 
481     lang_t              language;         // Translation to use.
482     const char*         lang_name;        // Database name of the language.
483     vector<flang_entry> fake_langs;       // The fake language(s) in use.
has_fake_langgame_options484     bool has_fake_lang(flang_t flang)
485     {
486         return any_of(begin(fake_langs), end(fake_langs),
487                       [flang] (const flang_entry &f)
488                       { return f.lang_id == flang; });
489     }
490 
491     // -1 and 0 mean no confirmation, other possible values are 1,2,3 (see fail_severity())
492     int         fail_severity_to_confirm;
493     int         fail_severity_to_quiver;
494 #ifdef WIZARD
495     // Parameters for fight simulations.
496     string      fsim_mode;
497     bool        fsim_csv;
498     int         fsim_rounds;
499     string      fsim_mons;
500     vector<string> fsim_scale;
501     vector<string> fsim_kit;
502 #endif  // WIZARD
503 
504 #ifdef USE_TILE
505     // TODO: have these present but ignored in non-tile builds
506     string      tile_show_items; // show which item types in tile inventory
507     bool        tile_skip_title; // wait for a key at title screen?
508     bool        tile_menu_icons; // display icons in menus?
509 
510     // minimap colours
511     VColour     tile_unseen_col;
512     VColour     tile_floor_col;
513     VColour     tile_wall_col;
514     VColour     tile_mapped_floor_col;
515     VColour     tile_mapped_wall_col;
516     VColour     tile_door_col;
517     VColour     tile_item_col;
518     VColour     tile_monster_col;
519     VColour     tile_plant_col;
520     VColour     tile_upstairs_col;
521     VColour     tile_downstairs_col;
522     VColour     tile_branchstairs_col;
523     VColour     tile_feature_col;
524     VColour     tile_water_col;
525     VColour     tile_lava_col;
526     VColour     tile_trap_col;
527     VColour     tile_excl_centre_col;
528     VColour     tile_excluded_col;
529     VColour     tile_player_col;
530     VColour     tile_deep_water_col;
531     VColour     tile_portal_col;
532     VColour     tile_transporter_col;
533     VColour     tile_transporter_landing_col;
534     VColour     tile_explore_horizon_col;
535 
536     VColour     tile_window_col;
537 #ifdef USE_TILE_LOCAL
538     int         game_scale;
539     // font settings
540     string      tile_font_crt_file;
541     string      tile_font_msg_file;
542     string      tile_font_stat_file;
543     string      tile_font_lbl_file;
544     string      tile_font_tip_file;
545     bool        tile_single_column_menus;
546 #endif
547 #ifdef USE_TILE_WEB
548     string      tile_font_crt_family;
549     string      tile_font_msg_family;
550     string      tile_font_stat_family;
551     string      tile_font_lbl_family;
552     string      glyph_mode_font;
553     int         glyph_mode_font_size;
554 #endif
555     int         tile_font_crt_size;
556     int         tile_font_msg_size;
557     int         tile_font_stat_size;
558     int         tile_font_lbl_size;
559     int         tile_font_tip_size;
560 #ifdef USE_TILE_LOCAL
561 #ifdef USE_FT
562     bool        tile_font_ft_light;
563 #endif
564     // window settings
565     screen_mode tile_full_screen;
566     int         tile_window_width;
567     int         tile_window_height;
568     int         tile_window_ratio;
569     maybe_bool  tile_use_small_layout;
570 #endif
571     int         tile_cell_pixels;
572     int         tile_viewport_scale;
573     int         tile_map_scale;
574     bool        tile_filter_scaling;
575     int         tile_map_pixels;
576 
577     bool        tile_force_overlay;
578     VColour     tile_overlay_col;           // Background color for message overlay
579     int         tile_overlay_alpha_percent; // Background alpha percent for message overlay
580     // display settings
581     int         tile_update_rate;
582     int         tile_runrest_rate;
583     int         tile_key_repeat_delay;
584     int         tile_tooltip_ms;
585     tag_pref    tile_tag_pref;
586 
587     bool        tile_show_minihealthbar;
588     bool        tile_show_minimagicbar;
589     bool        tile_show_demon_tier;
590     string      tile_show_threat_levels;
591     bool        tile_water_anim;
592     bool        tile_misc_anim;
593     vector<string> tile_layout_priority;
594     monster_type tile_use_monster;
595     tileidx_t   tile_player_tile;
596     pair<int, int> tile_weapon_offsets;
597     pair<int, int> tile_shield_offsets;
598 #ifdef USE_TILE_WEB
599     bool        tile_realtime_anim;
600     string      tile_display_mode;
601     bool        tile_level_map_hide_messages;
602     bool        tile_level_map_hide_sidebar;
603     bool        tile_web_mouse_control;
604 #endif
605 #endif // USE_TILE
606 
607     typedef map<string, string> opt_map;
608     opt_map     named_options;          // All options not caught above are
609                                         // recorded here.
610 
611     newgame_def game;      // Choices for new game.
612 
613 private:
614     typedef map<string, string> string_map;
615     string_map     aliases;
616     string_map     variables;
617     set<string>    constants; // Variables that can't be changed
618     set<string>    included;  // Files we've included already.
619 
620 public:
621     // Fix option values if necessary, specifically file paths.
622     void fixup_options();
623 
624 private:
625     string unalias(const string &key) const;
626     string expand_vars(const string &field) const;
627     void add_alias(const string &alias, const string &name);
628 
629     void clear_feature_overrides();
630     void clear_cset_overrides();
631     void add_cset_override(dungeon_char_type dc, int symbol);
632     void add_feature_override(const string &, bool prepend);
633     void remove_feature_override(const string &, bool prepend);
634 
635     void add_message_colour_mappings(const string &, bool, bool);
636     void add_message_colour_mapping(const string &, bool, bool);
637     message_filter parse_message_filter(const string &s);
638 
639     void set_default_activity_interrupts();
640     void set_activity_interrupt(FixedBitVector<NUM_ACTIVITY_INTERRUPTS> &eints,
641                                 const string &interrupt);
642     void set_activity_interrupt(const string &activity_name,
643                                 const string &interrupt_names,
644                                 bool append_interrupts,
645                                 bool remove_interrupts);
646     void set_fire_order(const string &full, bool append, bool prepend);
647     void add_fire_order_slot(const string &s, bool prepend);
648     void set_fire_order_spell(const string &s, bool append, bool remove);
649     void set_fire_order_ability(const string &s, bool append, bool remove);
650     void set_menu_sort(string field);
651     void str_to_enemy_hp_colour(const string &, bool);
652     void new_dump_fields(const string &text, bool add = true,
653                          bool prepend = false);
654     void do_kill_map(const string &from, const string &to);
655     int  read_explore_stop_conditions(const string &) const;
656     use_animations_type read_use_animations(const string &) const;
657 
658     void split_parse(const string &s, const string &separator,
659                      void (game_options::*add)(const string &, bool),
660                      bool prepend = false);
661     void add_mon_glyph_override(const string &, bool prepend);
662     void remove_mon_glyph_override(const string &, bool prepend);
663     cglyph_t parse_mon_glyph(const string &s) const;
664     void add_item_glyph_override(const string &, bool prepend);
665     void remove_item_glyph_override(const string &, bool prepend);
666     void set_option_fragment(const string &s, bool prepend);
667     bool set_lang(const char *s);
668     void set_fake_langs(const string &input);
669     void set_player_tile(const string &s);
670     void set_tile_offsets(const string &s, bool set_shield);
671     void add_force_targeter(const string &s, bool prepend);
672     void remove_force_targeter(const string &s, bool prepend);
673 
674     static const string interrupt_prefix;
675 
676     vector<GameOption*> option_behaviour;
677     map<string, GameOption*> options_by_name;
678     const vector<GameOption*> build_options_list();
679     map<string, GameOption*> build_options_map(const vector<GameOption*> &opts);
680 };
681 
682 char32_t get_glyph_override(int c);
683 object_class_type item_class_by_sym(char32_t c);
684 
685 #ifdef DEBUG_GLOBALS
686 #define Options (*real_Options)
687 #endif
688 extern game_options  Options;
689 
macro_colour(short col)690 static inline short macro_colour(short col)
691 {
692     ASSERT(col < NUM_TERM_COLOURS);
693     return col < 0 ? col : Options.colour[ col ];
694 }
695