From: Pasi Kallinen Date: Sun, 5 Mar 2023 14:38:19 +0000 (+0200) Subject: More tutorial level X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c2d6bde9cdc1a3d5e8054d4a563842db9e5d61eb;p=nethack More tutorial level Add more stuff to the tutorial level: - closing a door - cursed armor - taking off armor - shuffled descriptions - removing curses - reading scrolls --- diff --git a/dat/nhlib.lua b/dat/nhlib.lua index 849188e7f..a18de8214 100644 --- a/dat/nhlib.lua +++ b/dat/nhlib.lua @@ -223,6 +223,38 @@ function tutorial_leave() nh.gamestate(true); end +local tutorial_events = { + { + ucoord = { 2, 5 }, + remove = true, + func = function() + tutorial_whitelist_commands["close"] = true; + end, + }, + { + ucoord = { 27, 10 }, + remove = true, + func = function() + tutorial_whitelist_commands["takeoff"] = true; + end, + }, + { + ucoord = { 22, 11 }, + remove = true, + func = function() + tutorial_whitelist_commands["read"] = true; + end, + }, +}; + function tutorial_turn() + for k, v in pairs(tutorial_events) do + if ((v.ucoord and u.ux == v.ucoord[1] + 3 and u.uy == v.ucoord[2] + 3) + or (v.ucoord == nil)) then + if (v.func() or v.remove) then + tutorial_events[k] = nil; + end + end + end -- nh.pline("TUT:turn"); end diff --git a/dat/tut-1.lua b/dat/tut-1.lua index 0fdc3bcd5..b2d1b27d8 100644 --- a/dat/tut-1.lua +++ b/dat/tut-1.lua @@ -11,11 +11,11 @@ des.map([[ ||.|.|.......|....|.......................................................| ||.|.|.......|....|.......................................................| |-+-S-------------|.......................................................| -|......| |.......................................................| -|......| ###### |.......................................................| -|----.-| -+- # |.....-----.............................................| -|----+----.----+---.....|...|.............................................| -|........|.|......|.....F...|.............................................| +|......| |----------.............................................| +|......| ###### |.........|.............................................| +|----.-| -+- # |.....---.|.............................................| +|----+----.----+---.|.--|.|.|.............................................| +|........|.|......|.|...F...|.............................................| |.P......-S|......|------.---.............................................| |..........|......+.|...|.---.............................................| |.W......---......|.|.|.|.+...............................................| @@ -58,6 +58,9 @@ des.engraving({ coord = { 2,4 }, type = "engrave", text = "Some actions may requ des.engraving({ coord = { 2,5 }, type = "engrave", text = "Open the door by moving into it", degrade = false }); des.door({ coord = { 2,6 }, state = "closed" }); +des.engraving({ coord = { 2,7 }, type = "engrave", text = "Close the door with '" .. nh.eckey("close") .. "'", degrade = false }); + + -- des.engraving({ coord = { 4,5 }, type = "engrave", text = "You can leave the tutorial via the magic portal.", degrade = false }); @@ -98,7 +101,7 @@ des.engraving({ coord = { 19,13 }, type = "engrave", text = "Pick up items with local armor = (u.role == "Monk") and "leather gloves" or "leather armor"; -des.object({ id = armor, spe = 0, buc = "not-cursed", coord = { 19,14} }); +des.object({ id = armor, spe = 0, buc = "cursed", coord = { 19,14} }); des.engraving({ coord = { 19,15 }, type = "engrave", text = "Wear armor with '" .. nh.eckey("wear") .. "'", degrade = false }); @@ -115,6 +118,7 @@ des.monster({ id = "lichen", coord = { 23,15 }, waiting = true, countbirth = fal des.engraving({ coord = { 24,16 }, type = "engrave", text = "Now you know the very basics. You can leave the tutorial via the magic portal.", degrade = false }); +des.engraving({ coord = { 26,16 }, type = "engrave", text = "Step into this portal to leave the tutorial", degrade = false }); des.trap({ type = "magic portal", coord = { 27,16 }, seen = true }); -- @@ -124,6 +128,21 @@ des.object({ id = "boulder", coord = {25,12} }); -- +des.engraving({ coord = { 27,9 }, type = "engrave", text = "Take off armor with '" .. nh.eckey("takeoff") .. "'", degrade = false }); + +-- + +des.object({ class = "?", id = "remove curse", buc = "blessed", coord = {23,11} }) +des.engraving({ coord = { 22,11 }, type = "engrave", text = "Some items have shuffled descriptions, different each game", degrade = false }); +des.engraving({ coord = { 23,11 }, type = "engrave", text = "Pick up this scroll, read it with '" .. nh.eckey("read") .. "', and try to remove the armor again", degrade = false }); + +-- + +des.engraving({ coord = { 19,10 }, type = "engrave", text = "Another magic portal, a way to leave this tutorial", degrade = false }); +des.trap({ type = "magic portal", coord = { 19,11 }, seen = true }); + +-- + des.door({ coord = { 26,14 }, state = "locked" }); des.engraving({ coord = { 27,14 }, type = "burn", text = "UNDER CONSTRUCTION", degrade = false });