##### Crawl Init file ############################################### # For descriptions of options, see options_guide.txt in your /docs directory. # That file is also available online at: # https://github.com/b-crawl/bcrawl/blob/master/crawl-ref/docs/options_guide.txt ##### typical speedrun settings (remove # to enable): #view_delay = 0 explore_delay = -1 travel_delay = -1 rest_delay = -1 show_travel_trail = true #use_animations -= beam rest_wait_both = true tile_full_screen = false auto_butcher = true auto_butcher_max_chunks = 2 easy_eat_chunks = true default_manual_training = true ability_menu = true spell_menu = true autofight_stop = 69 # Any uniques and any pan lords force_more_message += (?-i:[A-Z]).* comes? into view force_more_message += You have discovered the spell force_more_message += It's so over # Convenient shortcuts ai += curing:@q1 ai += potions? of heal wounds:@q2 ai += potions? of haste:@q3 ai += scrolls? of teleportation:@r2 ai += identify:@r1 { --------------------------------- --- HP Warnings & Notes --- --------------------------------- -- Print a message and take note when hp goes above or below a certain ratio -- "force_more_message += it's so over" will pause the game when at low hp -- Must include "evaluate_wellbeing()" in your ready() function or this won't work -- Set these two variables as desired -- (currently warning at 30% and celebration at 70%) itsoverratio = .30 werebackratio = .70 function hp_ratio() hp, mhp = you.hp() return hp / mhp end itsover = hp_ratio() <= itsoverratio -- initializing this in case save is loaded at low hp function evaluate_wellbeing() if itsover and hp_ratio() >= werebackratio then crawl.take_note("We're so back!") crawl.mpr("we're so back!") itsover = false elseif not itsover and hp_ratio() <= itsoverratio then hp, mhp = you.hp() crawl.take_note(string.format("It's so over! %d/%d", hp, mhp)) crawl.mpr("it's so over!") itsover = true end end -- Called when it is your turn to act function ready() -- Open skill screen on turn 0. if not skills_set and you.turns() == 0 then crawl.sendkeys("m") skills_set = true end evaluate_wellbeing() end }