##### Crawl Init file ###############################################
# For descriptions of all options, as well as some more in-depth information
# on setting them, consult the file
# options_guide.txt
# in your /docs directory. If you can't find it, the file is also available
# online at:
# https://github.com/crawl/crawl/blob/master/crawl-ref/docs/options_guide.txt
# Show warning color when HP falls below this percentage
hp_warning = 70
# Delay (ms) for visual monster movement animations
view_delay = 300
# Delay between steps during auto-travel (-1 = none)
travel_delay = -1
# Delay between steps during auto-explore (-1 = none)
explore_delay = -1
# Delay between rest ticks (-1 = none)
rest_delay = -1
# Stop autofight when HP falls below this percentage
autofight_stop = 80
# Wait for both HP and MP to fully recover when resting
rest_wait_both = true
# Automatically rest when autoexplore sees low HP/MP
explore_auto_rest = true
# Disable paged --more-- prompts for general messages
show_more = false
# Show currently equipped items in a status bar (console only)
equip_bar = true
# Use manual skill training by default
default_manual_training = true
# Stop autofight if you're caught in a net or web
autofight_caught = true
# Do nothing (instead of waiting) if no enemy is in range for autofight
autofight_wait = false
# Bind tilde (~) key to open Lua console
bindkey = [~] CMD_LUA_CONSOLE
# Show "god gift" tag only on unidentified gifted items
show_god_gift = unident
msc := message_colour
msc += mute:returns to your side
msc += mute:a demon appears
msc += mute:puff of smoke
msc += mute:carefully avoids
msc += mute:is recalled
msc += mute:dissolves? into (sparkling lights|shadows)
msc += mute:(crumbles|melts) away\.
msc += mute:(merges|forms) itself .* the air
msc += mute:you swap places
msc += mute:your.*(looks stronger|shudders|resists)
msc += mute:your.*(stumbles backwards|holds.*ground)
msc += mute:your.*(blinks|safely over)
msc += mute:(phases out.*|misses) (your|something).*
msc += mute:your.*(picks up|drops)
msc += mute:your.*basks in the mutagenic energy
msc += mute:your.*(struggles|tears|pulls away).*(web|net)
mons := mon_glyph
# Monsters that can be easy to miss
mons ^= * : ✱
mons ^= dancing weapon : cyan {
mons ^= spectral weapon : lightcyan {
# Classed Demonspawn
mon += blood saint:9
mon += warmonger:9
mon += corrupter:9
mon += black sun:9
more := force_more_message
: if you.god() == "Ashenzari" then
more += You have a vision of.*gates?
: end
more += The mighty Pandemonium lord .* resides here
# Interrupts
more += You don't .* that spell
more += You fail to use your ability
more += You miscast.*(Blink|Borgnjor|Door|Invisibility)
more += You can't (read|drink|do)
more += You cannot .* while unable to breathe
more += You cannot .* in your current state
more += when .*silenced
more += too confused
more += There's something in the way
more += There's nothing to (close|open) nearby
more += not good enough to have a special ability
more += You are too berserk
more += no means to grasp
more += That item cannot be evoked
more += You are held in a net
more += You don't have any such object
more += You can't unwield
more += enough magic points
more += You don't have the energy to cast that spell
more += You are unable to access your magic
# Bad things
more += Your surroundings flicker
more += You cannot teleport right now
more += A sentinel's mark forms upon you
more += (blundered into a|invokes the power of) Zot
more += enter a teleport trap
more += Ouch! That really hurt!
more += dispelling energy hits you
more += You are blasted by holy energy!
more += You are (blasted|electrocuted)!
more += You are.*(confused|poisoned)
more += god:(sends|finds|silent|anger)
more += You feel a surge of divine spite
more += disloyal to dabble
more += lose consciousness
more += You are too injured to fight blindly
more += calcifying dust hits
more += Space warps.*around you
more += Space bends around you
more += watched by something
more += flickers and vanishes!
more += doesn't seem very happy
more += is no longer charmed
# Hell effects
more += hell_effect:
# Expiring effects
more += You feel yourself slow down
more += You are starting to lose your buoyancy
more += Your hearing returns
more += time is quickly running out
more += life is in your own hands
more += You start to feel a little slower
more += You feel less protected from missiles
# Others
more += You have reached level
more += You rejoin the land of the living
more += You have finished (your manual|forgetting about)
more += Your scales start
more += You feel monstrous
more += Jiyva alters your body
: if you.god() == "Xom" then
more += god:
: end
# Dangerous monsters we force_more when first seen.
# Things with ranged (or extremely fast), irresistable effects.
more += ((glass|shining) eye|dream sheep|death drake).*into view
more += (wretched star|apocalypse crab|death drake).*into view
more += (entropy weaver|torpor snail|spriggan druid).*into view
more += (vault (warden|sentinel)|merfolk (avatar|siren)).*into view
more += (guardian serpent|draconian shifter|convoker|death cob).*into view
more += (phantasmal warrior).*into view
# Paralysis/Petrify/Banish
more += (orc sorcerer|(? 0.1 then told10 = false end
if pct > 0.3 then told30 = false end
if pct > 0.5 then told50 = false end
if pct > 0.7 then told70 = false end
if pct <= 0.1 and not told10 then
crawl.mpr("[HP_WARN] Health below 10%")
told10, told30, told50, told70 = true, true, true, true
return
end
if pct <= 0.3 and not told30 then
crawl.mpr("[HP_WARN] Health below 30%")
told30, told50, told70 = true, true, true
return
end
if pct <= 0.5 and not told50 then
crawl.mpr("[HP_WARN] Health below 50%")
told50, told70 = true, true
return
end
if pct <= 0.7 and not told70 then
crawl.mpr("[HP_WARN] Health below 70%")
told70 = true
return
end
end
}
{
---------------------------
---- Begin force_mores ----
---------------------------
-- See README.md for documentation.
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|simulacrum)).*into view".
--
-- To allow derived undead forms of a monster to match, include 'spectral ' at
-- the beginning of and/or ' (skeleton|zombie|simulacrum)' 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
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 .. "" .. color .. ">")
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 force_mores ----
-------------------------
}
# The ready() function is needed for code that has to process each turn or UI
# action.
{
function ready()
-- Open skill screen on turn 0.
if not skills_set and you.turns() == 0 then
crawl.sendkeys("m")
skills_set = true
end
-- force_mores.lua
force_mores()
update_health_force_more()
end
}