< function ready() AnnounceDamage() end > ################### # Quality of life # ################### # Zooms the game in a bit tile_viewport_scale = 4 # How long auto-explore waits after each move (milliseconds). Depends on # platform. In particular, setting travel_delay = -1 and # explore_delay = 20 means you will see the individual moves of # autoexplore, but not the individual moves of other forms of travel. # Setting to -1 means the auto-explore delay will be the same as # travel_delay. explore_delay = 10 # When set to true, the path taken during autoexplore or travel # will be highlighted. The console colour and glyph of the travel trail # can be further configured using the feature option to override the # "travel trail" feature. If a travel trail is currently being displayed, # the Clear Map command (Ctrl-C) clears the trail instead of the map # (pressing it a second time then clears the map as usual). show_travel_trail = false default_manual_training = true # Cannot target self with risky magic allow_self_target = no ############# # Interface # ############# view_delay = 300 hp_colour = 100:lightgreen, 99:lightgray, 75:yellow, 50:lightred, 25:red hp_warning = 50 # always_show_zot determines whether to show the "Zot" status light at all times # even when you've got plenty of time left. defaults to `false` always_show_zot = true # tile_player_tile ######################## # Minimap color scheme # ######################## tile_upstairs_col = #99ff33 tile_downstairs_col = #00ff20 tile_branchstairs_col = #ff1a1a tile_portal_col = #ff1a1a tile_door_col = #cb6d4d tile_wall_col = #595959 tile_explore_horizon_col = #bfbfbf tile_floor_col = #262626 tile_item_col = #262626 tile_feature_col = #d4be21 tile_plant_col = #5c8745 tile_water_col = #0086b3 tile_deep_water_col = #1f1fed tile_trap_col = #d24dff tile_transporter_col = #ff80bf tile_transporter_landing_col = #59ff89 tile_lava_col = #6f0b00 # ############### # Auto Pickup # ############### autopickup += $?!:"/}( { add_autopickup_func(function(it, name) if it.is_useless then return false end if name:find("dispersal") and name:find("boomerang") then return true end if name:find("throwing net") then return true end local class = it.class(true) local armour_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots", body="body Armour", shield="Shield"} if (class == "armour") then sub_type = it.subtype() equipped_item = items.equipped_at(armour_slots[sub_type]) if (sub_type == "cloak") or (sub_type == "helmet") or (sub_type == "gloves") or (sub_type == "boots") then if (you.race() == "Octopode") then if sub_type == "helmet" then return it.artefact or it.branded or it.ego end return false end if you.race() == "Minotaur" then if sub_type == "helmet" then return it.artefact or it.branded or it.ego end end if you.race() == "Felid" then return false end if not equipped_item then return true else return it.artefact or it.branded or it.ego end end if (sub_type == "body") then if you.race():find("Draconian") then return false end if you.race() == "Felid" then return false end if you.race() == "Octopode" then return false end if equipped_item then local armourname = equipped_item.name() if equipped_item.artefact or equipped_item.branded or equipped_item.ego or (equipped_item.plus > 2) or armourname:find("dragon") or armourname:find("troll") then return it.artefact else return it.artefact or it.branded or it.ego end end return true end if (sub_type == "shield") then if equipped_item then if equipped_item.artefact or equipped_item.branded or equipped_item.ego or (equipped_item.plus > 2) then return it.artefact or it.branded or it.ego else return true end else return it.artefact or it.branded or it.ego end end end end) } ############### # Damage Calc # ############### { 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 } ######################