# github.com/refracta/dcss-webtiles-extension-module/blob/main/modules/sound-support/README.md
sound_on = true
one_SDL_sound_channel = true
sound_volume = 0.07
sound_fade_time = 2.8
sound_pack += https://osp.nemelex.cards/build/latest.zip:["init.txt"]
sound_pack += https://sound-packs.nemelex.cards/Autofire/BindTheEarth/BindTheEarth.zip
<
function ready()
OpenSkills()
AnnounceDamage()
end
>
####################
# Opens skill menu #
####################
<
local need_skills_opened = true
function OpenSkills()
if you.turns() == 0 and need_skills_opened then
need_skills_opened = false
you.set_training_target("Fighting",18)
you.set_training_target("Maces & Flails",18)
you.set_training_target("Axes",18)
you.set_training_target("Polearms",20)
you.set_training_target("Unarmed Combat",18)
you.set_training_target("Throwing",9)
you.set_training_target("Short Blades",18)
you.set_training_target("Long Blades",18)
you.set_training_target("Ranged Weapons",18)
you.set_training_target("Armour",9)
you.set_training_target("Dodging",9)
you.set_training_target("Shields",9)
you.set_training_target("Stealth",9)
you.set_training_target("Spellcasting",6)
you.set_training_target("Translocations",9)
you.set_training_target("Air Magic",6)
you.set_training_target("Invocations",6)
you.set_training_target("Evocations",6)
you.set_training_target("Shapeshifting",23)
crawl.sendkeys("m","!")
end
end
>
###############
# 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")) or
previous_form:find("hydra")then
max_hp_decreased = true
elseif (current_form:find("dragon") or
current_form:find("statue") or
current_form:find("tree") or
previous_form:find("ice")) or
previous_form:find("hydra")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 hp_difference >= (max_hp * 0.30) then
crawl.mpr("MASSIVE DAMAGE!!")
elseif hp_difference >= (max_hp * 0.20) then
crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif hp_difference >= (max_hp * 0.10) then
crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif hp_difference >= (max_hp * 0.05) 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
end
--On gaining 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 gain ' .. health_inturn .. ' hp, and have ' .. current_hp .. '/' .. max_hp .. ' hp.')
elseif current_hp <= (max_hp * 0.50) then
crawl.mpr('You gain ' .. health_inturn .. ' hp, and have ' .. current_hp .. '/' .. max_hp .. ' hp.')
elseif current_hp <= (max_hp * 0.70) then
crawl.mpr('You gain ' .. health_inturn .. ' hp, and have ' .. current_hp .. '/' .. max_hp .. ' hp')
elseif current_hp <= (max_hp * 0.90) then
crawl.mpr('You gain ' .. health_inturn .. ' hp, and have ' .. current_hp .. '/' .. max_hp ..' hp')
else
crawl.mpr('You gain ' .. health_inturn .. ' hp, and have ' .. current_hp .. '/' .. max_hp .. ' hp')
end
end
end
--On losing magic
if current_mp < previous_mp then
if current_mp <= (max_mp / 4) 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
>
#######################
### Mini Map Colors ###
#######################
# reddit.com/r/dcss/comments/gpz245/custom_minimap_color_scheme_for_better_clarity/
tile_portal_col = #ff4f1a
tile_downstairs_col = #ff1a1a
tile_branchstairs_col = #ff006a
tile_upstairs_col = #99ff33
tile_explore_horizon_col = #bfbfbf
tile_floor_col = #262626
tile_water_col = #0086b3
tile_deep_water_col = #1f1fed
tile_lava_col = #6f0b00
tile_wall_col = #595959
tile_door_col = #cb7d4d
tile_feature_col = #d4be21
tile_plant_col = #5c8745
tile_transporter_col = #ff80bf
tile_transporter_landing_col = #59ff89
tile_trap_col = #d24dff
###############
### Display ###
###############
# github.com/crawl/crawl/blob/master/crawl-ref/source/dat/defaults/menu_colours.txt
tile_font_crt_size = 21
tile_font_stat_size = 21
tile_font_msg_size = 21
tile_font_tip_size = 21
tile_font_lbl_size = 21
tile_font_ft_light = false
tile_cell_pixels = 38
tile_font_crt_family = UD デジタル 教科書体 N-B
tile_font_stat_family = UD デジタル 教科書体 N-B
tile_font_msg_family = UD デジタル 教科書体 N-B
tile_font_lbl_family = UD デジタル 教科書体 N-B
tile_realtime_anim = true
# Crash caused by signal #6: Aborted
# archive.nemelex.cards/morgue/c50/crash-c50-20241211-132132.txt
# tile_show_player_species = true
action_panel_font_size = 19
action_panel_font_family = UD デジタル 教科書体 N-B
action_panel_orientation = vertical
action_panel_show = false
menu := menu_colour
# menu ^= lightgrey:potions? of (attraction|lignification|mutation)
# menu ^= lightgrey:scrolls? of (poison|torment|immolation|vulnerability|noise)
msc := message_colour
msc ^= lightgrey:( miss | misses |no damage)
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
tile_show_threat_levels = tough nasty unusual
tile_show_demon_tier = true
always_show_gems = true
more_gem_info = true
#############
# Interface #
#############
autofight_nomove_fires = false
autofight_fire_stop = true
autofight_caught = true
autofight_wait = true
autofight_stop = 40
rest_wait_both = true
rest_wait_ancestor = true
fire_order = spell, throwing, evokable
fire_order_ability -= all
fail_severity_to_quiver = 3
fail_severity_to_confirm = 5
spell_menu = true
show_more = false
easy_confirm = safe
equip_unequip = true
sort_menus = true:equipped,charged,art,ego,glowing,identified,basename
stat_colour = 3:red, 7:lightred
# skill_focus = false
default_manual_training = true
# travel_delay = 1
explore_delay = 15
view_delay = 550
level_map_cursor_step = 8
warn_hatches = true
travel_open_doors = approach
explore_stop = greedy_pickup_smart
explore_stop += stairs,shops,altars,portals,branches,runed_doors,glowing_items,artefacts,runes
###########
# Prompts #
###########
# github.com/crawl/crawl/blob/master/crawl-ref/source/dat/defaults/messages.txt
# github.com/crawl/crawl/blob/master/crawl-ref/source/dat/defaults/runrest_messages.txt
# github.com/crawl/crawl/blob/master/crawl-ref/source/dat/defaults/misc.txt
ignore := runrest_ignore_message
stop := runrest_stop_message
more := force_more_message
# ignore += duration:
ignore += recovery:
ignore += contamination has completely
ignore += your breath back
ignore += engulfed in a cloud of smoke
ignore += engulfed in white fluffiness
ignore += safely over a trap
# Timed portals
stop += timed_portal:
stop += You hear.*(nearby|distant)
more += Found.*(bazaar|secret trove of treasure|sand-covered staircase|glowing drain|flagged portal|gauntlet entrance|frozen archway|dark tunnel|ruined gateway|magic portal|ziggurat)
more += The walls and floor vibrate strangely for a moment
# Expiring effects
more += Your transformation is almost over
more += back to life
more += You feel yourself slow down
more += less insulated
more += You are starting to lose your buoyancy
more += You lose control over your flight
more += Your hearing returns
more += You have a feeling this form
more += You feel yourself come back to life
more += uncertain
more += time is quickly running out
more += life is in your own hands
more += shroud falls apart
more += You start to feel a little slower
more += You flicker
more += You feel less protected from missiles
# 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
# github.com/crawl/crawl/blob/master/crawl-ref/source/dat/database/monspell.txt
# github.com/crawl/crawl/blob/master/crawl-ref/source/beam.cc
more += mutation:
flash_screen_message += You feel vulnerable to
more += hell_effect:
more += LOW HITPOINT WARNING
more += An alarm trap emits a blaring wail
more += A sentinel's mark forms upon you
more += Your surroundings flicker
more += You cannot teleport right now
more += A huge blade swings out and slices into you
more += (blundered into a|invokes the power of) Zot
more += Ouch! That really hurt!
more += You convulse
more += Your body is wracked with pain
more += You are (blasted|electrocuted)
more += You are.*confused
more += wrath finds you
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 += The blast of calcifying dust hits you
more += Space warps horribly.*around you
more += Space bends around you
more += watched by something
more += Your limbs have turned to stone
more += lethally poison
more += You are covered in intense liquid fire!
more += Strange energies course through your body
more += You feel strangely unstable
more += (? 18 then
more += Found.*(Zin|The Shining One)
: end
# Uniques and baddies
more += is (wielding|wearing) the
more += changes into
more += (torpor snail|nekomata|doom hound|acid blob|entropy weaver|ghost moth) (?!zombie|skeleton|simulacrum).*into view
more += (? 22 then
# unusual_monster_items += holy
more += (?>
note_items += of experience,of resistance,archmagi,crystal plate armour,pearl dragon scales,granite talisman,talisman of death
note_messages += You pass through the gate
note_messages += cast.*Abyss
note_messages += BOSS
# dump_item_origins = none
dump_order = header,hiscore,stats,misc,apostles,mutations,inventory,skills,spells
dump_order += overview,messages,screenshot,monlist,kills
dump_order += notes,vaults,skill_gains,action_counts,turns_by_place
##############
# Autopickup #
##############
# github.com/crawl/crawl/blob/master/crawl-ref/source/dat/defaults/autopickup_exceptions.txt
autopickup = $?!:"/}(
ae := autopickup_exceptions
ae += 4 then
ae += stone
: end
: if you.xl() > 24 then
ae += identify, vulnerability, wand of (polymorph|charming|paralysis|mindburst)
: end
: if you.xl() <= 10 then
drop_disables_autopickup = true
: end
: if you.xl() > 11 then
drop_disables_autopickup = false
: end
: if you.xl() <= 15 then
# Armour/Weapon autopickup by rwbarton, enhanced by HDA
{
add_autopickup_func(function(it, name)
if it.is_useless then return false end
if name:find("dispersal") and name:find("boomerang") then return true end
if name:find("throwing net") then return true end
local class = it.class(true)
local armour_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots", body="body Armour", shield="Shield"}
if (class == "armour") then
sub_type = it.subtype()
equipped_item = items.equipped_at(armour_slots[sub_type])
if (sub_type == "cloak") or (sub_type == "helmet") or (sub_type == "gloves") or (sub_type == "boots") then
if (you.race() == "Octopode") then
if sub_type == "helmet" then
return it.artefact or it.branded or it.ego
end
return false
end
if you.race() == "Minotaur" then
if sub_type == "helmet" then
return it.artefact or it.branded or it.ego
end
end
if you.race() == "Felid" then
return false
end
if not equipped_item then
return true
else
return it.artefact or it.branded or it.ego
end
end
if (sub_type == "body") then
if you.race():find("Draconian") then
return false
end
if you.race() == "Felid" then
return false
end
if you.race() == "Octopode" then
return false
end
if equipped_item then
local armourname = equipped_item.name()
if equipped_item.artefact or equipped_item.branded or equipped_item.ego or (equipped_item.plus > 2) or armourname:find("dragon") or armourname:find("troll") then
return it.artefact
else
return it.artefact or it.branded or it.ego
end
end
return true
end
if (sub_type == "shield") then
if equipped_item then
if equipped_item.artefact or equipped_item.branded or equipped_item.ego or (equipped_item.plus > 2) then
return it.artefact or it.branded or it.ego
else
return true
end
else
return it.artefact or it.branded or it.ego
end
end
end
end)
}
: end
##################
### Item slots ###
##################
ai := autoinscribe
# Prevent melee with all staves; if we want to melee with one, it's safe to require removing the annotation.
ai += magical staff:!a
ai += (large rock|silver javelin|throwing net|(curare|datura|atropa)-tipped dart|of dispersal):=f
ai += potions? of heal wounds:@q1
ai += potions? of curing:@q2
ai += potions? of cancellation:@q3
ai += potions? of haste:@q4
ai += scrolls? of identify:@r1
ai += scrolls? of teleportation:@r2
ai += scrolls? of blinking:@r3
ai += enchant armour:@r4
ai += enchant weapon:@r5
ai += wand of iceblast:@v1
ai += wand of acid:@v2
ai += wand of roots:@v3
ai += wand of flame:@v4@Q4
ai += wand of mindburst:@v5@Q5
ai += wand of paralysis:@v6
ai += wand of polymorph:@v7
ai += wand of charm:@v8
ai += wand of digging:@v9
ai += boomerang:@f1@Q1
ai += (?
macros += M U X<
macros += M T G\{9}
macros += M B *f.\{13}
macros += M P *fin_shop\{32}&&\{32}!!carried\{13}
# macros += M S *f!!altar\{32}&&\{32}!!carried\{13}
macros += M n x+
macros += M l x+v
macros += M L x-v
macros += M C X*e
macros += M Y tt
macros += M I II
macros += M R \\-
macros += M O aa
macros += M K ab
macros += M y ff
# F1:\{-265}:poisoned dart, F2:\{-266}:boomerang, "(":wand of mindburst, ")":flame, "<":iceblast, ">":acid
macros += M \{-265} F35
macros += M \{-266} F15
macros += M ( V55
macros += M ) V45
macros += M < V15
macros += M > V25
macros += M 1 za
macros += M 2 zb
macros += M 3 zc
macros += M 4 zd
macros += M 5 ze
macros += M 6 zf
macros += M 7 zg
macros += M 8 zh
macros += M 9 zi
bindkey = [NP5] CMD_WAIT
bindkey = [NP5] CMD_TARGET_SELECT_ENDPOINT
bindkey = [s] CMD_REST
bindkey = [c] CMD_CLOSE_DOOR
bindkey = [C] CMD_MAP_CLEAR_EXCLUDES
bindkey = [W] CMD_WIELD_WEAPON
bindkey = [w] CMD_WEAR_ARMOUR
bindkey = [p] CMD_WEAR_JEWELLERY
bindkey = [Tab] CMD_AUTOFIGHT_NOMOVE
bindkey = [H] CMD_AUTOFIRE
bindkey = [u] CMD_PREV_CMD_AGAIN
bindkey = [i] CMD_RESISTS_SCREEN
bindkey = [e] CMD_FULL_VIEW
bindkey = [e] CMD_TARGET_FULL_DESCRIBE
bindkey = [e] CMD_MAP_EXIT_MAP
bindkey = [k] CMD_DISPLAY_OVERMAP
bindkey = [k] CMD_TARGET_EXCLUDE
bindkey = [k] CMD_MAP_EXCLUDE_AREA
bindkey = [\{13}] CMD_DISPLAY_INVENTORY
bindkey = [NPenter] CMD_DISPLAY_INVENTORY
bindkey = [\{NP+}] CMD_GO_DOWNSTAIRS
bindkey = [\{NP-}] CMD_GO_UPSTAIRS
bindkey = [\{NP+}] CMD_MAP_FIND_DOWNSTAIR
bindkey = [\{NP-}] CMD_MAP_FIND_UPSTAIR
bindkey = [\{NP*}] CMD_CYCLE_QUIVER_FORWARD
bindkey = [\{NP/}] CMD_CYCLE_QUIVER_BACKWARD
bindkey = [ ] CMD_TARGET_CANCEL
bindkey = [ ] CMD_MAP_EXIT_MAP
bindkey = [b] CMD_TARGET_CANCEL
bindkey = [h] CMD_TARGET_CANCEL
bindkey = [j] CMD_TARGET_CANCEL
bindkey = [l] CMD_TARGET_CANCEL
bindkey = [n] CMD_TARGET_CANCEL
bindkey = [u] CMD_TARGET_CANCEL
bindkey = [y] CMD_TARGET_CANCEL
bindkey = [B] CMD_TARGET_CANCEL
bindkey = [H] CMD_TARGET_CANCEL
bindkey = [J] CMD_TARGET_CANCEL
bindkey = [K] CMD_TARGET_CANCEL
bindkey = [L] CMD_TARGET_CANCEL
bindkey = [N] CMD_TARGET_CANCEL
bindkey = [U] CMD_TARGET_CANCEL
bindkey = [Y] CMD_TARGET_CANCEL
bindkey = [b] CMD_MAP_EXIT_MAP
bindkey = [h] CMD_MAP_EXIT_MAP
bindkey = [j] CMD_MAP_EXIT_MAP
bindkey = [l] CMD_MAP_EXIT_MAP
bindkey = [n] CMD_MAP_EXIT_MAP
bindkey = [u] CMD_MAP_EXIT_MAP
bindkey = [y] CMD_MAP_EXIT_MAP
bindkey = [B] CMD_MAP_EXIT_MAP
bindkey = [H] CMD_MAP_EXIT_MAP
bindkey = [J] CMD_MAP_EXIT_MAP
bindkey = [K] CMD_MAP_EXIT_MAP
bindkey = [L] CMD_MAP_EXIT_MAP
bindkey = [N] CMD_MAP_EXIT_MAP
bindkey = [U] CMD_MAP_EXIT_MAP
bindkey = [Y] CMD_MAP_EXIT_MAP