All files / js/levels Arc-strt.js

100% Statements 129/129
100% Branches 3/3
100% Functions 2/2
100% Lines 129/129

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 1301x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Arc-strt - NetHack special level
 * Converted from: Arc-strt.lua
 */
 
import * as des from '../sp_lev.js';
import { selection } from '../sp_lev.js';
 
export async function generate() {
    // NetHack Archeologist Arc-strt.lua	$NHDT-Date: 1652195999 2022/5/10 15:19:59 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.2 $
    // Copyright (c) 1989 by Jean-Christophe Collet
    // Copyright (c) 1991 by M. Stephenson
    // NetHack may be freely redistributed.  See license for details.
    // 
    // 
    // The "start" level for the quest.
    // 
    // Here you meet your (besieged) class leader, Lord Carnarvon
    // and receive your quest assignment.
    // 
    des.level_init({ style: "solidfill", fg: " " });
 
    des.level_flags("mazelevel", "noteleport", "hardfloor");
 
    await des.map(`\
............................................................................
............................................................................
............................................................................
............................................................................
....................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.................
....................}-------------------------------------}.................
....................}|..S......+.................+.......|}.................
....................}-S---------------+----------|.......|}.................
....................}|.|...............|.......+.|.......|}.................
....................}|.|...............---------.---------}.................
....................}|.S.\\.............+.................+..................
....................}|.|...............---------.---------}.................
....................}|.|...............|.......+.|.......|}.................
....................}-S---------------+----------|.......|}.................
....................}|..S......+.................+.......|}.................
....................}-------------------------------------}.................
....................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.................
............................................................................
............................................................................
............................................................................
`);
    // Dungeon Description
    await des.region(selection.area(0,0,75,19), "lit");
    await des.region(selection.area(22,6,23,6), "unlit");
    await des.region(selection.area(25,6,30,6), "unlit");
    await des.region(selection.area(32,6,48,6), "unlit");
    await des.region(selection.area(50,6,56,8), "lit");
    await des.region(selection.area(40,8,46,8), "unlit");
    await des.region(selection.area(22,8,22,12), "unlit");
    await des.region(selection.area(24,8,38,12), "unlit");
    await des.region(selection.area(48,8,48,8), "lit");
    await des.region(selection.area(40,10,56,10), "lit");
    await des.region(selection.area(48,12,48,12), "lit");
    await des.region(selection.area(40,12,46,12), "unlit");
    await des.region(selection.area(50,12,56,14), "lit");
    await des.region(selection.area(22,14,23,14), "unlit");
    await des.region(selection.area(25,14,30,14), "unlit");
    await des.region(selection.area(32,14,48,14), "unlit");
    // Stairs
    des.stair("down", 55,7);
    // Portal arrival point
    des.levregion({ region: [63,6,63,6], type: "branch" });
    // Doors
    des.door("closed",22,7);
    des.door("closed",38,7);
    des.door("locked",47,8);
    des.door("locked",23,10);
    des.door("locked",39,10);
    des.door("locked",57,10);
    des.door("locked",47,12);
    des.door("closed",22,13);
    des.door("closed",38,13);
    des.door("locked",24,14);
    des.door("closed",31,14);
    des.door("locked",49,14);
    // Lord Carnarvon
    await des.monster({ id: "Lord Carnarvon", coord: [25, 10], inventory: async function() {
       await des.object({ id: "fedora", spe: 5 });
       await des.object({ id: "bullwhip", spe: 4 });
    } })
    // The treasure of Lord Carnarvon
    await des.object("chest", 25, 10);
    // student guards for the audience chamber
    await des.monster("student", 26, 9);
    await des.monster("student", 27, 9);
    await des.monster("student", 28, 9);
    await des.monster("student", 26, 10);
    await des.monster("student", 28, 10);
    await des.monster("student", 26, 11);
    await des.monster("student", 27, 11);
    await des.monster("student", 28, 11);
    // city watch guards in the antechambers
    await des.monster("watchman", 50, 6);
    await des.monster("watchman", 50, 14);
    // Eels in the moat
    await des.monster("giant eel", 20, 10);
    await des.monster("giant eel", 45, 4);
    await des.monster("giant eel", 33, 16);
    // Non diggable walls
    des.non_diggable(selection.area(0,0,75,19));
    // Random traps
    await des.trap();
    await des.trap();
    await des.trap();
    await des.trap();
    await des.trap();
    await des.trap();
    // Monsters on siege duty.
    await des.monster("S", 60, 9);
    await des.monster("M", 60, 10);
    await des.monster("S", 60, 11);
    await des.monster("S", 60, 12);
    await des.monster("M", 60, 13);
    await des.monster("S", 61, 10);
    await des.monster("S", 61, 11);
    await des.monster("S", 61, 12);
    await des.monster("S", 30, 3);
    await des.monster("M", 20, 17);
    await des.monster("S", 67, 2);
    await des.monster("S", 10, 19);
 
 
    return des.finalize_level();
}