]> granicus.if.org Git - nethack/commitdiff
More tutorial level
authorPasi Kallinen <paxed@alt.org>
Sun, 5 Mar 2023 14:38:19 +0000 (16:38 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 5 Mar 2023 14:38:24 +0000 (16:38 +0200)
Add more stuff to the tutorial level:
 - closing a door
 - cursed armor
 - taking off armor
 - shuffled descriptions
 - removing curses
 - reading scrolls

dat/nhlib.lua
dat/tut-1.lua

index 849188e7f2032a072c70251264fe357836502b36..a18de82148308ae635ddd99157ff7d84b6efc141 100644 (file)
@@ -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
index 0fdc3bcd55eb2d1a29288071230af7f655dc6240..b2d1b27d89b024bc4a808ab6a41cfeb6adbe0173 100644 (file)
@@ -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 });