##########
# Macros #
##########
#F1 set explore speed to minions
macros += K \{-265} \{20}
#F4 unhide spells
macros += M \{-268} M!!!
#Num0 target summon
macros += M \{-1000} ta
#Num+ Autoexplore
macros += K \{-1016} o
#Num- Autocast
macros += K \{-1018} p
#Num0 target summon numlock off
macros += M \{-1000} ta
#Num+ Autoexplore numlock off
macros += K \{-1016} o
#Num- Autocast numlock off
macros += K \{-1018} p
macros += M 1 za
macros += M 2 zb
macros += M 3 zc
macros += M 4 zd
#########################
# Tweakable Settings #
#########################
default_manual_training = true
autofight_stop = 50
show_more = false
hp_warning = 50
fail_severity_to_confirm = 4
###########
# Testing #
###########
travel_open_doors = approach
always_show_zot = true
menu_arrow_control = false
explore_auto_rest = true
jewellery_prompt = false
enable_recast_spell = false
cloud_status = true
hp_colour = 75:yellow, 50:lightred, 25:red
#hp_colour =85:lightgreen, 67:lightcyan, 50:yellow, 35:lightmagenta, 25:red
monster_item_view_coordinates = true
#skill_focus = false
game_scale = 4
tile_show_minihealthbar = false
tile_show_minimagicbar = false
tile_viewport_scale = 1.0
#################
# Lua Functions #
#################
###############
# 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("OW! MY ORGANS!!")
-- 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
}
####################
# Equipment Pickup #
####################
{
-- 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)
}
##############
# Warn Wands #
##############
{
local wand = true
function Wand_Check()
if you.xl() <= 12 and wand and string.gmatch(crawl.messages(5), "carrying a wand")() then
crawl.yesno("Warning: an enemy near you is armed with a wand! (Y or N to confirm.)", false, false, true, true)
crawl.mpr("Neutralize or avoid the wand carrier ASAP!")
wand = false
end
if string.gmatch(crawl.messages(1), "restored")() then
wand = true
end
end
}
##################
# Ready Function #
##################
{
local need_skills_opened = true
function ready()
AnnounceDamage()
-- Skill menu at game start by rwbarton
if you.turns() == 0 and need_skills_opened then
need_skills_opened = false
crawl.sendkeys("m")
end
end
}
#############
# Interface #
#############
autofight_throw = false
autofight_throw_nomove = false
show_travel_trail = true
travel_delay = -1
rest_delay = -1
explore_wall_bias = 0
explore_key_stop = true
show_game_time = true
warn_hatches = true
equip_unequip = true
allow_self_target = false
sort_menus = true : equipped, identified, basename, qualname
auto_hide_spells = true
wall_jump_move = false
##############
# Autopickup #
##############
autopickup = $?!+"/}|
ae := autopickup_exceptions
# autopickup artifacts
ae += scrolls? of (vulnerability|amnesia|enchant|brand)
ae ^= potions? of (attraction|lign|mut)
ae += atropa
ae += datura
ae +=