Source:NetHack 5.0.0/dat/Bar-strt.lua

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to Bar-strt.lua from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/dat/Bar-strt.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 Barbarian Bar-strt.lua	$NHDT-Date: 1652196001 2022/05/10 15:20:01 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
2. --	Copyright (c) 1989 by Jean-Christophe Collet
3. --	Copyright (c) 1991 by M. Stephenson
4. -- NetHack may be freely redistributed.  See license for details.
5. --
6. --
7. --	The "start" level for the quest.
8. --
9. --	Here you meet your (besieged) class leader, Pelias,
10. --	and receive your quest assignment.
11. --
12. des.level_init({ style = "solidfill", fg = " " });
13. 
14. des.level_flags("mazelevel", "noteleport", "hardfloor")
15. 
16. des.map([[
17. ..................................PP........................................
18. ...................................PP.......................................
19. ...................................PP.......................................
20. ....................................PP......................................
21. ........--------------......-----....PPP....................................
22. ........|...S........|......+...|...PPP.....................................
23. ........|----........|......|...|....PP.....................................
24. ........|.\..........+......-----...........................................
25. ........|----........|...............PP.....................................
26. ........|...S........|...-----.......PPP....................................
27. ........--------------...+...|......PPPPP...................................
28. .........................|...|.......PPP....................................
29. ...-----......-----......-----........PP....................................
30. ...|...+......|...+..--+--.............PP...................................
31. ...|...|......|...|..|...|..............PP..................................
32. ...-----......-----..|...|.............PPPP.................................
33. .....................-----............PP..PP................................
34. .....................................PP...PP................................
35. ....................................PP...PP.................................
36. ....................................PP....PP................................
37. ]]);
38. 
39. -- the forest beyond the river
40. des.replace_terrain({ region={37,00, 59,19}, fromterrain=".", toterrain="T", chance=5 })
41. des.replace_terrain({ region={60,00, 64,19}, fromterrain=".", toterrain="T", chance=10 })
42. des.replace_terrain({ region={65,00, 75,19}, fromterrain=".", toterrain="T", chance=20 })
43. -- guarantee a path and free spot for the portal
44. des.terrain(selection.randline(selection.new(), 37,7, 62,02, 7), ".")
45. des.terrain({62,02}, ".")
46. 
47. -- Dungeon Description
48. des.region(selection.area(00,00,75,19), "lit")
49. des.region(selection.area(09,05,11,05), "unlit")
50. des.region(selection.area(09,07,11,07), "lit")
51. des.region(selection.area(09,09,11,09), "unlit")
52. des.region(selection.area(13,05,20,09), "lit")
53. des.region(selection.area(29,05,31,06), "lit")
54. des.region(selection.area(26,10,28,11), "lit")
55. des.region(selection.area(04,13,06,14), "lit")
56. des.region(selection.area(15,13,17,14), "lit")
57. des.region(selection.area(22,14,24,15), "lit")
58. -- Stairs
59. des.stair("down", 09,09)
60. -- Portal arrival point
61. des.levregion({ region = {62,02,62,02}, type="branch" })
62. -- Doors
63. des.door("locked",12,05)
64. des.door("locked",12,09)
65. des.door("closed",21,07)
66. des.door("open",07,13)
67. des.door("open",18,13)
68. des.door("open",23,13)
69. des.door("open",25,10)
70. des.door("open",28,05)
71. -- Elder
72. des.monster({ id = "Pelias", coord = {10, 07}, inventory = function()
73.    des.object({ id = "runesword", spe = 5 });
74.    des.object({ id = "chain mail", spe = 5 });
75. end })
76. -- The treasure of Pelias
77. des.object("chest", 09, 05)
78. -- chieftain guards for the audience chamber
79. des.monster("chieftain", 10, 05)
80. des.monster("chieftain", 10, 09)
81. des.monster("chieftain", 11, 05)
82. des.monster("chieftain", 11, 09)
83. des.monster("chieftain", 14, 05)
84. des.monster("chieftain", 14, 09)
85. des.monster("chieftain", 16, 05)
86. des.monster("chieftain", 16, 09)
87. -- Non diggable walls
88. des.non_diggable(selection.area(00,00,75,19))
89. -- One trap to keep the ogres at bay.
90. des.trap("spiked pit",37,07)
91. -- Eels in the river
92. des.monster("giant eel", 36, 01)
93. des.monster("giant eel", 37, 09)
94. des.monster("giant eel", 39, 15)
95. -- Monsters on siege duty.
96. local ogrelocs = selection.floodfill(37,7) & selection.area(40,03, 45,20)
97. for i = 0, 11 do
98.    des.monster({ id = "ogre", coord = ogrelocs:rndcoord(1), peaceful = 0 })
99. end