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

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to medusa-4.lua from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/dat/medusa-4.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-4.lua	$NHDT-Date: 1716152274 2024/05/19 20:57:54 $  $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")
8. --
9. -- Here the Medusa rules some slithery monsters from her 'palace', with
10. -- a yellow dragon nesting in the backyard.
11. --
12. des.map([[
13. }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
14. }}}}}}}}}}}}}}........}}}}}}}}}}}}}}}}}}}}}}}..}}}.....}}}}}}}}}}}----|}}}}}
15. }}}}}}..----------F-.....}}}}}}}}}}}}}}}}..---...}}}}....T.}}}}}}}....|}}}}}
16. }}}.....|...F......S}}}}....}}}}}}}...}}.....|}}.}}}}}}}......}}}}|......}}}
17. }}}.....+...|..{...|}}}}}}}}}}}}.....}}}}|...|}}}}}}}}}}}.}}}}}}}}----.}}}}}
18. }}......|...|......|}}}}}}}}}......}}}}}}|.......}}}}}}}}}}}}}..}}}}}...}}}}
19. }}|-+--F|-+--....|F|-|}}}}}....}}}....}}}-----}}.....}}}}}}}......}}}}.}}}}}
20. }}|...}}|...|....|}}}|}}}}}}}..}}}}}}}}}}}}}}}}}}}}....}}}}}}}}....T.}}}}}}}
21. }}|...}}F...+....F}}}}}}}..}}}}}}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}....}}..}}
22. }}|...}}|...|....|}}}|}....}}}}}}....}}}...}}}}}...}}}}}}}}}}}}}}}}}.....}}}
23. }}--+--F|-+--....-F|-|....}}}}}}}}}}.T...}}}}....---}}}}}}}}}}}}}}}}}}}}}}}}
24. }}......|...|......|}}}}}.}}}}}}}}}....}}}}}}}.....|}}}}}}}}}.}}}}}}}}}}}}}}
25. }}}}....+...|..{...|.}}}}}}}}}}}}}}}}}}}}}}}}}}.|..|}}}}}}}......}}}}...}}}}
26. }}}}}}..|...F......|...}}}}}}}}}}..---}}}}}}}}}}--.-}}}}}....}}}}}}....}}}}}
27. }}}}}}}}-----S----F|....}}}}}}}}}|...|}}}}}}}}}}}}...}}}}}}...}}}}}}..}}}}}}
28. }}}}}}}}}..............T...}}}}}.|.......}}}}}}}}}}}}}}..}...}.}}}}....}}}}}
29. }}}}}}}}}}....}}}}...}...}}}}}.......|.}}}}}}}}}}}}}}.......}}}}}}}}}...}}}}
30. }}}}}}}}}}..}}}}}}}}}}.}}}}}}}}}}-..--.}}}}}}}}..}}}}}}..T...}}}..}}}}}}}}}}
31. }}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}}...}}}}}}}....}}}}}}}.}}}..}}}...}}}}}}}}
32. }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}....}}}}}}}}}}}}}}}}}}}...}}}}}}
33. }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
34. ]]);
35. 
36. --
37. -- place handling is similar to medusa-3.lua except that there are 4
38. -- downstairs-eligible rooms rather than 3, and only 2 of them are used
39. local place = selection.new();
40. -- each of these spots are inside a distinct room
41. place:set(04,08);
42. place:set(10,04);
43. place:set(10,08);
44. place:set(10,12);
45. 
46. -- location of Medusa and downstairs and Perseus's statue
47. local medloc = place:rndcoord(1,1);
48. -- specific location for some other statue in a different downstairs-eligible
49. -- room, to prevent object detection from becoming a trivial way to pinpoint
50. -- Medusa's location
51. -- [usefulness depends on future STATUE->dknown changes in nethack's core]
52. local altloc = place:rndcoord(1,1);
53. 
54. --
55. des.region(selection.area(00,00,74,19),"lit")
56. -- fixup_special hack: The first "room" region in Medusa levels gets filled
57. -- with some leaderboard statues, so this needs to be a room; setting
58. -- irregular=1 will force this
59. des.region({ region={13,03, 18,13}, lit=1, type="ordinary", irregular=1 })
60. --
61. des.teleport_region({ region = {64,01,74,17}, dir="down" });
62. des.teleport_region({ region = {02,02,18,13}, dir="up" });
63. --
64. des.levregion({ region = {67,01,74,20}, type="stair-up" });
65. 
66. -- place the downstairs at the same spot where Medusa will be placed
67. des.stair("down", medloc)
68. --
69. des.door("locked",04,06)
70. des.door("locked",04,10)
71. des.door("locked",08,04)
72. des.door("locked",08,12)
73. des.door("locked",10,06)
74. des.door("locked",10,10)
75. des.door("locked",12,08)
76. --
77. des.levregion({ region = {27,00,79,20}, type="branch" });
78. --
79. des.non_diggable(selection.area(01,01,22,14));
80. --
81. des.object("crystal ball", 07,08)
82. --
83. -- same spot as Medusa plus downstairs
84. des.object({ id="statue", coord=medloc, buc="uncursed",
85.                       montype="knight", historic=1, male=1,name="Perseus",
86.                       contents = function()
87.                          if percent(75) then
88.                             des.object({ id = "shield of reflection", buc="cursed", spe=0 })
89.                          end
90.                          if percent(25) then
91.                             des.object({ id = "levitation boots", spe=0 })
92.                          end
93.                          if percent(50) then
94.                             des.object({ id = "scimitar", buc="blessed", spe=2 })
95.                          end
96.                          if percent(50) then
97.                             des.object("sack")
98.                          end
99.                       end
100. });
101. --
102. -- first random statue is in one of the designated stair rooms but not the
103. -- one with Medusa plus downstairs
104. des.object({ id = "statue", coord=altloc, 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. des.object({ id = "statue", contents=0 })
110. des.object({ id = "statue", contents=0 })
111. for i=1,8 do
112.    des.object()
113. end
114. --
115. for i=1,7 do
116.    des.trap()
117. end
118. --
119. -- place Medusa before placing other monsters so that they won't be able to
120. -- unintentionally steal her spot on the downstairs
121. des.monster({ id = "Medusa", coord=medloc, asleep=1 })
122. des.monster("kraken", 07,07)
123. --
124. -- the nesting dragon
125. des.monster({ id = "yellow dragon", x=05, y=04, asleep=1 })
126. if percent(50) then
127.    des.monster({ id = "baby yellow dragon", x=04,y=04, asleep=1 })
128. end
129. if percent(25) then
130.    des.monster({ id = "baby yellow dragon", x=04, y=05, asleep=1 })
131. end
132. des.object({ id = "egg", x=05, y=04, montype="yellow dragon" });
133. if percent(50) then
134.    des.object({ id = "egg", x=05, y=04, montype="yellow dragon" });
135. end
136. if percent(25) then
137.    des.object({ id = "egg", x=05, y=04, montype="yellow dragon" });
138. end
139. --
140. des.monster("giant eel")
141. des.monster("giant eel")
142. des.monster("jellyfish")
143. des.monster("jellyfish")
144. for i=1,14 do
145.    des.monster("S")
146. end
147. for i=1,4 do
148.    des.monster("black naga hatchling")
149.    des.monster("black naga")
150. end
151. 
152. --#medusa-4.lua