##### Crawl Init file ############################################### # Stop using dark blue for unseen tiles # by telling the game that the terminal # can render dark grey bold_brightens_foreground = true # 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_cell_pixels = 42 # 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 # =================== show_more = false fm := force_more_message fm += You feel strangely unstable fm += You feel you are being watched by something fm += wielding.*(distortion|chaos|electrocution|venom) fm += quivering.*tipped darts fm += carrying a wand fm += (Sigmund|Erolcha|Grinder) .* into view fs := flash_screen_message fs += You feel you are being watched by something # Autoinscriptions # ================ ai := autoinscribe ai += potions? of curing:@q1 ai += potions? of heal wounds:@q2 ai += scrolls? of identify:@r1 ai += scrolls? of teleportation:@r2 ai += .*-tipped darts?:=f =F ai += throwing nets?:=f =F ai += boomerangs? of dispersal:=f =F #---------------------------------------------------------------------------- # # LUA # #---------------------------------------------------------------------------- # { local prev_hp = nil local prev_mp = nil 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 and mp_diff < 0 then message = string.format("MP: %s/%s (%s)", mp_curr, mp_max, mp_diff) elseif hp_diff < 0 and mp_diff == 0 then message = string.format("HP: %s/%s (%s)", hp_curr, hp_max, hp_diff) elseif hp_diff < 0 and mp_diff < 0 then message = string.format("HP: %s/%s (%s)", hp_curr, hp_max, hp_diff) message = message .. string.format(" MP: %s/%s (%s)", mp_curr, mp_max, mp_diff) end if message ~= nil then local channel = "plain" if hp_diff < 0 then -- Always warn about HP loss channel = "warning" elseif hp_curr < hp_max * 0.5 then -- Danger below half health channel = "danger" end 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 }