Source:NetHack 5.0.0/dat/tower1.lua

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to tower1.lua from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/dat/tower1.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 tower tower1.lua	$NHDT-Date: 1717178759 2024/05/31 18:05:59 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.3 $
2. --	Copyright (c) 1989 by Jean-Christophe Collet
3. -- NetHack may be freely redistributed.  See license for details.
4. --
5. --
6. -- Upper stage of Vlad's tower
7. des.level_init({ style = "solidfill", fg = " " });
8. 
9. des.level_flags("mazelevel", "noteleport", "hardfloor", "solidify")
10. des.map({ halign = "half-left", valign = "center", map = [[
11.   --- --- ---  
12.   |.| |.| |.|  
13. ---S---S---S---
14. |.......+.+...|
15. ---+-----.-----
16.   |...\.|.+.|  
17. ---+-----.-----
18. |.......+.+...|
19. ---S---S---S---
20.   |.| |.| |.|  
21.   --- --- ---  
22. ]] });
23. 
24. local niches = { {03,01}, {03,09}, {07,01}, {07,09}, {11,01}, {11,09} };
25. shuffle(niches);
26. 
27. des.ladder("down", 11,05)
28. -- The lord and his court
29. des.monster("Vlad the Impaler", 06, 05)
30. des.monster("V",niches[1])
31. des.monster("V",niches[2])
32. des.monster("V",niches[3])
33. -- The brides; they weren't named in Bram Stoker's original _Dracula_
34. -- and when appearing in umpteen subsequent books and movies there is
35. -- no consensus for their names.  According to the Wikipedia entry for
36. -- "Brides of Dracula", the "Czechoslovakian TV film Hrabe Drakula (1971)"
37. -- gave them titles rather than (or perhaps in addition to) specific names
38. -- and we use those titles here.  Marking them as 'waiting' forces them to
39. -- start in vampire form instead of vampshifted into bat/fog/wolf form.
40. local Vgenod = nh.is_genocided("vampire");
41. local Vnames = { nil, nil, nil };
42. if (not Vgenod) then
43.    Vnames = { "Madame", "Marquise", "Countess" };
44. end
45. des.monster({ id="vampire lady", coord=niches[4], name=Vnames[1], waiting=1 })
46. des.monster({ id="vampire lady", coord=niches[5], name=Vnames[2], waiting=1 })
47. des.monster({ id="vampire lady", coord=niches[6], name=Vnames[3], waiting=1 })
48. -- The doors
49. des.door("closed",08,03)
50. des.door("closed",10,03)
51. des.door("closed",03,04)
52. des.door("locked",10,05)
53. des.door("locked",08,07)
54. des.door("locked",10,07)
55. des.door("closed",03,06)
56. -- treasures
57. des.object("chest", 07,05)
58. 
59. des.object("chest",niches[6])
60. des.object("chest",niches[1])
61. des.object("chest",niches[2])
62. des.object("chest",niches[3])
63. des.object({ id = "chest", coord=niches[4],
64.              contents = function()
65.                 des.object({ id = "wax candle", quantity=math.random(4,8) })
66.              end
67. });
68. des.object({ id = "chest", coord=niches[5],
69.              contents = function()
70.                 des.object({ id = "tallow candle", quantity=math.random(4,8) })
71.              end
72. });
73. -- We have to protect the tower against outside attacks
74. des.non_diggable(selection.area(00,00,14,10))