function ready()
AnnounceDamage()
OpenSkills()
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 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
>
####################
# Opens skill menu #
####################
<
local need_skills_opened = true
function OpenSkills()
if you.turns() == 0 and need_skills_opened then
need_skills_opened = false
crawl.sendkeys("m")
end
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
}
{
----------------------------
---- Begin load_message ----
----------------------------
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 ----
-----------------------------------
}
--toggles autofight_throw - macro
{
local aft = false
function toggle_autothrow()
if aft then
crawl.setopt("autofight_throw = false")
crawl.mpr("Autofight_throw is off.")
else
crawl.setopt("autofight_throw = true")
crawl.mpr("Autofight_throw is on.")
end
aft = not aft
end
--only cast invis if uncontaminated - macro
local contam = 0
function smart_invis()
contam = you.contaminated()
if contam > 1
then crawl.mpr("Too much contam")
else
crawl.sendkeys("zI")
end
contam = 0
end
}
###############
# Spell slots #
###############
force_targeter=
# Set Alias for Spell Slots
slot := spell_slot
# Try to keep in alphabetic order (by keybind)
slot += Freeze:a
slot += Shroud:a
slot += Frozen Ramparts:b
slot += Blink:b
slot += Call Canine Familiar:c
slot += Confuse:c
slot += Conjure Flame:c
slot += Control Undead:c
slot += Freezing Aura:c
slot += Petrify:c
slot += Spider Form:b
slot += Summon Ice Beast:c
slot += Summon Lightning Spire:c
slot += Fireball:f
slot += Apportation:g
slot += Sublimation of Blood:m
slot += Slow:s
slot += Sticky Flame:s
slot += Swiftness:s
slot += Passwall:w
slot += Corona:v
slot += Blade Hands:z
slot += Iskenderun's Mystic Blast:x
slot += Lightning Bolt:x
slot += Mephitic Cloud:x
slot += Stone Arrow:x
slot += Vampiric Draining:x
slot += Iskenderun's Battlesphere:z
slot += Lee's Rapid Deconstruction:z
slot += Animate Dead:A
slot += Animate Skeleton:A
slot += Ozocubu's Armour:A
slot += Death's Door:D
slot += Borgnjor's Revivification:R
bindkey = [s] CMD_WEAPON_SWAP
bindkey = ['] CMD_PREV_CMD_AGAIN
item_slot ^= potions? of curing:q
item_slot ^= potions? of heal wounds:l
item_slot ^= potions? of haste:h
item_slot ^= potions? of might:d
item_slot ^= potions? of agility:s
item_slot ^= potions? of resistance:n
item_slot ^= ring of poison resistance:P
item_slot ^= ring of positive energy:N
item_slot ^= ring of protection from cold:I
item_slot ^= ring of protection from fire:F
item_slot ^= ring of protection from magic:mM
item_slot ^= ring of resist corrosion:C
item_slot ^= ring of see invisible:S
item_slot ^= ring of wizardry:W
item_slot ^= scrolls? of blinking:B
item_slot ^= scrolls? of fear:g
item_slot ^= scrolls? of identify:i
item_slot ^= scrolls? of teleportation:t
item_slot ^= scrolls? of remove curse:w
item_slot ^= wand of digging:D
#################
### Interface ###
#################
#consumables_panel =
easy_floor_use = true
easy_confirm = all
default_manual_training = true
equip_unequip = true
sort_menus = true:equipped,identified,>qty,basename,art,ego,glowing,qualname
tile_web_mouse_control = false
autofight_caught = true
autofight_wait = false
autofight_stop = 60
: if you.race() == "Deep Dwarf" then
autofight_stop = 25
: end
note_messages += Saving game
note_messages += Your magical essence is drained by the effort!
fail_severity_to_confirm = 0
tile_water_anim = false
use_animations -= player
#tile_player_tile = mons:boggart
############################
### Travel & Exploration ###
############################
show_more = false
rest_wait_both = true
travel_delay = -1
explore_delay = -1
rest_delay = -1
interrupt_travel -= sense_monster
travel_key_stop = false
show_travel_trail = false
explore_stop = artefacts,greedy_pickup_smart
explore_stop += stairs,shops
explore_stop += altars,portals,branches,runed_doors
view_delay = 200
travel_one_unsafe_move = true
##################
### Autopickup ###
##################
# Add staves, misc; note you can't use += with this option.
autopickup = $?!:"/}|
ae := autopickup_exceptions
ae += scrolls? of silence
ae += >xom's chess
# Don't ever need a second stave
ae += staff of .*
ae += >ring of stealth
ae += >ring of protection from cold
ae += >ring of protection from fire
ae += >ring of protection from magic
ae += >ring of positive energy
ae += >ring of fire
ae += >ring of flight
ae += >ring of ice
ae += >ring of magical power
ae += >ring of strength
ae += >ring of intelligence
ae += >ring of dexterity
ae += >ring of wizardry
ae += >ring of poison resistance
ae += >ring of resist corrosion
ae += >ring of see invisible
ae += >boomerangs? of dispersal
ae += >amulet of faith
ae += >amulet of reflection
ae += >amulet of the acrobat
ae += >amulet of regeneration
ae += >amulet of magic regeneration
ae += >amulet of guardian spirit
ae += >amulet of nothing
more := force_more_message
: if you.god() == "Ashenzari" then
more += You have a vision of.*gates?
: end
more += The mighty Pandemonium lord .* resides here
#####################
# Table of Contents #
#####################
# 1. Dungeon Features
# 2. Failure
# 3. Bad Things
# 4. Translocations
# 5. Expiring Effects
# 6. Religion
# 7. Hell Effects
# 8. Monsters
# Set Alias
more := force_more_message
####################
# Dungeon Features #
####################
# Abyssal Rune
more += Found .* abyssal rune of Zot
# Entrances, Exits, and Arrivals
more += Found a frozen archway
more += Found a gateway leading out of the Abyss
more += Found a labyrinth entrance
more += Found a staircase to the Ecumenical Temple
more += The mighty Pandemonium lord.*resides here
# Portal Timers
more += distant snort
more += interdimensional caravan
more += invites you to visit
more += oppressive heat
more += roar of battle
more += sound of rushing water
more += The drain falls to bits
more += There is an entrance to a bailey on this level
more += tolling of a bell
more += wave of frost
more += You hear the drain falling apart
more += You hear.*crackle.*magical portal
more += You hear.*crackling.*archway
more += You hear.*creaking.*(oriflamme|portcullis)
more += You hear.*hiss.*sand
more += You hear.*rumble.*avalanche
more += You hear.*rusting.*drain
more += You hear.*ticking.*clock
# Traps
more += (blundered into a|invokes the power of) Zot
more += A huge blade swings out and slices into you
stop += An alarm trap emits a blaring wail
more += The power of Zot is invoked against you
more += You (become entangled|are caught) in (a|the) (web|net)
more += You fall through a shaft
more += You stumble into the trap
# Other
more += Another plant grows acid sacs
more += One of the plants suddenly grows acid sacs
more += The walls and floor vibrate strangely for a moment
more += You are suddenly pulled into a different region
more += You have a vision of.*gates?
###########
# Failure #
###########
more += do not work when you're silenced
more += sense of stasis
more += Something interferes with your magic
#more += The spell fizzles
more += The writing blurs in front of your eyes
#more += The.*is unaffected
more += This potion can/'t work under stasis
more += You are held in a net
more += You are too injured to fight blindly
more += You can't unwield
more += You cannot cast spells when silenced
more += You cannot cast spells while unable to breathe
more += You cannot teleport right now
more += You don't have enough magic
more += You fail to use your ability
more += You haven't enough magic at the moment
#more += You miscast
more += Your attempt to break free
#############################
# Bad and Unexpected Things #
#############################
# Bad things happening to you
more += You are corroded
more += corrodes you
more += corrodes your equipment
more += Your corrosive artefact corrodes you
more += are blown away by the wind
more += magical effects are unraveling
more += infuriates you
more += lose consciousness
more += mark forms upon you
more += MASSIVE DAMAGE
more += Ouch! That really hurt!
more += silver sears you
more += Space bends around you
more += Space warps horribly around you
more += surroundings become eerily quiet
more += Terrible wounds (open|spread) all over you
#more += The acid corrodes your
more += The air around.*erupts in flames
more += The air twists around and violently strikes you in flight
more += You shudder from the earth-shattering force
more += The barbed spikes become lodged in your body
more += The barbed spikes dig painfully into your body as you move
more += The blast of calcifying dust hits you[^r]
more += The poison in your body grows stronger
more += The pull of.*song draws you forwards
more += The.*engulfs you in water
more += The(tentacled monstrosity|anaconda).*grabs you[^r]
more += You (are|feel) drained
more += You are electrocuted
more += You are blown backwards
more += You are burned terribly
more += You are encased in ice
more += You are engulfed in calcifying dust
more += You are engulfed in dark miasma
more += You are engulfed in mutagenic fog
more += You are knocked back
more += You are mesmerised
more += You are slowing down
more += You are trampled
more += You convulse
more += You feel a (horrible|terrible) chill
more += You feel haunted
#more += You feel less vulnerable to poison
more += You feel your attacks grow feeble
more += You feel your flesh.*rot
more += You feel your power drain away
more += You feel your power leaking away
more += You feel yourself grow more vulnerable to poison
more += You stumble backwards
more += You.*re (confused|more confused|too confused)
more += You.*re (poisoned|more poisoned|lethally poisoned)
more += Your body is wracked with pain
more += Your damage is reflected back at you
more += Your limbs are stiffening
more += Your magical defenses are stripped away
more += Your?.*suddenly stops? moving
# Monsters doing bad things
more += A tree reaches out and hits you!
more += begins to recite a word of recall
#more += Being near the torpor snail leaves you feeling lethargic
more += blows on a signal horn
more += cast banishment
more += cast paralyse
more += cast Torment
more += goes berserk
more += The moth of wrath goads something on
more += is duplicated
more += is no longer invulnerable
more += Its appearance distorts for a moment
more += Mara seems to draw the.*out of itself
more += Mara shimmers
more += Miasma billows from the
more += shoots a curare
more += stands defiantly in death's doorway
more += steals.*your
more += swoops through the air toward you
more += The forest starts to sway and rumble
more += The jumping spider pounces on you [^but]
more += The shadow imp is revulsed by your support of nature
more += The water nymph flows with the water
more += The.*offers itself to Yredelemnul
#more += The.*seems to speed up
#more += The.*shudders
more += There is a horrible\, sudden wrenching feeling in your soul
more += Vines fly forth from the trees!
more += You are hit by a branch
more += You feel you are being watched by something
more += Your magical defenses are stripped away
more += \'s.*reflects
#more += Two slime creatures merge to form a very large slime creature.
more += Two slime creatures merge to form an enormous slime creature.
more += Two slime creatures merge to form a titanic slime creature.
# Unexpected situations
more += A magical barricade bars your way
more += Done waiting
more += doors? slams? shut
more += It doesn't seem very happy
more += Mutagenic energies flood into your body
more += Some monsters swap places
more += (The|Your).*falls away!
more += The divine light dispels your darkness!
more += The walls disappear
more += There is a sealed passage
more += You are wearing\:
more += You cannot afford.*fee
#more += You feel (dopey|clumsy|weak)
more += You feel a genetic drift
more += You feel monstrous
more += You feel your rage building
#more += You have disarmed
more += You have finished your manual
#more += You have reached level
more += You stop (a|de)scending the stairs
more += You turn into a fleshy mushroom
more += Your body shudders with the violent release of wild energies
more += Your guardian golem overheats
more += your magic stops regenerating
more += Your scales start
#more += your.*devoured
more += Green shoots are pushing up through the earth
# Things getting better
more += You can move again
more += You slip out of the net
more += You.*and break free
more += seems mollified
##################
# Translocations #
##################
# Teleporting
more += You blink
more += You.*teleport [^f]
more += You feel strangely (unstable|stable)
more += You feel your translocation being delayed
more += Your surroundings flicker
more += Your surroundings seem slightly different
more += Your surroundings suddenly seem different
# -Tele
more += You cannot blink right now
more += You cannot teleport right now
more += You feel.*firmly anchored in space
more += You are no longer firmly anchored in space
####################
# Expiring Effects #
####################
# God Abilities
# Divine Shield (The Shining One)
#more += Your divine shield starts to fade.
more += Your divine shield fades away.
# Jelly Prayer (Jiyva)
Your prayer is over.
# Mirror Damage (Yredelemnul)
more += dark mirror aura disappears
# Player Spells
# Death Channel
more += Your unholy channel is weakening
# Death's Door
more += time is quickly running out
more += life is in your own
# Enslavement
more += is no longer charmed
# Flight
more += You are starting to lose your buoyancy
stop += You lose control over your flight
# Haste
more += Your extra speed is starting to run out
more += You feel yourself slow down
# Invisibility
more += You feel more conspicuous
more += You flicker for a moment
more += You flicker back
# Ozocubu's Armour
#more += Your icy armour evaporates
#more += Your icy armour melts away
# Silence
more += Your hearing returns
# Swiftness
stop += start to feel a little slower
more += You feel sluggish
# Transmutations
#more += Your transformation is almost over
more += You have a feeling this form
more += You feel yourself come back to life
# Other
# Potion of Resistance
more += You start to feel less resistant.
more += Your resistance to elements expires
############
# Religion #
############
# Gifts or abilities are ready
# Dithmenos
more += You are shrouded in an aura of darkness
more += You now sometimes bleed smoke
more += You.*no longer.*bleed smoke
more += Your shadow no longer tangibly mimics your actions
more += Your shadow now sometimes tangibly mimics your actions
# Gozag
more += will now duplicate a non-artefact item
# Jiyva
more += will now unseal the treasures of the Slime Pits
# Kikubaaqudgha
more += Kikubaaqudgha will now enhance your necromancy
# Lugonu
more += Lugonu will now corrupt your weapon
# Qazlal
more += resistances upon receiving elemental damage
more += You are surrounded by a storm which can block enemy attacks
# Ru
more += you are ready to make a new sacrifice
# Sif Muna
more += Sif Muna is protecting you from the effects of miscast magic
# The Shining One
more += The Shining One will now bless
# Zin
more += will now cure all your mutations
# Poor Decisions
more += You really shouldn't be using
# Gaining new abilities
#: if you.god() ~= "Uskayaw" then
#more += You can now
#more += Your?.*can no longer
#: end
# Wrath
more += Fedhas invokes the elements against you
more += Lugonu sends minions to punish you
more += Okawaru sends forces against you
more += wrath finds you
# Xom Effects
more += staircase.*moves
more += is too large for the net to hold
# Other
more += Jiyva alters your body
: if you.god() == "Xom" then
more += god:
: end
: if not string.find(you.god(), "Jiyva") then
more += splits in two
:end
################
# Hell Effects #
################
#more += A gut-wrenching scream fills the air
#more += Brimstone rains from above
#more += Die\, mortal
#more += Leave now\, before it is too late
#more += Something frightening happens
#more += Trespassers are not welcome here
#more += We do not forgive those who trespass against us
#more += We have you now
#more += You do not belong in this place
#more += You feel a terrible foreboding
#more += You feel lost and a long\, long way from home
#more += You hear diabolical laughter
#more += You hear words spoken in a strange and terrible language
#more += You sense a hostile presence
#more += You sense an ancient evil watching you
#more += You shiver with fear
#more += You smell brimstone
#more += You suddenly feel all small and vulnerable
#more += You will not leave this place
############
# Monsters #
############
# Arriving Unexpectedly
more += appears in a shower of sparks
more += appears out of thin air
more += comes (up|down) the stairs
more += Something appears in a flash of light
more += The.*is a mimic
more += You sense the presence of something unfriendly
more += The.*answers the.*call
more += Wisps of shadow swirl around
more += Shadows whirl around
# Item Use
more += drinks a potion
more += evokes.*(amulet|ring)
more += reads a scroll
more += zaps a (wand|rod)
# 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|spriggan druid).*into view
more += (vault (warden|sentinel)|merfolk (avatar|siren)).*into view
more += (serpent|shifter|convoker|death cob).*into view
more += (phantasmal warrior|air elemental).*into view
# Paralysis/Petrify/Banish
more += (orc sorcerer|(?