Source:NetHack 5.0.0/dat/wizard1.lua
Jump to navigation
Jump to search
Below is the full text to wizard1.lua from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/dat/wizard1.lua#line12]], for example.
The NetHack General Public License applies to screenshots, source code and other content from NetHack.
This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.
1. -- NetHack yendor wizard1.lua $NHDT-Date: 1652196039 2022/05/10 15:20:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $ 2. -- Copyright (c) 1989 by Jean-Christophe Collet 3. -- Copyright (c) 1992 by M. Stephenson and Izchak Miller 4. -- NetHack may be freely redistributed. See license for details. 5. -- 6. -- 7. -- The top (real) wizard level. 8. -- Keeping the Moat for old-time's sake 9. des.level_init({ style="mazegrid", bg ="-" }); 10. 11. des.level_flags("mazelevel", "noteleport", "hardfloor") 12. 13. local tmpbounds = selection.match("-"); 14. local bnds = tmpbounds:bounds(); 15. local bounds2 = selection.fillrect(bnds.lx, bnds.ly + 1, bnds.hx - 2, bnds.hy - 1); 16. 17. local wiz1 = des.map({ halign = "center", valign = "center", map = [[ 18. ----------------------------x 19. |.......|..|.........|.....|x 20. |.......S..|.}}}}}}}.|.....|x 21. |..--S--|..|.}}---}}.|---S-|x 22. |..|....|..|.}--.--}.|..|..|x 23. |..|....|..|.}|...|}.|..|..|x 24. |..--------|.}--.--}.|..|..|x 25. |..|.......|.}}---}}.|..|..|x 26. |..S.......|.}}}}}}}.|..|..|x 27. |..|.......|.........|..|..|x 28. |..|.......|-----------S-S-|x 29. |..|.......S...............|x 30. ----------------------------x 31. ]], contents = function(rm) 32. des.levregion({ type="stair-up", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} }) 33. des.levregion({ type="stair-down", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} }) 34. des.levregion({ type="branch", region={01,00,79,20}, region_islev=1, exclude={0,0,28,12} }) 35. des.teleport_region({ region={01,00,79,20}, region_islev=1, exclude={0,0,27,12} }) 36. des.region({ region={12,01, 20,09}, lit=0, type="morgue", filled=2, contents=function() 37. local sdwall = { "south", "west", "east" }; 38. des.door({ wall = sdwall[math.random(1, #sdwall)], state = "secret" }); 39. end }) 40. -- another region to constrain monster arrival 41. des.region({ region={01,01, 10,11}, lit=0, type="ordinary", arrival_room=true }) 42. des.mazewalk(28,05,"east") 43. des.ladder("down", 06,05) 44. -- Non diggable walls 45. -- Walls inside the moat stay diggable 46. des.non_diggable(selection.area(00,00,11,12)) 47. des.non_diggable(selection.area(11,00,21,00)) 48. des.non_diggable(selection.area(11,10,27,12)) 49. des.non_diggable(selection.area(21,00,27,10)) 50. -- Non passable walls 51. des.non_passwall(selection.area(00,00,11,12)) 52. des.non_passwall(selection.area(11,00,21,00)) 53. des.non_passwall(selection.area(11,10,27,12)) 54. des.non_passwall(selection.area(21,00,27,10)) 55. -- The wizard and his guards 56. des.monster({ id = "Wizard of Yendor", x=16, y=05, asleep=1 }) 57. des.monster("hell hound", 15, 05) 58. des.monster("vampire lord", 17, 05) 59. -- The local treasure 60. des.object("Book of the Dead", 16, 05) 61. -- Surrounding terror 62. des.monster("kraken", 14, 02) 63. des.monster("giant eel", 17, 02) 64. des.monster("kraken", 13, 04) 65. des.monster("giant eel", 13, 06) 66. des.monster("kraken", 19, 04) 67. des.monster("giant eel", 19, 06) 68. des.monster("kraken", 15, 08) 69. des.monster("giant eel", 17, 08) 70. des.monster("piranha", 15, 02) 71. des.monster("piranha", 19, 08) 72. -- Random monsters 73. des.monster("D") 74. des.monster("H") 75. des.monster("&") 76. des.monster("&") 77. des.monster("&") 78. des.monster("&") 79. -- And to make things a little harder. 80. des.trap("board",16,04) 81. des.trap("board",16,06) 82. des.trap("board",15,05) 83. des.trap("board",17,05) 84. -- Random traps. 85. des.trap("spiked pit") 86. des.trap("sleep gas") 87. des.trap("anti magic") 88. des.trap("magic") 89. -- Some random loot. 90. des.object("ruby") 91. des.object("!") 92. des.object("!") 93. des.object("?") 94. des.object("?") 95. des.object("+") 96. des.object("+") 97. des.object("+") 98. end 99. }); 100. 101. local protected = bounds2:negate() | wiz1; 102. hell_tweaks(protected);