##### 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
#
# Crawl uses the first file of the following list as its option file:
# * init.txt in the -rcdir directory (if specified)
# * .crawlrc in the -rcdir directory (if specified)
# * init.txt (in the Crawl directory)
# * ~/.crawl/init.txt (Unix only)
# * ~/.crawlrc (Unix only)
# * ~/init.txt (Unix only)
# * settings/init.txt (in the Crawl directory)
##### Some basic explanation of option syntax #######################
# Lines beginning with '#' are comments. The basic syntax is:
#
# field = value or field.subfield = value
#
# Only one specification is allowed per line.
#
# The terms are typically case-insensitive except in the fairly obvious
# cases (the character's name and specifying files or directories when
# on a system that has case-sensitive filenames).
#
# White space is stripped from the beginning and end of the line, as
# well as immediately before and after the '='. If the option allows
# multiple comma/semicolon-separated terms (such as
# autopickup_exceptions), all whitespace around the separator is also
# trimmed. All other whitespace is left intact.
#
# There are three broad types of Crawl options: true/false values (booleans),
# arbitrary values, and lists of values. The first two types use only the
# simple =, with later options - which includes your options that are different
# from the defaults - overriding earlier ones. List options allow using +=, ^=,
# -=, and = to append, prepend, remove, and reset, respectively. Usually you will
# want to use += to add to a list option. Lastly, there is := which you can use
# to create an alias, like so:
# ae := autopickup_exceptions
# From there on, 'ae' will be treated as if it you typed autopickup_exceptions,
# so you can save time typing it.
#
##### Other files ###################################################
# You can include other files from your options file using the 'include'
# option. Crawl will treat it as if you copied the whole text of that file
# into your options file in that spot. You can uncomment some of the following
# lines by removing the beginning '#' to include some of the other files in
# this folder.
# Some useful, more advanced options, implemented in LUA.
# include = advanced_optioneering.txt
# Alternative vi bindings for Dvorak users.
# include = dvorak_command_keys.txt
# Alternative vi bindings for Colemak users.
# include = colemak_command_keys.txt
# Alternative vi bindings for Neo users.
# include = neo_command_keys.txt
# Override the vi movement keys with a non-command.
# include = no_vi_command_keys.txt
# Turn the shift-vi keys into safe move, instead of run.
# include = safe_move_shift.txt
##### Ancient versions ##############################################
# If you're used to the interface of ancient versions of Crawl, you may
# get back parts of it by uncommenting the following options:
# include = 034_command_keys.txt
# And to revert monster glyph and colouring changes:
# include = 052_monster_glyphs.txt
# include = 060_monster_glyphs.txt
# include = 071_monster_glyphs.txt
# include = 080_monster_glyphs.txt
# include = 0.9_monster_glyphs.txt
# include = 0.12_monster_glyphs.txt
# include = 0.13_monster_glyphs.txt
# include = 0.14_monster_glyphs.txt
# Crawl Init file
# See the README for further details:
# https://github.com/gammafunk/dcss-rc/blob/master/README.md
###############
### Display ###
###############
view_delay = 300
hp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red
mp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red
hp_warning = 50
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
###############
### Console ###
###############
# Enable use of darkgrey.
bold_brightens_foreground=true
equip_bar = true
## For item_glyph, subsequent matches override previous ones.
item := item_glyph
## Reasonable defaults
item += potion:lightgrey
item += scroll:lightgrey
item += wand:lightgrey
item += dangerous_item:blue
item += useless_item:darkgrey
### Potions ###
item += potions? of.*(curing|flight):lightgrey
: if you.race() == "Vampire" then
item += potions? of blood:lightgrey
: end
item += potions? of.*berserk:brown
item += potions? of.*might:yellow
item += potions? of.*cancellation:cyan
item += potions? of.*ambrosia:blue
item += potions? of.*experience:lightred
item += potions? of.*heal wounds:white
item += potions? of.*(resistance|agility):green
item += potions? of.*(haste|invisibility):lightgreen
item += potions? of.*mutation:lightcyan
item += potions? of.*brilliance:magenta
item += potions? of.*magic:lightmagenta
### Scrolls ###
: if you.race() == "Vampire" or you.race() == "Mummy"
: or you.race() == "Ghoul" then
item += scroll.*holy word:darkgrey
item += scroll.*torment:brown
: else
item += scroll.*holy word:brown
item += scroll.*torment:darkgrey
: end
item += scroll.*acquirement:white
item += scroll.*(summoning):yellow
item += scroll.*identify:cyan
item += scroll.*magic mapping:lightcyan
item += scroll.*(silence|vulnerability|immolation):blue
item += scroll.*remove curse:lightgrey
item += scroll.*(fog|teleport):green
item += scroll.*(fear|blink):lightgreen
item += scroll.*(recharging):magenta
item += scroll.*(enchant|brand weapon):lightmagenta
### Wands ###
# Sometimes dangerous
item += wand of.*random effects:blue
# Single target piercing.
item += wand of.*lightning:brown
item += wand of.*acid:yellow
item += wand of.*flame:lightgrey
item += wand of.*clouds:white
item += wand of.*digging:green
# Single-turn AOE
item += wand of.*iceblast:cyan
item += wand of.*scattershot:lightcyan
item += wand of.*(disintegration|confusion|polymorph):magenta
item += wand of.*(paralysis|enslavement):lightmagenta
### General Identification ###
item += (identified|known).*(jewellery|magical staff):brown
item += identified.*spellbook:magenta
item += unidentified.*(potion|scroll|jewellery|wand|magical staff).*:lightblue
item += unidentified.*book:lightmagenta
item += manual:lightcyan
item += manual of:cyan
### Jewellery ###
item += known.*(ring of (dexterity|strength|intelligence|slaying|evasion|protection(?! from))|amulet of reflection):magenta
item += identified.*artefact.*(jewellery):white
item += unidentified.*artefact.*(jewellery).*:lightmagenta
item += (a )?stones?$:lightgray
### Food ###
item += chunks?.*flesh:lightgrey
item += evil_eating.*chunk:red
item += ( ration):green
# Want this to override anything above
item += useless:darkgrey
# Only mark these types when forbidden; for other types it looks odd.
item += forbidden.*(potion|scroll|food):red
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
# Wall glyphs; requires a font and terminal that can render these.
feature += crystal wall {â–‘}
feature += stone wall {â–’}
feature += metal wall {â–“}
feature += unnaturally hard rock wall {â–ˆ}
feature += altar {âš‘}
#############
### Tiles ###
#############
tile_window_width = 1300
tile_window_height = 700
tile_full_screen = false
tile_map_pixels = 3
###################
### Menu Colors ###
###################
# These should match the item_glyph colours exactly when possible.
# For menu_colour, the first match ignores subsequent matches.
menu := menu_colour
menu =
# Many of the entries below come from dat/defaults/menu_colours.txt,
# which we have to duplicate here since we want only some of the
# entries from that file.
menu += notes:white:Reached XP level
### General Inventory###
# Items currently not affecting you.
menu += darkgrey:(melded)
# Items disliked by your god.
menu += red:forbidden
# Useless items, comes here to override artefacts etc.
menu += darkgrey:.*useless.*
# Handle cursed and equipped items early to override other colour settings.
menu += lightred:.*equipped.* cursed
menu += red: (a|the) cursed
menu += inventory:lightgreen:.*equipped.*
# Colouring of autoinscribed god gifts
menu += pickup:lightred:god gift
# Highlight (partly) selected items
menu += inventory:white:\w \+\s
menu += inventory:white:\w \#\s
### Food ###
# Color chunks, put ordinary ones on lightgrey.
menu += red:evil_eating.*chunk
menu += blue:mutagenic.*chunk
menu += lightgrey: +(chunks?$|chunks? +)
# Other food
menu += green:( ration)
### Potions ###
: if you.race() == "Vampire" then
menu += lightgrey:potions? of blood
: end
menu += lightgrey:potions? of.*(curing|flight)
menu += brown:potions? of.*berserk
menu += yellow:potions? of.*might
menu += cyan:potions? of.*cancellation
menu += blue:potions? of.*(lignification|ambrosia)
menu += lightred:potions? of.*experience
menu += white:potions? of.*heal wounds
menu += green:potions? of.*(resistance|agility)
menu += lightgreen:potions? of.*(haste|invisibility)
menu += lightcyan:potions? of.*mutation
menu += magenta:potions? of.*brilliance
menu += lightmagenta:potions? of.*magic
### Scrolls ###
: if you.race() == "Vampire" or you.race() == "Mummy"
: or you.race() == "Ghoul" then
menu += darkgrey:scroll.*holy word
menu += brown:scroll.*torment
: else
menu += brown:scroll.*holy word
menu += darkgrey:scroll.*torment
: end
menu += white:scroll.*acquirement
menu += yellow:scroll.*(summoning)
menu += cyan:scroll.*identify
menu += lightcyan:scroll.*magic mapping
menu += blue:scroll.*(noise|silence|vulnerability|immolation)
menu += lightgrey:scroll.*remove curse
menu += green:scroll.*(fog|teleport)
menu += lightgreen:scroll.*(fear|blink)
menu += magenta:scroll.*(recharging)
menu += lightmagenta:scroll.*(enchant|brand weapon)
### Wands ###
# Can be harmful
menu += blue:wand of.*random effects
# Damaging beam.
menu += brown:wand of.*flame
menu += yellow:wand of.*acid
menu += white:wand of.*clouds
menu += green:wand of.*digging
# Explosion
menu += cyan:wand of.*iceblast
menu += lightcyan:wand of.*scattershot
# MR-checking
menu += magenta:wand of.*(disintegration|polymorph)
menu += lightmagenta:wand of.*(paralysis|enslavement)
### General identification ###
menu += cyan:manual of
menu += lightcyan:manual
menu += lightmagenta:unidentified.*artefact.*
menu += white:.*artefact.*
menu += lightblue:unidentified .*(potion|scroll|wand|jewellery|spellbook|rod|magical staff)
menu += magenta:.*known .*(ring of (dexterity|strength|intelligence|slaying|evasion|protection(?! from))|amulet of reflection)
menu += inventory:lightgray:.*(book|jewellery|magical staff)
# Ego items
menu += lightblue:unidentified.*weapon.*(runed|glowing|enchanted)
menu += lightblue:unidentified.*armour.*(runed|glowing|embroidered|shiny|dyed)
#################
### Interface ###
#################
default_manual_training = true
easy_eat_chunks = true
equip_unequip = true
sort_menus = true:equipped,identified,basename,art,ego,glowing,qualname,curse,charged,slot
ability_menu = false
autofight_stop = 50
autofight_caught = true
autofight_wait = false
auto_butcher = true
bindkey = [~] CMD_LUA_CONSOLE
############################
### Travel & Exploration ###
############################
rest_wait_both = true
auto_sacrifice = true
travel_delay = -1
explore_delay = -1
rest_delay = -1
show_travel_trail = true
# explore_stop += greedy_items
explore_stop = stairs,shops,altars,portals,branches,runed_doors,glowing_items
explore_stop += greedy_pickup_smart,greedy_visited_item_stack,artefacts
wall_jump_move = false
################
### Messages ###
################
channel.multiturn = mute
msc := message_colour
msc += mute:returns to your side
msc += mute:a demon appears
msc += lightgrey:The deck of cards disappears
msc += mute:puff of smoke
msc += mute:carefully avoids
msc += mute:is recalled
msc += mute:wall.*burn.*your
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)
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 += This wand has no charges
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)
more += flesh rotting
more += (starving|devoid of blood)
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 += Your transformation is almost over
more += You have a feeling this form
more += You feel yourself come back to life
more += time is quickly running out
more += life is in your own hands
more += Your shroud falls apart
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 += ((floating|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|air elemental).*into view
# Paralysis/Petrify/Banish
more += (orc sorcerer|(?>
note_items += experience,of resistance, Archmagi
note_items += crystal plate armour,pearl dragon scales
note_items += artefact
note_messages += You feel monstrous
note_messages += You pass through the gate
note_messages += cast .* Abyss
# Noteable monsters
# Undead
note_monsters += ancient lich,curse skull,curse toe,greater mummy
# Depths
note_monsters += caustic shrike
# Special hall_of_zot spawns
note_monsters += killer klown,electric golem,orb of fire
dump_message_count = 30
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,xp_by_level
############
## Macros ##
############
# Only make these macros for my username. If copying this part of my RC
# directly into your own, remove these lines including the '{' and '}' if you
# don't want RandomTiles or save_with_message. If you want either of those,
# replace these lines with normal RC macro lines like:
#
# macros += M S ===save_with_message
# macros += M 8 ===new_random_tile
# ...
#
# {
# -- Must use crawl.setopt() for the name condition to work.
# if you.name() == "gammafunk" then
# crawl.setopt("macros += M 1 zz")
# crawl.setopt("macros += M S ===save_with_message")
# crawl.setopt("macros += M 8 ===new_random_tile")
# crawl.setopt("macros += M 9 ===set_tile_by_name")
# crawl.setopt("macros += M 0 ===toggle_tile_timer")
# crawl.setopt("macros += M - ===toggle_random_tile")
# end
# }
###########
### Lua ###
###########
{
-- 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)
-- Spellcasting spam reduction by monqy
local function generic_cast_spell(cmd)
crawl.mpr('Cast which spell?')
crawl.flush_prev_message()
crawl.process_keys(cmd)
end
function cast_spell()
generic_cast_spell('z')
end
function force_cast_spell()
generic_cast_spell('Z')
end
}
# Note: My final RC file has code from lua files found at:
# https://github.com/gammafunk/dcss-rc/blob/master/README.md
# starting from the line below.
{
---------------------------
---- 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|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
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 ----
-------------------------
----------------------------
---- Begin load_message ----
----------------------------
-- See README.md for documentation.
message_color = "white"
-- 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 save_with_message()
if you.turns() == 0 then
crawl.sendkeys("S")
return
end
crawl.formatted_mpr("Save game and exit?", "prompt")
local res = crawl.getch()
if not (string.char(res) == "y" or string.char(res) == "Y") then
crawl.formatted_mpr("Okay, then.", "prompt")
return
end
crawl.formatted_mpr("Leave a message: ", "prompt")
local res = crawl.c_input_line()
c_persist.message = res
crawl.sendkeys(control("s"))
end
function load_message()
if c_persist.message and c_persist.message ~= "nil"
and c_persist.message ~= "" then
mpr("MESSAGE: " .. c_persist.message, message_color)
c_persist.message = nil
end
end
-----------------------------------
---- End leave message on save ----
-----------------------------------
}
{
-----------------------------
---- Begin char_defaults ----
-----------------------------
-- See README.md for documentation.
weapon_skills = {"Unarmed Combat", "Short Blades", "Long Blades", "Axes",
"Maces & Flails", "Polearms", "Staves"}
ranged_skills = {"Throwing", "Bows", "Crossbows", "Slings"}
other_skills = {"Fighting", "Armour", "Dodging",
"Shields", "Spellcasting", "Conjurations", "Hexes", "Charms",
"Summonings", "Necromancy", "Translocations", "Transmutations",
"Fire Magic", "Ice Magic", "Air Magic", "Earth Magic",
"Poison Magic", "Invocations", "Evocations","Stealth"}
skill_glyphs = { [1] = "+", [2] = "*" }
chdat = nil
char_combo = you.race() .. you.class()
loaded_attempted = 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 skill_message(prefix, skill, skill_type, value)
local msg = ""
if prefix then
msg = prefix .. ";"
end
if skill_type then
msg = msg .. skill_type .. "(" .. skill .. "):" .. value
else
msg = msg .. skill .. ":" .. value
end
return msg
end
function save_char_defaults(quiet)
if you.class() == "Wanderer" then
return
end
if not c_persist.char_defaults then
c_persist.char_defaults = { }
end
c_persist.char_defaults[char_combo] = { }
chdat = c_persist.char_defaults[char_combo]
local msg = nil
local have_weapon = false
for _,sk in ipairs(weapon_skills) do
if you.train_skill(sk) > 0 then
chdat["Weapon"] = you.train_skill(sk)
msg = skill_message(nil, sk, "Weapon",
skill_glyphs[chdat["Weapon"]])
have_weapon = true
break
end
end
if not have_weapon then
chdat["Weapon"] = nil
end
local have_ranged = false
for _,sk in ipairs(ranged_skills) do
if you.train_skill(sk) > 0 then
chdat["Ranged"] = you.train_skill(sk)
msg = skill_message(msg, sk, "Ranged",
skill_glyphs[chdat["Ranged"]])
have_ranged = true
break
end
end
if not have_ranged then
chdat["Ranged"] = nil
end
for _,sk in ipairs(other_skills) do
if you.train_skill(sk) > 0 then
chdat[sk] = you.train_skill(sk)
msg = skill_message(msg, sk, nil, skill_glyphs[chdat[sk]])
else
chdat[sk] = nil
end
end
if not quiet then
mpr("Saved default for " .. char_combo .. ": " .. msg)
end
end
function have_defaults()
return you.class() ~= "Wanderer"
and c_persist.char_defaults ~= nil
and c_persist.char_defaults[char_combo] ~= nil
end
function load_char_defaults(quiet)
if not have_defaults() then
return
end
local msg = nil
local found_weapon = false
chdat = c_persist.char_defaults[char_combo]
for _,sk in ipairs(weapon_skills) do
if you.base_skill(sk) > 0 and chdat["Weapon"] then
you.train_skill(sk, chdat["Weapon"])
msg = skill_message(msg, sk, "Weapon",
skill_glyphs[chdat["Weapon"]])
found_weapon = true
else
you.train_skill(sk, 0)
end
end
if chdat["Weapon"] and not found_weapon then
you.train_skill("Unarmed Combat", chdat["Weapon"])
msg = skill_message(msg, "Unarmed Combat", "Weapon",
skill_glyphs[chdat["Weapon"]])
end
local found_ranged = false
for _,sk in ipairs(ranged_skills) do
if you.base_skill(sk) > 0 and chdat["Ranged"] then
you.train_skill(sk, chdat["Ranged"])
msg = skill_message(msg, sk, "Ranged",
skill_glyphs[chdat["Ranged"]])
found_ranged = true
else
you.train_skill(sk, 0)
end
end
if chdat["Ranged"] and not found_ranged then
you.train_skill("Throwing", chdat["Ranged"])
msg = skill_message(msg, "Throwing", "Ranged",
skill_glyphs[chdat["Ranged"]])
end
for _,sk in ipairs(other_skills) do
if chdat[sk] then
you.train_skill(sk, chdat[sk])
msg = skill_message(msg, sk, nil, skill_glyphs[chdat[sk]])
else
you.train_skill(sk, 0)
end
end
if not quiet and msg ~= "" then
mpr("Loaded default for " .. char_combo .. ": " .. msg)
end
end
function char_defaults(quiet)
if you.turns() ~= 0 then
return
end
if not load_attempted then
load_char_defaults(quiet)
load_attempted = true
-- Open the skill menu if we don't have settings to load.
if not have_defaults() then
crawl.sendkeys("m")
end
end
end
---------------------------
---- End char_defaults ----
---------------------------
}
###############
# 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
}
# The ready() function is needed for code that has to process each turn or UI
# action.
#https://github.com/HilariousDeathArtist/DCSSConfigFile/blob/master/HDamage.txt
{
local need_skills_opened = true
function ready()
if you.turns() == 0 and need_skills_opened then
need_skills_opened = false
crawl.sendkeys("m")
end
-- 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()
-- char_defaults.lua
char_defaults()
AnnounceDamage()
end
}
#############
### Debug ###
#############
fsim_rounds = 10000
# -- Enable these only for my username. If copying this portion of my RC into
# -- your own and you don't want these features, remove everything from the 'if
# -- you.name() ...' line to the ' end' line corresponding to that 'if'
# -- statement. If you do want those features, remove only the 'if' line and
# -- its corresponding ' end' line so that they're not conditioned on my
# -- username.
# if you.name() == "gammafunk" then
# -- load_message.lua
# load_message()
#
# -- RandomTiles
# random_tile()
# end
###########################
### Spell/Ability slots ###
###########################
ability_slot += Fly|flight:lF
ability_slot += Stop Flying:L
ability_slot += Breathe:t
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 ###
##################
## In order of letter used.
item_slot += amulet of harm : H
item_slot += amulet of rage : B
item_slot += ring of (ice|protection from cold) : Cc
item_slot += amulet of the acrobat : A
item_slot += \+[0-9]+ ring of evasion : Ee
item_slot += ring of .*fire : Ff
item_slot += amulet of regeneration : g
item_slot += amulet of guardian spirit : G
item_slot += amulet of faith : T
item_slot += \+[0-9]+ ring of intelligence : Ii
item_slot += ring of flight : L
item_slot += ring of protection from magic : Mm
item_slot += ring of positive energy : Nn
item_slot += \+[0-9]+ ring of protection : Oo
item_slot += ring of poison resistance : P
item_slot += ring of stealth : Qq
item_slot += ring of resist corrosion : R
item_slot += amulet of mana regeneration : r
item_slot += \+[0-9]+ ring of strength : Ss
item_slot += ring of teleportation : t
item_slot += amulet of gourmand : U
item_slot += ring of see invisible : v
item_slot += ring of magical power : Ww
item_slot += \+[0-9]+ ring of dexterity : Dd
item_slot += \+[0-9]+ ring of slaying : Yy
item_slot += ring of wizardry : Zz
always_show_zot = true
explore_wall_bias = 4
show_more = false
bindkey = [p] CMD_QUAFF
# macros += M \{-265} Zaf
# macros += M \{-266} Zb
# macros += M \{-267} Zd
# macros += M \{-268} Zi