# TEAMNAME Adventurous Pantagruel
# TEAMMEMBERS Antunes Bwijn
#
##################
# Mob Warnings #
# orig. ScarletJ #
##################
<
function SpoilerAlert()
local mobwarnings = {}
--Add dangerous monsters to this table by using their name as the key, (as a lua pattern)
--Set the value to the warning string you want to display, where it will formatted like:
--"[The] Monster_Name Warning_Message"
--If the Monster_Name includes a capital letter, the message will be prepended with [The]
mobwarnings["giant eyeball"] = "can paralyse you!"
mobwarnings["naga ritualist"] = "can remove poison resistance, and do damage over time with toxic radiance!"
mobwarnings["naga sharpshooter"] = "can shoot you with portal projectiles!"
mobwarnings["greater naga"] = "is strong in melee, and can cast poison arrow and IMB!"
mobwarnings["salamander mystic"] = "can haste allies, and can cast bolt of magma and IMB!"
mobwarnings["mana viper"] = "has an antimagic bite!"
mobwarnings["Vashnia"] = "can blink herself and allies away!"
mobwarnings["golden eyeball"] = "can confuse you!"
mobwarnings["electric golem"] = "has nasty electric attacks!"
mobwarnings["storm dragon"] = "has a nasty electric breath attack!"
mobwarnings["great orb of eyes"] = "can cast paralyse, disintegrate, slow, confuse, and teleport you!"
mobwarnings["vampire knight"] = "can cast paralyse!"
mobwarnings["vampire mage"] = "can Summon Undead and Animate Dead!"
mobwarnings["orc sorcerer"] = "can cast paralyse!"
mobwarnings["fire giant"] = "can cast fireball and bolt of fire!"
mobwarnings["frost giant"] = "can cast bolt of cold!"
mobwarnings["spriggan druid"] = "can awaken trees, and cast might on recalled animals!"
mobwarnings["thorn hunter"] = "can throw a nasty volley of thorns, and create brambles!"
mobwarnings["ice giant"] = "can cast bolt of ice!"
--mobwarnings["orc wizard"] = "might cast slow or confuse!"
mobwarnings["wraith"] = "can slow you in melee!"
mobwarnings["stone giant"] = "can throw large rocks and is a brute in melee!"
mobwarnings["ettin"] = "is a beast in melee!"
mobwarnings["fire dragon"] = "has a nasty fire breath attack!"
mobwarnings["fire crab"] = "has a flaming cloud breath attack!"
mobwarnings["ice dragon"] = "has a nasty cold breath attack!"
mobwarnings["apocalypse crab"] = "has a chaos cloud breath attack!"
mobwarnings["shadow dragon"] = "has a nasty draining breath attack!"
mobwarnings["golden dragon"] = "has multiple nasty breath attacks!"
mobwarnings["tentacled monstrosity"] = "is a beast in melee!"
mobwarnings["cyclops"] = "can throw large rocks!"
mobwarnings["red wasp"] = "can paralyse, slow, and poison in melee!"
mobwarnings["yellow wasp"] = "can paralyse and poison in melee!"
mobwarnings["Grinder"] = "can cast paralyse!"
mobwarnings["Rupert"] = "can paralyse you in fear!"
mobwarnings["air mage"] = "can cast airstrike!"
mobwarnings["titan"] = "can cast airstrike!"
mobwarnings["jumping spider"] = "can ensnare you in webs!"
mobwarnings["Aizul"] = "will try to put you to sleep and casts strong poison conjurations!"
mobwarnings["Arachne"] = "can ensnare you in her webs!"
mobwarnings["Harold"] = "can throw nets and cast bolt of fire"
mobwarnings["blizzard demon"] = "can cast airstrike!"
mobwarnings["wind drake"] = "can cast airstrike!"
mobwarnings["Gastronok"] = "can cast airstrike!"
mobwarnings["Enchantress"] = "can cast Dimension Anchor, Slow, Haste, Mass Confusion, and Strip Resistance!"
mobwarnings["Sojobo"] = "can cast airstrike!"
mobwarnings["Maurice"] = "can steal items, go invisible, and teleport away!"
mobwarnings["deep elf demonologist"] = "can cast banishment or summon Greater Demons!"
mobwarnings["Louise"] = "can cast banishment!"
mobwarnings["Psyche"] = "might banish you in melee!"
mobwarnings["Sonja"] = "will probably banish you in melee!"
mobwarnings["draconian caller"] = "can summon Dragons and Death Drakes!"
mobwarnings["draconian annihilator"] = "can cast Lehudib's Crystal Spear or Iron Shot!"
mobwarnings["draconian zealot"] = "can cast smite-targeted Hellfire or smite you!"
mobwarnings["deep elf annihilator"] = "can cast Lehudib's Crystal Spear or Iron Shot!"
mobwarnings["blood saint"] = "can cast LCS and other Legendary Destruction!"
mobwarnings["black sun"] = "can give allies a dangerous black mark which gives melee effects!"
mobwarnings["corrupter"] = "can summon allies from various branches!"
mobwarnings["moth of wrath"] = "can enrage both enemies and you!"
mobwarnings["orb spider"] = "can cast Orb of Destruction!"
mobwarnings["tarantella"] = "can cause confusion in melee!"
mobwarnings["brown ugly thing"] = "can cause corrosion in melee!"
mobwarnings["brown very ugly thing"] = "can cause corrosion in melee!"
mobwarnings["red ugly thing"] = "can burn your scrolls in melee!"
mobwarnings["red very ugly thing"] = "can cause sticky flames in melee!"
mobwarnings["flaming corpse"] = "can cause sticky flames in melee!"
mobwarnings["purple ugly thing"] = "can cause sickness in melee!"
mobwarnings["purple very ugly thing"] = "can cause rotting in melee!"
mobwarnings["komodo dragon"] = "can cause sickness in melee!"
mobwarnings["deep troll earth mage"] = "can cast LRD and dig!"
mobwarnings["deep troll shaman"] = "can cast haste and might on allies!"
mobwarnings["warmonger"] = "can sap your magic and summon a grand avatar!"
mobwarnings["chaos champion"] = "can dispel or entrap you, or other chaos effects!"
mobwarnings["draconian shifter"] = "can block teleports, blink allies encircling you, or cause you to blink!"
mobwarnings["guardian serpent"] = "can blink allies encircling you!"
mobwarnings["Roxanne"] = "can cast LCS and Iron Shot at you, or shift your position!"
mobwarnings["wizard"] = "might cast banishment, paralyse, or LCS!"
mobwarnings["ogre mage"] = "might cast banishment, paralyse, or LCS!"
mobwarnings["lich"] = "might cast banishment, paralyse, summon demon, or LCS!"
mobwarnings["Erolcha"] = "might cast banishment, paralyse, or LCS!"
mobwarnings["draconian scorcher"] = "can cast smite-targeted Hellfire!"
mobwarnings["hellion"] = "can cast smite-targeted Hellfire!"
mobwarnings["Azrael"] = "can cast smite-targeted Hellfire!"
mobwarnings["deep elf sorcerer"] = "can cast banishment or line-of-sight Hellfire!"
mobwarnings["deep elf mage"] = "can cast fireball and slow!"
mobwarnings["quicksilver dragon"] = "can dispel your buffs!"
mobwarnings["purple draconian"] = "can dispel your buffs!"
mobwarnings["yellow draconian"] = "can corrode your equipment at range!"
mobwarnings["mottled draconian"] = "can spit sticky flames at range!"
mobwarnings["vault sentinel"] = "can mark you and blow a signal horn!"
mobwarnings["vault warden"] = "can lockdown doors and staircases!"
mobwarnings["ironbrand convoker"] = "can recall allies and cast might on them!"
mobwarnings["ironheart preserver"] = "can absorb the damage of its allies and heal itself!"
mobwarnings["Hell Sentinel"] = "can cast line-of-sight Hellfire and Iron Shot!"
mobwarnings["Asmodeus"] = "can cast line-of-sight Hellfire and Summon Greater Demons!"
mobwarnings["flayed ghost"] = "can Flay you to shreds!"
mobwarnings["Ice Fiend"] = "can cast Torment!"
mobwarnings["Shadow Fiend"] = "can cast Torment and Dispel Undead!"
mobwarnings["curse skull"] = "can cast Torment and Summon Undead!"
mobwarnings["tormentor"] = "can cast Torment!"
mobwarnings["curse toe"] = "can cast Torment and Summon Fungus!"
mobwarnings["Menkaure"] = "can cast torment!"
mobwarnings["Gloorx Vloq"] = "can cast Torment!"
mobwarnings["Ereshkigal"] = "can cast Torment and paralyse!"
mobwarnings["Brimstone Fiend"] = "can cast torment and line-of-sight Hellfire!"
mobwarnings["daeva"] = "can smite you!"
mobwarnings["balrug"] = "can smite you, and cast fireball!"
mobwarnings["smoke demon"] = "can smite you, and cast ranged sticky flame!"
mobwarnings["deep elf priest"] = "can smite you!"
mobwarnings["orc priest"] = "can smite you!"
mobwarnings["orc high priest"] = "can smite you!"
mobwarnings["starcursed mass"] = "can smite you!"
mobwarnings["Frances"] = "can smite you!"
mobwarnings["Mnoleg"] = "cast Summon Eyes and smite you!"
mobwarnings["deep elf high priest"] = "can cast smite-targeted Hellfire or smite you!"
mobwarnings["mummy priest"] = "can cast torment and smite you!"
mobwarnings["greater mummy"] = "can cast torment and smite you!"
mobwarnings["Khufu"] = "can cast torment and smite you!"
mobwarnings["sphinx"] = "can cast paralyse, slow, confuse, and smite you!"
mobwarnings["Norris"] = "can cast paralyse and smite you, or drain your Int!"
mobwarnings["catoblepas"] = "can petrify you with its breath!"
mobwarnings["Jorgrun"] = "can cast petrify and shatter!"
mobwarnings["brain worm"] = "can drain your Int!"
mobwarnings["orange crystal statue"] = "can cast confuse and Shadow Creatures, or drain your Int!"
mobwarnings["Jory"] = "can mesmerise, cast LCS and blink close!"
mobwarnings["neqoxec"] = "can mutate you or drain your Int!"
mobwarnings["cacodemon"] = "can mutate you!"
mobwarnings["shining eye"] = "can mutate you!"
mobwarnings["orb of fire"] = "can mutate you!"
mobwarnings["pulsating lump"] = "can mutate you in melee!"
mobwarnings["Cerebov"] = "can cast Fire Storm, Iron Shot, and Summon Greater Demons!"
mobwarnings["Mennas"] = "can cast silence and confuse!"
mobwarnings["Ignacio"] = "can cast Agony!"
mobwarnings["giant orange brain"] = "can cast Shadow Creatures, or drain your Int!"
mobwarnings["boggart"] = "can cast Shadow Creatures!"
mobwarnings["shadow demon"] = "can cast Shadow Creatures!"
mobwarnings["ynoxinul"] = "can cast Iron Shot!"
mobwarnings["Frederick"] = "can cast Iron Shot!"
mobwarnings["Dispater"] = "can cast line-of-sight Hellfire, Iron Shot, and summon Greater Demons!"
mobwarnings["ghost moth"] = "will drain your Magic!"
mobwarnings["eye of draining"] = "will drain your Magic!"
-- Holds the overall alert message and count of dangers
local alerts = ""
local short_alert = " "
local total_dangers = 0
-- For each type of monster you can see, using getMonsterList()
-- This goes through each monster in the mobwarnings table above and
-- Checks to see if it matches the description of each mob in sight
-- Excluding forms that can't cast: zombie, skeleton, simulcrum, but not incapacited forms
for mons, count in pairs(getMonsterList()) do
for mob, message in pairs(mobwarnings) do
if string.find(mons, mob)
and not string.find(mons, "zombie")
and not string.find(mons, "orc wizard") -- there should be a better way to do this
and not string.find(mons, "skeleton")
and not string.find(mons, "shaped block of ice")
and not string.find(mons, "spectral")
and not string.find(mons, "simulacr") then
--Used to format the string for Unique/Named mobs
local is_fiend = (string.find(mons, "Fiend") ~= nil)
local is_uppercase = (string.find(mons, "%u") ~= nil) and not is_fiend
--Holds this mobs alert message
local alert = ""
local mob_name = ""
--Formatting for uniques
if is_uppercase then
alert = "" .. mons .. " " .. message
mob_name = mons
--For more than 1 of the same monster
elseif (count > 1) then
alert = "The ".. mons .. " " .. message .. "(" .. count .. "x)"
mob_name = mons .. "(" .. count .. "x)"
--For a single non-unique monster
else
alert = "The " .. mons .. " " .. message
mob_name = mons
end
--Keeps a count of all the found matches
total_dangers = total_dangers + count
--Adds the created alert string to the full string of alerts
alerts = alerts .. " " .. alert
short_alert = short_alert .. mob_name .. ", "
end
end
end
short_alert = string.sub(short_alert, 1, -3) .. "!"
--If there is an alert and it was not displayed in the last six messages then display the warning
if not ((alerts == "")
or string.find(crawl.messages(6), escape(alerts))) then
--For a single monster
if total_dangers == 1 then
crawl.mpr("Spoiler Alert:" .. alerts .. "")
--For 2 or 3
elseif total_dangers < 4 then
crawl.mpr("Warning(" ..total_dangers .. "x):" .. alerts .. "")
--For 4 to 7
elseif total_dangers < 8 and (not string.find(crawl.messages(6), escape(short_alert))) then
crawl.mpr("Danger(" ..total_dangers .. "x):" .. short_alert .. "")
--For 8 or more
elseif not string.find(crawl.messages(6), escape(short_alert)) then
crawl.mpr("PANIC(" ..total_dangers .. "x):" .. short_alert .. "")
end
end
end
-- Returns a table where the key is the monster description and value is the total number of that mob in your vision
function getMonsterList()
local monsters = {}
for x = -8,8 do
for y = -8,8 do
m = monster.get_monster_at(x, y)
if m and (m:attitude() == 0) then
desc = m:desc()
if (monsters[desc] == nil) then
monsters[desc] = 1
else
monsters[desc] = monsters[desc] + 1
end
end
end
end
return monsters
end
--Escapes the special characters in a string for pattern matching
function escape(str)
--Escapes parens and dash "()-"
local escaped = str:gsub('[%(%)%-]','%\%1')
--Removes any coloration parts of the string
return (escaped:gsub('<[^<]*>',''))
end
>
###############
# Damage Calc #
###############
: local previous_hp = 0
: local previous_mp = 0
: local max_hp = you.hp()
: local max_mp = you.mp()
:
: function AnnounceDamage()
: local current_hp = you.hp()
: local current_mp = you.mp()
: -- Set max hp/mp at beginning of turn
: if current_mp > max_mp then
: max_mp = current_mp
: end
: if current_hp > max_hp then
: max_hp = current_hp
: end
:
: --Skips message on initializing game
: if previous_hp > 0 then
: local hp_difference = previous_hp - current_hp
: local mp_difference = previous_mp - current_mp
:
: --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
: crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.")
: 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("Danger: You now have " .. current_mp .. "/" ..max_mp .." mp.")
: elseif current_mp <= (max_mp / 2) then
: crawl.mpr("Warning: You now have " .. current_mp .. "/" ..max_mp .." mp.")
: else
: crawl.mpr("You now have " .. current_mp .. "/" ..max_mp .." mp.")
: end
: end
: end
: --Set previous hp and mp at end of turn
: previous_hp = current_hp
: previous_mp = current_mp
: end
#############
# Autofight #
#############
# Do/don't throw stuff when autofighting
autofight_throw = true
autofight_throw_nomove = true
# If true. items are autofired stopping at the monsters feet (same as firing using .)
autofight_fire_stop = true
fire_order = launcher, return
fire_order += large rock, javelin, tomahawk, dart, stone
# Prevent me from tab-fighting to death below 75% HP
autofight_stop = 75
# Enables automagic attacks
automagic_enable = false
automagic_slot = a
# Percentage of MP to stop automagic at
automagic_stop = 0
# If set to true, resort to melee when automagic_stop is active
automagic_fight = false
##############
# Autopickup #
##############
# Used
# $ = gold
# ? = scroll
# ! = potion
# : = book
# " = jewellery
# / = wand
# % = food
# } = miscellaneous
# \ = rods
# | = staves
autopickup += $?!:"/%}\|
# Unused
# ) = weapon
# ( = missiles
# [ = armour
# X = corpses
# Secondary Armour Auto-Pickup
{
add_autopickup_func(function(item, name)
if item.class(true) == "armour" then
local good_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots"}
sub_type, _ = item.subtype()
current_item = items.equipped_at(good_slots[sub_type])
if (good_slots[sub_type] ~= nil) and (current_item == nil) then
return true
end
return false
end
end)
}
# Allows easily dropping multiple items
drop_mode += multi
# Always show the full list of items when you pick up a stack
pickup_mode += multi
# Allows followers to pick up ANYTHING (take care not to lose artifacts)
default_friendly_pickup += all
# Set Alias for Autopickup Exceptions
ae := autopickup_exceptions
ae += useless_item, dangerous_item, evil_item
# Dont pickup potion(s) of [coagulated] blood if you are not a vampire
: if you.race() ~= "Vampire" then
ae += potions? of.*blood
: end
# Autopickup artefacts/ego
ae +=