###################################################################### # General Settings # ###################################################################### # Force more # Set Alias more := force_more_message stop := runrest_stop_message more += The blast of calcifying dust hits you[^r] # New (0.28) action panel settings action_panel_show = true action_panel_show_unidentified = true # Prevents Wu Jian wall move by moving into a wall. #wall_jump_move = false # use magic with Tab #automagic_enable = true # fire slot a with Tab automagic_slot = a # percentage of MP to stop automagic automagic_stop = 25 # Throw missiles with 'f.' when using tab autofight_fire_stop = true # Stops tab fighting at 65% health autofight_stop = 65 # Autofight will attempt to escape webs or nets that are holding you, even if no enemies are in view autofight_caught = true # Don't throw throwables when using tab autofight_throw = false # Try it. Clears messages between player actions clear_messages = false # Sets skill training to manual default_manual_training = true # Force uppercase Y on dangerous questions easy_confirm = safe # 'W'ear will also allow you to 'T'ake off worn armour, and vice versa, and the same is true for 'P'utting on / 'R'emoving jewellery equip_unequip = false # Auto rest before auto explore explore_auto_rest = false # How long auto-explore waits after each move (milliseconds) explore_delay = -1 hp_colour = 100:green, 99:lightgrey, 75:yellow, 50:lightred, 25:red # Gives warning when HP under 50% hp_warning = 50 mp_colour = 100:green, 99:lightgrey, 75:yellow, 50:lightred, 25:red # Gives warning when MP under 40% mp_warning = 40 # Only shows red threat levels on tiles tile_show_threat_levels = nasty # Monster list colors monster_list_colour = monster_list_colour += friendly:green,neutral:brown monster_list_colour += good_neutral:brown,strict_neutral:brown monster_list_colour += trivial:darkgrey,easy:lightgrey monster_list_colour += tough:yellow,nasty:lightred # How long resting waits after each move (milliseconds) rest_delay = -1 # If true, only stop resting when both HP/MP are full rest_wait_both = false # Shows 'more' prompts when outputting more than one screen of messages show_more = false # Highlights the path taking during autoexplore or travel show_travel_trail = true # If true, disables smart targeting for explosion and bouncing bolt spells simple_targeting = false # Items are sorted according to the order provided sort_menus = true:equipped,identified,basename,art,ego,glowing,qualname,curse,slot # Color stats if they drop below a given value. stat_colour = 3:red, 7:lightred # How long travel waits after each move (milliseconds) travel_delay = -1 # Controls the speed of animations view_delay = 300 # Disables mouse control tile_web_mouse_control = false # Always show Zot clock always_show_zot = true # Disables zoom when using X mode tile_map_scale = 1 # Shows plain menus, without icons tile_menu_icons = true # Displays the player using the monster tile for their species tile_player_tile = playermons # Adjusts how much autoexplore favours attempting to discover room perimeters and corners. # At values higher than 0, autoexplore will more heavily favour visiting squares that are next to walls # reasonable values range from 0 to 10 maybe? # Try it. explore_wall_bias = 2 # Safe HP for walking onto traps trapwalk_safe_hp = dart:15,needle:25,arrow:25,bolt:30,spear:20,axe:40,blade:50 # Fire order fire_order = launcher fire_order += rock, dart, javelin, boomerang, stone, net fire_order += inscribed # Screen flashes flash_screen_message += distortion flash_screen_message += You feel strangely unstable flash_screen_message += Strange energies course through your body # Ignores butterflies runrest_ignore_monster += butterfly:1 # Documented as delay_safe_poison? Change it? runrest_ignore_poison = 3:30 # Explore stop config explore_stop = glowing_items, artefacts, runes, shops, branches, altars, portals, runed_doors, stairs, greedy_pickup_smart #explore_stop += greedy_items, greedy_pickup_smart # My personal keybindings. # The full list of CMD_* is at cmd-keys.h bindkey = [g] CMD_AUTOFIGHT_NOMOVE bindkey = [s] CMD_WEAPON_SWAP bindkey = ['] CMD_PREV_CMD_AGAIN # Force all movements to be deliberate while enemies are in LOS. bindkey = [B] CMD_MOVE_DOWN_LEFT bindkey = [H] CMD_MOVE_LEFT bindkey = [J] CMD_MOVE_DOWN bindkey = [K] CMD_MOVE_UP bindkey = [L] CMD_MOVE_RIGHT bindkey = [N] CMD_MOVE_DOWN_RIGHT bindkey = [U] CMD_MOVE_UP_RIGHT bindkey = [Y] CMD_MOVE_UP_LEFT bindkey = [b] CMD_SAFE_MOVE_DOWN_LEFT bindkey = [h] CMD_SAFE_MOVE_LEFT bindkey = [j] CMD_SAFE_MOVE_DOWN bindkey = [k] CMD_SAFE_MOVE_UP bindkey = [l] CMD_SAFE_MOVE_RIGHT bindkey = [n] CMD_SAFE_MOVE_DOWN_RIGHT bindkey = [u] CMD_SAFE_MOVE_UP_RIGHT bindkey = [y] CMD_SAFE_MOVE_UP_LEFT ################################# # damage announcements messages # # HDamage.rc # # Updated 2018-05-02 57f0e26 # ################################# < local previous_hp = 0 local previous_mp = 0 local previous_form = "" local was_berserk_last_turn = false function AnnounceDamage() local current_hp, max_hp = you.hp() local current_mp, max_mp = you.mp() --Things that increase hp/mp temporarily really mess with this local current_form = you.transform() local you_are_berserk = you.berserk() local max_hp_increased = false local max_hp_decreased = false if (current_form ~= previous_form) then if (previous_form:find("dragon") or previous_form:find("statue") or previous_form:find("tree") or previous_form:find("ice")) then max_hp_decreased = true elseif (current_form:find("dragon") or current_form:find("statue") or current_form:find("tree") or current_form:find("ice")) then max_hp_increased = true end end if (was_berserk_last_turn and not you_are_berserk) then max_hp_decreased = true elseif (you_are_berserk and not was_berserk_last_turn) then max_hp_increased = true end --crawl.mpr(string.format("previous_form is: %s", previous_form)) --crawl.mpr(string.format("current_form is: %s", current_form)) --crawl.mpr(string.format("max_hp_increased is: %s", max_hp_increased and "True" or "False")) --crawl.mpr(string.format("max_hp_decreased is: %s", max_hp_decreased and "True" or "False")) --crawl.mpr(string:format("you_are_berserk is: %s", you_are_berserk and "True" or "False")) --crawl.mpr(string:format("was_berserk_last_turn is: %s", was_berserk_last_turn and "True" or "False")) --Skips message on initializing game if previous_hp > 0 then local hp_difference = previous_hp - current_hp local mp_difference = previous_mp - current_mp if max_hp_increased or max_hp_decreased then if max_hp_increased then crawl.mpr("You now have " .. current_hp .. "/" .. max_hp .. " hp.") else crawl.mpr("You now have " .. current_hp .. "/" .. max_hp .. " hp.") end else --On losing health if (current_hp < previous_hp) then if current_hp <= (max_hp * 0.30) then crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.") elseif current_hp <= (max_hp * 0.50) then crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.") elseif current_hp <= (max_hp * 0.70) then crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.") elseif current_hp <= (max_hp * 0.90) then crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.") else crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.") end if hp_difference > (max_hp * 0.20) then crawl.mpr("MASSIVE DAMAGE!!") end end --On gaining more than 1 health if (current_hp > previous_hp) then --Removes the negative sign local health_inturn = (0 - hp_difference) if (health_inturn > 1) and not (current_hp == max_hp) then if current_hp <= (max_hp * 0.30) then crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.") elseif current_hp <= (max_hp * 0.50) then crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.") elseif current_hp <= (max_hp * 0.70) then crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.") elseif current_hp <= (max_hp * 0.90) then crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.") else crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.") end end if (current_hp == max_hp) then crawl.mpr("Health restored: " .. current_hp .. "") end end --On gaining more than 1 magic if (current_mp > previous_mp) then --Removes the negative sign local mp_inturn = (0 - mp_difference) if (mp_inturn > 1) and not (current_mp == max_mp) then if current_mp < (max_mp * 0.25) then crawl.mpr("You regained " .. mp_inturn .. " mp, and now have " .. current_mp .. "/" .. max_mp .. " mp.") elseif current_mp < (max_mp * 0.50) then crawl.mpr("You regained " .. mp_inturn .. " mp, and now have " .. current_mp .. "/" .. max_mp .. " mp.") else crawl.mpr("You regained " .. mp_inturn .. " mp, and now have " .. current_mp .. "/" .. max_mp .. " mp.") end end if (current_mp == max_mp) then crawl.mpr("MP restored: " .. current_mp .. "") end end --On losing magic if current_mp < previous_mp then if current_mp <= (max_mp / 5) then crawl.mpr("You now have " .. current_mp .. "/" ..max_mp .." mp.") elseif current_mp <= (max_mp / 2) then crawl.mpr("You now have " .. current_mp .. "/" ..max_mp .." mp.") else crawl.mpr("You now have " .. current_mp .. "/" ..max_mp .." mp.") end end end end --Set previous hp/mp and form at end of turn previous_hp = current_hp previous_mp = current_mp previous_form = current_form was_berserk_last_turn = you_are_berserk end > ###################################################################### # Character Dump (Morgue) # ###################################################################### dump_order = header, hiscore, stats, misc, mutations, skills, spells, inventory dump_order += overview, screenshot, monlist, messages, skill_gains, action_counts dump_order += vaults, notes, kills, turns_by_place, kills_by_place, xp_by_level # Number of last messages to be displayed dump_message_count = 30 note_items += amulet, ring of, potion, scroll, Archmagi note_items += crystal plate armour, pearl dragon scales note_items += of Zot, acquirement, artefact note_hp_percent = 25 note_all_skill_levels = true note_xom_effects = true # Logs chat messages into the notes note_chat_messages = false # Prefixes manually added notes with the >> string, to make them easier to find user_note_prefix = >> # Notes when your draconian scales turn a color note_messages += Your scales start note_messages += protects you from harm note_messages += You fall through a shaft note_messages += banish.*Abyss note_messages += cast.*Abyss note_messages += You feel monstrous note_messages += You pass through the gate # Use the notes in the character dump to spoil information about whether an # enemy has been seen before (i.e. have I now killed the same demonologist # from which I have fled earlier or was this a different one?). note_monsters += Brimstone Fiend note_monsters += Ice Fiend note_monsters += Tzitzimitl note_monsters += caustic shrike note_monsters += curse skull note_monsters += curse toe note_monsters += entropy weaver note_monsters += ancient lich note_monsters += pearl dragon note_monsters += orb of fire note_monsters += greater mummy note_monsters += killer klown, electric golem ###################################################################### # Ability Slots # ###################################################################### ability_slot += Invisibility:iv # Abilities prone to miskeys. ability_slot += Blink:IB ability_slot += Berserk:k ability_slot += Corrupt:C ability_slot += Enter the Abyss:E ###################################################################### # Item Slots # ###################################################################### item_slot ^= amulet of faith : T item_slot ^= amulet of guardian spirit:G item_slot ^= amulet of mana regeneration : r item_slot ^= amulet of regeneration:R item_slot ^= amulet of the acrobat : A item_slot ^= potions? of curing:q item_slot ^= potions? of heal wounds:l item_slot ^= potions? of haste:h item_slot ^= potions? of might:d item_slot ^= potions? of attraction:s item_slot ^= potions? of resistance:n item_slot ^= ring of evasion : Ee item_slot ^= ring of flight : L item_slot ^= ring of poison resistance:P item_slot ^= ring of positive energy:N item_slot ^= ring of protection from cold:I item_slot ^= ring of protection from fire:F item_slot ^= ring of protection from magic:mM item_slot ^= ring of resist corrosion:C item_slot ^= ring of see invisible:S item_slot ^= ring of slaying : Yy item_slot += ring of magical power : M item_slot ^= ring of wizardry : W item_slot ^= scrolls? of blinking:B item_slot ^= scrolls? of fear:g item_slot ^= scrolls? of fog:z item_slot ^= scrolls? of identify:i item_slot ^= scrolls? of teleportation:t item_slot ^= stones?:Q item_slot ^= poisoned darts?:f item_slot ^= sling bullets?:q item_slot ^= the ring.*rC\+:I item_slot ^= the ring.*rF\+:F item_slot ^= wand of digging:D item_slot ^= condenser vane:C ###################################################################### # Spell Slots # ###################################################################### spell_slot += Absolute Zero:zbtlr spell_slot += Alistair's intoxication:txc spell_slot += Apportation:aoi spell_slot += Airstrike:ktA spell_slot += Aura of abjuration:auo spell_slot += Agony:yng spell_slot += Animate dead:dmn spell_slot += Animate skeleton:snk spell_slot += Beastly appendage:eau spell_slot += Blade hands:bhld spell_slot += Blink:BOAE spell_slot += Bolt of magma:bmtg spell_slot += Borgnjor's revivification:OEI spell_slot += Borgnjor's vile clutch:vbc spell_slot += Call canine familiar:fcn spell_slot += Call imp:cpl spell_slot += Cause fear:cfr spell_slot += Controlled blink:oia spell_slot += Corona:zcn spell_slot += Chain lightning:cln spell_slot += Confusing touch:oui spell_slot += Conjure flame:cfj spell_slot += Corpse rot:crt spell_slot += Dazzling Flash:dzlf spell_slot += Darkness:aed spell_slot += Death channel:dtcl spell_slot += Death's door:EAOI spell_slot += Discord:DCSR spell_slot += Disjunction:iuoe spell_slot += Dispel undead:ndp spell_slot += Dispersal:iea spell_slot += Dragon form:dgrf spell_slot += Dragon's call:dcl spell_slot += Ensorcelled hibernation:zxc spell_slot += Excruciating wounds:eao spell_slot += Fire storm:fmt spell_slot += Fireball:fbl spell_slot += Flame wave: fwl spell_slot += Foxfire:zfxr spell_slot += Freezing cloud:fcg spell_slot += Freeze:zfr spell_slot += Frozen Ramparts:rptzf spell_slot += Fulminant prism:fpm spell_slot += Gell's Gravitas:gvt spell_slot += Hailstorm:htn spell_slot += Haunt:htn spell_slot += Hydra form:hydf spell_slot += Ice form:crmf spell_slot += Ignition:ntg spell_slot += Iron shot:stnr spell_slot += Infusion:uoi spell_slot += Inner flame:frn spell_slot += Invisibility:ieI spell_slot += Irradiate:rtd spell_slot += Iskenderun's battlesphere:bnk spell_slot += Leda's Liquefaction:eai spell_slot += Lee's rapid deconstruction:ldr spell_slot += Lesser Beckoning:lbg spell_slot += Lehudib's crystal spear:lcs spell_slot += Lightning bolt:lbt spell_slot += Magic dart:zdt spell_slot += Malign gateway:mgy spell_slot += Mephitic cloud:mcd spell_slot += Metabolic englaciation:mcn spell_slot += Monstrous menagerie:mst spell_slot += Necromutation:eou spell_slot += Olgreb's toxic radiance:oia spell_slot += Orb of destruction:dbn spell_slot += Ozocubu's armour:oau spell_slot += Ozocubu's refrigeration:cbz spell_slot += Pain:zpn spell_slot += Passage of golubria:uoi spell_slot += Passwall:aeu spell_slot += Petrify:pyt spell_slot += Poisonous vapours:pvs spell_slot += Portal projectile:oei spell_slot += Recall:eau spell_slot += Ring of flames:oia spell_slot += Sandblast:zst spell_slot += Searing ray:sry spell_slot += Scorch:sco spell_slot += Shadow creatures:scw spell_slot += Shatter:STH spell_slot += Shock:zok spell_slot += Shroud of golubria:oua spell_slot += Simulacrum:scm spell_slot += Silence:SLC spell_slot += Slow:swh spell_slot += Song of slaying:oaie spell_slot += Spectral weapon:eao spell_slot += Spellforged servitor:svt spell_slot += Spider form:sprf spell_slot += Starburst:stdc spell_slot += Static discharge:tdc spell_slot += Statue form:stmf spell_slot += Sticks to snakes:tkc spell_slot += Sticky flame:yfk spell_slot += Sting:zptg spell_slot += Stone arrow:wtn spell_slot += Summon butterflies:uei spell_slot += Summon demon:dsmn spell_slot += Summon forest:ftms spell_slot += Summon greater demon:gds spell_slot += Summon guardian golem:gds spell_slot += Summon horrible things:hts spell_slot += Summon hydra:hsy spell_slot += Summon ice beast:bct spell_slot += Summon lightning spire:lst spell_slot += Summon mana viper:vms spell_slot += Summon small mammal:zsm spell_slot += Swiftness:ieao spell_slot += Teleport other:tprh spell_slot += Tornado:TDN spell_slot += Tukima's Dance:dkc spell_slot += Vampiric draining:vnd spell_slot += Yara's violent unraveling:yvg # Default letters spell_slot += .*:XYZ ############################################################################ # Auto Inscriptions # ############################################################################ # Set Alias ai := autoinscribe # Overwrite annoying inscriptions with your own # Inscribe distortion weapons if you are not worshipping Lugonu : if you.god() ~= "Lugonu" then ai += distortion:!w ai += (Sonja|Psyche):!w : end # Misc # ai += [Mm]anual of:!d ai += (throwing net|curare):!f ai += the.*Fragile:!w # Consumables ai += (bad|dangerous)_item.*potion:!q ai += potions? of berserk rage:!q ai += potions? of mutation:!q ai += potions? of invisibility:!q ai += potions? of resistance:!q ai += potions? of lignification:!q ai += potions? of ambrosia:!q ai += potions? of haste:!q ai += potions? of brilliance:!q ai += potions? of might:!q ai += potions? of cancellation:!q ai += potions? of heal wounds:!q ai += potions? of magic:!q ai += (bad|dangerous)_item.*scroll:!r ai += scrolls? of blinking:!r ai += scrolls? of holy word:!r ai += scrolls? of magic mapping:!r ai += scrolls? of vulnerability:!r ai += scrolls? of fear:!r ai += scrolls? of summoning:!r ai += scrolls? of silence:!r ai += scrolls? of teleportation:!r # Amulets ai += amulet of faith:Faith, !P ai += amulet of innacuracy:Innacuracy, !P ai += amulet of harm:Harm, !P #autoinscribe_cursed = false # God gifts lose the annotation when identified show_god_gift = unident # Convenient shortcuts ai += potions? of heal wounds:@q1 ai += curing:@q2 ai += remove curse:@r2 ai += identify:@r1 ai += hunting sling:@w1 ###################################################################### # Custom Lua Functions # ###################################################################### -- Opens skill menu at the beginning of the game { local need_skills_opened = true function OpenSkills() if you.turns() == 0 and need_skills_opened then need_skills_opened = false crawl.sendkeys("m") end end } -- The following functions and declarations are needed for custom_rest() { function hp_percent() a,b=you.hp() return 100*a/b end function mp_percent() a,b=you.mp() return 100*a/b end -- Custom rest function (prompt when trying to rest at full HP) -- Bind via macro definition: -- M:5 -- A:===custom_rest function custom_rest() if ((hp_percent() == 100 and mp_percent() == 100) or you.race() == "Deep Dwarf") and (you.corrosion() == 0 and not you.slowed() and not you.exhausted()) then --if (hp_percent() == 100 and mp_percent() == 100 and you.corrosion() == 0 and not you.slowed() and not you.exhausted()) or you.race() == "Deep Dwarf" then if crawl.yesnoquit("Wait 100 turns?", true, 'n') == 1 then crawl.process_keys("5") end else crawl.process_keys("5") end end } { --------------------------------------- ---- Begin gammafunk's autopickup ----- --------------------------------------- -- Equipment autopickup (by Medar and various others) local function pickup_equipment(it, name) if it.is_useless then return end local class = it.class(true) if class == "armour" then local good_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots"} st, _ = it.subtype() -- Autopickup found aux armour if 1) we don't have any or 2) it's artefact, -- or 3) if we don't have artefact or ego armour, and the found armour is -- ego. if good_slots[st] ~= nil then if good_slots[st] == "Gloves" and you.has_claws() > 0 then return end if it.artefact then return true end local cur = items.equipped_at(good_slots[st]) if cur == nil then return true end if cur.branded or cur.artefact then return end if it.branded then return true end -- Autopickup found body armour of the same kind we're wearing, according -- to conditions (2) and (3) above used for aux slots. elseif st == "body" then local cur = items.equipped_at("armour") if cur == nil then return end if cur.name("qual") ~= it.name("qual") then return end if it.artefact then return true end if cur.branded or cur.artefact then return end if it.branded then return true end end end return end add_autopickup_func(pickup_equipment) } ------------------------------------- ---- End gammafunk's autopickup ----- ------------------------------------- { --------------------------------------- ---- Begin gammafunk's force_mores ---- --------------------------------------- last_turn = you.turns() -- Each entry must have a 'name' field with a descriptive name, a 'pattern' -- field, a 'cond' field giving the condition type, and a 'cutoff' field giving -- the max value for where the force_more will apply. Possible values for -- 'cond' are xl and maxhp. -- -- The 'pattern' field's value can be either a regexp string or array of regexp -- strings matching the appropriate monster(s). Any values are joined by "|" to -- make a new force_more of the form: -- -- ((?!spectral )VALUE1|VALUE2|...)(?! (skeleton|zombie|simularcrum)).*into view". -- -- To allow derived undead forms of a monster to match, include 'spectral ' at -- the beginning of and/or ' (skeleton|zombie|simularcrum)' at the end of your -- pattern for that monster. fm_patterns = { -- Fast, early game Dungeon problems for chars with low mhp. {name = "30mhp", cond = "maxhp", cutoff = 30, pattern = "adder|hound"}, -- Dungeon monsters that can damage you for close to 50% of your mhp with a -- ranged attack. {name = "40mhp", cond = "maxhp", cutoff = 40, pattern = "orc priest|electric eel"}, {name = "60mhp", cond = "maxhp", cutoff = 60, pattern = "acid dragon|steam dragon|manticore"}, {name = "70mhp", cond = "maxhp", cutoff = 70, pattern = "centaur(?! warrior)|meliai|yaktaur(?! captain)"}, {name = "80mhp", cond = "maxhp", cutoff = 80, pattern = "gargoyle|orc (warlord|knight)"}, {name = "90mhp", cond = "maxhp", cutoff = 90, pattern = {"centaur warrior", "deep elf archer", "efreet", "molten gargoyle", "tengu conjurer"} }, {name = "110mhp", cond = "maxhp", cutoff = 110, pattern = {"centaur warrior", "deep elf (mage|knight)", "cyclops", "efreet", "molten gargoyle", "tengu conjurer", "yaktaur captain", "necromancer", "deep troll earth mage", "hell knight", "stone giant"} }, {name = "160mhp", cond = "maxhp", cutoff = 160, pattern = {"(fire|ice|quicksilver|shadow|storm) dragon", "(fire|frost) giant", "war gargoyle", "draconian (knight|stormcaller"} } } -- end fm_patterns -- TODO ultraviolent4 fm_patterns. Uncomment and substitute the previous ones to use these -- fm_patterns = { -- {name = "XL5", cond = "xl", cutoff = 5, pattern = "adder|gnoll"}, -- {name = "XL8", cond = "xl", cutoff = 8, pattern = "ogre|centaur|orc wizard|scorpion|worker ant"}, -- {name = "XL15", cond = "xl", cutoff = 15, pattern = "two-headed ogre|centaur warrior|orc (warlord|knight)"}, -- {name = "50mhp", cond = "maxhp", cutoff = 50, pattern = "orc priest|electric eel"}, -- {name = "60mhp", cond = "maxhp", cutoff = 60, pattern = "acid dragon|steam dragon|manticore"}, -- {name = "70mhp", cond = "maxhp", cutoff = 70, pattern = "meliai"} -- } -- end fm_patterns active_fm = {} -- Set to true to get a message when the fm change notify_fm = false -- Wrapper of crawl.mpr() that prints text in white by default. if not mpr then mpr = function (msg, color) if not color then color = "white" end crawl.mpr("<" .. color .. ">" .. msg .. "") end end function init_force_mores() for i,v in ipairs(fm_patterns) do active_fm[#active_fm + 1] = false end end function update_force_mores() local activated = {} local deactivated = {} local hp, maxhp = you.hp() for i,v in ipairs(fm_patterns) do local msg = nil if type(v.pattern) == "table" then for j, p in ipairs(v.pattern) do if msg == nil then msg = p else msg = msg .. "|" .. p end end else msg = v.pattern end msg = "(?= v.cutoff then action = "-" elseif not active_fm[i] and you.xl() < v.cutoff then action = "+" end elseif v.cond == "maxhp" then if active_fm[i] and maxhp >= v.cutoff then action = "-" elseif not active_fm[i] and maxhp < v.cutoff then action = "+" end end if action == "+" then activated[#activated + 1] = fm_name elseif action == "-" then deactivated[#deactivated + 1] = fm_name end if action ~= nil then local opt = "force_more_message " .. action .. "= " .. msg crawl.setopt(opt) active_fm[i] = not active_fm[i] end end if #activated > 0 and notify_fm then mpr("Activating force_mores: " .. table.concat(activated, ", ")) end if #deactivated > 0 and notify_fm then mpr("Deactivating force_mores: " .. table.concat(deactivated, ", ")) end end local last_turn = nil function force_mores() if last_turn ~= you.turns() then update_force_mores() last_turn = you.turns() end end init_force_mores() ------------------------------------- ---- End gammafunk's force_mores ---- ------------------------------------- } { function ready() AnnounceDamage() force_mores() OpenSkills() end }