##### Crawl Init file ############################################### # For descriptions of all options, as well as some more in-depth information # on setting them, consult the file # options_guide.txt # in your /docs directory. If you can't find it, the file is also available # online at: # https://github.com/crawl/crawl/blob/master/crawl-ref/docs/options_guide.txt # # Crawl uses the first file of the following list as its option file: # * init.txt in the -rcdir directory (if specified) # * .crawlrc in the -rcdir directory (if specified) # * init.txt (in the Crawl directory) # * ~/.crawl/init.txt (Unix only) # * ~/.crawlrc (Unix only) # * ~/init.txt (Unix only) # * settings/init.txt (in the Crawl directory) ##### Some basic explanation of option syntax ####################### # Lines beginning with '#' are comments. The basic syntax is: # # field = value or field.subfield = value # # Only one specification is allowed per line. # # The terms are typically case-insensitive except in the fairly obvious # cases (the character's name and specifying files or directories when # on a system that has case-sensitive filenames). # # White space is stripped from the beginning and end of the line, as # well as immediately before and after the '='. If the option allows # multiple comma/semicolon-separated terms (such as # autopickup_exceptions), all whitespace around the separator is also # trimmed. All other whitespace is left intact. # # There are three broad types of Crawl options: true/false values (booleans), # arbitrary values, and lists of values. The first two types use only the # simple =, with later options - which includes your options that are different # from the defaults - overriding earlier ones. List options allow using +=, ^=, # -=, and = to append, prepend, remove, and reset, respectively. Usually you will # want to use += to add to a list option. Lastly, there is := which you can use # to create an alias, like so: # ae := autopickup_exceptions # From there on, 'ae' will be treated as if it you typed autopickup_exceptions, # so you can save time typing it. # ##### Other files ################################################### # You can include other files from your options file using the 'include' # option. Crawl will treat it as if you copied the whole text of that file # into your options file in that spot. You can uncomment some of the following # lines by removing the beginning '#' to include some of the other files in # this folder. # Some useful, more advanced options, implemented in LUA. # include = advanced_optioneering.txt # Alternative vi bindings for Dvorak users. # include = dvorak_command_keys.txt # Alternative vi bindings for Colemak users. # include = colemak_command_keys.txt # Alternative vi bindings for Neo users. # include = neo_command_keys.txt # Override the vi movement keys with a non-command. # include = no_vi_command_keys.txt # Turn the shift-vi keys into safe move, instead of run. # include = safe_move_shift.txt ##### Ancient versions ############################################## # If you're used to the interface of ancient versions of Crawl, you may # get back parts of it by uncommenting the following options: # include = 034_command_keys.txt # And to revert monster glyph and colouring changes: # include = 052_monster_glyphs.txt # include = 060_monster_glyphs.txt # include = 071_monster_glyphs.txt # include = 080_monster_glyphs.txt # include = 0.9_monster_glyphs.txt # include = 0.12_monster_glyphs.txt # include = 0.13_monster_glyphs.txt # include = 0.14_monster_glyphs.txt ##### Crawl Init file ############################################### # Console Visuals # =============== # Stop using dark blue for unseen tiles # by telling the game that the terminal # can render dark grey bold_brightens_foreground = true # Remove the menu selector, it always selects the first item in any # selection (w,W,q,r,Q,z,Z) menu_arrow_control = false # Quality of life # =============== default_manual_training = true auto_hide_spells = true # Macros # ====== # Hit to rest macros += M \{32} 5 # Viewport # ======== view_max_width = 60 view_max_height = 60 # Webtiles # ======== tile_display_mode = tiles tile_web_mouse_control = false tile_viewport_scale = 1.5 # HP/MP Colors/Warnings # ================== hp_warning = 50 mp_warning = 50 hp_colour = 95:yellow, 75:brown, 50:magenta, 25:red # Travel # ====== travel_one_unsafe_move = true travel_avoid_terrain = deep water travel_delay = -1 explore_delay = 10 explore_wall_bias = 5 show_travel_trail = true # Autofight / Automagic # ===================== autofight_stop = 50 autofight_warning = 100 # Force More Messages / Flash Screen # ================================== show_more = false # HP loss flash_screen_message += HP: \d+/\d+ \(-\d+\).*!+ # Statuses force_more_message += You feel strangely unstable flash_screen_message += You are (confused|paralysed|sleeping|corroded|poisoned) flash_screen_message += You feel sluggish # Threats force_more_message += wielding.*(distortion|chaos|electrocution|venom) force_more_message += quivering.*tipped darts force_more_message += carrying a wand flash_screen_message += You feel you are being watched by something flash_screen_message += The.*attacks as you move away! # Autoinscriptions # ================ autoinscribe += potions? of curing:@q1 autoinscribe += potions? of heal wounds:@q2 autoinscribe += scrolls? of identify:@r1 autoinscribe += scrolls? of teleportation:@r2 autoinscribe += .*-tipped darts?:=f=F autoinscribe += throwing nets?:=f=F autoinscribe += boomerangs? of dispersal:=f=F # Quivering # ========= fire_order_spell = attack fire_order_ability = attack launcher_autoquiver = false quiver_menu_focus = false #---------------------------------------------------------------------------- # # LUA # #---------------------------------------------------------------------------- # < local prev_hp = nil local prev_mp = nil function bar(current, change, max, length) local length = length or 12 local fraction_filled = current / max local fraction_changed = math.abs(change / max) local characters_filled = math.min(length, math.floor(length * fraction_filled)) local characters_changed = math.min(length, math.ceil(length * fraction_changed)) local filled = ''..string.rep('=', characters_filled)..'' local lost = ''..string.rep('-', characters_changed)..'' local rest = string.rep('-', length - characters_filled - characters_changed) return ' '..filled..lost..rest..' ' end function bighit(hp_loss, hp_max, fraction) if hp_loss >= 0 then return '' end -- Add '!' per every 10th of HP by default multiplier = fraction and 1/fraction or 10 local fraction_changed = math.abs(hp_loss / hp_max) local ouch = string.rep('!', math.floor(fraction_changed * multiplier)) return ouch == '' and '' or ' '..ouch end function announce_damage() local hp_curr, hp_max = you.hp() local mp_curr, mp_max = you.mp() -- Skips message on initializing game if prev_hp ~= nil and prev_mp ~= nil then local hp_diff = hp_curr - prev_hp local mp_diff = mp_curr - prev_mp local message = nil if hp_diff < 0 then message = string.format("HP: %s/%s (%s)", hp_curr, hp_max, hp_diff) end if mp_diff < 0 then if hp_diff < 0 and mp_diff < 0 then message = message .. ' ' end message = (message or '') .. string.format("MP: %s/%s (%s)", mp_curr, mp_max, mp_diff) end if message ~= nil then if hp_diff < 0 then -- Always warn about HP loss message = message..bar(hp_curr, hp_diff, hp_max) message = message..bighit(hp_diff, hp_max) end local channel = hp_curr < hp_max * 0.5 and "danger" or hp_diff < 0 and "warning" or "plain" crawl.mpr(message, channel) end end -- Set previous hp/mp and form at end of turn prev_hp = hp_curr prev_mp = mp_curr end -- Run every player turn function ready() -- Display damage taken in log announce_damage() end >