From 633487849bc5969764082b6b13412200ae513bc1 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 18 Mar 2023 12:07:46 +0200 Subject: [PATCH] Tutorial: looting containers, zapping wands --- dat/nhlib.lua | 8 ++++++++ dat/tut-1.lua | 36 ++++++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/dat/nhlib.lua b/dat/nhlib.lua index 5049d075b..dcab6bc3e 100644 --- a/dat/nhlib.lua +++ b/dat/nhlib.lua @@ -262,6 +262,14 @@ local tutorial_events = { tutorial_whitelist_commands["quiver"] = true; end, }, + { + ucoord = { 38, 6 }, + remove = true, + func = function() + tutorial_whitelist_commands["loot"] = true; + tutorial_whitelist_commands["zap"] = true; + end, + }, }; function tutorial_turn() diff --git a/dat/tut-1.lua b/dat/tut-1.lua index 43e279a05..a4a3feb8e 100644 --- a/dat/tut-1.lua +++ b/dat/tut-1.lua @@ -6,15 +6,15 @@ des.level_flags("mazelevel", "noflip", des.map([[ --------------------------------------------------------------------------- |-.--|.......|......|..S....|.F.......|...................................| -|.-..........|......|--|....|.F.....|.|...................................| -||.--|.......|..T......|....|.F.....|.|...................................| -||.|.|.......|......|-.|....|.F.....|.|...................................| -||.|.|.......|......||.|-.-----------.-...................................| -|-+-S---------..---.||....................................................| -|......| |.-------------------...................................| -|......| ###### |.........|.............................................| -|----.-| -+- # |.....---.|.............................................| -|----+----.----+---.|.--|.|.|.............................................| +|.-..........|......|--|....|.F.....|.|S-------...........................| +||.--|.......|..T......|....|.F.....|.|.......|...........................| +||.|.|.......|......|-.|....|.F.....|.|.......|...........................| +||.|.|.......|......||.|-.-----------.-.......|...........................| +|-+-S---------..---.||........................|...........................| +|......| |.-------------------.......|...........................| +|......| ###### |.........|.........S.......|...........................| +|----.-| -+- # |.....---.|.........|.......S...........................| +|----+----.----+---.|.--|.|.|.........---------...........................| |........|.|......|.|...F...|.............................................| |.P......-S|......|------.---.............................................| |..........|......+.|...|.|...............................................| @@ -180,10 +180,22 @@ des.engraving({ coord = { 33,4 }, type = "engrave", text = "You can wait a turn -- -des.door({ coord = { 38,6 }, state = "locked" }); -des.engraving({ coord = { 39,6 }, type = "burn", text = "UNDER CONSTRUCTION", degrade = false }); +des.door({ coord = { 38,6 }, state = "closed" }); -des.trap({ type = "magic portal", coord = { 45,6 }, seen = true }); +des.engraving({ coord = { 39,6 }, type = "engrave", text = "You loot containers with '" .. nh.eckey("loot") .. "'", degrade = false }); + +des.object({ coord = { 42,6 }, id = "large box", broken = true, + contents = function(obj) + des.object({ id = "secret door detection", class = "/", spe = 30 }); end +}); + +des.engraving({ coord = { 45,6 }, type = "engrave", text = "Magic wands are used with '" .. nh.eckey("zap") .. "'", degrade = false }); + +-- + +des.engraving({ coord = { 55,9 }, type = "burn", text = "UNDER CONSTRUCTION", degrade = false }); + +des.trap({ type = "magic portal", coord = { 60,9 }, seen = true }); ----------------