Source:NetHack 5.0.0/dat/medusa-3.lua

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to medusa-3.lua from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/dat/medusa-3.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 medusa medusa-3.lua	$NHDT-Date: 1716152250 2024/05/19 20:57:30 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.8 $
2. --	Copyright (c) 1989 by Jean-Christophe Collet
3. --	Copyright (c) 1990, 1991 by M. Stephenson
4. -- NetHack may be freely redistributed.  See license for details.
5. --
6. des.level_init({ style = "solidfill", fg = " " });
7. des.level_flags("noteleport", "mazelevel", "shortsighted")
8. --
9. -- Here you disturb ravens nesting in the trees.
10. --
11. des.map([[
12. }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
13. }}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}
14. }}}}}}}}T..T.}}}}}}}}}}}}}}}}}}}}..}}}}}}}}.}}}...}}}}}}}.}}}}}......}}}}}}}
15. }}}}}}.......T.}}}}}}}}}}}..}}}}..T.}}}}}}...T...T..}}...T..}}..-----..}}}}}
16. }}}...-----....}}}}}}}}}}.T..}}}}}...}}}}}.....T..}}}}}......T..|...|.T..}}}
17. }}}.T.|...|...T.}}}}}}}.T......}}}}..T..}}.}}}.}}...}}}}}.T.....+...|...}}}}
18. }}}}..|...|.}}.}}}}}.....}}}T.}}}}.....}}}}}}.T}}}}}}}}}}}}}..T.|...|.}}}}}}
19. }}}}}.|...|.}}}}}}..T..}}}}}}}}}}}}}T.}}}}}}}}..}}}}}}}}}}}.....-----.}}}}}}
20. }}}}}.--+--..}}}}}}...}}}}}}}}}}}}}}}}}}}T.}}}}}}}}}}}}}}}}.T.}........}}}}}
21. }}}}}.......}}}}}}..}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}.}}.T.}}}}}}
22. }}.T...T...}}}}T}}}}}}}}}}}....}}}}}}}}}}T}}}}}.T}}...}}}}}}}}}}}}}}...}}}}}
23. }}}...T}}}}}}}..}}}}}}}}}}}.T...}}}}}}}}.T.}.T.....T....}}}}}}}}}}}}}.}}}}}}
24. }}}}}}}}}}}}}}}....}}}}}}}...}}.}}}}}}}}}}............T..}}}}}.T.}}}}}}}}}}}
25. }}}}}}}}}}}}}}}}..T..}}}}}}}}}}}}}}..}}}}}..------+--...T.}}}....}}}}}}}}}}}
26. }}}}.}..}}}}}}}.T.....}}}}}}}}}}}..T.}}}}.T.|...|...|....}}}}}.}}}}}...}}}}}
27. }}}.T.}...}..}}}}T.T.}}}}}}.}}}}}}}....}}...|...+...|.}}}}}}}}}}}}}..T...}}}
28. }}}}..}}}.....}}...}}}}}}}...}}}}}}}}}}}}}T.|...|...|}}}}}}}}}}}....T..}}}}}
29. }}}}}..}}}.T..}}}.}}}}}}}}.T..}}}}}}}}}}}}}}---S-----}}}}}}}}}}}}}....}}}}}}
30. }}}}}}}}}}}..}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}T..T}}}}}}}}}}}}}}}}}}}}}}}}}}
31. }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
32. ]]);
33. 
34. local place = selection.new();
35. -- each of these spots are inside a distinct room
36. place:set(08,06);
37. place:set(66,05);
38. place:set(46,15);
39. 
40. -- location of Medusa and downstairs and Perseus's statue
41. local medloc = place:rndcoord(1,1);
42. -- specific location for some other statue in a different downstairs-eligible
43. -- room, to prevent object detection from becoming a trivial way to pinpoint
44. -- Medusa's location
45. -- [usefulness depends on future STATUE->dknown changes in nethack's core]
46. local altloc = place:rndcoord(1,1);
47. -- location of a fountain, in the remaining of three downstairs-eligible rooms
48. local othloc = place:rndcoord(1,1);
49. -- once here, all three points set in 'place' have been used up
50. 
51. des.region(selection.area(00,00,74,19),"lit")
52. -- fixup_special hack: the first room defined on a Medusa level gets some
53. -- leaderboard statues, use arrival_room to force it to be a room even though
54. -- monsters won't arrive within it
55. des.region({ region={49,14, 51,16}, lit=-1, type="ordinary", arrival_room=true });
56. des.region(selection.area(07,05,09,07),"unlit")
57. des.region(selection.area(65,04,67,06),"unlit")
58. des.region(selection.area(45,14,47,16),"unlit")
59. -- Non diggable walls
60. -- 4th room has diggable walls as Medusa is never placed there
61. des.non_diggable(selection.area(06,04,10,08))
62. des.non_diggable(selection.area(64,03,68,07))
63. des.non_diggable(selection.area(44,13,48,17))
64. -- All places are accessible also with jumping, so don't bother
65. -- restricting the placement when teleporting from levels below this.
66. des.teleport_region({ region = {33,02,38,07}, dir="down" })
67. des.levregion({ region = {32,01,39,07}, type="stair-up" });
68. 
69. -- place the downstairs at the same spot where Medusa will be placed
70. des.stair("down", medloc);
71. --
72. des.door("locked",08,08)
73. des.door("locked",64,05)
74. des.door("random",50,13)
75. des.door("locked",48,15)
76. --
77. -- in one of the three designated rooms, but not the one with Medusa plus
78. -- downstairs and also not 'altloc' where a random statue will be placed
79. des.feature("fountain", othloc);
80. --
81. -- same spot as Medusa plus downstairs
82. des.object({ id="statue", coord=medloc, buc="uncursed",
83.                       montype="knight", historic=1, male=1,name="Perseus",
84.                       contents = function()
85.                          if percent(75) then
86.                             des.object({ id = "shield of reflection", buc="cursed", spe=0 })
87.                          end
88.                          if percent(25) then
89.                             des.object({ id = "levitation boots", spe=0 })
90.                          end
91.                          if percent(50) then
92.                             des.object({ id = "scimitar", buc="blessed", spe=2 })
93.                          end
94.                          if percent(50) then
95.                             des.object("sack")
96.                          end
97.                       end
98. });
99. --
100. -- first random statue is in one of the three designated rooms but not the
101. -- one with Medusa plus downstairs or the one with the fountain
102. des.object({ id = "statue", coord=altloc, contents=0 })
103. des.object({ id = "statue", contents=0 })
104. des.object({ id = "statue", contents=0 })
105. des.object({ id = "statue", contents=0 })
106. des.object({ id = "statue", contents=0 })
107. des.object({ id = "statue", contents=0 })
108. des.object({ id = "statue", contents=0 })
109. 
110. for i=1,8 do
111.    des.object()
112. end
113. des.object("scroll of blank paper",48,18)
114. des.object("scroll of blank paper",48,18)
115. --
116. des.trap("rust")
117. des.trap("rust")
118. des.trap("board")
119. des.trap("board")
120. des.trap()
121. --
122. -- place Medusa before placing other monsters so that they won't be able to
123. -- unintentionally steal her spot on the downstairs
124. des.monster({ id = "Medusa", coord=medloc, asleep=1 })
125. des.monster("giant eel")
126. des.monster("giant eel")
127. des.monster("jellyfish")
128. des.monster("jellyfish")
129. des.monster("wood nymph")
130. des.monster("wood nymph")
131. des.monster("water nymph")
132. des.monster("water nymph")
133. 
134. for i=1,30 do
135.    des.monster({ id = "raven", peaceful = 0 })
136. end
137. 
138. --#medusa-3.lua