# TEAMNAME The Three Sphinxes
# TEAMMEMBERS Mumonspawn

  _   __    __                  __ 
 | | / /__ / /  __ ____ _  ___ / /_
 | |/ / -_) _ l/ // /  i l/ -_) __/
 |___/l__/_//_/l_,_/_/_/_/l__/l__/ 


#참고사이트
#gsub : 구글
#http://crawl.akrasiac.org/docs/options_guide.txt
#crawl.messages(1) : https://doc.dcss.io/modules/crawl.html#messages
#ready() : https://doc.dcss.io/modules/Hooks.html#ready


############################
### Interface & Commands ###
############################
travel_delay = -1
explore_delay = -1
explore_wall_bias = 0
warn_hatches=true
explore_auto_rest = true
rest_wait_both = true
rest_wait_ancestor = true
view_delay = 120
default_manual_training = true
sort_menus = true:equipped,identified,basename,art,ego,glowing,qualname,curse,charged,slot
ability_menu = true
cloud_status = true
hp_warning = 10
mp_warning = 20
autofight_stop  = 40
show_more = false
tile_show_demon_tier = True
force_targeter =
force_spell_targeter =
#travel_avoid_terrain = deep water
tile_font_crt_family = Consolas
tile_font_stat_family = Consolas
tile_font_msg_family = Consolas
tile_font_lbl_family = Consolas

include = no_vi_command_keys.txt

fire_order = launcher, throwing

wall_jump_move = true

wall_jump_prompt = true


translation_language = ko
translation_debug = true
always_show_gems = true

sound_on = true

sound_pack += https://osp.nemelex.cards/build/latest.zip:["init.txt"]

one_SDL_sound_channel = true

sound_fade_time = 0.5



sound_volume = 0.1


#############################################
##### Autoexplore Interruption Messages #####
#############################################
delay_safe_poison = 90:100
rrst := runrest_stop_message
rrig := runrest_ignore_message
rrst += Your unholy channel is weakening
rrst += You flicker back into view
rrig += your breath back
rrig += You feel.*sick
rrig += You feel.*hungry
rrig += You regained.*mp
rrig += You are no longer corroded.
rrig += You can drink potions agian
rrig += You feel yourself come back to life
rrig += frozen ramparts melt away
rrig += Your transformation has ended
rrig += Your blood armour dries and flakes away
rrig += You are no longer poisoned
rrig += You feel yourself speed up
rrig += Your fire (vortexlvortices).*something
rrig += something .* fire (vortexlvortices)
rrig += you destroy the.*shaped block of ice
rrig += You feel a bit more experienced
rrig += A nearby plant withers and dies
rrig += Your protection from.*is fading
rrig += You feel less protected from
rrig += You can no longer merge with and destroy a victim
rrig += You can no longer pass through
rrig += the wereblood boils in your veins
#message_colour += mute:Really attack next to the
#message_colour += mute:Really refrigerate near your

message_colour ^= lightgreen:.*(shout|hiss|bark|howl|roar|roars|hear a roar|growl|croak|creak|buzz|screech|bellow|gurgles|gurgling sound|squeal)
message_colour ^= lightyellow:.*(shout|squeal)

##########################
### Messages & Display ###
##########################
hp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red
mp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red
monster_list_colour =
monster_list_colour += friendly:green,neutral:brown
monster_list_colour += good_neutral:brown,strict_neutral:brown
monster_list_colour += trivial:darkgrey,easy:lightgrey
monster_list_colour += tough:yellow,nasty:lightred

message_colour ^= green:more experienced
menu_colour += lightgreen:potions? of agility

##########################
#####  autoinscribe  #####
##########################
autoinscribe += potion.*berserk rage:!q
autoinscribe += potion.*might:!q
autoinscribe += potion.*agile:!q
autoinscribe += potion.*stab:!q
autoinscribe += potion.*curing:!q
autoinscribe += potion.*brilliance:!q
autoinscribe += potion.*ambrosia:!q
autoinscribe += potion.*cancellation:!q
autoinscribe += potion.*magic:!q
autoinscribe += potion.*invisibility:!q
autoinscribe += potion.*resistance:!q
autoinscribe += potion.*haste:!q
autoinscribe += potion.*flight:!q
autoinscribe += potion.*heal wounds:!q
autoinscribe += scroll.*mapping:!r
autoinscribe += scroll.*silence:!r
autoinscribe += scroll.*fog:!r
autoinscribe += scroll.*fear:!r
autoinscribe += scroll.*teleportation:!r
autoinscribe += scroll.*summoning:!r
autoinscribe += scroll.*holy word:!r
autoinscribe += throwing net:!f
autoinscribe += atropa:!f
autoinscribe += curare-:!f
autoinscribe += datura:!f
autoinscribe += ziggurat:!V

############################
########  Shortcuts ########
############################
Item_slot += (arrow|bolt|bullet):+q
Item_slot += poisoned dart:+v
Item_slot += curare:+c
Item_slot += throwing net:+z

Item_slot += wand of flame:+f
Item_slot += wand of (disintegration|mind):+d
Item_slot += wand of digging:+D
Item_slot += wand of iceblast:+g
Item_slot += wand of acid:+G
Item_slot += wand of (enslave|charm):+E
Item_slot += wand of paralysis:+e
Item_slot += wand of random effect:+h
Item_slot += wand of cloud:+H

Item_slot += lightning rod:+V
Item_slot += phial of floods:+C
Item_slot += tin of tremorstones:+F
Item_slot += Condenser vane:+B
Item_slot += Box of beasts:+Z
Item_slot += Phantom mirror:+x
Item_slot += Lamp of fire:+B
Item_slot += fan of gales:+X

item_slot += scroll.*identify:+r
item_slot += scroll.*enchant armour:+a
item_slot += scroll.*enchant weapon:+A
item_slot += scroll.*magic mapping:+s
item_slot += scroll.*immolation:+S
item_slot += scroll.*blink:+W
item_slot += scroll.*fear:+R
item_slot += scroll.*remove curse:+t
item_slot += scroll.*fog:+y
item_slot += scroll.*teleportation:+T

item_slot += potion.*curing:+Q
item_slot += potion.*haste:+h
item_slot += potion.*might:+K
item_slot += potion.*lignification:+l
item_slot += potion.*brilliance:+L
item_slot += potion.*stabbing:+m
item_slot += potion.*resistance:+M
############################
ability_slot += heal wounds:+U

ability_slot += Evoke Berserk:+t
ability_slot += Fly|flight:+d
ability_slot += Stop Flying:+D
ability_slot += Breathe:f
ability_slot += Blink:+s
ability_slot += Invisibility:+e
ability_slot += End Transformation:+q

ability_slot += Berserk:+a
ability_slot += trog's hand:+w
ability_slot += Brothers In Arms:+c

ability_slot += Draw Escape:+r
ability_slot += Draw Summoning:+w
ability_slot += Draw Destruction:+a
ability_slot += Triple Draw:+Q
ability_slot += Deal Four:+A
ability_slot += Stack Five:+R

ability_slot += Draw out power:+w
ability_slot += power leap:+a
ability_slot += apocalypse:+c

ability_slot += line pass:+s
ability_slot += finale:+c

ability_slot += bend time:+w
ability_slot += temporal distortion:+a
ability_slot += slouch:+c
ability_slot += step out of time:+b

ability_slot += recall:+w
ability_slot += animate remains:+a
ability_slot += animate dead:+U
ability_slot += pain mirror:+c
ability_slot += drain life:+a
ability_slot += enslave soul:+v

ability_slot += lesser servant:+w
ability_slot += greater servant:+r
ability_slot += minor des:+a
ability_slot += major des:+c

ability_slot += recite:+a
ability_slot += vitalisation:+w
ability_slot += imprison:+c
ability_slot += sanctuary:+r

ability_slot += Lesser healing:+U
ability_slot += heal other:+c
ability_slot += purification:+w
ability_slot += divine protection:+W
ability_slot += greater healing:+a
ability_slot += divine vigor:+r

ability_slot += cleansing flame:+a
ability_slot += divine shield:+w
ability_slot += summon divine warrior:+c

ability_slot += enter the abyss:+W
ability_slot += corrupt:+C
ability_slot += banish:+a
############################
spell_slot += Dragon Form:P
spell_slot += Necromutation:P
spell_slot += Statue Form:P

spell_slot += Magic Dart:z
spell_slot += Searing Ray:x
spell_slot += Fulminant Prism:b
spell_slot += Iskenderun's Mystic Blast:v
spell_slot += Iskenderun's Battlesphere:q

spell_slot += Sandblast:z
spell_slot += Stone Arrow:x
spell_slot += petrify:f
spell_slot += lee's rapid deconstruction:c

spell_slot += Foxfire:U
spell_slot += conjure flame:b
spell_slot += sticky flame:x
spell_slot += fireball:c

spell_slot += Freeze:z
spell_slot += Frozen ramparts:U
spell_slot += ozocubu's armour:P
spell_slot += hail storm:x
spell_slot += summon ice beast:O

spell_slot += Shock:z
spell_slot += static discharge:x
spell_slot += airstrike:v
spell_slot += Lightning Bolt:c
spell_slot += Conjure Ball Lightning:U

spell_slot += Sting:z
spell_slot += Poisonous Vapours:x
spell_slot += Mephitic cloud:f
#spell_slot += Venom bolt:c
spell_slot += Olgreb's Toxic Radiance:U
spell_slot += Ignite poison:I

spell_slot += pain:z
spell_slot += vampiric draining:x
spell_slot += agony:c
spell_slot += animate skeleton:q
spell_slot += animate dead:U

spell_slot += Petrify:d
spell_slot += Portal Projectile:e
spell_slot += Cause Fear:r
spell_slot += Corona:z
spell_slot += Slow:x
spell_slot += Inner Flame:v

#spell_slot += Regeneration:U
#spell_slot += Shroud of Golubria:I
#spell_slot += Song of Slaying:O
#spell_slot += Ozocubu's armour:O
#spell_slot += Spectral weapon:U
#spell_slot += Infusion:z
#spell_slot += Aura Of Abjuration:P
#spell_slot += Deflect Missiles:P

spell_slot += Invisibility:J
spell_slot += Silence:y

spell_slot += Blink:+s
spell_slot += Passwall:+d
spell_slot += Golubria's passage:+a
spell_slot += Swift:L
spell_slot += Leda's Liquefaction:P
spell_slot += Summon Butterflies:N
spell_slot += Apportation:+n

######################
##### Autopickup #####
######################
autopickup = $?!:"/|\}
ae := autopickup_exceptions
ae ^= >scroll.*(torment|vulnerability)
ae += <(Roxanne|horn of Geryon|.*Wucad Mu)
ae ^= <(immolation|lignification|mutation|atrraction)
ae ^= <tin of tremorstones
ae ^= <wand.*(random|polymorph|flame|disintegration)
ae += >staff of (fire|cold|air|earth|conj|pois|death)
ae += >amulet of (faith|regen|reflect|the acrobat|guardian|magic)
ae += >chessboard
ae += <(boomerang|javelin|throwing net|dart)
ae += <artefact
ae += useless_item

: if you.race() ~= "Octopede" then
ae += >ring of protection from (magic|fire|cold)
ae += >ring of (fire|ice|pois|positive|resist corr|see|will)
ae += >ring of (mag|flight|steal|wiz|int|str|dex|slay|prot|eva)
: end

: if you.race() == "Ogre" or you.race() == "Troll" then
ae += <large rock
: end

########################
#####  Force_more  #####
########################
more := force_more_message
flash := flash_screen_message

: if you.xl() < 8 then
more += (ogre|orc priest|orc warrior|hornet|centaur|drake|cyclops).*into view
more += wielding.*(venom|chaos|elec|drain)
: end
: if you.xl() < 15 then
more += (meliai|beetle|hydra|dragon|ettin|stone giant|frost giant|fire giant).*into view
more += identify.*(gained.*)
: end
: if you.xl() < 27 then
more += (high priest|annihilator|sorcerer|scorcher|moth).*into view
more += (titan|juggernaut|shrike|moth|warden|acid blob|executioner).*into view
#슬라임 합침27
more += form an (enormous|titanic)
#투명27
more += Deactivating autopickup
more += sky beast appears
#위험한 완드27
more += carrying a wand of
more += zaps a wand
#위험한 다트27
more += is.*quivering
#왜곡 무기 경고27
more += hits you.*distortion
more += Its appearance distorts for a moment
more += you fell strangely unstable
flash += wielding.*distortion
flash += distortion.*into view
flash += There is.*of distortion.
more += wielding.*distortion
more += distortion.*into view
more += There is.*of distortion.
#텔포
more += Your surroundings suddenly seem different
: end

#돌연변이
more += (neqoxec|cacodemon|shining eye).*into view
#토먼트
more += (tormentor|curse skull|curse Toe|mummy priest|greater mummy).*into view
#그 외
more += (hellion|hell sentinel|fiend|tzitzimitl).*into view
more += (lich|doom hound|floating eye).*into view
#네임드
more += (27-headed|gold.*simulacrum).*into view
more += (Agnes|Aizul|Antaeus|Arachne|Asmodeus|Asterion|Azrael|Bai suzhen|Blork|Boris|Crazy Yiuf|Dissolution|Dispater|Donald|Dowan|Duvessa|Edmund|Enchantress|Ereshkigal|Erica|Erolcha|Eustachio|Fannar|Frances|Frederick|Gastronok|Geryon|Grinder|Grum|Harold|Ignacio|Ijyb|Ilsuiw|Jessica|Jorgrun|Jory|Joseph|Josephine|Khufu|Kirke|Lernaean|Louise|Maggie|Mara|Margery|Maurice|Menkaure|Mennas|Murray|Nergalle|Natasha|Nessos|Nikola|Pikel|Polyphemus|Ribbit|Psyche|Purgy|Robin|Roxanne|Royal jelly|Rupert|Roka|Serpent of Hell|Sigmund|Snorg|Sojobo|Sonja|Terence|Tiamat|Urug|Vashnia|Xtahua|pandemonium).*into view
#위험한 몬스터로 변이
more += change.*(floating|shining|moth)

#제단 발견
more += found.*altar

#판데 룬 구역 진입
more += The mighty Pandemonium lord.*resides here

#위험한 피격
more += you!!
more += you with.*!!
more += you convulse!
more += pie hits you
more += Your body is wracked with pain
more += low hitpoint warning
more += looks drowsy

#위험한 마법
more += You cannot cast
more += weaves a glowing
more += Roxanne (casts|mumb)
more += The naga.*blink.*blink
more += A sentinel's mark forms upon you
more += goes berserk!
more += You feel.*slow down
more += The floating eye.*(glare|focuse|fixate)
more += revealing.*core
flash += The floating eye.*(glare|focuse|fixate)
flash += The spriggan druid calls
flash += watched by something

#마법 못 씀
more += You are unable to access your magic

#촉수샛기 배신
more += Your eldritch tentacle suddenly becomes enraged

#마법 풀림
more += You feel.*(confused|wooden)
more += Your magical effects are unravelling
more += You flicker back
more += Your unholy channel is weakening
more += Your skin stops
more += You miscast

#위험한 변이
more += You.*(uncertain|pissed off|vision blurs)
#?뭐더라
more += You don't feel so good about this

#위험한 브레스
more += The catoblepas breathes
#아포꽃게more += chaos 어쩌구
more += The vile air.*you
more += the foul vapour.*you
#:if you.race() ~= "Gargoyle" then
#:end

#위험한 함정
more += You are suddenly yanked towards
more += You become entangled in the net
more += enter.*dispersal trap
more += hear a loud "Zot
flash += (blundered into a|invokes the power of) Zot

#신성 무기 경고
:if you.race() == "Vampire" or you.race() == "Mummy" or you.race() == "Ghoul" or you.race() == "Demonspawn" then
more += (revenant|black sun).*into view
more += wielding.*holy wrath
more += holy wrath.*into view
flash += wielding.*holy wrath
flash += holy wrath.*into view
:end

#메뉴얼
more += finished your manual
more += Training target

#입구 찾음
more += Found.*(Temple|Pandemonium|Abyss|bazaar|rune of zot)

#뭔지 모름
more += greedy_visited_item_stack,stairs,shops

#신 관련
more += Vehumet offers
more += Ru.*(believe|offer)
more += god:(sends|finds|silent|anger)
more += Uskayaw will force your foes to helplessly watch your dance
flash += Uskayaw links your audience in an emotional bond!
: if you.god() == "Ashenzari" then
more += You have a vision of.*gate
: end

#미니 던전
more += (sound.*rushing water|rusting.*drain|drain falling apart)
more += (hiss.*sand|ticking.*clock|dying ticks)
more += (wave of frost|crackling.*melting|rumble.*avalanche|falling.*rocks)
more += (rumble.*avalanche|falling.*rocks|volcano eruptslheat about you)
more += (interdimensional caravan|coins.*counted|tolling.*bell)
more += (distant wind|whistling.*wind)
more += (beating.*drum|drumbeats cease|rapidly growing quiet)
more += (roar of battle|creaking.*port|portcullis is probably)
more += (crackle.*arcane power|crackle.*magical portal)
rrst += (sound.*rushing water|rusting.*drain|drain falling apart)
rrst += (hiss.*sand|ticking.*clock|dying ticks)
rrst += (wave of frost|crackling.*melting|rumble.*avalanche|falling.*rocks)
rrst += (rumble.*avalanche|falling.*rocks|volcano eruptslheat about you)
rrst += (interdimensional caravan|coins.*counted|tolling.*bell)
rrst += (distant wind|whistling.*wind)
rrst += (beating.*drum|drumbeats cease|rapidly growing quiet)
rrst += (roar of battle|creaking.*port|portcullis is probably)
rrst += (crackle.*arcane power|crackle.*magical portal)


##################################
######## Function Section ########
##################################
{
function ready()
   XLCheckOptions()
   Altarmore()
   crawlstart()
   chatchat()
   zmutate()
   Statueman()
   Contamgirl()
   hpWarning()
   hp_percent()
   mp_percent()
   AnnounceDamage()
end
}
#ready제외
#   DDoorWarning()
#  DDoorCounter()


{
local check8 = true
local check15 = true
local check27 = true
function XLCheckOptions()
  if you.xl() >= 8 and check8 then
    crawl.setopt("more -= (ogre|orc priest|orc warrior|hornet|centaur|drake|cyclops).*into view")
    crawl.setopt("more -= wield.*(venom|chaos|elec|drain)")
    crawl.setopt("more -= you!")
    crawl.setopt("more -= you with.*!")
    crawl.setopt("more ^= you!!")
    crawl.setopt("more ^= you with.*!!")
    check8 = false
  end
  if you.xl() >= 15 and check15 then
    crawl.setopt("more -= (meliai|beetle|hydra|dragon|ettin|stone giant|frost giant|fire giant).*into view")
    crawl.setopt("more -= identify.*(gained.*)")
    crawl.setopt("ae ^= >potion.*berserk")
    crawl.setopt("ae ^= >(poisoned dart|atropa|datura)")
    crawl.setopt("ae ^= >wand of disintegration")
    crawl.setopt("ae ^= wand of (random|poly|flame)")
    ToggleRestper()
    ToggleAutofightStop()
    check15 = false
  end
  if you.xl() == 27 and check27 then
    crawl.setopt("more -= (high priest|annihilator|sorcerer|scorcher|moth).*into view")
    crawl.setopt("more -= (titan|juggernaut|shrike|moth|warden|acid blob|executioner).*into view")
    crawl.setopt("more -= form an (enormous|titanic)")
    crawl.setopt("more -= Deactivating autopickup")
    crawl.setopt("more -= sky beast appears")
    crawl.setopt("more -= carrying a wand of")
    crawl.setopt("more -= zaps a wand")
    crawl.setopt("more -= is.*quivering")
    crawl.setopt("more -= hits you.*distortion")
    crawl.setopt("more -= Its appearance distorts for a moment")
    crawl.setopt("more -= you fell strangely unstable")
    crawl.setopt("more -= wielding.*distortion")
    crawl.setopt("more -= Your surroundings suddenly seem different")
    crawl.setopt("ae ^= phial of floods")
    crawl.setopt("ae ^= lightning rod")
    crawl.setopt("ae ^= scroll.*remove curse")
    check27 = false
  end
end
}

{
local altar = true
function Altarmore()
 if altar and (you.xl() >= 15 or you.race() == "demigod" or you.god() ~= "No God" or string.find(crawl.messages(1), "@@godnono")) then
  altar = false
  crawl.setopt("more -= found.*altar")
 end
end
}

{
local crast = true
function crawlstart()
 if you.turns() == 0 and crast then
 crast = false
 crawl.sendkeys("m")
 crawl.mpr("<white>자동 휴식, 휴식 시 회복비율 100, 선별 경고 적용</white>")
 end
end
}

{
function chatchat()
 if string.find(crawl.messages(1), "@@help") then
  crawl.yesno("more 경고 범위 : F8 (Y/N)", false, false, true, false)
  crawl.yesno("탐험 시 자동 휴식 : F9 (Y/N)", false, false, true, false)
  crawl.yesno("휴식 회복 비율 : F10 (Y/N)", false, false, true, false)
  crawl.yesno("자신, 아군 공격 허용/불허 : - (Y/N)", false, false, true, false)
  crawl.yesno("이동 딜레이 : 9 (Y/N)", false, false, true, false)
  crawl.yesno("휴식 시 고려할 것 : 10 (Y/N)", false, false, true, false)
  crawl.yesno("아래 명령어는 @@명령어 로 사용 (Y/N)", false, false, true, false)
  crawl.yesno("타일 관련 : tilenormal, tile몬스터이름 (Y/N)", false, false, true, false)
  crawl.mpr("<white>끝</white>")
 end
 if (string.find(crawl.messages(1), "@@tilenormal")) then
   crawl.setopt("tile_player_tile = normal")
 elseif (string.find(crawl.messages(1), "@@tile")) then
   monsterName = crawl.messages(1):gsub("Enter note: @@tile", "")
   crawl.setopt("tile_player_tile = tile:mons_" .. monsterName)
 end
end
}

{
local guant = true
function zmutate()
 if you.petrifying() then
  crawl.yesno("<red>석화</red>", false, false, true, true)
  crawl.mpr("<white>텔/블링크/야라/캔슬</white>")
 end
 if gaunt and (you.god() == "Lugonu" or you.god() == "Fedhas") and string.find(crawl.messages(4), "enter.*gauntlet") then
  crawl.yesno("<white>권능 쓰자</white>", false, false, true, true)
  gaunt = false
 end
end
}

{
local contam = true
function Contamgirl()
 if you.status("slightly contaminated") and contam then
  crawl.mpr("<white>you convulse!</white>")
  contam = false
 end
 if you.status("very slightly contaminated") and not contam then
  crawl.mpr("<white>freezes</white>")
  contam = true
 end
end
}

###############################################################################
{
local statue = true
function Statueman()
if (you.status("statue-form (expiring)") or you.status("lich-form (expiring)") or you.status("dragon-form (expiring)") or you.status("hydra-form (expiring)")) and statue and hostile_in_los() then
crawl.mpr("<white>you convulse!</white>")
statue = false
end
if (not you.status("statue-form (expiring)") and not you.status("lich-form (expiring)") and not you.status("dragon-form (expiring)") and not you.status("hydra-form (expiring)")) then
statue = true
end
end
}

{
local los_range = 7
if you.race() == "Barachi" then
los_range = 8
end
function hostile_in_los()
local have_t1 = false
for x = -los_range,los_range do
for y = -los_range,los_range do
m = monster.get_monster_at(x, y)
if m and not m:is_safe() then
return true
end
end
end
return false
end
}
###############################################################################
{
function hp_percent()
  a,b=you.hp() return 90*a/b
end
}
{
function mp_percent()
 a,b=you.mp() return 90*a/b
end
}

{
local hp59 = true
local hp39 = true
local hp19 = true
function hpWarning()
 if hp_percent() < 59 and hp_percent() > 40 and hp59 then
  crawl.mpr("<white>looks drowsy</white>")
  crawl.mpr("<white>체력이 60% 이하..</white>")
  hp59 = false
 end
 if hp_percent() > 60 then
  hp59 = true
 end

 if hp_percent() < 39 and hp_percent() > 20 and hp39 and not you.status("death's door") then
  crawl.yesno("체력 40% 이하.. 주의(Y/N)", false, false, true, true)
  crawl.mpr("<white>투명,가속,수호정령 마나물약,지구랏</white>")
  hp59 = false
  hp39 = false
 end
 if hp_percent() > 40 then
  hp39 = true
 end

 if hp_percent() < 19 and hp59 and not you.status("death's door") then
  crawl.yesno("You Die...", false, false, true, true)
  crawl.yesno("키보드에서 손 떼!!!", false, false, true, true)
  crawl.mpr("<white>투명,가속,수호정령 마나물약,지구랏</white>")
  crawl.mpr("<white>You convulse!</white>")
  hp59 = false
  hp39 = false
  hp19 = false
 end
 if hp_percent() > 20 then
  hp19 = true
 end
end
}

{
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")) then
      max_hp_decreased = true
    elseif (current_form:find("dragon") or
        current_form:find("statue") or
        current_form:find("tree") or
        current_form:find("ice")) 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("<green>You now have " .. current_hp .. "/" .. max_hp .. " hp.</green>")
      else
        crawl.mpr("<yellow>You now have " .. current_hp .. "/" .. max_hp .. " hp.</yellow>")
      end
    else
      --On losing health
      if (current_hp < previous_hp) then
        if current_hp <= (max_hp * 0.30) then
          crawl.mpr("<red>@ " .. hp_difference .. " 의 대미지,</red><lightred> 남은 HP = " .. current_hp .. "/" .. max_hp .. " hp.</lightred>")
        elseif current_hp <= (max_hp * 0.50) then
          crawl.mpr("<red>@2 " .. hp_difference .. " 의 대미지, 남은 HP2 = " .. current_hp .. "/" .. max_hp .. " hp.</red>")
        elseif current_hp <= (max_hp *  0.70) then
          crawl.mpr("<red>@3 " .. hp_difference .. " 의 대미지,</red><yellow> 남은 HP3 = " .. current_hp .. "/" .. max_hp .. " hp.</yellow>")
        elseif current_hp <= (max_hp * 0.90) then
          crawl.mpr("<red>@4 " .. hp_difference .. " 의 대미지,</red><lightgrey> 남은 HP4 = " .. current_hp .. "/" .. max_hp .. " hp.</lightgrey>")
        else
          crawl.mpr("<red>@5 " .. hp_difference .. " 의 대미지,</red><green> 남은 HP5 = " .. current_hp .. "/" .. max_hp .. " hp.</green>")
        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
}

{
local door = true
function DDoorWarning()
  if you.status("death's door (expiring)") and door then
  crawl.yesno("DDoor is almost expired! (Y or N to confirm.)", false, false, true, false)
  crawl.mpr("<white>It will be ended within 5-10 turns......</white>")
  door = false
  end
  if not you.status("death's door (expiring)") then
  door = true
  end
end
}
{
local counter = you.turns()
function DDoorCounter()
if you.status("death's door (expiring)") then
crawl.mpr("<white>Count "..you.turns() - counter.."......</white>")
end
if not you.status("death's door (expiring)") then
counter = you.turns()+1
end
end
}

##############################
##### non-ready function #####
##############################
{
function c_answer_prompt(prompt)

 if prompt:find("vortices") or prompt:find("vortex") or prompt:find("battlesphere") or prompt:find("servitor") or prompt:find("scarab") then
 return true
 end

 if prompt:find("Really.*into that cloud of flame?") and you.res_fire() == 3 then
 return true
 end

 if prompt:find("Really.*into that cloud of freezing vapour?") and you.res_cold() == 3 then
 return true
 end

 if not target and (prompt:find("Really target yourself") or 
  prompt:find("Really fire in your ally")) then
   crawl.mpr("<white>사격 취소 됨.</white>")
   return false
 end

end
}


# if prompt:find("Really attack near your") and (you.god() ~= "Okawaru" or 
#you.god() ~= "Fedhas" or you.god() ~= "Jiyva" or you.god() ~= "Beogh" or #you.god() ~= "Yredelemnul" or you.god() ~= "Elyvilon" or you.god() ~= "The #Shining One" or you.god() ~= "Zin") then
#  return true
# end


{
spdrr = false
spdwp = false
function SpeedrunRest()
 if not spdrr then
  spdrr = true
  crawl.mpr("휴식..")
 else
  spdrr = false
  crawl.mpr("끝!")
 return
 end

 if spdrr and not spdwp then
  crawl.sendkeys("w*j")
  spdwp = true
 elseif not spdrr and spdwp then
  crawl.sendkeys("wu")
  spdwp = false
 end

 if spdrr and hostile_in_los() then
  crawl.mpr("<white>you convulse!</white>")
  spdrr = false
 end
end
}

#Toggle
#macros += M - ===ToggleTargeting
{
target = true
 function ToggleTargeting()
  if target then
   target = false
   crawl.mpr("자신, 아군 사격 허용")
  else
   target = false
   crawl.mpr("자신, 아군 사격 불가")
   target = true
  end
 end
}

#macros += M 9 ===ToggleDelaytrav
#{
#local delaytrav = true
#function ToggleDelaytrav()
# if delaytrav then
#  crawl.setopt("travel_delay = 1")
#  crawl.setopt("explore_delay = 1")
#  crawl.mpr("<white>또르르...</white>")
#  delaytrav = false
# else
#  crawl.setopt("travel_delay = -1")
#  crawl.setopt("explore_delay = -1")
#  crawl.mpr("<white>휙휙</white>")
#  delaytrav = true
# end
#return
#end
#}

#macros += M \{-274} ===ToggleAutofightStop
{
local autofight1 = 50
function ToggleAutofightStop()
 if autofight1 == 50 then
  crawl.setopt("autofight_stop  = 40")
  crawl.mpr("<white>탭질 한계 40%</white>")
   autofight1 = 40
 elseif autofight1 == 40 then
   crawl.setopt("autofight_stop  = 30")
  crawl.mpr("<white>탭질 한계 30%</white>")
   autofight1 = 30
 elseif autofight1 == 30 then
   crawl.setopt("autofight_stop  = 50")
  crawl.mpr("<white>탭질 한계 50%</white>")
   autofight1 = 50
 end
return
end
}


macros += M \{-272} ===ToggleMoreall
{
local moreall = 0
function ToggleMoreall()
 if moreall == 0 then
  crawl.setopt("more += into view")
  crawl.mpr("<white>모두 경고</white>")
  moreall = 1
 elseif moreall == 1 then
  crawl.setopt("more -= into view")
  crawl.setopt("more -= (neqoxec|cacodemon|shining eye).*into view")
  crawl.setopt("more -= (tormentor|curse skull|curse Toe|mummy priest|greater mummy).*into view")
  crawl.setopt("more -= (hellion|hell sentinel|fiend|tzitzimitl).*into view")
  crawl.setopt("more -= (lich|doom hound|floating eye).*into view")
  crawl.setopt("more -= hit you!!")
  crawl.setopt("more -= hit you with.*!!")
  crawl.setopt("more += hit you!!!")
  crawl.setopt("more += hit you with.*!!!")
  crawl.mpr("<white>지구랏 경고 완화</white>")
  moreall = 2
 elseif moreall == 2 then
  crawl.setopt("more -= hit you!!!")
  crawl.setopt("more -= hit you with.*!!!")
  crawl.setopt("more += (hellion|hell sentinel|fiend|tzitzimitl).*into view")
  crawl.setopt("more += (lich|doom hound|floating eye).*into view")
  crawl.setopt("more += hit you!!")
  crawl.setopt("more += hit you with.*!!")
  crawl.mpr("<white>원래대로 선별 경고</white>")
  moreall = 0
 end
return
end
}

macros += M \{-273} ===ToggleAutorest
{
local autorest = true
function ToggleAutorest()
 if autorest then
  crawl.setopt("explore_auto_rest = false")
  crawl.mpr("<white>자동 휴식 OFF</white>")
  autorest = false
 else
  crawl.setopt("explore_auto_rest = true")
  crawl.mpr("<white>자동 휴식 ON</white>")
  autorest = true
 end
return
end
}

macros += M \{-274} ===ToggleRestper
{
local restper1 = 100
function ToggleRestper()
 if restper1 == 100 then
  crawl.setopt("rest_wait_percent = 90")
  crawl.mpr("<white>90% 휴식</white>")
   restper1 = 90
 elseif restper1 == 90 then
   crawl.setopt("rest_wait_percent = 80")
   crawl.mpr("<white>80% 휴식</white>")
   restper1 = 80
 elseif restper1 == 80 then
   crawl.setopt("rest_wait_percent = 50")
   crawl.mpr("<white>50% 휴식</white>")
   restper1 = 50
 elseif restper1 == 50 then
   crawl.setopt("rest_wait_percent = 100")
   crawl.mpr("<white>100% 휴식</white>")
   restper1 = 100
 end
return
end
}


########################################
### autopickup armor enhanced by HDA ###
########################################
{
add_autopickup_func(function(it, name)
  local class = it.class(true)
  local armour_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots", body="Armour", shield="Shield"}
  if (class == "armour") then
  if it.is_useless then return false end
    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 not equipped_item then
        return true
      else
        return it.artefact or it.branded or it.ego
      end
    end
    if (sub_type == "shield") then
      if equipped_item then
          return it.artefact or it.branded or it.ego
      end
    end
    if (sub_type == "body") then
      if equipped_item then
          return it.artefact or it.branded or it.ego
      end
    end
  end
end)
}


#####################
##### webmodule #####
#####################
#$ lab_gold_status = true
#$ lab_disable_mouse_move = true
#$ lab_sound_on = true
## 웹죽 세션 강제 유지 및 잠수 알림 (5분 이상 입력이 없어도 종료되지 않음) ##
#$ lab_maintain_session = true
## 방을 이동해도 채팅을 지우지 않음 ##
#$ lab_disable_chat_clear = true

######################
######  macros  ######
######################
macros += M \{-265} zU
macros += M \{-266} zI
macros += M \{-267} zO
macros += M \{-268} zP
macros += M \{-269} zJ
macros += M \{-270} zK
macros += M \{-271} zL
macros += M \{-1015} o
macros += M ! w-
macros += M 1 wu
macros += M 2 wi
macros += M 3 wo
macros += M 4 wp
macros += M B zN
macros += M e ff
macros += M c zz\{32}
macros += M b Zn.
macros += M 6 w*j
macros += M 7 Q*
macros += M * o
macros += M + o
macros += M / \{9}
macros += M h aff
macros += M j aI
macros += M k E
macros += M l E
macros += M y E
macros += M u E
macros += M Y E
macros += M U E
macros += M H E
macros += M J E
macros += M K E
macros += M L E


  _   __    __                  __ 
 | | / /__ / /  __ ____ _  ___ / /_
 | |/ / -_) _ l/ // /  i l/ -_) __/
 |___/l__/_//_/l_,_/_/_/_/l__/l__/