# TEAMCAPTAIN EnegeticOcto #combo += fewn #newgame_after_quit = true always_show_zot=true #default_autopickup = false #show_more = false explore_delay=-1 travel_delay=-1 #show_travel_trail=false travel_key_stop = false #easy_confirm = all #use_animations = false #tile_misc_anim = false #tile_realtime_anim = true default_manual_training=true #Makes your character try to break free from nets and the like with autofight even when there are no enemies autofight_caught = true warn_hatches = true autofight_stop = 70 #explore_auto_rest = false rest_wait_percent = 100 #ability_slot ^=Heroism:b #ability_slot ^=Finesse:d #item_slot ^= (ration):e item_slot ^= potions? of curing:q item_slot ^= potions? of heal wounds:w item_slot ^= potions? of haste:h item_slot ^= potions? of might:d item_slot ^= potions? of resistance:n item_slot ^= scrolls? of identify:r item_slot ^= scrolls? of remove curse:x item_slot ^= scrolls? of teleportation:t item_slot ^= scrolls? of blinking:z item_slot ^= wand of digging:v autopickup_exceptions -= dangerous_item autopickup_exceptions += book autopickup_exceptions += >ring of fire # autopickup_exceptions += >ring of protection from cold autopickup_exceptions += >ring of ice #autopickup_exceptions += >ring of positive energy #autopickup_exceptions += >ring of magical power #autopickup_exceptions += >ring of wizardry #autopickup_exceptions += >ring of dexterity #autopickup_exceptions += >ring of intelligence #autopickup_exceptions += >ring of stealth #autopickup_exceptions += >potions? of brilliance #autopickup_exceptions += >wand of disintegration #autopickup_exceptions += >wand of flame #autopickup_exceptions += >wand of iceblast #autopickup_exceptions += >wand of paralysis #autopickup_exceptions += >wand of polymorph #autopickup_exceptions += >wand of random effects autopickup_exceptions += = 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 .. "") 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 }