1-- NetHack 3.7 Arch.des $NHDT-Date: 1432512784 2015/05/25 00:13:04 $ $NHDT-Branch: master $:$NHDT-Revision: 1.10 $ 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-- 6des.level_init({ style = "solidfill", fg = " " }); 7 8des.level_flags("mazelevel", "noteleport", "noflip", "nommap", "noflipx"); 9 10des.map([[ 11 --- ----- ----- 12 ---|.| |...| --. |...| .. ... 13 |.||.|------ -----...| . ... |.--- ... .... 14 ---S--S-|....|---------...S...| ..-.......| .. . ........ 15 ------|.......|....S........S...----- ---.......... ........... . 16 |.S...S.......S....|---S-----...S.| -----......................... 17 -----|.|---|.......|....| |.| --.---- |....................... .... 18 |....S.| ---S--S----S-S- --S-- -S------.................- .. . -.-.--- 19 -----|.| |.S..|.----.|.|-|...|---|.................... ..-- . |.....| 20 |.| ----.|..|.S.|.S.S...+...+................... |.| |.....| 21 |.| |.--.|.-S|.|-|...+...+..................| |.| |.....| 22 ----S-------S--S-S-.|.| |...|---|..................| |.| --S---- 23 |.<.....S.S.......|--S---S--- --S-----...........|----S--- |.| 24 |.......--|.......|...S....| |.| |...........S..S....|------.| 25 |.......| |.......|---|....|------S---------.......|--|....S.....S.| 26 -----S----|.......|---|....S.......S..| ------..| |....|---S---- 27 |.....S.......S...S....|-------|..| ---- |....| |.| 28 ---S----S--------------- |..| ---S-- --- 29 |.| |.| ---- |.| 30 --- --- --- 31]]); 32 33-- Some map regions 34local bigroom_and_tunnel = selection.floodfill(50,09) 35local tunnel_only = selection.area(56,00,76,08) & bigroom_and_tunnel 36local stairroom = selection.area(05,12,11,14) 37local non_hall_areas = selection.area(00,00,42,19) | selection.area(58,00,62,02) 38 | selection.area(56,08,75,19) 39non_hall_areas = non_hall_areas ~ (selection.area(56,08,67,08) | selection.area(37,08,42,11)) 40non_hall_areas = non_hall_areas:filter_mapchar('.') 41 42-- Dungeon Description 43des.region(stairroom, "lit") 44-- des.region(bigroom_and_tunnel, "lit") 45des.region({ region={44,04,54,15}, lit=0, type="temple", filled=2 }) -- abandoned 46-- Stairs 47des.stair("up", 06, 12) 48-- Non diggable walls -- the right is diggable (has already been dug by enemies) 49des.non_diggable(selection.area(00,00,43,19)) 50-- Constrain arrival location by levelport 51des.teleport_region({ region={05,12,11,14}, exclude_islev=1 }) 52 53-- Non-secret doors 54des.door({ state="closed", x=32, y=09, iron=0 }) 55des.door({ state="closed", x=32, y=10, iron=0 }) 56des.door({ state="locked", x=36, y=09, iron=0 }) 57des.door({ state="locked", x=36, y=10, iron=0 }) 58 59-- Vary the topology a bit by closing off some of the secret doors 60fillA = { {09,05},{12,12},{14,12},{09,15},{14,16} } 61fillB = { {15,07},{18,07},{16,11},{19,11} } 62fillC = { {21,05},{21,11},{22,09},{23,07},{26,16} } 63fillD = { {25,07},{25,12} } 64fillE = { {35,04},{30,07},{28,09},{29,12},{31,15} } 65shuffle(fillA); shuffle(fillB); shuffle(fillC); shuffle(fillD); shuffle(fillE); 66des.terrain({ coord=fillA[1], typ='-' }) 67des.terrain({ coord=fillB[1], typ='-' }) 68des.terrain({ coord=fillC[1], typ='-' }) 69des.terrain({ coord=fillD[1], typ='-' }) 70des.terrain({ coord=fillE[1], typ='-' }) 71 72-- Statues, some lining the main hall 73local statue_coords = { {39,08},{41,08},{43,08},{45,06},{49,05},{39,11},{41,11},{43,11},{45,13},{49,14},{54,15},{54,12} } 74for i=1,#statue_coords do 75 -- back statues are gold 76 local mat = statue_coords[i][1] > 50 and 'gold' or 'copper' 77 des.object({ id='statue', montype='couatl', material=mat, historic=true, coord=statue_coords[i] }) 78end 79local rndstatue_mons = { 'couatl', 'human mummy', 'stone golem' } 80for i=1,d(2,3) do 81 des.object({ id='statue', montype=rndstatue_mons[d(#rndstatue_mons)], historic=true, coord={non_hall_areas:rndcoord()} }) 82end 83 84-- Nemesis 85des.monster({ id="Schliemann", x=53, y=09, inventory = function() 86 des.object({ id="fedora", spe=1 }) 87 des.object({ id="jacket", material="leather", spe=2 }) 88 des.object({ id="pick-axe", spe=4 }) 89 des.object({ id="oil lamp", lit=1 }) 90 -- nethack doesn't have explosives; this is the closest substitute... 91 des.object({ id="oil", cursed=0, quantity=7+d(5) }) 92 des.object({ id="shield of reflection",buc="blessed",material="gold",spe=1,name="Itlachiayaque" }) 93 des.object({ id="Bell of Opening", buc="uncursed" }) 94end }) 95 96-- His crew of archeologists 97function henchman_inventory() 98 if percent(80) then des.object("fedora") end 99 if percent(50) then des.object({ id="jacket", material="leather" }) end 100 if percent(50) then 101 if percent(50) then des.object("high boots") else des.object("low boots") end 102 end 103 if percent(30) then des.object("gloves") end 104 if percent(40) then des.object("bullwhip") end 105 if percent(70) then 106 des.object("pick-axe") 107 else 108 des.object("dagger") 109 end 110 if percent(20) then 111 des.object({ id='lantern', lit=1 }) 112 else 113 des.object({ id='wax candle', lit=1 }) 114 end 115 if percent(40) then des.object({ id="gold piece", quantity=100+d(200) }) end 116 if percent(15) then des.object({ class="!", id="oil" }) end 117 if percent(10) then 118 des.object("/") 119 elseif percent(10) then 120 des.object("!") 121 end 122 if percent(5) then des.object({ class="?", id="earth" }) end 123end 124des.monster({ id="archeologist", x=30, y=10, peaceful=0, waiting=1, inventory=henchman_inventory }) 125des.monster({ id="archeologist", x=45, y=07, peaceful=0, waiting=1, inventory=henchman_inventory }) 126des.monster({ id="archeologist", x=50, y=14, peaceful=0, waiting=1, inventory=henchman_inventory }) 127des.monster({ id="archeologist", x=58, y=08, peaceful=0, waiting=1, inventory=henchman_inventory }) 128 129-- Rubble from the dig operation 130for i=1,20 do 131 des.object({ id="rock", coord={bigroom_and_tunnel:rndcoord()}, quantity=d(10) }) 132end 133for i=1,d(2,3) do 134 des.object({ id="boulder", coord={tunnel_only:rndcoord()} }) 135end 136 137-- Pits from the dig operation 138for i=1,d(3,2) do 139 x1, y1 = bigroom_and_tunnel:rndcoord() 140 x2, y2 = tunnel_only:rndcoord() 141 des.trap('pit', x1, y1) 142 des.trap('pit', x2, y2) 143end 144 145-- Identify dead ends for putting stuff in 146local deadends = get_deadends() 147-- add in some points that are in dead-end rooms but aren't one-space dead ends 148deadends:set(42,02, 1) 149deadends:set(60,09, 1) 150deadends:set(41,17, 1) 151 152-- Mummies and other monsters 153for i=1,d(6,2) do 154 -- These ones aren't waiting for approach. They've already been disturbed by 155 -- the dig option. 156 des.monster({ id='human mummy', coord={non_hall_areas:rndcoord()} }) 157end 158for i=1,d(3) do 159 des.monster({ class='M', coord={deadends:rndcoord()} }) 160end 161for i=1,d(2,3) do 162 des.monster({ class='S', coord={non_hall_areas:rndcoord()} }) 163end 164 165-- Traps 166for i=1,10+d(5) do 167 x1, y1 = non_hall_areas:rndcoord() 168 des.trap({ x=x1, y=y1, no_spider_on_web=true }) 169end 170des.trap("rolling boulder") 171 172-- Objects 173for i=1,10 do 174 des.object({ id='gold piece', quantity = d(250) }) 175end 176for i=1,d(2,2) do 177 local box = { id='chest', material='gold', coord={deadends:rndcoord()}, trapped=1, spe=3 } 178 if percent(50) then 179 box['trapped'] = 1 180 box['spe'] = 3 181 end 182 des.object(box) 183end 184-- duplicate of Arc-filb code but not important enough to put in nhlib.lua 185local wpn_mats = { "copper", "silver", "gold", "bone" } 186local wpns = { "short sword", "dagger", "knife", "spear", "javelin", "quarterstaff", "axe", "flail" } 187for i=1,d(2,3) do 188 des.object({ id=wpns[d(#wpns)], material=wpn_mats[d(#wpn_mats)], coord={non_hall_areas:rndcoord()} }) 189end 190