Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 1x 1x 1x 5x 4x 4x 4x 4x 5x 2x 2x 2x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x | /**
* valley - NetHack special level
* Converted from: valley.lua
*/
import * as des from '../sp_lev.js';
import { selection, percent } from '../sp_lev.js';
export async function generate() {
// NetHack gehennom valley.lua $NHDT-Date: 1652196038 2022/5/10 15:20:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.4 $
// Copyright (c) 1989 by Jean-Christophe Collet
// Copyright (c) 1992 by M. Stephenson and Izchak Miller
// NetHack may be freely redistributed. See license for details.
//
//
des.level_init({ style: "solidfill", fg: " " });
des.level_flags("mazelevel", "noteleport", "hardfloor", "nommap", "temperate");
await des.map(`\
----------------------------------------------------------------------------
|...S.|..|.....| |.....-| |................| |...............| |...|
|---|.|.--.---.| |......--- ----..........-----.-----....---........---.-.|
| |.|.|..| |.| --........| |.............| |.......---| |-...........--|
| |...S..| |.| |.......-----.......------| |--------..---......------- |
|----------- |.| |-......| |....|...-- |...-----................---- |
|.....S....---.| |.......| |....|...| |..............----------- |
|.....|.|......| |.....--- |......--- |....---.......| |
|.....|.|------| |....-- --....-- |-------- ----....--------------- |
|.....|--......---BBB-| |...-- |.......| |..................| |
|..........||........-| --...| |.......| |...||.............| |
|.....|...-||-........------....| |.......---- |...||.............-- |
|.....|--......---...........--------..........| |.......---------...-- |
|.....| |------| |--.......--| |..B......----- -----....| |.| |....--- |
|.....| |......--| ------..| |----..B......| |.--------.-- |-.....---|
|------ |........| |.|....| |.....----BBBB---------...........---.........|
| |........| |...|..| |.....| |-.............--------...........---|
| --.....-----------.| |....-----.....---------- |.........---- |
| |..|..B...........| |.|..........|.| |.|........| |
----------------------------------------------------------------------------
`);
// Make the path somewhat unpredictable
// If you get "lucky", you may have to go through all three graveyards.
if (percent(50)) {
des.terrain(selection.line(50,8, 53,8), '-');
des.terrain(selection.line(40,8, 43,8), 'B');
}
if (percent(50)) {
des.terrain({ x: 27, y: 12, typ: '|' });
des.terrain(selection.line(27,3, 29,3), 'B');
des.terrain({ x: 28, y: 2, typ: '-' });
}
if (percent(50)) {
des.terrain(selection.line(16,10, 16,11), '|');
des.terrain(selection.line(9,13, 14,13), 'B');
}
// Dungeon Description
// The shrine to Moloch.
await des.region({ region: [1,6, 5,14],lit: 1,type: "temple",filled: 2 });
// The Morgues
await des.region({ region: [19,1, 24,8],lit: 0,type: "morgue",filled: 1,irregular: 1 });
await des.region({ region: [9,14, 16,18],lit: 0,type: "morgue",filled: 1,irregular: 1 });
await des.region({ region: [37,9, 43,14],lit: 0,type: "morgue",filled: 1,irregular: 1 });
// Stairs
des.stair("down", 1,1);
// Branch location
des.levregion({ type: "branch", region: [66,17,66,17] });
des.teleport_region({ region: [58,9,72,18], dir: "down" });
// Secret Doors
des.door("locked",4,1);
des.door("locked",8,4);
des.door("locked",6,6);
// The altar of Moloch.
await des.altar({ x: 3,y: 10,align: "noalign", type: "shrine" });
// Non diggable walls - everywhere!
des.non_diggable(selection.area(0,0,75,19));
// Objects
// **LOTS** of dead bodies (all human).
// note: no priest(esse)s or monks - maybe Moloch has a *special*
// fate reserved for members of *those* classes.
//
await des.object({ id: "corpse",montype: "archeologist" });
await des.object({ id: "corpse",montype: "archeologist" });
await des.object({ id: "corpse",montype: "barbarian" });
await des.object({ id: "corpse",montype: "barbarian" });
await des.object({ id: "corpse",montype: "caveman" });
await des.object({ id: "corpse",montype: "cavewoman" });
await des.object({ id: "corpse",montype: "healer" });
await des.object({ id: "corpse",montype: "healer" });
await des.object({ id: "corpse",montype: "knight" });
await des.object({ id: "corpse",montype: "knight" });
await des.object({ id: "corpse",montype: "ranger" });
await des.object({ id: "corpse",montype: "ranger" });
await des.object({ id: "corpse",montype: "rogue" });
await des.object({ id: "corpse",montype: "rogue" });
await des.object({ id: "corpse",montype: "samurai" });
await des.object({ id: "corpse",montype: "samurai" });
await des.object({ id: "corpse",montype: "tourist" });
await des.object({ id: "corpse",montype: "tourist" });
await des.object({ id: "corpse",montype: "valkyrie" });
await des.object({ id: "corpse",montype: "valkyrie" });
await des.object({ id: "corpse",montype: "wizard" });
await des.object({ id: "corpse",montype: "wizard" });
//
// Some random weapons and armor.
//
await des.object("[");
await des.object("[");
await des.object("[");
await des.object("[");
await des.object(")");
await des.object(")");
await des.object(")");
await des.object(")");
//
// Some random loot.
//
await des.object("ruby");
await des.object("*");
await des.object("*");
await des.object("!");
await des.object("!");
await des.object("!");
await des.object("?");
await des.object("?");
await des.object("?");
await des.object("/");
await des.object("/");
await des.object("=");
await des.object("=");
await des.object("+");
await des.object("+");
await des.object("(");
await des.object("(");
await des.object("(");
// (Not so) Random traps.
await des.trap("spiked pit", 5,2);
await des.trap("spiked pit", 14,5);
await des.trap("sleep gas", 3,1);
await des.trap("board", 21,12);
await des.trap("board");
await des.trap("dart", 60,1);
await des.trap("dart", 26,17);
await des.trap("anti magic");
await des.trap("anti magic");
await des.trap("magic");
await des.trap("magic");
// Random monsters.
// The ghosts.
await des.monster("ghost");
await des.monster("ghost");
await des.monster("ghost");
await des.monster("ghost");
await des.monster("ghost");
await des.monster("ghost");
// Add a few bats for atmosphere.
await des.monster("vampire bat");
await des.monster("vampire bat");
await des.monster("vampire bat");
// And a lich for good measure.
await des.monster("L");
// Some undead nasties for good measure
await des.monster("V");
await des.monster("V");
await des.monster("V");
await des.monster("Z");
await des.monster("Z");
await des.monster("Z");
await des.monster("Z");
await des.monster("M");
await des.monster("M");
await des.monster("M");
await des.monster("M");
return des.finalize_level();
}
|