##############################################
# Tutorial map 3: Items and Inventory        #
##############################################

{{
crawl_require("dlua/tutorial.lua")

tutorial3 = {}

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

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

function tutorial3.win()
    crawl.mark_game_won()
    return tutorial3.exit()
end

function callback.tutorial_trap(data, triggerable, triggerer, marker, ev)
  crawl.mpr("You hear a click...")

  if data.triggered == true then
    crawl.mpr("Nothing continues to happen.")
    return
  end

  data.triggered = true
  crawl.mpr("Luckily, nothing happens.")
  return
end

}}

NAME:    tutorial_lesson3
TAGS:    no_rotate no_monster_gen no_item_gen no_hmirror no_vmirror no_trap_gen no_pool_fixup tutorial
DESC:    Lesson 3: Items and Inventory
ORDER:   3
ORIENT:  encompass
KFEAT:   ABC = .
COLOUR:  defgABC = lightblue
FTILE:   defgABC = tutorial_pad
# "useful" is for keeping the boots from turning into bardings
ITEM:    pair of boots mundane useful
ITEM:    scroll of fog q:1
ITEM:    scroll of fear q:1
ITEM:    flail ego:venom
MONS:    goblin ; nothing
MONS:    rat, giant cockroach, hobgoblin ; nothing
MARKER:  d = lua:tutorial3.msg("armour")
MARKER:  A = lua:tutorial3.msg("autopickup")
MARKER:  e = lua:tutorial3.msg("scroll")
MARKER:  f = lua:tutorial3.msg("scroll_noautopickup")
MARKER:  g = lua:tutorial3.msg("ego_weapon")
MARKER:  B = lua:tutorial3.msg("inventory")
MARKER:  C = lua:tutorial3.msg("battle")
MARKER:  } = lua:tutorial3.msg("downstairs")
MARKER:  ] = lua:tutorial3.msg("downstairs")
MARKER:  { = lua:one_way_stair { dst  = "tutorial_lesson3", \
                                 onclimb = "tutorial3.exit" }
MARKER:  ( = lua:one_way_stair { dst  = "tutorial_lesson3", \
                                 onclimb = "tutorial3.exit" }
MARKER:  [ = lua:one_way_stair { dst  = "tutorial_lesson3", \
                                 onclimb = "tutorial3.exit" }
epilogue{{
  if crawl.game_started() then
    crawl.tutorial_hint("HINT_MULTI_PICKUP")
    crawl.tutorial_hint("HINT_CHOOSE_STAT")
    crawl.clear_messages(true)
    crawl.tutorial_msg("tutorial3 start")
    tutorial_intro()
  end
}}
MAP
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxx.....e..xxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxx..xx.....xxxx..(..xxxxxxxxxx
xxxxxxxx..+...xxxxxx..A...d...{xxxxxxxxxx
xxxxxxxx..xxxxxxxxxxxxxxxx..[..xxxxxxxxxx
xxxxxxxxfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxx1.xxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxx.xxxxxxxxxxtttttttttttttttxx
xxxxxxxxxxttx+xttxxxxxxxtttttttttttttttxx
xxxxxxxxxttt...tttttttttttt....3.t..tttxx
xxxxxxxxxtt.....tttttttttt..3.t.t..2}ttxx
xxxxxxxxxtt..g..B......C+........4..tttxx
xxxxxxxxxtt.....tttttttttt2...t.t.3.]ttxx
xxxxxxxxxttt...tttttttttttt..3...t..tttxx
xxxxxxxxxtttttttttxxxxxxtttttttttttttttxx
xxxxxxxxxxttttttttxxxxxxtttttttttttttttxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ENDMAP

##########################################################
# Level 2: Items continued
##########################################################
NAME:    tutorial_lesson3_level2
TAGS:    no_rotate no_monster_gen no_item_gen no_hmirror no_vmirror no_trap_gen no_pool_fixup tutorial_lesson3
PLACE:   D:2
ORIENT:  encompass
KFEAT:   ^ = pressure plate trap
{{
 local tm = TriggerableFunction:new{func="callback.tutorial_trap",
              repeated=true,
              data={triggered=false} }
 tm:add_triggerer(DgnTriggerer:new{type="pressure_plate"})
 lua_marker('^', tm)
}}
KFEAT:   AB = .
COLOUR:  ABdefghi = lightblue
FTILE:   ABdefghi = tutorial_pad
RTILE:   c = wall_vines
ITEM:    potion of curing q:1
ITEM:    cloak_of_starlight
ITEM:    wand of flame charges:9 pre_id
ITEM:    wand of digging charges:15 pre_id
ITEM:    amulet of faith
MONS:    goblin ; sling ego:none . stone q:30 . dagger \
         ego:none
MONS:    gnoll ; spear mundane
MARKER:  A = lua:tutorial3.msg("trap")
MARKER:  d = lua:tutorial3.msg("potion")
MARKER:  e = lua:tutorial3.msg("artefact_armour")
MARKER:  f = lua:tutorial3.msg("wand_fire")
MARKER:  g = lua:tutorial3.msg("wand_digging")
MARKER:  h = lua:tutorial3.msg("amulet")
MARKER:  B = lua:tutorial3.msg("drop")
epilogue{{
  if crawl.game_started() then
    crawl.clear_messages(true)
    crawl.tutorial_msg("tutorial3 command_help")
  end
}}
MAP
cccccccccccccccccccccc
cc.....c.....ccc.....c
cc..[..c..e...+...f..c
cc.....c.....ccc.....c
cccc.ccccc.ccccccc.ccc
cc...ccccc+ccccccc+ccc
ccAccccccc1ccccccc.ccc
cc^ccccccc.ccccccc.ccc
cc...ccccc.ccccccc.ccc
cccc.ccccc.ccccccc.ccc
cccc.ccccc.ccccccc.ccc
cc.....ccc.ccccc.....c
cc..d......ccccc..2..c
cc.....ccccccccc.....c
cccccccccccccccccc.ccc
ccccccccccc.....cc.ccc
ccccccccccc..g.....ccc
ccccccccccc.....cccccc
ccccccccccccxbvccccccc
ccccccccccccxbvccccccc
ccccccccccccxbvccccccc
cccccc..ccc.....cccccc
cccccc).B+...h..cccccc
cccccc..ccc.....cccccc
cccccccccccccccccccccc
ENDMAP

##########################################################
# Level 3: Shopping
##########################################################
NAME:    tutorial_lesson3_level3
TAGS:    no_rotate no_monster_gen no_item_gen no_hmirror no_vmirror no_trap_gen no_pool_fixup tutorial_lesson3
PLACE:   D:3
ORIENT:  encompass
KFEAT:   ABC, = .
COLOUR:  ABCde = lightblue
COLOUR:  . = brown
FTILE:   .{)deS = floor_swamp, t = floor_grass
FTILE:   ABCde = tutorial_pad
FTILE:   c = wall_vines
KFEAT:   S = general shop use_all ; \
             ring of flight mundane | potion of curing | \
             potion of heal wounds | potion of heal wounds q:2 | \
             potion of might | wand of paralysis | ring mail | \
             buckler ego:none | ring of slaying | scroll of enchant weapon
ITEM:    gold q:40
ITEM:    gold q:220
MONS:    gnoll ; flail ego:none | morningstar ego:none | spear ego:none . \
         leather armour | ring mail
MONS:    ufetubus
MONS:    orc ; scimitar ego:none | battleaxe ego:none | trident ego:none . \
         ring mail | chain mail
MARKER:  d = lua:tutorial3.msg("gold");
MARKER:  A = lua:tutorial3.msg("shop");
MARKER:  S = lua:tutorial3.msg("enter_shop");
MARKER:  e = lua:tutorial3.msg("go_shopping");
MARKER:  B = lua:tutorial3.msg("autoexplore_reminder");
MARKER:  C = lua:tutorial3.msg("optional_battle");
MARKER:  } = lua:tutorial3.msg("tutorial_end");
MARKER:  ) = lua:tutorial3.msg("tutorial_end");
MARKER:  ] = lua:tutorial3.msg("tutorial_end");
MARKER:  } = lua:one_way_stair { dst  = "tutorial_lesson3", \
                                 desc = "exit from the tutorial", \
                                 onclimb = "tutorial3.win" }
MARKER:  ) = lua:one_way_stair { dst  = "tutorial_lesson3", \
                                 desc = "exit from the tutorial", \
                                 onclimb = "tutorial3.win" }
MARKER:  ] = lua:one_way_stair { dst  = "tutorial_lesson3", \
                                 desc = "exit from the tutorial", \
                                 onclimb = "tutorial3.win" }
epilogue{{
  if crawl.game_started() then
    crawl.clear_messages(true)
    crawl.tutorial_msg("tutorial3 command_help")
  end
}}
MAP
tttttttttttttttttttttttttttttttttttttttttttttttttttt
tttttttttttttttttttttttttttttttttttttttttttttttttttt
tttttttttttttttttttttttttttttttttttttttt...ttttttttt
ttttttttttccccccccctttttttttttttttttttt..(.ttttttttt
ttttttttttc,),,,],cttttttttttttttttttttt....tttttttt
ttttttttttc,,3,3,,ctttttttttttttttttttttt.tttttttttt
ttttttttttc,,,2,,,cttttttttttttttttttttttt.ttttttttt
ttttttttttc,1,,,1,ctttttttttttttttttttttttt.tttttttt
ttttttttttc,,,1,,,ctttttttttttttttttttttttt.tttttttt
ttttttttttcccc+ccccttttttttttttttttttttttttt.ttttttt
tttttttttttttt.ttttttttttttttttttttttttttttt..tttttt
tttttttttttttt.tttttttttttttttttttttttttttt.dt.ttttt
ttttttttttttttt.tttttttttttttttttttttttttttt...twwww
tttttttttttttttCttttttttttttttttttttttttttttwWWwwwww
tttttttttttttt..tttttttttttttttttttttttttwwwwW..tttw
ttttttttttttt...t..ttttttttttttttttttttwwwwwtt...ttt
ttttttttttt.......ttt.tttttttttttttttwwwwtttttt.tttt
tttttttttt.......e.....ttttttttttttwwwwwwwttttt..ttt
ttttttttt..wwwwww....t..ttttttttwwwwwwwttttttttt.ttt
ttttttttt.wwwwwwwwW...ttttwwwwwwwwwwwtttttttttt.tttt
wtttttttwwwwwwwwwwwW.Wwwwwwwtwwwwwttttttttttttt.tttt
wwwtttttwwww...wwwwwWWWwwwwtttttttttttttttttttttAttt
wwwwwwwwwww...}...wwwWWWttttttttt..B..ttttt..t...ttt
wwwwwwwwwwwww....wwww....tttttt..ttttt.....tt..S..tt
tttttwwwwwwwwwwwwwww......ttt..ttttttttttttttt...ttt
ttttttttttwwwwwwwwt....ttt...ttttttttttttttttttttttt
tttttttttttttttttttttttttttttttttttttttttttttttttttt
tttttttttttttttttttttttttttttttttttttttttttttttttttt
ENDMAP
