summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat/rooms.des
blob: 6380dd98f8676953bc8b8f499c5e07511204d308 (plain) (blame)
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
lua {{

function fill_special_room(mon, lord_mon, pack)
    local level, tl_x, tl_y, br_x, br_y = dgn.get_special_room_info()

    -- Return early if we're being called during map validation.
    if not level then
        return
    end

    if type(mon) == "table" then
        mon = util.join(" / ", mon)
    end

    if type(mon) == "string" then
        mon = dgn.monster_spec(mon)
    end

    local lord_x, los_y = -1, -1
    if lord_mon then
        lord_x = crawl.random_range(tl_x, br_x)
        lord_y = crawl.random_range(tl_y, br_y)
    end

    for x = tl_x, br_x do
        for y = tl_y, br_y do
            if (pack or not crawl.one_chance_in(4))
               and not (lord_x == x and lord_y == y)
            then
                dgn.create_monster(x, y, mon)
            end
        end
    end

    if lord_mon then
        dgn.create_monster(lord_x, lord_y, lord_mon)
    end
end

-- NOTE: To make beehives occur in the Lair with the same absolute frequency
-- as in 0.4, the special room definitions which don't fit there should
-- just do nothing.  Can't use dummy vaults to do this since vault
-- frequency is controlled by absolute depth rather than by branch depth.
function is_in_lair()
    local l_name = dgn.level_name(dgn.level_id())
    return string.find(dgn.level_name(dgn.level_id()), "Lair")
end

function sroom_kobold_lair()
    local level = dgn.get_special_room_info()

    -- Return early if we're being called during map validation.
    if not level then
        return
    end

    if is_in_lair() then
        return
    end

    local level_mons = 3

    if level < 4 then
        level_mons = 0
    elseif level < 6 then
        level_mons = 1
    elseif level < 9 then
        level_mons = 2
    end

    local big_freq   = 3 + level_mons
    local small_freq = 10 - big_freq

    local mon = "kobold w:" .. small_freq .. " / big kobold w:" .. big_freq

    fill_special_room(mon, "big kobold")
end

function sroom_orc_lair()
    local level = dgn.get_special_room_info()

    -- Return early if we're being called during map validation.
    if not level then
        return
    end

    if is_in_lair() then
        return
    end

    local mon
    if level > 24 then
        mon = "orc w:2 / orc warrior w:3 / orc knight w:2 / ogre w:2 / "
              .. "troll w:1"
    elseif level > 15 then
        mon = "orc w:6 / orc knight w:1 / orc warrior w:2 / ogre w:1"
    elseif level > 9 then
        mon = "orc w:8 / orc warrior w:2"
    else
        mon = "orc w:9 / orc warrior w:1"
    end

    fill_special_room(mon)
end

function sroom_beehive()
    local level, tl_x, tl_y, br_x, br_y = dgn.get_special_room_info()

    -- Return early if we're being called during map validation.
    if not level then
        return
    end
    fill_special_room("patrolling killer bee larva w:1 / "
                      .. "patrolling killer bee w:6",
                      "patrolling queen bee", true)

    local food = dgn.item_spec("royal jelly w:1 / honeycomb w:24")
    for x = tl_x, br_x do
        for y = tl_y, br_y do
            if crawl.one_chance_in(2) then
                dgn.create_item(x, y, food)
            end
        end
    end
end

function sroom_morgue()
    if is_in_lair() then
        return
    end

    fill_special_room("small zombie w:500 / wight w:167 / necrophage w:167 / "
                      .. "wraith w:125 / vampire w:42", nil, true)
end

function sroom_jelly_pit()
    local level, tl_x, tl_y, br_x, br_y = dgn.get_special_room_info()

    -- Return early if we're being called during map validation.
    if not level then
        return
    end

    local mons = {}

    mons[1] = "ooze w:" .. (27 - math.floor(level / 5))
    mons[2] = "jelly w:20"
    mons[3] = "brown_ooze w:" .. (3 + level)
    mons[4] = "death ooze w:" .. (2 + (2 * math.floor(level / 3)))

    if level >= 12 then
        mons[5] = "azure jelly w:" .. (1 + math.floor((level - 12)/3))
    end

    if level >= 15 then
        mons[6] = "acid blob w:" .. (1 + math.floor((level - 15) / 4))
    end

    -- XXX: This may leave behind random Jiyva altars when the vault is veto'd.
    -- It really shouldn't, though!
    local jiyva_placed = false
    local jiyva_altar = dgn.fnum("altar_jiyva")
    for x = tl_x, br_x do
        for y = tl_y, br_y do
            if not jiyva_placed and crawl.one_chance_in(30) then
                dgn.grid(x, y, jiyva_altar)
                jiyva_placed = true
            end
        end
    end

    fill_special_room(mons, nil, true)
end
}}

##########################

NAME:   special_room_kobold
DEPTH:  6-14, !Lair, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 11
: sroom_kobold_lair()
MAP
ENDMAP

NAME:   special_room_orc_a
DEPTH:  8-14, !Lair, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 59
: sroom_orc_lair()
MAP
ENDMAP

NAME:   special_room_bee_a
DEPTH:  8-14, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 30
: sroom_beehive()
MAP
ENDMAP
################################
NAME:   special_room_orc_b
DEPTH:  15-16, !Lair, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 50
: sroom_orc_lair()
MAP
ENDMAP

NAME:   special_room_bee_b
DEPTH:  15-16, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 25
: sroom_beehive()
MAP
ENDMAP

NAME:   special_room_morgue_b
DEPTH:  15-16, !Lair
TAGS:   special_room allow_dup
WEIGHT: 25
: sroom_morgue()
MAP
ENDMAP
#################################
NAME:   special_room_orc_c
DEPTH:  17, !Lair, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 40
: sroom_orc_lair() 
MAP
ENDMAP

NAME:   special_room_bee_c
DEPTH:  17, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 25
: sroom_beehive()
MAP
ENDMAP

NAME:   special_room_morgue_c
DEPTH:  17, !Lair
TAGS:   special_room allow_dup
WEIGHT: 27
: sroom_morgue()
MAP
ENDMAP

NAME:   special_room_jelly_c
DEPTH:  17, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 9
: sroom_jelly_pit()
MAP
ENDMAP
#################################
NAME:   special_room_orc_d
DEPTH:  18-20, !Lair, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 25
: sroom_orc_lair()
MAP
ENDMAP

NAME:   special_room_bee_d
DEPTH:  18-20, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 33
: sroom_beehive()
MAP
ENDMAP

NAME:   special_room_morgue_d
DEPTH:  18-20, !Lair
TAGS:   special_room allow_dup
WEIGHT: 29
: sroom_morgue()
MAP
ENDMAP

NAME:   special_room_jelly_d
DEPTH:  18-20, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 13
: sroom_jelly_pit()
MAP
ENDMAP
#################################
NAME:   special_room_orc_e
DEPTH:  21-, !Lair, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 15
: sroom_orc_lair()
MAP
ENDMAP

NAME:   special_room_bee_e
DEPTH:  21-, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 8
: sroom_beehive()
MAP
ENDMAP

NAME:   special_room_morgue_e
DEPTH:  21-, !Lair
TAGS:   special_room allow_dup
WEIGHT: 32
: sroom_morgue()
MAP
ENDMAP

NAME:   special_room_jelly_e
DEPTH:  21-, !Crypt
TAGS:   special_room allow_dup
WEIGHT: 45
: sroom_jelly_pit()
MAP
ENDMAP

#########################################################################
#########################################################################

# 0.4 crawl C code for randomly determining which special room type to
# use

#    if (level_number < 7)
#        spec_room_type = SROOM_LAIR_KOBOLD;
#    else
#    {
#        spec_room_type = random2(NUM_SPECIAL_ROOMS);
#
#        if (level_number < 23 && one_chance_in(4))
#            spec_room_type = SROOM_BEEHIVE;
#
#        // Replace overly dangerous special rooms with a room full of orcs.
#        if (level_number > 13 && spec_room_type == SROOM_LAIR_KOBOLD
#            || level_number < 16 && spec_room_type == SROOM_MORGUE
#            || level_number < 14 && spec_room_type == SROOM_JELLY_PIT
#            || level_number < 17 && one_chance_in(4))
#        {
#            spec_room_type = SROOM_LAIR_ORC;
#        }
#
#        if (level_number > 19 && coinflip())
#            spec_room_type = SROOM_MORGUE;
#
#        if (level_number > 13 &&
#            one_chance_in(6 - (level_number > 23) - (level_number > 18)))
#        {
#            spec_room_type = SROOM_JELLY_PIT;
#        }
#    }
#

####################################

# 0.4 crawl percentages for each room type generated per level (for 10,000
# randomly generated vaults per level)

#  |   K   |    O   |    B   |    M   |    J   |
#-----------------------------------------------
# 0|  0.00 |   0.00 |   0.00 |   0.00 |   0.00 |
# 1|  0.00 |   0.00 |   0.00 |   0.00 |   0.00 |
# 2|  0.00 |   0.00 |   0.00 |   0.00 |   0.00 |
# 3|  0.00 |   0.00 |   0.00 |   0.00 |   0.00 |
# 4|  0.00 |   0.00 |   0.00 |   0.00 |   0.00 |
# 5|  0.00 |   0.00 |   0.00 |   0.00 |   0.00 |
# 6|100.00 |   0.00 |   0.00 |   0.00 |   0.00 |
# 7| 11.39 |  59.25 |  29.36 |   0.00 |   0.00 |
# 8| 11.07 |  58.43 |  30.50 |   0.00 |   0.00 |
# 9| 11.23 |  57.98 |  30.79 |   0.00 |   0.00 |
#10| 11.46 |  58.39 |  30.15 |   0.00 |   0.00 |
#11| 11.30 |  58.78 |  29.92 |   0.00 |   0.00 |
#12| 11.21 |  58.65 |  30.14 |   0.00 |   0.00 |
#13| 10.92 |  58.96 |  30.12 |   0.00 |   0.00 |
#14|  0.00 |  49.58 |  24.99 |  25.43 |   0.00 |
#15|  0.00 |  49.74 |  24.56 |  25.70 |   0.00 |
#16|  0.00 |  39.51 |  24.77 |  27.04 |   8.68 |
#17|  0.00 |  24.23 |  33.07 |  29.57 |  13.13 |
#18|  0.00 |  25.31 |  32.99 |  29.06 |  12.64 |
#19|  0.00 |  24.52 |  32.53 |  31.09 |  11.86 |
#20|  0.00 |  11.63 |  15.84 |  25.52 |  47.01 |
#21|  0.00 |  12.06 |  17.33 |  25.60 |  45.01 |
#22|  0.00 |  12.12 |  15.97 |  25.50 |  46.41 |
#23|  0.00 |  14.94 |   8.64 |  27.63 |  48.79 |
#24|  0.00 |  15.20 |   7.29 |  32.14 |  45.37 |
#25|  0.00 |  14.82 |   7.88 |  33.04 |  44.26 |
#26|  0.00 |  14.99 |   7.91 |  31.94 |  45.16 |
#27|  0.00 |  14.96 |   7.28 |  32.06 |  45.70 |
#28|  0.00 |  15.12 |   7.88 |  32.11 |  44.89 |
#29|  0.00 |  15.48 |   7.40 |  33.17 |  43.95 |
#30|  0.00 |  15.08 |   7.84 |  31.97 |  45.11 |