#TEAMCAPTAIN monsterracer
##### 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
# 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
{
---------------------------
---- Begin RandomTiles ----
---------------------------
-- Automatically and randomly change the player tile to that of various
-- monsters. See README.md for setup details.
-- RandomTile options
-- If you set randtile_options elsewhere in your rc, we don't override it.
if not randtile_options then
randtile_options = {
-- Change the tile every N turns
turns_change = 100,
-- Which setting for tile_player_tile to use when disabling RandomTiles
-- with toggle_random_tile(). Can set to e.g. "normal", "playermons",
-- or a fixed mons/tile.
disabled_setting = "normal",
-- If true, print the what tile we're changing to as if it were a
-- god message from our current god or the default_god below when we
-- have no god. If false, print a more generic message.
god_message = true,
default_god = "You",
-- Cute speech string templates. In these %g is replaced with the
-- god name, %am with the monster's name with an article, and %m
-- with the monster's name without an article.
god_speech = {["You"] = "%g become %am!",
-- Used when the god has no entry
["default"] = "%g says: Become %am!",
["Sif Muna"] = "%g whispers: Become %am.",
["Trog"] = "%g roars: Now %m!!!",
["Xom"] = "%g titters: I'd like %am!"},
-- Colour of tile change message.
message_colour = "lightblue" }
end
-- player_tiles defines the default array of player tiles that RandomTiles
-- chooses from. New tiles can be added anywhere in this array, and lines can
-- be removed or comment out to disable a tile. Each entry must have a `mons'
-- field with the monster name at a minimum. The actual tile to use can be come
-- from the fields `mons', `tile', or `tileset'.
-- The `mons' field should be a string that describes the player tile if `tile'
-- or `tileset' is used, or the corresponding monster's name if not. If neither
-- `tile' nor `tileset' are defined, and `mons' has value of e.g. "monster
-- name", then the tile is changed equivalent to the command:
-- tile_player_tile = mons:monster name
-- If the `mons' value isn't the monster's name or the tile doesn't have a
-- corresponding monster, the `tile' field must exist and give the tile's
-- name. The player_name_pairs[] array in the source file
-- rltiles/tiledef-player.cc defines the names for all player tiles, and only
-- tiles defined in this file can be used. These are the tiles you see in
-- crawl's tilesheet file player.png.
-- When `tile' is defined with a string like "mons_monster_name", the tile is
-- changed equivalent to the command:
-- tile_player_tile = tile:mons_monster_name
-- For tiles like butterflies with variant tiles, you can set the field
-- `num_var' to the number of variants. The array _tile_player_count[] in
-- rltiles/tiledef-player.cc defines how many variants exist for each tile, but
-- it's easier to look in files/subfolders e.g. rltiles/mon where the
-- individual tile images and see how many variants a tile has. Since
-- rltiles/mon/animals has butterfly.png through butterfly10.png, which means
-- 11 variants, the entry is:
-- {mons = "butterfly", tile = "mons_butterfly", num_var=11},
-- By default RandomTiles chooses a new variant with each UI action (e.g. any
-- keystroke, even if the player's turn didn't change). Set the field
-- `var_type' to either "fixed" or "sequence" to change this behaviour. With
-- "fixed" a single variant is chosen with each tile index change, and with
-- "sequence" variants are progressed through in order with each UI action.
-- You can define a custom set of variants using the `tileset' field. For
-- example, here's an entry for the Serpent of Hell:
-- {mons = "The Serpent of Hell",
-- tileset = {"mons_serpent_of_hell_tartarus",
-- "mons_serpent_of_hell_cocytus",
-- "mons_serpent_of_hell_dis",
-- "mons_serpent_of_hell_gehenna"},
-- num_var = 4},
-- These variants are used will be chosen according to the same rules above.
-- begin player_tiles array
player_tiles = {{mons = "felid", tile = "felid", num_var=10}}
-- end player_tiles array
-- Note: No further configuration past this point.
-- A list of tiles that are valid and compatible with our version.
local valid_tiles = {}
-- state data
local randtile_state = { index = 0,
last_index_change = -1,
last_variant = -1,
last_xl = -1,
enabled = true,
timer_enabled = true }
-- Populate valid_tiles
function init_player_tiles(tiles)
-- earliest version with tile_player_tile
version = 0.15
if crawl.version then
version = tonumber(crawl.version("major"))
end
for i,v in ipairs(player_tiles) do
if v.mons
and (not v.min_version or version >= tonumber(v.min_version))
and (not v.max_version or version <= tonumber(v.max_version)) then
valid_tiles[#valid_tiles + 1] = v
end
end
end
-- Print a message about a tile set change
function tile_change_message()
god = you.god()
if god == "No God" then
god = randtile_options.default_god
end
if not randtile_options.god_message then
god = "You"
end
if randtile_options.god_speech[god] then
msg_template = randtile_options.god_speech[god]
else
msg_template = randtile_options.god_speech["default"]
end
msg = msg_template:gsub("%%g", god)
amons = crawl.grammar(valid_tiles[randtile_state.index].mons, "A")
msg = msg:gsub("%%am", amons)
mons = valid_tiles[randtile_state.index].mons
mons = mons:gsub("^[tT][hH][eE] ", "")
mons = mons:gsub("^[aA][nN]? ", "")
msg = msg:gsub("%%m", mons)
crawl.mpr("<" .. randtile_options.message_colour .. ">" .. msg .. ""
.. randtile_options.message_colour .. ">")
end
-- Change the current tile using the tileset entry with the given index in
-- valid_tiles. This will update the randtile state as necessary.
function change_tile(index, force)
tileopt = nil
index_change = force or index ~= randtile_state.index
if valid_tiles[index].num_var then
var_type = valid_tiles[index].var_type
if not var_type then
var_type = "random"
end
variant = 1
if var_type == "random"
or (var_type == "fixed" and index_change) then
variant = crawl.random2(valid_tiles[index].num_var) + 1
elseif var_type == "sequence"
and not index_change
and randtile_state.last_variant >= 1
and randtile_state.last_variant < valid_tiles[index].num_var then
variant = randtile_state.last_variant + 1
end
randtile_state.last_variant = variant
-- custom-defined tilesets or an variant set defined by crawl itself.
if valid_tiles[index].tileset then
tileopt = valid_tiles[index].tileset[variant]
elseif valid_tiles[index].tile then
if variant == 1 then
var_suf = ""
else
var_suf = "_" .. variant - 1
end
tileopt = valid_tiles[index].tile .. var_suf
end
tileopt = "tile:" .. tileopt
elseif valid_tiles[index].tile then
tileopt = "tile:" .. valid_tiles[index].tile
elseif valid_tiles[index].mons then
tileopt = "mons:" .. valid_tiles[index].mons
end
if not tileopt then
return
end
if index_change then
randtile_state.index = index
randtile_state.last_index_change = you.turns()
end
crawl.setopt("tile_player_tile = " .. tileopt)
if valid_tiles[index].weapon_offsets then
crawl.setopt("tile_weapon_offsets = "
.. valid_tiles[index].weapon_offsets)
else
crawl.setopt("tile_weapon_offsets = reset")
end
if valid_tiles[index].shield_offsets then
crawl.setopt("tile_shield_offsets = "
.. valid_tiles[index].shield_offsets)
else
crawl.setopt("tile_shield_offsets = reset")
end
if index_change then
tile_change_message()
end
end
-- Change the tile by partial match of name to the mons entries in
-- valid_tiles. Reads name from input if it's not given as an argument.
function set_tile_by_name(name)
if name == nil then
crawl.mpr("Enter a tile name search string: ")
name = crawl.c_input_line()
if not name then
return
end
end
first_match = nil
name = name:lower()
for i,v in ipairs(valid_tiles) do
mname = v.mons:lower()
if mname == name then
first_match = i
break
elseif mname:find(name) and not first_match then
first_match = i
end
end
if first_match then
change_tile(first_match, true)
else
crawl.mpr("Unable to match a player_tile mons value with " .. name,
"error")
end
end
-- Checks the randtile state, changing the tile when necessary. A
-- change of the tile index will cause a tile change message to be
-- displayed. The tile may be changed to a new tileset variant even if
-- the index is unchanged, depending on the definition of the current
-- tileset. If force_change is true, the tile index will always be
-- changed.
function random_tile(force_change)
if not valid_tiles or not randtile_state.enabled then
return
end
num_tiles = #valid_tiles
session_start = randtile_state.last_xl < 0
or randtile_state.last_index_change < 0
xl_changed = tonumber(you.xl()) ~= randtile_state.last_xl
if session_start or xl_changed then
randtile_state.last_xl = tonumber(you.xl())
end
turns_passed = tonumber(you.turns()) - randtile_options.turns_change
index_changed = force_change or session_start or randtile_state.timer_enabled
and (xl_changed or turns_passed >= randtile_state.last_index_change)
if index_changed then
index = 1 + crawl.random2(num_tiles)
else
index = randtile_state.index
end
var_type = "fixed"
if valid_tiles[index].num_var
and (valid_tiles[index].tile or valid_tiles[index].tileset) then
var_type = valid_tiles[index].var_type
end
if not index_changed and var_type == "fixed" then
return
end
-- We are changing the player tile because of an index change or because we
-- are using a variant tileset that changes with every UI input.
change_tile(index)
end
-- Force a tile change
function new_random_tile()
random_tile(true)
end
-- Toggle the turn/xl timer to disable/enable index changing.
function toggle_tile_timer()
if randtile_state.timer_enabled then
crawl.mpr("Disabling tile changes by turn or XL.")
else
crawl.mpr("Enabling tile changes by turn and XL.")
end
randtile_state.timer_enabled = not randtile_state.timer_enabled
end
-- Toggle RandomTiles, setting it tile_player_tile to default setting if we're
-- disabling.
function toggle_random_tile()
if randtile_state.enabled then
randtile_state.enabled = false
crawl.setopt("tile_player_tile = " .. randtile_options.disabled_setting)
crawl.setopt("tile_weapon_offsets = reset")
crawl.setopt("tile_shield_offsets = reset")
crawl.mpr("Disabling RandomTiles.")
else
crawl.mpr("Enabling RandomTiles.")
randtile_state.enabled = true
new_random_tile()
end
end
-- Initialize the tileset, removing any invalid tile entries.
init_player_tiles(player_tiles)
-------------------------
---- End RandomTiles ----
-------------------------
}
#{
function ready()
-- Enable random tile
random_tile()
end
}
#use_animations = false
auto_fight_stop = 50
show_more = false
explore_auto_rest = true
rest_wait_percent = 100
wall_jump_move = true
# autofight_throw = true
auto_butcher = true
auto_butcher += engorged
flash_screen_message += carrying
autoinscribe ^= magical staff:!a
force_more_message += suddenly yanked