##############################################
# Tutorial map 4: Magic and Spellcasting     #
##############################################
#
# TODO:
#  * trigger when trying to walk into a cloud
#  * trigger on "might hit yourself" prompt
#  * potion of experience gives too much skills - find another way for Meph?
#
{{
crawl_require("dlua/tutorial.lua")

tutorial4 = {}

function tutorial4.msg(text)
    return tutorial_msg("tutorial4 " .. text)
end

function tutorial4.exit()
    crawl.tutorial_msg("tutorial4 exit", true)
end

function tutorial4.win()
    crawl.mark_game_won()
    return tutorial4.exit()
end
}}

NAME:    tutorial_lesson4
TAGS:    no_rotate no_monster_gen no_item_gen no_hmirror no_vmirror no_trap_gen no_pool_fixup tutorial
DESC:    Lesson 4: Magic and Spellcasting
ORDER:   4
ORIENT:  encompass
KFEAT:   ABCDEF = .
# TODO: pad g here was for spell hunger, what else could go here?
COLOUR:  ABCDEFdef = lightblue
FTILE:   ABCDEFdef = tutorial_pad
ITEM:    randbook numspells:2 spells:magic_dart&mephitic_cloud title:Introductory_Spellcasting owner:player
ITEM:    ring of magical power
ITEM:    ring of wizardry
# TODO: g was rations for spell hunger, replace with something more modern
MONS:    training dummy ; stone q:20
MONS:    bat skeleton, goblin skeleton
MONS:    rat, goblin
KMONS:   8 = training dummy hd:3 hp:7
MARKER:  d = lua:tutorial4.msg("spellbook")
MARKER:  B = lua:tutorial4.msg("spellcasting")
MARKER:  e = lua:tutorial4.msg("ring_power")
MARKER:  C = lua:tutorial4.msg("undead")
MARKER:  f = lua:tutorial4.msg("spell_success")
MARKER:  D = lua:tutorial4.msg("mephitic_cloud")
MARKER:  E = lua:tutorial4.msg("meph_reminder")
MARKER:  F = lua:tutorial4.msg("aiming_clouds")
MARKER:  { = lua:one_way_stair { dst  = "tutorial_lesson4", \
                                 onclimb = "tutorial4.exit" }
epilogue{{
  if crawl.game_started() then
    crawl.tutorial_hint("HINT_NEW_LEVEL")
    crawl.clear_messages(true)
    crawl.tutorial_msg("tutorial4 start")
    tutorial_intro()
  end
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxx...xxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxExxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx}xxxxxxx4...xxxFxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx).....5....4...xxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxx]xxxxxx..4...xxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

##########################################################
# Level 2: Forgetting spells, allies.
##########################################################
NAME:    tutorial_lesson4_level2
TAGS:    no_rotate no_monster_gen no_item_gen no_hmirror no_vmirror no_trap_gen no_pool_fixup tutorial_lesson4
PLACE:   D:2
ORIENT:  encompass
KFEAT:   ABCDE = .
COLOUR:  dABCDEe = lightblue
FTILE:   dABCDEe = tutorial_pad
ITEM:    scroll of amnesia ident:type q:3
ITEM:    randbook numspells:1 spells:call_imp title:Demonology_for_Dummies owner:player
ITEM:    kite shield
ITEM:    ring mail
MONS:    hobgoblin
MONS:    rat
MONS:    goblin
MONS:    gnoll; nothing
MARKER:  d = lua:tutorial4.msg("forget_spell")
MARKER:  e = lua:tutorial4.msg("memorise2")
MARKER:  B = lua:tutorial4.msg("displace_allies")
MARKER:  C = lua:tutorial4.msg("order_allies")
MARKER:  D = lua:tutorial4.msg("heavy_armour")
MARKER:  E = lua:tutorial4.msg("resting_reminder")
MARKER:  } = lua:tutorial4.msg("tutorial_end")
MARKER:  ) = lua:tutorial4.msg("tutorial_end")
MARKER:  ] = lua:tutorial4.msg("tutorial_end")
MARKER:  } = lua:one_way_stair { dst  = "tutorial_lesson4", \
                                 desc = "exit from the tutorial", \
                                 onclimb = "tutorial4.win" }
MARKER:  ) = lua:one_way_stair { dst  = "tutorial_lesson4", \
                                 desc = "exit from the tutorial", \
                                 onclimb = "tutorial4.win" }
MARKER:  ] = lua:one_way_stair { dst  = "tutorial_lesson4", \
                                 desc = "exit from the tutorial", \
                                 onclimb = "tutorial4.win" }
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxx......B.xxxx.T.xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxx......B...x.....xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxCCCxxxx...+..e......xxxxxxxxxxxxxxx
xxxxxxxxxxx+++xxxxx..x.....xxxx..xxxxxxxxxxxxx
xxxxxxxxxx.....xxxxxxxx.T.xxxxxxx.xxxxxxxxxxxx
xxxxxxxxxx.....xxxxxxxxx.xxxxxxxxxdxxxxxxxxxxx
xxxxxxxxxx.....xxxxxxxxxxxxxxxxxxx.xxxxxxxxxxx
xxxxxxxxxx.....xxxxxxxxxxxxxxxxxx...xxxxxxxxxx
xxxxxxxxxx.....xxxxxxxxxxxxxxxxxx{([xxxxxxxxxx
xxxxxxxxxx..1..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxx.xxxx...xxxxxxxxxxxx.2..xxxxxxxxxx
xxxxxxxxxxxx.xxx..f..xxxxxxxxGx.....4]xxxxxxxx
xxxxxxxxxxxx.xxx.....xxxxxxxG.+...2....xxxxxxx
xxxxxxxxxxxx......D........E..+......3.)xxxxxx
xxxxxxxxxxxxxxxx.....xxxxxxxG.+...3....xxxxxxx
xxxxxxxxxxxxxxxx..g..xxxxxxxxGx.....2}xxxxxxxx
xxxxxxxxxxxxxxxxx...xxxxxxxxxxxx2...xxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP
